Note that there are some explanatory texts on larger screens.

plurals
  1. POChecking username availability
    primarykey
    data
    text
    <p>I have created an check username availability inside a createuserwizard. And i had added a progress indicator to the checking process and would show a spinner image (in gif format) and it was done by using java script. </p> <p>if the system is in the midst of checking the username in database, it would display the spinner image and at the same time display a text "Checking availability..."</p> <p>And the problem not is the spinner image do not appear when it was checking.. </p> <p>Here is code: </p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; // Hook the InitializeRequest event. Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(InitializeRequest); function InitializeRequest(sender, args) { // Change div's CSS class and text content. $get('UserAvailability').className = 'progress'; $get('UserAvailability').innerHTML = 'Checking availability...'; } &lt;/script&gt; &lt;asp:UpdatePanel runat="server" ID="up1"&gt; &lt;ContentTemplate&gt; &lt;tr&gt; &lt;td class="style4"&gt;Username:&lt;/td&gt; &lt;td&gt; &lt;asp:TextBox runat="server" ID="UserName" AutoPostBack="True" ontextchanged="Username_Changed" Width="190" /&gt; &lt;div runat="server" id="UserAvailability" style="background-position: left; background-repeat: no-repeat; margin-left: -250px; padding-left: 22px; float:right;"&gt;&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; </code></pre> <p>Here is the code behind: </p> <pre><code> protected void Username_Changed(object sender, EventArgs e) { System.Threading.Thread.Sleep(2000); TextBox UserNameTextBox = (TextBox)CreateUserWizardStep1.ContentTemplateContainer.FindControl("UserName"); if (Membership.GetUser(UserName.Text) != null) { UserAvailability.InnerText = "Username taken, sorry."; UserAvailability.Attributes.Add("class", "taken"); } else { UserAvailability.InnerText = "Username available!"; UserAvailability.Attributes.Add("class", "available"); } } </code></pre> <p>I have used a masterpage, I had tried putting the JS file inside masterpage, but the image still not appearing. </p> <p><strong>EDIT</strong> </p> <pre><code> &lt;style type="text/css"&gt; #UserAvailability { padding-left: 22px; margin-left: 30px; float: left; background-position: left; background-repeat: no-repeat; } .progress { background-image: url(Images/spinner.gif); } .taken { background-image: url(Images/taken.gif); } .available { background-image: url(Images/available.gif); } &lt;/style&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload