ASP.net Ajax: linkbutton button feedback problem

I have a Yes button that pops up a window (ModalPopUpExtender) The popup window contains a web user control that allows the user to enter data if they click Yes.

The β€œYes” button is located inside the asp panel with another β€œNo” link button, which is hidden and will become visible when the user clicks on the text field. this text box is a dropdownextender object. The Yes and No buttons trigger a text field inside an UpdatePanel and update its text value to Y or N.

If I click the No linkbutton button, it will run the code after the event and update the value of the text field, but not with the link button. It does not initiate its event (OnClick) (code behind). It will only trigger the modal popup expander, so I cannot update the text field value to Y using the link button.

I can change the value of the text field using javascript, but when I click the Refresh button to update the database. the value of the text field is still unchanged. I assume that javascript only changes the html value of the text field, but not the value inside the viewstate.

two questions:

  • Can a control fire an event (trigger code after code) if it is used as targetcontrol in ajax framework? Did I miss something?

  • How to change control value through javascript? Not only on the surface (html), but also in the view, so when the update occurs, the actual value of the control, such as the text value .text, changes.

+3
source share
3 answers

I'm a little confused by your question ... but I remember trying to do such things. Whenever you interact with ASP and java, this page is very helpful:

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

+1
source

If both Yes and No LinkButtons are inside the UpdatePanel, why not just turn on the Yes button for asynchronous postback, change the TextBox, and then call the Show () method in ModalPopup from the code?

, ... .

0

everything. I cheat a little and use the Hidden Field. I am using javascript to change the hidden field value to get the result I want.

Hope this helps someone with a similar problem.

Jack

0
source

Source: https://habr.com/ru/post/1702505/


All Articles