View Single Post
  #3 (permalink)  
Old October 30th, 2009, 02:48 PM
sophia sophia is offline
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts

First of all thank you sir for such a great post.
But I am still having some problem. As I am using VB.NET so accordingly I changed the web service in and used in code behind file
The web service that I used looks like
Partial Class sign_up
    Inherits System.Web.UI.Page
 <WebMethod()> _
   Public Function UserNameExists(ByVal yourName As String) As Boolean
        Return Membership.GetUser(yourName) IsNot Nothing
    End Function

   Emailing function goes here.............
End Class
And used the code in sign_up.aspx file as mentioned in post.

create user wizard here....................
     <script type="text/javascript">
      var userNameTextBox = $get('<%= CreateUserWizard1.ClientID %>_CreateUserStepContainer_UserName')
      var userNameRequiredMessage = $get('<%= CreateUserWizard1.ClientID %>_CreateUserStepContainer_UserNameRequired')

      var errorMessage = document.createElement('span') = 'hidden' = 'red'
      errorMessage.innerText = 'User name already taken'

      function UserNameExists()
        var userName = userNameTextBox.value
        PageMethods.UserNameExists(userName, UserNameExistsCallback)

      function UserNameExistsCallback(result)
      { = result ? 'visible' : 'hidden'

      $addHandler(userNameTextBox, 'blur', UserNameExists)
I have used script manager in master page and necessary namespace in code behind file sign_up.aspx.vb
But on running the code it reports an error as PageMethod is not declared. Is there any thing wrong with webservice that I have changed to or in calling it?
How it can be fixed.....
Thank you once again for such post.