frewfrux Posted December 6, 2005 Posted December 6, 2005 Here's the situation... I have web user control (.ascx) that has some properties I would like to define when the user control is added to the form. Currently I am under the impression that the code (c#) in the user control should be: public string name { get { return name; } set { name = value; } } and then in the web form's asp.net code I set the name when I declare the user control: <uc1:WebUserControl1 id="WebUserControl11" name="testing" runat="server"></uc1:WebUserControl1> If I don't declare the name there then it all works fine (except I have an unnamed control) Can anyone see what I'm doing wrong? Quote
frewfrux Posted December 7, 2005 Author Posted December 7, 2005 Ok, so to answer my own question for the benifit of anyone else who may want to know, the c# code needed to be: private string _name = ""; public string name { get { return _name; } set { _name = value; } } and then assign a value by going: _name = this.name; Problem solved (2.5 hours...but solved none the less). Now, how can I...hmmmmmmmmmmmm Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.