My SharePoint solution has a userControl that Register a js block
string getJS(string title, string htmlContent)
{
return (string.Format(@"
ExecuteOrDelayUntilScriptLoaded(function () {{
var options = SP.UI.$create_DialogOptions();
options.title = '{0}';
options.html = '{1}';
options.autoSize = true;
options.showClose=true;
options.allowMaximize=false;
SP.UI.ModalDialog.showModalDialog(options);
}}, 'sp.js');"
, title, "<div>Blah blah</div>"));
}
I have registered the sp.ui.dialog.js to make sure that this function is available
<Sharepoint:ScriptLink ID="slSAAuto" Name="sp.ui.dialog.js" LoadAfterUI="true" Localizable="false" runat="server"></Sharepoint:ScriptLink>
I register my JS block at run time
ScriptManager.RegisterClientScriptBlock(this.Page, typeof(Page), "popupOnPageLoad", getJS(title,htmlContent), true);
after page loads, i got a JS error
Uncaught TypeError: Object <div>Blah blah</div> has no method 'getElementsByTagName'
Where did i go wrong?