View Single Post
  #1 (permalink)  
Old January 6th, 2014, 02:22 AM
pitters pitters is offline
Registered User
Points: 19, Level: 1
Points: 19, Level: 1 Points: 19, Level: 1 Points: 19, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2013
Posts: 5
Thanks: 4
Thanked 0 Times in 0 Posts
Default Unable to get blur event working - chap 16

Hi Imar,

I followed the instructions - so well laid out! :) - from:
http://imar.spaanjaars.com/494/check...th-aspnet-ajax
but I am unable to see anything happening when I move the focus away from the userName field.
I copied your code - even copied and pasted it from your samples - but no joy.

My apologies for the lengthy post . . .

My signup.aspx is

Code:
<%@ Page Title="Sign up for a new account at Planet Wrox" Language="C#" MasterPageFile="~/MasterPages/FrontEnd.master" AutoEventWireup="true" CodeFile="SignUp.aspx.cs" Inherits="SignUp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">

  <asp:CreateUserWizard ID="CreateUserWizard1" runat="Server" MailDefinition-BodyFileName="~/App_Data/SignUpConfirmation.txt" MailDefinition-Subject="Your new account at PlanetWrox.com" ClientIDMode="Static">
<MailDefinition BodyFileName="~/App_Data/SignUpConfirmation.txt" Subject="Your new account at PlanetWrox.com"></MailDefinition>
    <WizardSteps>
      <asp:CreateUserWizardStep runat="server" >
        <ContentTemplate>
          <table>
            <tr>
              <td align="center" colspan="2">Sign Up for Your New Account</td>
            </tr>
            <tr>
              <td align="right">
                <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label>
              </td>
              <td>
                <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
              </td>
            </tr>
            <tr>
              <td align="right">
                <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
              </td>
              <td>
                <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
              </td>
            </tr>
            <tr>
              <td align="right">
                <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label>
              </td>
              <td>
                <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
                <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword" ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
              </td>
            </tr>
            <tr>
              <td align="right">
                <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label>
              </td>
              <td>
                <asp:TextBox ID="Email" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email" ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
              </td>
            </tr>
            <tr>
              <td align="right">
                <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security Question:</asp:Label>
              </td>
              <td>
                <asp:TextBox ID="Question" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question" ErrorMessage="Security question is required." ToolTip="Security question is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
              </td>
            </tr>
            <tr>
              <td align="right">
                <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security Answer:</asp:Label>
              </td>
              <td>
                <asp:TextBox ID="Answer" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer" ErrorMessage="Security answer is required." ToolTip="Security answer is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
              </td>
            </tr>
            <tr>
              <td align="center" colspan="2">
                <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password" ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match." ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
              </td>
            </tr>
            <tr>
              <td align="center" colspan="2" style="color:Red;">
                <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
              </td>
            </tr>
          </table>
        </ContentTemplate>
      </asp:CreateUserWizardStep>
      <asp:CompleteWizardStep runat="server" />
    </WizardSteps>
  </asp:CreateUserWizard>
<%--  debugger;--%>
      <script type="text/javascript">
        var userNameTextBox = $get('<%= CreateUserWizard1.ClientID %>_CreateUserStepContainer_UserName');
        
        var userNameRequiredMessage = $get('<%= CreateUserWizard1.ClientID %>_CreateUserStepContainer_UserNameRequired');

        var errorMessage = document.createElement('span');
        errorMessage.style.visibility = 'hidden';
        errorMessage.style.color = 'red';
        errorMessage.innerHTML = 'User name already taken';
        userNameRequiredMessage.parentNode.appendChild(errorMessage);

        function UserNameExists()
        {
          var UserName = UserNameTextBox.value;
          PageMethods.UserNameExists(userName, UserNameExistsCallback);
        }

        function UserNameExistsCallback(result)
        {
          errorMessage.style.visibility = result ? 'visible' : 'hidden';
        }

        $addHandler(UserNameTextBox, 'blur', UserNameExists);

    </script>
 <%--</asp:ScriptManager>--%>    
  
