Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Modal window disappear after asp.net postback
30th July, 12:37
Post: #1
Modal window disappear after asp.net postback
Hello,
I'm using qtip to dynamically load another asp.net page as modal. this page has some buttons that cause a postback. the problem is after postback the modal qtip disappears and the asp.net page is shows in a separate browser window. parent widnow code follows.
I've been trying to fix this problem for a long time so any help will be highly appreciated.

Thanks,
Mohammad

JS Code
<script type="text/javascript">
        $(document).ready(function() {
            $('a[rel="modal"]:first').qtip(
   {
       content: {
           title: {
               text: 'my Page',
               button: 'Close'
           },
           url: 'mypage.aspx'
       },
       position: {
           target: $(document.body), 
           corner: 'center' 
       },
       show: {
           when: 'click', 
           solo: true 
       },
       hide: false,
       style: {
           width: { max: 500 },
           padding: '14px',
           border: {
               width: 9,
               radius: 9,
               color: '#666666'
           },
           name: 'light'
       },
       api: {
           beforeShow: function() {
               $('#qtip-blanket').fadeIn(this.options.show.effect.length);
           },
           beforeHide: function() {
               $('#qtip-blanket').fadeOut(this.options.hide.effect.length);
           }
       }
   });
 
            // Create the modal backdrop on document load so all modal tooltips can use it
            $('<div id="qtip-blanket">')
      .css({
          position: 'absolute',
          top: $(document).scrollTop(), // Use document scrollTop so it's on-screen even if the window is scrolled
          left: 0,
          height: $(document).height(), // Span the full document height...
          width: '100%', // ...and full width
 
          opacity: 0.5, // Make it slightly transparent
          backgroundColor: 'black',
          zIndex: 5000  // Make sure the zIndex is below 6000 to keep it below tooltips!
      })
      .appendTo(document.body) // Append to the document body
      .hide(); // Hide it initially
        });
    </script>


HTML Code
<form id="form1" runat="server">
    <div>
        <div id="content" class="modal">
            <div class="center" style="text-align: center">
                <a href="#" rel="modal">Click here to open modal</a>
            </div>
        </div>
    </div>
    </form>
Find all posts by this user
Quote this message in a reply
2nd August, 09:05
Post: #2
RE: Modal window disappear after asp.net postback
Mohammed, are you wanting the pages returned by these buttons to be placed in the qTip content? If so, it's probably a better idea to use an Iframe element, or you could possibly attach an event handler to these buttons which fetches the pages via AJAX and adjust the qTip content accordingly.

Craig Thompson
Web Developer / Designer
Craigsworks
http://www.craigsworks.com
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [Solved] qtip shows tail only on postback (refresh) wwdev 5 147 9th May 20:58
Last Post: wwdev
  [Solved] Help when using an asp.net updatepanel mark007 4 439 15th February 10:04
Last Post: mark007
  qTip & ASP.NET UpdatePanel Postback Problem qTipNoob 4 3,039 10th January 15:01
Last Post: naupadnara
  [solved] Trouble with qtips adding a scrollbar momentarily to window patricia 0 354 2nd December 19:40
Last Post: patricia
  [Solved] Prevent qTip to be displayed outside the window SDirk 2 857 9th August 15:48
Last Post: usman
  Modal tooltips on modal tooltips Dukegatts 2 537 17th June 07:38
Last Post: Dukegatts
  [Solved] Getting QTip To Disappear After Three Seconds? theferrett 4 1,048 4th April 16:34
Last Post: theferrett
  [Solved] Swap between showing qTip as a tooltip and as a modal window Surya 3 1,197 16th February 20:53
Last Post: Craig
  qtip with dynamic content using vb.net mrnorway 1 1,195 13th February 16:33
Last Post: Craig
  qTip, AJAX and .NET miketravis 19 5,599 21st January 20:45
Last Post: dotNETMkv



User(s) browsing this thread: 1 Guest(s)