how to disable the Jqueryui dialogbox when the page loads the second time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • preethi 123
    New Member
    • Dec 2011
    • 6

    how to disable the Jqueryui dialogbox when the page loads the second time

    Hi,
    i have created a jquery ui dialogbox at my masterpage,so in my site dialogbox appears in all the pages, I close the dialogbox using clickevent after that when i go to next page dialogbox again open.once i close the dialogbox it should not open at next pageload .please give me some idea for this to do.
    How can i do this??

    This is my jquery code:

    Code:
        <script type="text/javascript">
     
            $(document).ready(function () {
          
                $("#dialog").dialog({ modal: false, resizable: false,
                    bgiframe: true, draggable: false, position: ['right', 'bottom'], height: 150, width: 300
                });
    
                  
                $("#<%=btnCancel.ClientID%>").click(
                function () {
                    $("#dialog").dialog('close');
                    return false;
                    
    
                });
    
    
                $("#<%=btnyes.ClientID%>").click(
                function () {
                    var url = ".....";
                    $(location).attr('href', url);
                    return false
                });
    
    
                // To Store
    
    
    
            });
    </script>


    this is my design code:

    Code:
    <div id="dialog" title="How Are We Doing?" style="width:500px; margin:0 0;" background-color="white">
      
         <asp:Label ID="Label1" runat="server" Text="Please take a minute to give us your feedback…MICROMO.com’s User Feedback Program."></asp:Label>
        </br></br>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<asp:Button ID="btnyes"  runat="server" Text="YES" BackColor="#0099cc" width="40px" ForeColor="White" Font-Bold="true" />
        &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<asp:Button ID="btnCancel" runat="server" Text="NO"  width="40px" BackColor="#0099cc" ForeColor="White" Font-Bold="true"/>
    
    </div>
    Last edited by Dormilich; Apr 16 '12, 05:48 AM. Reason: Please use [CODE] [/CODE] tags when posting code.
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    Solution:
    don't put it in the master page.
    put it in there desired page only from where you want to execute.

    but if the starting page can be anywhere then i would suggest you to keep a session data to know if you already showed it or not

    Comment

    • preethi 123
      New Member
      • Dec 2011
      • 6

      #3
      Hi
      If i add that in masterlayout the popup will shown in all the pages but once i click the no button It will not shown anymore for that I have to use session But in jquery we cant set session value.

      so i use the code behind in masterlayout as
      Code:
      <script runat="server">
       protected void btnCancel_Click(object sender, EventArgs e)
          {
            Session["sesvalue"] = 1;
             
          }
      </script>
      but clicking on the no button these function is not fire
      How to call serverside function by clicking button in jquery uidialogbox?
      Please help me...
      Last edited by acoder; Apr 17 '12, 02:47 PM. Reason: Added [code] tags

      Comment

      • johny10151981
        Top Contributor
        • Jan 2010
        • 1059

        #4
        in jquery we cannot set session value, but we can preset session value and

        as example:

        Code:
        <?php
        $_SESSION['data']='some data';
        
        ?>
        <script>
        var Session_value='<?php echo $_SESSION['data'];?>';
        </script>
        <?php
        
        ?>
        rest is up to you

        Comment

        Working...