I have an ASP.NET application written in C#. one of the web form where you
create user information and user name has a button to click to print
selected user information for the users record. However when this button is
clicked it does nothing the first time, bring up the popup the second time
it is clicked. We need this button to bring up the popup with the
information the first time it is clicked. Any ideas will be greatly
appreciated. The code in the btn_click event is listed below.
private void btnPrint_Click(object sender, System.EventArgs e)
{
string securityQuestion=ddlQuestion.SelectedItem.Text;
securityQuestion=securityQuestion.Replace("'","\\' ");
lblName.Text=txtUserName.Text;
lblPswd.Text=txtPassword.Text;
lblSecQuestion.Text= securityQuestion;
lblAns.Text=txtAnswer.Text;
btnPrint.Attributes.Add("OnClick","return
PrintDocument('"+divusername.ClientID+"');");
}
Thanks!