Loosing Textbox value on postback

Posted by Dusty Roberts on Stack Overflow See other posts from Stack Overflow or by Dusty Roberts
Published on 2010-06-09T07:49:48Z Indexed on 2010/06/09 7:52 UTC
Read the original article Hit count: 337

Filed under:
|
|

Hi Peeps i have an href that once clicking on it, it opens a dialog and sets a textbox value for that dialog.

however, once i click on submit in that dialog, the textbox value is null.

Link: <a href="#" onclick="javascript:expand('https://me.yahoo.com'); jQuery('#openiddialog').dialog('open'); return false;"><img id="yahoo" class="spacehw" src="/Content/Images/spacer.gif" /></a>

Script: <script type="text/javascript"> jQuery(document).ready(function () { jQuery("#openiddialog").dialog({ autoOpen: false, width: 600, modal: true, buttons: { "Cancel": function () { $(this).dialog("close"); } } }); }); function expand(obj) { $("#<%=openIdBox.ClientID %>").val(obj); } </script>

Dialog:<div id="openiddialog" title="Log in using OpenID"> <p> <asp:Label ID="Label1" runat="server" Text="OpenID Login" /> <asp:TextBox ID="openIdBox" EnableViewState="true" runat="server" /> <asp:JButton Icon="ui-icon-key" ID="loginButton" runat="server" Text="Authenticate" OnClick="loginButton_Click" /> <asp:CustomValidator runat="server" ID="openidValidator" ErrorMessage="Invalid OpenID Identifier" ControlToValidate="openIdBox" EnableViewState="false" OnServerValidate="openidValidator_ServerValidate" /> <br /> <asp:Label ID="loginFailedLabel" runat="server" EnableViewState="False" Text="Login failed" Visible="False" /> <asp:Label ID="loginCanceledLabel" runat="server" EnableViewState="False" Text="Login canceled" Visible="False" /> </p> </div>

... sorry... can't fix formatting ?!?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about JavaScript