</asp:Content>
and my Code Behind is

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using System.Web.Security;

public partial class SignUp : System.Web.UI.Page
{
  [WebMethod]
  public static bool UserNameExists(string UserName)
  {
    return Membership.GetUser(UserName) != null;
  }
  protected void Page_Load(object sender, EventArgs e)
  {

  }
}
My HTML source is (Chrome)
Code:
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
	Sign up for a new account at Planet Wrox
</title>

  <script src="/Scripts/modernizr-2.6.2.js"></script>
<link href="App_Themes/Monochrome/Monochrome.css" type="text/css" rel="stylesheet" /><style type="text/css">
	/* <![CDATA[ */
	#Menu1 img.icon { border-style:none;vertical-align:middle; }
	#Menu1 img.separator { border-style:none;display:block; }
	#Menu1 img.horizontal-separator { border-style:none;vertical-align:middle; }
	#Menu1 ul { list-style:none;margin:0;padding:0;width:auto; }
	#Menu1 ul.dynamic { z-index:1; }
	#Menu1 a { text-decoration:none;white-space:nowrap;display:block; }
	#Menu1 a.static { padding-left:0.15em;padding-right:0.15em; }
	#Menu1 a.popout-dynamic { background:url("/WebResource.axd?d=YAYach_zykzn7tRotFpEUu4GoLCvLnZX9EMIk-7HZc0BToIWtkGmtEvS1QlKTPzH3iLUGaIOeMLAXy1s11x1DAzwWjM89NEHYAoqAUG8AE41&t=635089743480000000") no-repeat right center;padding-right:14px; }
	/* ]]> */
</style></head>
<body>
    <form method="post" action="SignUp.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="cQdb4i3IOP7L7qRpmd1vIPbkQNmw/zGSNUHc68XAetranMpTNOFdpV5cquJfAoBQmyUb9t4sZXGL6VFL82OkMnJQrs9BU7YxYcfnQeO5lVImbcH2mzLNw43dgAe1VLbXN2gI/CGAIMU21szEZEYui/6x4j//XIUMkLvdBnLMNdOV9MckYgwLzD9ZsnbsQjA6Zk5z6l8GrTbYEQpb+S2V/EFtzAwp3I1jsDofIz62WcCUTq4KQfOunZnFD+kam26xLP0BCRV04Hiou3GLQW2ZyCpc3V/BR1/axTCDHIq6YssV7ylQir2btkSAzpBoMBM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xBIJRBmbfgQrnhiZ+gG2A7B16gCb6UiP1uUx1+tCeESOU6cEddsCSKFJK0DrHrM1ke4aU46Xn6kcySiqEbEcUJrH+4oiIWjKUOwEoJQSXPaz3KAoWAZz/9jiY2tTiF8+FDaGy0Clcudmw==" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>


<script src="/WebResource.axd?d=pynGkmcFUV13He1Qd6_TZFc2JxtZT0zpQOqRp64JeEAbLcBZ8xArgIymS0Poy6_Qf4pbiiFzfFmRySv204CjfQ2&amp;t=635089743480000000" type="text/javascript"></script>


<script src="/ScriptResource.axd?d=zvkqIRNUspAvS1yKeFhMb4GQ6P1kTzCl7U_55KUu0Ljn9akJKvSbYIIqw4edQQe-_pO49FvfwXyqOFd3zJ7SmrDwPXFELcwbe1fZlHX6BPe4RR3ValSnz7vpclfkDZobNHMXnct_KJPSuprHGPFcwg2&amp;t=69ddb300" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=nv7asgRUU0tRmHNR2D6t1PK51r9ZnxBgl-LgkyLnKUHflAXQGuLYmrl6hygvJFFLzRE2ZMnTrQ80p-Pd-7e1Eyciv5KdFkuFOhBVVGkxzQHOwjCNXvoSfg91HCsDKyG3XSgYodZnwsdfkuHIWSI54g2&amp;t=69ddb300" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQlx78wJmh-QzmYQNEEeFYKJ152ipkosivsQ6ow7H2UacmXuCR9VCbdgx8SSs23toGuAYrOiDWKkGEGnO5eQezWqY7vSXIlmRaNBN32-Ua6Jgc_80uveBd61D-Ere8RxRp8VtWZcx91qPluw_FaBWFRI1&amp;t=6119e399" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.');
//]]>
</script>

