ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 8th, 2003, 06:52 PM
macupryk macupryk is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: canada
Posts: 3 macupryk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry Stuck for one week. Check for duplicate email against sql with aspx

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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > Stuck for one week. Check for duplicate email against sql with aspx


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT