Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Noob Questions
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
01454896
Message ID:
01454950
Views:
39
>>>>>>>I think I'm really confused about how a web page works with respect to control event.s
>>>>>>>
>>>>>>>I have a textbox on my page. I want to know when the user changes something, so I dbl-clicked the TextChanged event - which
>>>>>>>doesn't fire unless the Texbox tag has the attribute AutoPostBack = "true" in it. At least, this is what's happening in my page.
>>>>>>>
>>>>>>>This of course causes the entire page to be reloaded.
>>>>>>>
>>>>>>>This is really screwy. I gotta be doing something wrong.
>>>>>>
>>>>>>That's how it works - the event has to be handled on the server. You really don't want to have the TextChanged event cause a postback (certainly not on an internet connection)
>>>>>>
>>>>>>>What if I want to collect data from 3 different textboxes, THEN send it all to the server. But I want to know when any field was
>>>>>>>changed? I'm not interested in firing off to the server when the user types, I just wanna know that they did type.
>>>>>>
>>>>>>Assuming that you did know that they typed something what would you want to do about it? (genuine question)
>>>>>
>>>>>
>>>>>I have 3 fields on the page. There is also a Save button. When the user changes the text in a field, I want the button to become
>>>>>enabled. Even if it was already enabled, I would not want to push data back to the server that has not changed. So, to answer the
>>>>>question, I want to know that data has changed. I am trying to use the tetChanged event to store a mode as a session var so I know
>>>>>what happened.
>>>>>
>>>>>I'm wide open to suggestion.
>>>>
>>>>
>>>>Put the 3 fields and the button in an AJAX updatepanel. Any events you handle will only result in postbacks for the fields and the button.
>>>
>>>A postback for every keystroke still seems a bit excessive ?
>>
>>
>>Actually I don't think the TextChanged event fires unless the textbox posts back (autopostback=true).
>
>Agreed. But what would be the point of hooking up the event if Autopostback wasn't true ?

None. Autopostback has to be true for this to be worth anything. It still will only postback and fire the textchanged event if the user leaves the textbox and text has changed. It won't do it on each keystroke.
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform