tags:

views:

2945

answers:

3

Hi all.

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.

A: 

If both Yes and No LinkButtons are inside of an UpdatePanel, why not just have Yes button trigger an async postback, change TextBox value, then call Show() method on ModalPopup from code behind?

I'm not sure if i'm understanding your question fully... Some code might help us to understand your situation better.

Brian Kim
A: 

Hi, all. I kinda cheat a little and use Hidden Field. I use javascript to alter the hidden field value thus it get the result that i want.

I hope this is helpful for someone with similar problem.

Jack

Jack
+1  A: 

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

Andrew
I'm not even sure how to ask. Thank for the link.
Jack

related questions