I am trying to initiate a JavaScript ShowModalDialog from ASP.Net code behind. The code snippet I currently have is as follows:
string _timeSpentinMin = "123";
Page page = HttpContext.Current.CurrentHandler as Page;
ScriptManager.RegisterStartupScript(page, page.GetType(), "OpenModalDialog", "<script type=text/javascript>window.showModalDialog('ClockPopUP.aspx', null, 'dialogWidth:290px;dialogHeight:270px;status:no'); </script>", false);
In addition, I would like to pass a query string to Clock.aspx using JavaScript:
function openmodalWinLunch() {
var variable1 = "Lunch";
window.showModalDialog("ClockPopUP.aspx?code=" + variable1, "dialogWidth:290px;dialogHeight:270px,");
}
My query revolves around how to achieve the same functionality from the ASP.NET code behind. Could you please modify my existing ASP.NET code behind to include passing the string variable _timespentinMin through the query string to the Clock.aspx page when using ShowModalDialog?