<script src="/ScriptResource.axd?d=JnUc-DEDOM5KzzVKtsL1tXrkrMQs5u46pvn35KqY-ri_Wtnc22kb9Xs3weLiGXoGs4x0L2k29zMNjlNsiB5Bzdg3ipqs2XWnueeZqgKDv4SIdFq9cWeu5WUCrACURINcfS6Znp7y-mpJdUEa88KGmY70jANZU0te0u6kxG8pC-cCqVCUBlQjcnf5oOXtXRtI0&amp;t=6119e399" type="text/javascript"></script>
<script src="Scripts/jquery-2.0.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
var PageMethods = function() {
PageMethods.initializeBase(this);
this._timeout = 0;
this._userContext = null;
this._succeeded = null;
this._failed = null;
}
PageMethods.prototype = {
_get_path:function() {
 var p = this.get_path();
 if (p) return p;
 else return PageMethods._staticInstance.get_path();},
UserNameExists:function(UserName,succeededCallback, failedCallback, userContext) {
/// <param name="UserName" type="String">System.String</param>
/// <param name="succeededCallback" type="Function" optional="true" mayBeNull="true"></param>
/// <param name="failedCallback" type="Function" optional="true" mayBeNull="true"></param>
/// <param name="userContext" optional="true" mayBeNull="true"></param>
return this._invoke(this._get_path(), 'UserNameExists',false,{UserName:UserName},succeededCallback,failedCallback,userContext); }}
PageMethods.registerClass('PageMethods',Sys.Net.WebServiceProxy);
PageMethods._staticInstance = new PageMethods();
PageMethods.set_path = function(value) {
PageMethods._staticInstance.set_path(value); }
PageMethods.get_path = function() { 
/// <value type="String" mayBeNull="true">The service url.</value>
return PageMethods._staticInstance.get_path();}
PageMethods.set_timeout = function(value) {
PageMethods._staticInstance.set_timeout(value); }
PageMethods.get_timeout = function() { 
/// <value type="Number">The service timeout.</value>
return PageMethods._staticInstance.get_timeout(); }
PageMethods.set_defaultUserContext = function(value) { 
PageMethods._staticInstance.set_defaultUserContext(value); }
PageMethods.get_defaultUserContext = function() { 
/// <value mayBeNull="true">The service default user context.</value>
return PageMethods._staticInstance.get_defaultUserContext(); }
PageMethods.set_defaultSucceededCallback = function(value) { 
 PageMethods._staticInstance.set_defaultSucceededCallback(value); }
PageMethods.get_defaultSucceededCallback = function() { 
/// <value type="Function" mayBeNull="true">The service default succeeded callback.</value>
return PageMethods._staticInstance.get_defaultSucceededCallback(); }
PageMethods.set_defaultFailedCallback = function(value) { 
PageMethods._staticInstance.set_defaultFailedCallback(value); }
PageMethods.get_defaultFailedCallback = function() { 
/// <value type="Function" mayBeNull="true">The service default failed callback.</value>
return PageMethods._staticInstance.get_defaultFailedCallback(); }
PageMethods.set_enableJsonp = function(value) { PageMethods._staticInstance.set_enableJsonp(value); }
PageMethods.get_enableJsonp = function() { 
/// <value type="Boolean">Specifies whether the service supports JSONP for cross domain calling.</value>
return PageMethods._staticInstance.get_enableJsonp(); }
PageMethods.set_jsonpCallbackParameter = function(value) { PageMethods._staticInstance.set_jsonpCallbackParameter(value); }
PageMethods.get_jsonpCallbackParameter = function() { 
/// <value type="String">Specifies the parameter name that contains the callback function name for a JSONP request.</value>
return PageMethods._staticInstance.get_jsonpCallbackParameter(); }
PageMethods.set_path("SignUp.aspx");
PageMethods.UserNameExists= function(UserName,onSuccess,onFailed,userContext) {
/// <param name="UserName" type="String">System.String</param>
/// <param name="succeededCallback" type="Function" optional="true" mayBeNull="true"></param>
/// <param name="failedCallback" type="Function" optional="true" mayBeNull="true"></param>
/// <param name="userContext" optional="true" mayBeNull="true"></param>
PageMethods._staticInstance.UserNameExists(UserName,onSuccess,onFailed,userContext); }
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]>
</script>

