message box

  • Thread starter Thread starter bbawa1
  • Start date Start date
B

bbawa1

I want to show a mwesage box depending on condition in button click
event. But it doesn't show message right away when I click the button
second time only then it shows me mseeagebox but I want to show
message box right away when it goes into else statement.


int count = VerifyDupRecord(str2, (this.lblUserid11.Text));
if (count == 0)
{
objCmd.ExecuteNonQuery();
}
else
{

btnApplication.Attributes.Add("onclick",
"javascript:alert('You already added this Application');");
objConn.Close();
return;
}
//objCmd.ExecuteNonQuery();
objConn.Close();
this.gdAddUser.DataBind();

}
 
thats because you added the alert to the click. see:

ClientScript.RegisterStartupScript(this.GetType(),"hello","alert('hi');",true);

-- bruce (sqlwork.com)
 
Back
Top