Opening the sharepoint modal dialog from asp.net code behind? Sharepoint 2010
<p>Is it possible to open the sharepoint 2010 javascript modal dialog from asp.net code behind? I have tried..</p>

<pre><code>        System.Web.HttpContext.Current.Response.Write("&lt;script type=\"text/javascript\"&gt;");
        System.Web.HttpContext.Current.Response.Write("var options =");
        System.Web.HttpContext.Current.Response.Write("{");
        System.Web.HttpContext.Current.Response.Write("    url: 'ok.aspx',");
        System.Web.HttpContext.Current.Response.Write("    width: 100,");
        System.Web.HttpContext.Current.Response.Write("    height: 100,");
        System.Web.HttpContext.Current.Response.Write("    allowMaximize: false,");
        System.Web.HttpContext.Current.Response.Write("    title: 'HATA'");
        System.Web.HttpContext.Current.Response.Write("};");
        System.Web.HttpContext.Current.Response.Write("modalDialog = SP.UI.ModalDialog.showModalDialog(options);");
        System.Web.HttpContext.Current.Response.Write("&lt;/script&gt;");
</code></pre>

<p>.. and it fails. </p>