<div class="aspNetHidden">

	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="oEf6eLunfwSBX9pU/4/u9Chf9RMvn89klq6wQ0N3b1oojw2c36qItBfpYoF2jjDakMsCGTl2auynwLybuPNJ0y19ryXObJS5FHb6MavnKse37xj2hpHee2RFWIpH02Aq2hUCKqMIelrzT35Q33brITjTBfdU1CNNwUXt464DjrI7b5quRktZvEbSSWKfhnsA/wHDc4bBIDiGmdBQJWbOn7JDFh4jX7mTc8UJ33qKI0MYELweqeu6CQXTuoCYdoIzp0pC7dfd/6effslrpe0snp4Sqwj836Mf2opr+acoY5vKVA0wOeKyeOMRxZHhBrT4" />
</div>
    <script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ctl00$Scriptmanager1', 'form1', [], [], [], 90, 'ctl00');
//]]>
</script>
  
        <Scripts>
          <asp:ScriptReference Name="jquery" />
          <asp:ScriptReference Name="Juice" />
        </Scripts>
    <div id="PageWrapper">
      <header><a href="/"></a></header>
      <nav>
        <a href="#Menu1_SkipLink" style="position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden;">Skip Navigation Links</a><div class="MainMenu" id="Menu1">
	<ul class="level1">
		<li><a title="Go to the homepage" class="level1" href="/Default.aspx">Home</a></li><li><a title="Reviews published on this site" class="level1" href="/Reviews/Default.aspx">Reviews</a><ul class="level2">
			<li><a title="All Reviews Grouped by Genre" class="level2" href="/Reviews/AllByGenre.aspx">By Genre</a></li><li><a title="All Reviews" class="level2" href="/Reviews/All.aspx">All Reviews</a></li>
		</ul></li><li><a title="All Gig Pics" class="level1" href="/PhotoAlbums/">Gig Pics</a><ul class="level2">
			<li><a title="All Gig Pics" class="level2" href="/PhotoAlbums/Default.aspx">Gig Pics</a></li><li><a title="Create a New Photo Album with Gig Pics" class="level2" href="/NewPhotoAlbum.aspx">New Album</a></li>
		</ul></li><li><a title="About this Site" class="level1" href="/About/Default.aspx">About</a><ul class="level2">
			<li><a title="Contact Us" class="level2" href="/About/Contact.aspx">Contact Us</a></li><li><a title="About Us" class="level2" href="/About/AboutUs.aspx">About Us</a></li><li><a title="My Profile" class="level2" href="/MyProfile.aspx">My Profile</a></li>
		</ul></li><li><a title="Log in to this web site" class="level1" href="/Login.aspx">Login</a></li>
	</ul>
