<tfoot id='dR78i'></tfoot>

      • <bdo id='dR78i'></bdo><ul id='dR78i'></ul>
    1. <small id='dR78i'></small><noframes id='dR78i'>

      <legend id='dR78i'><style id='dR78i'><dir id='dR78i'><q id='dR78i'></q></dir></style></legend>
      <i id='dR78i'><tr id='dR78i'><dt id='dR78i'><q id='dR78i'><span id='dR78i'><b id='dR78i'><form id='dR78i'><ins id='dR78i'></ins><ul id='dR78i'></ul><sub id='dR78i'></sub></form><legend id='dR78i'></legend><bdo id='dR78i'><pre id='dR78i'><center id='dR78i'></center></pre></bdo></b><th id='dR78i'></th></span></q></dt></tr></i><div id='dR78i'><tfoot id='dR78i'></tfoot><dl id='dR78i'><fieldset id='dR78i'></fieldset></dl></div>

    2. 发生带有 Jquery 对话框的 post bock 时,asp.net 文本框值为 null

      时间:2023-06-09

    3. <legend id='XGWUt'><style id='XGWUt'><dir id='XGWUt'><q id='XGWUt'></q></dir></style></legend>

        <small id='XGWUt'></small><noframes id='XGWUt'>

            • <bdo id='XGWUt'></bdo><ul id='XGWUt'></ul>
                <tbody id='XGWUt'></tbody>

              <i id='XGWUt'><tr id='XGWUt'><dt id='XGWUt'><q id='XGWUt'><span id='XGWUt'><b id='XGWUt'><form id='XGWUt'><ins id='XGWUt'></ins><ul id='XGWUt'></ul><sub id='XGWUt'></sub></form><legend id='XGWUt'></legend><bdo id='XGWUt'><pre id='XGWUt'><center id='XGWUt'></center></pre></bdo></b><th id='XGWUt'></th></span></q></dt></tr></i><div id='XGWUt'><tfoot id='XGWUt'></tfoot><dl id='XGWUt'><fieldset id='XGWUt'></fieldset></dl></div>

            • <tfoot id='XGWUt'></tfoot>
                本文介绍了发生带有 Jquery 对话框的 post bock 时,asp.net 文本框值为 null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我在 < 中有 Asp.net 文本框div> 点击btnReply"后的标签,<div> 由 Jquery Dialog 显示,因此用户在文本框中写下想法并单击发送"按钮(jquery 对话框按钮)并回发.

                I have Asp.net text box in < div> tag which after click on "btnReply",< div> showes by Jquery Dialog, so user write idea at text box and click "Send" button (jquery dialog button) and post back happend.

                但服务器端的 asp.net 文本框值为 null .为什么 ?我的代码在这里:

                but the asp.net text box value at server side is null . Why ? my code is here :

                     <div id="ReplyDiv"  style="display:none;">
                             <asp:TextBox ID="txtReply" runat="server" Textmode="MultiLine"/>
                     </div>
                
                     <input type="button" id="btnReply" onclick="javascript:retuen ShowReplyDialog();"/>
                
                      <asp:Button ID="AspBtnReply" runat="server" OnClick="AspBtnReply_Click" class="hidden"/>
                
                     /*-----Jquery script----*/
                    <script type="text/javascript">
                      function ShowReplyDialog()
                       {
                         $("#ReplyDiv").dialog({
                            width: 580,          
                            buttons: {
                               "Close": function () { $(this).dialog("close");} , 
                               "Send" : function () {
                                   //----Call Asp.net server method here
                                   $("#<%=AspBtnReply.ClientID %>").click();
                               }                    
                            }
                         }).parent().appendTo($("form:first"));
                      }
                    </script>
                

                推荐答案

                经过大量搜索,我明白有一些原因:

                After a lot of search i understand to have some reasons :

                1. 我可以解决它**Jquery UI Dialog 需要 z-index 样式**.我的意思是:

                1. I can solved it **Jquery UI Dialog need z-index style ** . i mean :

                <style>
                 .ui-widget-overlay
                 {
                     z-index:0;
                 }
                </style>
                

                并且需要jquery:

                And need jquery :

                  $("#..").dialog(.....).parent().parent().appendTo($("form:first"));
                

              1. 我使用 UpdatePanel 已经有一段时间了,但我相信在部分回发时,它们只会发送更新后的控件值.因此,在 UpdatePanel 中移动 TextBox,或者使用 Javascript 在 UpdatePanel 中填充隐藏控件,并在更新时使用 TextBox 的上下文.item

              2. It's been a while since I used UpdatePanels, but I believe that on partial postback they only send updated values for controls inside them. So move the TextBox inside the UpdatePanel, or perhaps use Javascript to populate a hidden control inside the UpdatePanel with the contexts of the TextBox whenever it is updated.item

                要在后面的代码中获取输入的值并通过服务器控件机制(textBox.Text)访问它们,它们的状态(和存在)需要保存在 ViewState 中.由于您使用 javascript 构建它们,因此它们的状态不会持久化,获取它们的值的唯一方法是使用 Request.Form 集合.

                To get the values of the inputs in the code behind and access them through the server controls mechanism (textBox.Text), their state (and presence) needs to be persisted in the ViewState. Since you are building them with javascript, their state is not persisted, the only way you can get their values is using the Request.Form collection.

                这个问题说最好的提示:jQuery Dialog-Postback但是 UpdatePanel 没有得到更新**

                This issue said best tips : jQuery Dialog-Postback but UpdatePanel doesn't get updated**

                禁用控件是最好的问题:检索 asp:TextBox 的值

                For disable controls is best issue : Retrieving the value of a asp:TextBox

                这篇关于发生带有 Jquery 对话框的 post bock 时,asp.net 文本框值为 null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

              3. 上一篇:如何动态获取文本框中datagridview列的总和 下一篇:与其他禁用的TextBox(es)相比,c#TextBox边框在被禁用时会发生变化

                相关文章

                • <bdo id='bC2jc'></bdo><ul id='bC2jc'></ul>

                  <small id='bC2jc'></small><noframes id='bC2jc'>

                  <legend id='bC2jc'><style id='bC2jc'><dir id='bC2jc'><q id='bC2jc'></q></dir></style></legend>

                1. <i id='bC2jc'><tr id='bC2jc'><dt id='bC2jc'><q id='bC2jc'><span id='bC2jc'><b id='bC2jc'><form id='bC2jc'><ins id='bC2jc'></ins><ul id='bC2jc'></ul><sub id='bC2jc'></sub></form><legend id='bC2jc'></legend><bdo id='bC2jc'><pre id='bC2jc'><center id='bC2jc'></center></pre></bdo></b><th id='bC2jc'></th></span></q></dt></tr></i><div id='bC2jc'><tfoot id='bC2jc'></tfoot><dl id='bC2jc'><fieldset id='bC2jc'></fieldset></dl></div>
                2. <tfoot id='bC2jc'></tfoot>