ASP.net Ajax: postback problem with linkbutton

asp.net-ajax

I have a "Yes" linkbutton that trigger a popup (ModalPopUpExtender)
The popup contain a web user control that allow the user to do some data entry if they click on "Yes" linkbutton.

The Yes linkbutton is inside a asp panel with another linkbutton called "No" that is hidden and will become visible when the user click on the text box. this text box is the target of the dropdownextender. Both Yes and No linkbutton is trigger for the text box that is inside a UpdatePanel and will update it's text value to either Y or N.

If i click on the No linkbutton, it will trigger the code behind event and update the text box value but not with Yes linkbutton. It will not trigger its event (OnClick) (code behind). It will only trigger the modal popup extender therefore i can't update the text box value to Y with Yes linkbutton.

I can change the text box value via javascript but when i click on Update button to update the database. the text box value is still not change. i guess the javascript only change the textbox's html value but not the value inside the viewstate.

two questions:

  1. Can the control trigger an event (run code behind code) if it is being use as targetcontrol in ajax framework control? Am i missing something?

  2. How do you change the value of a control via javascript? Not just on the surface (html) but also in the viewstate so when a update occurred the actual value of control such as textbox's .text value is changed.

Best Answer

I am sorta confused by your question...but I remember trying to do similar stuff. Whenever interacting with ASP and java this page was very helpful:

http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager_methods.aspx