</div><a id="Menu1_SkipLink"></a>
        
        
      </nav>
      <section id="MainContent"> 
        <span id="SiteMapPath1"><a href="#SiteMapPath1_SkipLink" style="position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden;">Skip Navigation Links</a><a id="SiteMapPath1_SkipLink"></a></span>
        <br /><br /> 
               

  <table cellspacing="0" cellpadding="0" id="CreateUserWizard1" style="border-collapse:collapse;">
	<tr style="height:100%;">
		<td><table cellspacing="0" cellpadding="0" style="height:100%;width:100%;border-collapse:collapse;">
			<tr>
				<td style="height:100%;width:100%;">
          <table>
            <tr>
              <td align="center" colspan="2">Sign Up for Your New Account</td>
            </tr>
            <tr>
              <td align="right">
                <label for="UserName" id="UserNameLabel">User Name:</label>
              </td>
              <td>
                <input name="ctl00$cpMainContent$CreateUserWizard1$CreateUserStepContainer$UserName" type="text" id="UserName" />
                <span data-val-controltovalidate="UserName" data-val-errormessage="User Name is required." data-val-validationGroup="CreateUserWizard1" id="UserNameRequired" title="User Name is required." data-val="true" data-val-evaluationfunction="RequiredFieldValidatorEvaluateIsValid" data-val-initialvalue="" style="visibility:hidden;">*</span>
              </td>
            </tr>
            <tr>
              <td align="right">
                <label for="Password" id="PasswordLabel">Password:</label>
              </td>
              <td>
                <input name="ctl00$cpMainContent$CreateUserWizard1$CreateUserStepContainer$Password" type="password" id="Password" />
                <span data-val-controltovalidate="Password" data-val-errormessage="Password is required." data-val-validationGroup="CreateUserWizard1" id="PasswordRequired" title="Password is required." data-val="true" data-val-evaluationfunction="RequiredFieldValidatorEvaluateIsValid" data-val-initialvalue="" style="visibility:hidden;">*</span>
              </td>
            </tr>
            <tr>
              <td align="right">
                <label for="ConfirmPassword" id="ConfirmPasswordLabel">Confirm Password:</label>
              </td>
              <td>
                <input name="ctl00$cpMainContent$CreateUserWizard1$CreateUserStepContainer$ConfirmPassword" type="password" id="ConfirmPassword" />
                <span data-val-controltovalidate="ConfirmPassword" data-val-errormessage="Confirm Password is required." data-val-validationGroup="CreateUserWizard1" id="ConfirmPasswordRequired" title="Confirm Password is required." data-val="true" data-val-evaluationfunction="RequiredFieldValidatorEvaluateIsValid" data-val-initialvalue="" style="visibility:hidden;">*</span>
              </td>
            </tr>
            <tr>
              <td align="right">
                <label for="Email" id="EmailLabel">E-mail:</label>
              </td>
              <td>
                <input name="ctl00$cpMainContent$CreateUserWizard1$CreateUserStepContainer$Email" type="text" id="Email" />
                <span data-val-controltovalidate="Email" data-val-errormessage="E-mail is required." data-val-validationGroup="CreateUserWizard1" id="EmailRequired" title="E-mail is required." data-val="true" data-val-evaluationfunction="RequiredFieldValidatorEvaluateIsValid" data-val-initialvalue="" style="visibility:hidden;">*</span>
              </td>
            </tr>
            <tr>
              <td align="right">
                <label for="Question" id="QuestionLabel">Security Question:</label>
              </td>
              <td>
                <input name="ctl00$cpMainContent$CreateUserWizard1$CreateUserStepContainer$Question" type="text" id="Question" />
                <span data-val-controltovalidate="Question" data-val-errormessage="Security question is required." data-val-validationGroup="CreateUserWizard1" id="QuestionRequired" title="Security question is required." data-val="true" data-val-evaluationfunction="RequiredFieldValidatorEvaluateIsValid" data-val-initialvalue="" style="visibility:hidden;">*</span>
              </td>
            </tr>
            <tr>
              <td align="right">
                <label for="Answer" id="AnswerLabel">Security Answer:</label>
              </td>
              <td>
                <input name="ctl00$cpMainContent$CreateUserWizard1$CreateUserStepContainer$Answer" type="text" id="Answer" />
                <span data-val-controltovalidate="Answer" data-val-errormessage="Security answer is required." data-val-validationGroup="CreateUserWizard1" id="AnswerRequired" title="Security answer is required." data-val="true" data-val-evaluationfunction="RequiredFieldValidatorEvaluateIsValid" data-val-initialvalue="" style="visibility:hidden;">*</span>
              </td>
            </tr>
            <tr>
              <td align="center" colspan="2">
                <span data-val-controltovalidate="ConfirmPassword" data-val-errormessage="The Password and Confirmation Password must match." data-val-display="Dynamic" data-val-validationGroup="CreateUserWizard1" id="PasswordCompare" data-val="true" data-val-evaluationfunction="CompareValidatorEvaluateIsValid" data-val-controltocompare="Password" data-val-controlhookup="Password" style="display:none;">The Password and Confirmation Password must match.</span>
              </td>
            </tr>
            <tr>
              <td align="center" colspan="2" style="color:Red;">
                
              </td>
            </tr>
          </table>
        </td>
			</tr>
		</table></td>
	</tr><tr>
		<td align="right"><table cellspacing="5" cellpadding="5" style="height:100%;width:100%;">
			<tr align="right">
				<td align="right"><input type="submit" name="ctl00$cpMainContent$CreateUserWizard1$__CustomNav0$StepNextButtonButton" value="Create User" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$cpMainContent$CreateUserWizard1$__CustomNav0$StepNextButtonButton&quot;, &quot;&quot;, true, &quot;CreateUserWizard1&quot;, &quot;&quot;, false, false))" id="StepNextButtonButton" /></td>
			</tr>
		</table></td>
	</tr>
