Ajax模式弹出窗口中的文本框 [英] Text box in ajax modal popup

查看:94
本文介绍了Ajax模式弹出窗口中的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在Ajax模态弹出窗口中有一个文本框,问题是当我在文本框中输入文本时,它没有返回值,而是显示空文本,这是什么问题? t

代码:

Hi,
I have one text box in Ajax modal pop up and the problem is when i entered text in textbox it doesn''t return value it shows empty text whats the problem? t

Code:

<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtenderLogin" runat="server" BehaviorID="ModalPopupBehavior"

        TargetControlID="Button1"

        PopupControlID="LoginPanel" />
    <asp:Panel ID="LoginPanel" runat="server" Style="clear: both;" Height="227px" Width="372px">
        <table border="0" cellpadding="3" cellspacing="1" width="374px" style="height: 180px;">
            <tr>
                <td style="width: 200px" align="center">
                    <span><b>Old Password:</b></span>
                </td>
                <td style="width: 175px" align="left">
                    <asp:TextBox ID="txtoldpassword" runat="server" TextMode="Password" TabIndex="1"

                        MaxLength="20" ValidationGroup="ChangePassword"></asp:TextBox>
                </td>
            </tr>



C#代码:



C# code:

int? updatenewpassword;
      objloginpl.oldpassword = txtoldpassword.Text.ToString();
      string str_encryptpwd;
      str_encryptpwd = objSecurity.psEncrypt(objloginpl.oldpassword);
      objloginpl.username = txtUserName.Text.ToString();
      objloginpl.password = str_encryptpwd;
      DataTable dtlogincheck = new DataTable();
      dtlogincheck = objloginbal.GetLogindetails(objloginpl);

推荐答案


好吧,在您将textmode更改为SingleLine之前,我会遇到此问题,您会发现u将对这个问题进行搜索,并且我找不到我在textchange上所做的有用的事情,我将值保存在viewstate上,然后再次对其进行赋值,它和我一起工作
希望对您有帮助
最好的问候
M.Mitwalli
Hi ,
Well i face this problem before if you change the textmode to SingleLine u will find u will value i search about this issue and i couldn''t find something useful what i did on the textchange i saved value on viewstate and i assign it again and it worked with me
hope it help you
Best regards
M.Mitwalli


使用以下脚本验证其是否为空

Use the below script to validate whether it is really empty

<script>
function check(value){
if(value=="" || (typeof(value==='number') && value > 0))
alert("The textfield is empty OR its content (value) is a number greater than 0 (> 0)");

}
</script>

<input type="text" onblur="check(this.value)" />


这篇关于Ajax模式弹出窗口中的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