To get a pop-up to appear in .NET from the code behind, you can do the following:
ScriptManager.RegisterStartupScript(this, this.GetType(), "alertName", string.Format("javascript:alert('Message to display with argument {0}')", argument1), true);
To get a pop-up to appear in .NET from the code behind, you can do the following:
ScriptManager.RegisterStartupScript(this, this.GetType(), "alertName", string.Format("javascript:alert('Message to display with argument {0}')", argument1), true);
While writing my first web service in .NET I came across the following error:
Cannot serialize member System.ComponentModel.Component.Site of type System.ComponentModel.ISite because it is an interface.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
I am having a problem where certain dynamic controls are not having their events triggered. I can re-create the problem by getting my code to re-create the controls in the PreRender event as follows:
protected void Page_PreRenderobject sender, EventArgs e)
{
GenControls();
}
protected void Page_Load(object sender, EventArgs e)
{
GenControls();
}
To make a web page return to the same position after a postback, 2 things are required. First, the following must be added to the web.config file:
Second, add the following into the Page_Load() function for the page:
protected void Page_Load(object sender, System.EventArgs e)
{
Page.MaintainScrollPositionOnPostBack = true;
}