.Net 2.0 with Confirmation question

  • Thread starter Thread starter Jason Huang
  • Start date Start date
J

Jason Huang

Hi,

The MessageBoxConfirm seems to work fine for my C#.Net 2.0 web project.
In the comfirmation message box, if the client hit the OK, the the
btnHidden's Text will get the value 'Y',
otherwise, the btnHidden's Text gets the value 'N';
Hoewever, in the following btnQry_Click event, the btnHidden.Text are all
just blank space, as the initial Text value.

protected void btnQry_Click(object sender, EventArgs e)
{
this.basfuncs.MessageBoxConfirm (this, "Are you sure?",
this.btnHidden );
if ( this.btnHidden .Text == "N")
{ }
else if ( this .btnHidden .Text == "Y")
{
this.txtCustNameInsert.Text = this.txtCustName.Text.Trim();
}
}

How do I solve this situation?
Thanks for help.


Jason
 
protected void Page_Load(object sender, EventArgs e)
{
string strbYes = Request["result"];

if ( bYes .Text =="Y")
{// Adding }
else
{
//
}
}



public void MessageBoxConfirm(Page currentPage, string strMSG, Control
ctl)
{

StringBuilder js = new StringBuilder();
js.Append ("<script language='javascript' type='text/javascript'>
");
js.Append (" result= window.confirm('");
js.Append (strMSG);
js.Append ("'); ");
js.Append(" form1.submit(); ");
js.Append("</script>");

currentPage.ClientScript.RegisterStartupScript(typeof(Page),
"MessageBoxConfirm", js.ToString());
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top