</table>

      <script type="text/javascript">
        var userNameTextBox = $get('CreateUserWizard1_CreateUserStepContainer_UserName');
        
        var userNameRequiredMessage = $get('CreateUserWizard1_CreateUserStepContainer_UserNameRequired');

        var errorMessage = document.createElement('span');
        errorMessage.style.visibility = 'hidden';
        errorMessage.style.color = 'red';
        errorMessage.innerHTML = 'User name already taken';
        userNameRequiredMessage.parentNode.appendChild(errorMessage);

        function UserNameExists()
        {
          var UserName = UserNameTextBox.value;
          PageMethods.UserNameExists(userName, UserNameExistsCallback);
        }

        function UserNameExistsCallback(result)
        {
          errorMessage.style.visibility = result ? 'visible' : 'hidden';
        }

        $addHandler(UserNameTextBox, 'blur', UserNameExists);

    </script>
     
  

      </section>
      <aside id="Sidebar">Select a Theme  <br />
        <select name="ctl00$ThemeList" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ThemeList\',\'\')', 0)" id="ThemeList">
	<option selected="selected" value="Monochrome">Monochrome</option>
	<option value="DarkGrey">DarkGrey</option>

</select>
        <br />
        <br />
        <div id="Banner1_VerticalPanel">
	
  <a href="http://p2p.wrox.com" id="Banner1_VerticalLink" target="_blank">
     <img id="Banner1_Image1" src="Images/Banner120x240.gif" alt="This is a sample banner" />
  </a>

</div>




        <br />
      </aside>
      <footer>
        
        
      </footer>
    </div>
      

      

    
<script type='text/javascript'>new Sys.WebForms.Menu({ element: 'Menu1', disappearAfter: 500, orientation: 'horizontal', tabIndex: 0, disabled: false });</script></form>
</body>
</html>
I tried putting a breakpoint at the line
public static bool UserNameExists(string UserName) (in the Code Behind)
but that did nothing
I tried Shift CTRL J and that gave the following message:
Uncaught TypeError: Cannot read property ‘parentNode’ of null SignUp.aspx:263

Line 263 in the source is
userNameRequiredMessage.parentNode.appendChild(err orMessage);

I'm sure it's a minor step I've missed - like last time

Regards
pitters
Reply With Quote