Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox GET & SET
Message
From
17/12/2002 22:05:40
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
General information
Forum:
ASP.NET
Category:
Web forms
Miscellaneous
Thread ID:
00733837
Message ID:
00733975
Views:
27
Paul,

I think I got it! I was setting Text = the Session value in the Page_Load intending to refresh the previous value when the user returns to the form, But without an "if !IsPostBack ..." the Text value never being allowed to be anything but "".

Thanks so much for your input!

Larry

>>When I step through the code, apparently the Text value hasn't been updated yet, because it's still empty. I know I could do it by adding another object like an OK button and assign the variable there, but is there a way to do it without adding another object?
>>
>
>Hmm...That works OK on my side. I would double check to make sure that your textbox is really named "TextBox". Since it's not working, you can try doing this another way. Every event passes in an object reference from the calling control. If you reference this control (eg. sender), you can get the new text value.
>
>
>private void TextBox_TextChanged(object sender, System.EventArgs e)
>{
>   System.Web.UI.WebControls.TextBox myControl = (System.Web.UI.WebControls.TextBox) sender;
>   Session["helloname"] = myControl.Text;
>   Server.Transfer("Form2.aspx");
>}
>
L.A.Long
ProgRes
lalong1@charter.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform