|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am getting an eror. I need an explanation in more detail look at URL
I have created a custom control tag: !-- Check to see if UserName exist --> <asp:CustomValidator id="UserNameCheckDuplicateValue" ControlToValidate="txtUserName" OnServerValidate="CheckDuplicateValue" ErrorMessage="This username is already being used." Font-Size="9" runat=server> </asp:CustomValidator> and the function in my .ascx file and I get the following error: Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0117: 'ASP.register_ascx' does not contain a definition for 'CheckDuplicateValue' Source Error: Line 153: Line 154: <!-- Check to see if UserName exist --> Line 155: <asp:CustomValidator id="UserNameCheckDuplicateValue" Line 156: ControlToValidate="txtUserName" Line 157: OnServerValidate="CheckDuplicateValue" Is there something wrong. How do I call this onsevervalide function from a .cs behind file or .aspx. I am trying to comprend. // Define User Control Function To Check For Duplicate UserNames public void CheckDuplicateValue(Object source, ServerValidateEventArgs arguments) { String UserName = arguments.Value; String sql; sql ="Select * FROM Users_UserName from DB_Public_Users where Users_UserName = '" + UserName.Replace("'","''") + "'"; SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["omegalove"]); conn.Open(); SqlCommand comm = new SqlCommand(sql,conn); SqlDataReader dr = comm.ExecuteReader(); if(dr.Read()) { arguments.IsValid=false; } else { arguments.IsValid=true; } dr.Close(); conn.Close(); } Matt Cupryk. 514-685-0449 Edited by - crazy_arms_matt on 6/8/2003 7:31:08 PM |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > Stuck for one week. Check for duplicate email against sql with aspx |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|