We help IT Professionals succeed at work.
Get Started

update panel not working

Last Modified: 2014-10-08
I have the below code to ty check mysql database and show if username is ok or not to use (if in db no - if not then yes.


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="signup.aspx.vb" Inherits="signup" %>
 <%@ Register Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" tagPrefix="ajax" %>
<asp:ScriptManager ID="scriptmanager1" runat="server">
<asp:UpdatePanel ID="updatepnl" runat="server">
Enter UserName 
<asp:TextBox ID="txtun" runat="server" AutoPostBack="true" OnTextChanged="CheckUserNameAvailability"/>
<div id="checkun" runat="server"  Visible="false">
<asp:Image ID="shwimg" runat="server" Width="17px" Height="17px"/>
<asp:Label ID="lblmsg" runat="server"></asp:Label>
Enter Password 
<asp:TextBox ID="txpwd" runat="server" TextMode="Password"></asp:TextBox>
Enter Confirm Password 
<asp:TextBox ID="txtconpwd" runat="server" TextMode="Password"></asp:TextBox>
<td colspan="3">
<asp:Button ID="txtbtn" Text="SUBMIT" runat="server" align="center" />

Open in new window


Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Data
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports MySql.Data.MySqlClient

Partial Class signup
    Inherits System.Web.UI.Page
	Dim MysqlConn As MySqlConnection
Dim con As New mySqlConnection(ConfigurationManager.ConnectionStrings("dbconnection").ConnectionString)
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    End Sub

	Protected Sub CheckUserNameAvailability(sender As Object, e As EventArgs)
		If Not String.IsNullOrEmpty(txtun.Text) Then
			Dim con As New mySqlConnection("Data Source=localhost;Initial Catalog=runningprofiles;User ID=8888;Password=88888")
			Dim cmd As New mySqlCommand("select * from members where email=@un", con)
			cmd.Parameters.AddWithValue("@un", txtun.Text)
			Dim dr As mySqlDataReader = cmd.ExecuteReader()
			If dr.HasRows Then
				checkun.Visible = True
				shwimg.ImageUrl = "Cancel.png"
				lblmsg.Text = "UserName Already Exist..!!"
				checkun.Visible = True
				shwimg.ImageUrl = "Accepted.png"
				lblmsg.Text = "Congratulation created Successfully..!!"
			End If
			checkun.Visible = False
		End If
	End Sub

End Class

Open in new window

but it shows nothing when entering information.... where have a gone wrong and how can i fix it??

the site itself is here: http://runningprofiles.com/signup.aspx
Watch Question
Top Expert 2011
This problem has been solved!
Unlock 1 Answer and 14 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE