Closed sandygettings closed 7 years ago
Hi! Can I ask why this was closed? Fixed, or...?
This looks like it was a request for programming help and not a bug report for learn.jquery.com.
Actually, this was a bug or feature request, depending how you look at it. Is this the wrong place?
Thx,
— Sandy
On Sep 12, 2017, at 3:01 PM, Dave Methvin notifications@github.com wrote:
This looks like it was a request for programming help and not a but report for learn.jquery.com.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jquery/learn.jquery.com/issues/759#issuecomment-328949319, or mute the thread https://github.com/notifications/unsubscribe-auth/AKy6tDv6kiayawIjQbiAPc_f75agmQQBks5shtT3gaJpZM4OIsf_.
To be honest I can't tell what is being asked for based on the description. However, I am pretty certain that it is not something to be addressed here. If this is something specific to Microsoft .NET then someone in that community might be interested.
We’re using jQuery Mobile and .Net web forms for constructing mobile web pages. We’re using the latest compatible versions, jQuery 2.1.4 and jQuery Mobile 1.4.5. I’ve discovered a case where .Net web controls lose their values if they are inside a popup widget. Take the following example:
Say a mobile page contains a jQuery popup DIV. Inside the popup, there are two .Net web controls, a TextBox and a LinkButton. Open the popup, type something into the textbox, then click the button. The popup closes as expected. But in the server-side handler during postback, the text in the TextBox is discarded and restored to its original text, if any.
This behavior prevents using popups for common tasks in a .Net environment, like asking the user for options and such. The same problem happens not just with TextBox controls, but DropDownList and other .Net controls as well. By inspecting the page while it’s running, I can see that JQM places the popup outside of the FORM element. My guess is that the page’s ViewState is being lost by the popup widget, because the widget and its .Net controls are outside the FORM element, but the ViewState hidden element is inside the FORM.
I tested a workaround by adding the code below to the page. By moving the popup widget inside the FORM element, the pages work as expected.
All other usage of .Net controls with jQuery mobile in the site work great. It’s just that within popups, the value of controls is lost. Can you consider moving the popup DIV inside the FORM element?
Sample .aspx page: