Chong xian

Chong xian

  • NA
  • 1
  • 2.2k

Run RegisterStartupScript multiple times in c#

Jun 10 2013 3:49 AM

Good day Everyone,

The following is part of my code

start code
protected void Button1_Click(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "temp", "<script>loadAdditionalInfoDialog(info1)</script>",false);

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "temp2", "<script>loadAdditionalInfoDialog(info2)</script>",false);
}
end of code

The loadAdditionalInfoDialog() function will prompt a small window and let user to key in some info and then click on "OK" button to proceed to next step.

But, when I click on Button1, I can only see the secoond RegisterStartupScript, which isloadAdditionalInfoDialog(info2) works, it will prompt the small window, and I can key in some info and click on "OK" button to proceed to next step.

Because of this, I CAN NOT enter info for the first RegisterStartupScript, which isloadAdditionalInfoDialog(info1).

Would like to ask for solution which is, when I click on Button1, I can first enter info forloadAdditionalInfoDialog(info1) and then click on "OK" button, then continue enter info forloadAdditionalInfoDialog(info2).

Thousand of thanks.


Answers (1)