|
-
December 20th, 2004, 05:57 PM
#1
Passing Values between ASPX and ASCX
I have a page (ASPX) that has a grid on the left side and an embedded web control (ASCX) on the right side. The ascx contains lots of textboxes,labels,etc.
I have added Get/Set properties for each of the controls in the ascx code-behind file. Here's a snippet of the code;
ASPX code-behind:
protected DeficiencyReport DeficiencyRpt1; //reference to ASCX
DeficiencyRpt1.SPRTextBox= "value"; // set new value
Property in ASCX:
public string SPRTextBox {
get {return SPR.Text;}
set {SPR.Text=value;}
}
Everything works fine except that the value is not displayed in the textbox. Can anybody tell me what I'm missing?
-
December 22nd, 2004, 12:09 AM
#2
Re: Passing Values between ASPX and ASCX
Do you use:
PHP Code:
DeficiencyRpt1 = new DeficiencyReport();
My history: QB->VB->TC++->VB->VC++->VC#
-
December 22nd, 2004, 02:34 PM
#3
Re: Passing Values between ASPX and ASCX
The code is all in C# code-behind
-
December 22nd, 2004, 03:16 PM
#4
Re: Passing Values between ASPX and ASCX
Yes.... but you must instanciate it.... and you forgot to put DeficiencyRpt1 = new DeficiencyReport(); after the declaration....
My history: QB->VB->TC++->VB->VC++->VC#
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|