Wednesday, June 26, 2013

JQuery Popup on page load asp.net

JS/CSS

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/themes/base/jquery-ui.css"
        type="text/css" media="all" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js"
        type="text/javascript"></script>.

Java Script Function


<script>

     
function ShowPopup(message) {
        $(function () {
       
//            $("#dialog").html(message);
           var bbw = '<%=Session["bbw"]%>';
           if (bbw=='') {
            $("#dialog").dialog({
             
                title: '<%=Session["CompanyName"]%>',
//                buttons: {
//                    Close: function () {
//                        //$(this).dialog('close');
//                    }
//                },
                   <%Session["bbw"] = "Welcome";%>
                modal: true
            });
            }
        });
    };
      
    </script>

Popup Div


<div id="dialog" title="Basic dialog" style="display:none;">
        <p>
            This is the default dialog which is useful for displaying information. The dialog
            window can be moved, resized and closed with the 'x' icon.</p>
    </div>

No comments:

Post a Comment

Opps Part 1 : Abstraction

  Abstraction in C# is a fundamental concept of object-oriented programming (OOP) that allows developers t...