运行时中的文本框值错误 [英] text box value error in runtime

查看:82
本文介绍了运行时中的文本框值错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我写了注册表格的代码.在运行时,单击保存按钮时无法获取文本框值.


示例代码:

Hi,

I wrote code for registration form. In runtime, i cant get the textbox value when i click save button.


example code:

If (Trim(txt_pass.Text) <> Trim(txt_cpass.Text)) Then
               Response.Write("<script language='javascript'>alert('Password and Conform Password Should be match!!!')</script>")
           Else
               cmd.Connection = con
               cmd.CommandType = CommandType.Text
               cmd.CommandText = "insert into tbl_Login(username,password)values('" + Trim(txt_uname.Text) + "','" + Trim(txt_pass.Text) + "')"
               cmd.ExecuteNonQuery()
               Response.Write("<script language='javascript'>alert('Successfully Registered')</script>")
               ClearControl()
               If (con.State = ConnectionState.Open) Then
                   con.Close()
               End If
               Response.Redirect("adminlogin.aspx")
           End If



请任何人帮助我.


在此先感谢



please anybody help me.


Thanks in advance

推荐答案



我在page_load中调用了Clear()方法.所以在运行时我无法获取文本值.我已纠正此错误.

谢谢大家
Hi,

I called Clear() method in page_load. So in run time i cant get text values. I Rectified this error.

Thanks for all


这篇关于运行时中的文本框值错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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