Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Sun, 31 Aug 2008 13:37:37 -0500,    group: microsoft.public.dotnet.framework.aspnet        back       


Button Click Event - Problem fetchin Textbox Text   
Hi,

I have a textbox and a button on my aspx page. When I click the button, the 
updated text (the original value is fetched from the database on form_load 
event) is supposed to be passed to a method in the button_click event.

The problem I face is that when the button is clicked, the old textbox value 
is passed - in other words, if the old text in the textbox was "Mars", and I 
updated it to "Venus" - the click event gets "Mars".

I tried simplyfing the code in the button's click event as follows:

String s = Textbox1.Text;

I still get the old value back.

Any Idea what's going wrong?

Thanks,
AJ
date: Sun, 31 Aug 2008 13:37:37 -0500   author:   AJ

Re: Button Click Event - Problem fetchin Textbox Text   
I figured out the problem - I had skipped IsPostback check on page load - 
Thanks anyway

"AJ"  wrote in message 
news:2CE6624C-8431-4E22-ADCE-9B59D9F77AC5@microsoft.com...
> Hi,
>
> I have a textbox and a button on my aspx page. When I click the button, 
> the updated text (the original value is fetched from the database on 
> form_load event) is supposed to be passed to a method in the button_click 
> event.
>
> The problem I face is that when the button is clicked, the old textbox 
> value is passed - in other words, if the old text in the textbox was 
> "Mars", and I updated it to "Venus" - the click event gets "Mars".
>
> I tried simplyfing the code in the button's click event as follows:
>
> String s = Textbox1.Text;
>
> I still get the old value back.
>
> Any Idea what's going wrong?
>
> Thanks,
> AJ
date: Sun, 31 Aug 2008 14:28:58 -0500   author:   AJ

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us