Saturday, October 29, 2011
Saturday, October 8, 2011
Best Practices: Using Disposable Windows SharePoint Services Objects
Modal PopUp in SharePoint
Have always got stuck in this.
/// <summary>
/// Generates a modal popup
/// </summary>
/// <param name="sTitleOfThePage"></param>
/// <param name="sWidthOfTheWindow"></param>
/// <param name="sHeightOfTheWindow"></param>
/// <param name="LinkOfThePageThatNeedsToBeOpened"></param>
private void CallModalPopUp(string sTitle, string sWidth, string sHeight, string newLink)
{
string command = "ExecuteOrDelayUntilScriptLoaded(function () {var options = SP.UI.$create_DialogOptions(); options.title = \""+sTitle+"\"; options.width = "+sWidth+"; options.height = "+sHeight+"; options.url = \"" + newLink + "\"; SP.UI.ModalDialog.showModalDialog(options);}, \"sp.js\");";
Page.ClientScript.RegisterStartupScript(this.GetType(), "PopupScript", command, true);
}
/// <summary>
/// Generates a modal popup
/// </summary>
/// <param name="sTitleOfThePage"></param>
/// <param name="sWidthOfTheWindow"></param>
/// <param name="sHeightOfTheWindow"></param>
/// <param name="LinkOfThePageThatNeedsToBeOpened"></param>
private void CallModalPopUp(string sTitle, string sWidth, string sHeight, string newLink)
{
string command = "ExecuteOrDelayUntilScriptLoaded(function () {var options = SP.UI.$create_DialogOptions(); options.title = \""+sTitle+"\"; options.width = "+sWidth+"; options.height = "+sHeight+"; options.url = \"" + newLink + "\"; SP.UI.ModalDialog.showModalDialog(options);}, \"sp.js\");";
Page.ClientScript.RegisterStartupScript(this.GetType(), "PopupScript", command, true);
}
Subscribe to:
Posts (Atom)