PC Review


Reply
Thread Tools Rate Thread

Button Click Event - Problem fetchin Textbox Text

 
 
AJ
Guest
Posts: n/a
 
      31st Aug 2008
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

 
Reply With Quote
 
 
 
 
AJ
Guest
Posts: n/a
 
      31st Aug 2008
I figured out the problem - I had skipped IsPostback check on page load -
Thanks anyway

"AJ" <(E-Mail Removed)> wrote in message
news:2CE6624C-8431-4E22-ADCE-(E-Mail Removed)...
> 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


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to raise an event of button (click event) from textbox's onkeydown event? ABC Microsoft Dot NET Framework Forms 2 25th Jul 2006 11:19 AM
How to fire both event button click and textchanged when button is click and text is changed Amy Microsoft ASP .NET 0 1st Jun 2006 03:33 PM
hitting enter button while in textbox calls correct button's click event TS Microsoft ASP .NET 5 29th Nov 2005 01:54 AM
Help:How to avoid button click event when Enter key is press in a TextBox? Jie Microsoft ASP .NET 7 9th Oct 2004 03:12 PM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge Microsoft ASP .NET 2 26th May 2004 12:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:32 PM.