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?
Re: Passing Values between ASPX and ASCX
Do you use:
PHP Code:
DeficiencyRpt1 = new DeficiencyReport();
Re: Passing Values between ASPX and ASCX
The code is all in C# code-behind
Re: Passing Values between ASPX and ASCX
Yes.... but you must instanciate it.... and you forgot to put DeficiencyRpt1 = new DeficiencyReport(); after the declaration....