Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

XML
<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# code:
C#
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);
Posted
Updated 29-Mar-12 23:43pm
v4

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
 
Share this answer
 
Comments
fjdiewornncalwe 2-Apr-12 13:50pm    
Please don't use text speak in answers. Use full words. Cheers.
Mohamed Mitwalli 2-Apr-12 13:55pm    
consider it done.
Use the below script to validate whether it is really empty

JavaScript
<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)" />
 
Share this answer
 
Comments
Member 8609405 30-Mar-12 2:52am    
I had already checked the value ther is no problem in textbox but it doesn't return the value

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900