I am trying to pop up a message if session times out and some error message comes back from my controller.
My include is as follows....
<link rel="stylesheet" type="text/css" href="<%= ResolveUrl("~/Content/jqueryui/redmond/jquery-ui-1.8.16.custom.css") %>"/>
<link rel="stylesheet" type="text/css" href="<%= ResolveUrl("~/css/slideshow.css") %>"/>
<script type="text/javascript" src="<%= Url.Content("~/Scripts/ui/jquery-1.6.2.js") %>"></script>
<script type="text/javascript" src="<%= Url.Content("~/Scripts/ui/jquery-ui-1.8.16.custom.js") %>"></script>
Here is the code:
<%
string AlertMessage2 = TempData["PublicAlertMessage"] as string;
string AlertMessage2Title = TempData["AlertMessageTitle"] == null ? String.Empty : TempData["AlertMessageTitle"] as string;
if( AlertMessage2 != null )
{ %>
<div id="AlertMessage" title="">
</div>
<script type="text/javascript">
jQuery.noConflict();
$("#AlertMessage").html("<center><%= AlertMessage2 %></center>");
$("#AlertMessage").dialog({ height: 240, width: 350, modal: true, title: '<%= AlertMessage2Title %>', buttons: { "OK": function () { $(this).dialog("close"); } } });
});
</script>
<% } %>
I am getting "Microsoft JScript runtime error: Unable to get value of the property 'html': object is null or undefined" when I implement the following Jquery dialog.
Am I missing any include file? I have no clue and where to look! any ideas?
Thanks!
Now I can see the modal window... but getting error "Microsoft JScript runtime error: Object doesn't support property or method 'dialog'" in ok button
This is in IE 9. When I try in Google chrome, I cannot close the modal window.
$("#AlertMessage").dialog({
height: 200,
width: 250,
modal: true,
title: '<%= AlertMessage2Title %>',
buttons: { "OK": function () {
// $(this).dialog('close'); --> comment this and try to run... no issues
} } });
what's wrong with the buttons?
Update on 29th: If I remove the close functionality of ok, there is no error. But how do I close the modal window? any other work around?
Update on Dec 2nd: This code does not work in IE 8 and IE 9. Also the pop up window does not close. But no problem in IE 7.