|

October 5th, 2009, 03:03 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 121
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Launching a Modal Popup Window from Server Code
Hello Everybody,
I am having the "REAL" problem trying to launch a Modal Popup Window from inside the Server Code behind. I have found the Microsoft tutorial on the WEB http://www.asp.net/LEARN/Ajax-Control-Toolkit/tutorial-27-cs.aspx but by some reason it is not working on my page. Maybe because my page is using the master page, or I am trying to call Modal Popup from inside AJAX TABControl? Anyway it is not working. I've done everything Microsoft suggested to do, and even more; I've tried both RegisterStartupScript() and RegisterClientScriptBlock() methods inside the btnPromoteSelected_Click() event.
Code:
protectedvoid btnPromoteSelected_Click(object sender, EventArgs e)
{
ArrayList batchList = newArrayList();
if (Session["CHECKED_ITEMS"] != null)
{
batchList = (ArrayList)Session["CHECKED_ITEMS"];
if (batchList != null && batchList.Count > 0)
{
//Do some JOB here!!!!!!!!!!!!!!!!!!!!!!}
else{
//Display the Message here:
//if (!this.ClientScript.IsClientScriptBlockRegistered("key"))// this.ClientScript.RegisterClientScriptBlock(this.GetType(), "key", "launchModal();", true);if (!this.ClientScript.IsStartupScriptRegistered("key"))
this.ClientScript.RegisterStartupScript(this.GetType(), "key", "launchModal();", true);
}
}
else{
//Display the Message here://if (!this.ClientScript.IsClientScriptBlockRegistered("key"))// this.ClientScript.RegisterClientScriptBlock(this.GetType(), "key", "launchModal();", true);if (!this.ClientScript.IsStartupScriptRegistered("key"))
this.ClientScript.RegisterStartupScript(this.GetType(), "key", "launchModal();", true);
}
}
In my case the launchModal() function is not being involved? I am completely frustrated. Any suggestions will be appreciated.
Thanks,
Dmitriy
|