Click here to Skip to main content
15,914,500 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Message box is displayed at (minimized) at taskbar...

But i want the messagebox to come above the page(at the center of a aspx page)

how to do that?

any sugestion?

regards
karan
Posted
Comments
Om Prakash Pant 16-May-11 7:08am    
can you paste code that is been used?
karan joshua 16-May-11 8:45am    
protected void DeleteButton_Click(object sender, EventArgs e)
{
if(System.Windows.Forms.MessageBox.Show("Are You Sure you want to delete this Study?","Confirm Delete",System.Windows.Forms.MessageBoxButtons.YesNo,
System.Windows.Forms.MessageBoxIcon.Question)==(System.Windows.Forms.DialogResult.Yes))
{
}
}
Sandeep Mewara 16-May-11 7:22am    
Tried anything?

1 solution

Dont use System.Windows.Forms.MessageBox() method... it will create this kind of bugs......
instead use RegisterStartupScript() static method of ScriptManager class to run javascript on serverside to display simple alert message.

string msg = "<script>alert('your custom message');</script>";
ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), msg, false);
 
Share this answer
 
Comments
karan joshua 16-May-11 8:42am    
how to get yes no confirmation using this/

it should be like:

when the button is clicked : a yes no confirmation shuld be asked..
if yes
then do this


how to go for it?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900