G
Guest
I have a TextBox field as shown below
<asp:TextBox id="txtIssueTo" runat="server" OnTextChanged="UserExist"
AutoPostBack="true" Text="UserName"></asp:TextBox>
The UserExist method takes the txtIssueTo value and checks if the user exist
in the database.... in the UserExist method i keep getting this error message:
Object reference not set to an instance of an object.
string strUserName = txtIssueTo.Text;
Here is my method
public void UserExist(object sender, System.EventArgs e)
{
string strUserName = txtIssueTo.Text;
bool UserExist = ad.UserExist(strUserName);
if(UserExist==false)
{
lblUserNotFound.Text = "User not found";
}
}
Any suggestions? many thanks in advance.
<asp:TextBox id="txtIssueTo" runat="server" OnTextChanged="UserExist"
AutoPostBack="true" Text="UserName"></asp:TextBox>
The UserExist method takes the txtIssueTo value and checks if the user exist
in the database.... in the UserExist method i keep getting this error message:
Object reference not set to an instance of an object.
string strUserName = txtIssueTo.Text;
Here is my method
public void UserExist(object sender, System.EventArgs e)
{
string strUserName = txtIssueTo.Text;
bool UserExist = ad.UserExist(strUserName);
if(UserExist==false)
{
lblUserNotFound.Text = "User not found";
}
}
Any suggestions? many thanks in advance.