Click here to Skip to main content
16,016,744 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

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


example code:
VB
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
Posted
Comments
[no name] 2-Dec-11 1:19am    
can you give us the exact error message you are getting?
Manoj K Bhoir 2-Dec-11 1:29am    
Please post what error you are getting?
Jayanthi-SE 2-Dec-11 2:03am    
i wrote this code. I cant get what i typed in textbox value to query.
Jayanthi-SE 2-Dec-11 2:04am    
in query, it display '' instead of string. But i can get radiobutton value and dropdownlist.
Jayanthi-SE 2-Dec-11 2:11am    
property evaluation failed - i got this error

1 solution

Hi,

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

Thanks for all
 
Share this answer
 

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