<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Hello Kirti : ModalPopup</title><link>http://blogs.technet.com/kirtid/archive/tags/ModalPopup/default.aspx</link><description>Tags: ModalPopup</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Using UpdatePanels with ModalPopups</title><link>http://blogs.technet.com/kirtid/archive/2007/05/03/using-updatepanels-with-modalpopups.aspx</link><pubDate>Fri, 04 May 2007 02:13:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:879932</guid><dc:creator>kirtid</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.technet.com/kirtid/comments/879932.aspx</comments><wfw:commentRss>http://blogs.technet.com/kirtid/commentrss.aspx?PostID=879932</wfw:commentRss><wfw:comment>http://blogs.technet.com/kirtid/rsscomments.aspx?PostID=879932</wfw:comment><description>&lt;P mce_keep="true"&gt;One of the most frequently asked questions on the &lt;A class="" title="Toolkit Sample Website" href="http://ajax.asp.net/ajaxtoolkit" mce_href="http://ajax.asp.net/ajaxtoolkit"&gt;Toolkit&lt;/A&gt; &lt;A class="" title="Toolkit forums" href="http://forums.asp.net/1022/ShowForum.aspx" mce_href="http://forums.asp.net/1022/ShowForum.aspx"&gt;forums&lt;/A&gt; and at &lt;A class="" title="MIX website" href="http://www.visitmix.com/" mce_href="http://www.visitmix.com"&gt;MIX&lt;/A&gt; after &lt;A class="" title="Shawn's demo blog post" href="http://blogs.msdn.com/sburke/archive/2007/05/01/slides-and-demos-for-mix-toolkit-talk.aspx" mce_href="http://blogs.msdn.com/sburke/archive/2007/05/01/slides-and-demos-for-mix-toolkit-talk.aspx"&gt;Shawn's demo&lt;/A&gt; was how to get &lt;A class="" title="Update Panel documentation" href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx" mce_href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx"&gt;UpdatePanels&lt;/A&gt; to work right with &lt;A class="" title="Modal Popup sample" href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx" mce_href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx"&gt;ModalPopups&lt;/A&gt;. The trick is to understand that the &lt;A class="" title="ModalPopup sample" href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx" mce_href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx"&gt;ModalPopup&lt;/A&gt; extender attaches itself to more than just the TargetControl and PopupControl. If you include the OK and Cancel buttons inside the &lt;A class="" title="ModalPopup sample" href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx" mce_href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx"&gt;ModalPopup&lt;/A&gt;&amp;nbsp;Panel in an &lt;A class="" title="Update Panel documentation" href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx" mce_href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx"&gt;UpdatePanel&lt;/A&gt;,&amp;nbsp;make sure you include the extender declaration in it as well. If you do not, once a postback occurs the extender will not reinitialize the handlers and you will get null references. Also, if buttons inside the &lt;A class="" title="ModalPopup sample" href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx" mce_href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx"&gt;ModalPopup&lt;/A&gt; Panel are set to be OK and Cancel buttons on the &lt;A class="" title="ModalPopup sample" href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx" mce_href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx"&gt;ModalPopup&lt;/A&gt;&amp;nbsp;Extender,&amp;nbsp;then their sole purpose is to close the Popup Panel and run their respective scripts if any have been set. They will not perform postbacks or&amp;nbsp;execute any other client side handlers since the&amp;nbsp;&lt;A class="" title="ModalPopup sample" href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx" mce_href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx"&gt;ModalPopup&lt;/A&gt;&amp;nbsp;prevents the event from&amp;nbsp;propagating up.&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;I have attached a sample page that demonstrates three simple scenarios with ModalPopups and UpdatePanels.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;A class="" title="ModalPopup sample" href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx" mce_href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx"&gt;&lt;STRONG&gt;ModalPopup&lt;/STRONG&gt;&lt;/A&gt;&amp;nbsp;&lt;STRONG&gt;with an &lt;/STRONG&gt;&lt;A class="" title="Update Panel documentation" href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx" mce_href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx"&gt;&lt;STRONG&gt;UpdatePanel&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt;&amp;nbsp;inside its Popup Panel:&lt;/STRONG&gt; Make sure that the OK and Cancel buttons are not inside the &lt;A class="" title="Update Panel documentation" href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx" mce_href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx"&gt;UpdatePanel&lt;/A&gt;&amp;nbsp;otherwise the handlers will be rendered useless on postback. &lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;STRONG&gt;&lt;A class="" title="Update Panel documentation" href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx" mce_href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx"&gt;&lt;STRONG&gt;UpdatePanel&lt;/STRONG&gt;&lt;/A&gt;&amp;nbsp;that contains a &lt;A class="" title="ModalPopup sample" href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx" mce_href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx"&gt;&lt;STRONG&gt;ModalPopup&lt;/STRONG&gt;&lt;/A&gt;&amp;nbsp;Extender and its Popup Panel: &lt;/STRONG&gt;Clicking&amp;nbsp;OK&amp;nbsp;or Cancel still does not cause the postback since those buttons are tied to client side handlers. Clicking on any other control will cause the server side handlers to kick in. Since the extender declaration is inside the UpdatePanel, the asynchronous postback causes the ModalPopupBehavior to be reinitialized correctly and any client side handlers are setup again when the request is completed. So if you would like to postback every time the user clicks OK or Cancel, just don't set those properties on the extender. The Modal Popup Panel closes on postback as desired since the entire popup is inside an &lt;A class="" title="Update Panel documentation" href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx" mce_href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx"&gt;UpdatePanel&lt;/A&gt;.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;&lt;STRONG&gt;What if that Popup Panel in # (2) contains an &lt;/STRONG&gt;&lt;A class="" title="Update Panel documentation" href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx" mce_href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx"&gt;&lt;STRONG&gt;UpdatePanel&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt;: &lt;/STRONG&gt;Specify the triggers that will cause the outer panel to update and allow the &lt;A class="" title="Update Panel documentation" href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx" mce_href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx"&gt;UpdatePanel&lt;/A&gt;&amp;nbsp;inside the &lt;A class="" title="ModalPopup sample" href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx" mce_href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx"&gt;ModalPopup&lt;/A&gt; to operate on its own terms. This time the &lt;A class="" title="ModalPopup sample" href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx" mce_href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx"&gt;ModalPopup&lt;/A&gt; Panel does not close on postback triggered from within it because the trigger for the outer panel is specifically set to be a separate button.&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;It is a good idea to design the page without &lt;A class="" title="Update Panel documentation" href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx" mce_href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx"&gt;UpdatePanels&lt;/A&gt;&amp;nbsp;in mind. When writing the page place &lt;A class="" title="Update Panel documentation" href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx" mce_href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx"&gt;UpdatePanels&lt;/A&gt;&amp;nbsp;when the rest is done. Once you have the page setup, determine locations in your page that need to be asynchronously&amp;nbsp;updated and the controls that should act as triggers to perform that operation and then appropriately place &lt;A class="" title="Update Panel documentation" href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx" mce_href="http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx"&gt;UpdatePanels&lt;/A&gt;&amp;nbsp;with the correct triggers and UpdateMode property set. With extenders it is important that you take into consideration not just the controls targetted by the extender but any others which it hooks into to provide additional functionality. &lt;/P&gt;
&lt;P mce_keep="true"&gt;This post should evolve as I get more feedback and I will update the sample accordingly as well. I hope this helps.&lt;FONT color=#0000ff&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=879932" width="1" height="1"&gt;</description><enclosure url="http://blogs.technet.com/kirtid/attachment/879932.ashx" length="5234" type="application/x-zip-compressed" /><category domain="http://blogs.technet.com/kirtid/archive/tags/Toolkit/default.aspx">Toolkit</category><category domain="http://blogs.technet.com/kirtid/archive/tags/MIX/default.aspx">MIX</category><category domain="http://blogs.technet.com/kirtid/archive/tags/ModalPopup/default.aspx">ModalPopup</category><category domain="http://blogs.technet.com/kirtid/archive/tags/UpdatePanel/default.aspx">UpdatePanel</category></item><item><title>Yours modally</title><link>http://blogs.technet.com/kirtid/archive/2007/04/08/yours-modally.aspx</link><pubDate>Mon, 09 Apr 2007 04:43:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:738060</guid><dc:creator>kirtid</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/kirtid/comments/738060.aspx</comments><wfw:commentRss>http://blogs.technet.com/kirtid/commentrss.aspx?PostID=738060</wfw:commentRss><wfw:comment>http://blogs.technet.com/kirtid/rsscomments.aspx?PostID=738060</wfw:comment><description>&lt;P&gt;I can see a gray Seattle skyline as I stare out of my window on what should have ideally been a nice Sunday evening in spring time. It is pouring buckets and the view is hazy, reminding me of the html hidden behind the gray modal popup background. I am unable to get out of my apartment and hit downtown before the showers stop because winter seems to be stuck modally in Seattle, just as I am unable to access the&amp;nbsp;webpage till I dismiss the popup. Does it sound like I am obsessed with the &lt;A class="" title="Modal Popup Sample" href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx" mce_href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx"&gt;ModalPopup&lt;/A&gt;? Well, not exactly. I am trying to add some more functionality to it and am stuck, unable to proceed and not liking it, hence the analogy to get the message across.&lt;/P&gt;
&lt;P&gt;The ModalPopup is already a loaded extender. The behavior encapsulates PopupBehavior, DragBehavior and DropShadowBehavior. Having made the &lt;A class="" title="Modal Popup Sample" href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx" mce_href="http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx"&gt;ModalPopup&lt;/A&gt;&amp;nbsp;draggable, I thought it would be interesting to make it resizable as well. Although, adding the ResizableControlBehavior problem turned out to be harder than I had expected. &lt;/P&gt;
&lt;P&gt;Here is a brief overview on how the ModalPopup works.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;TargetControl: &lt;/STRONG&gt;The control whose click event causes the popup to show.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PopupControl:&lt;/STRONG&gt; The popup that will be shown modally.&lt;/P&gt;
&lt;P&gt;If &lt;STRONG&gt;DragDrop &lt;/STRONG&gt;and &lt;STRONG&gt;DropShadow &lt;/STRONG&gt;functionalities are turned on the ModalPopup, the markup will be arranged in the following way which is quite tedious with the positioning&amp;nbsp;of all elements needed to be handled correctly. &lt;/P&gt;
&lt;P&gt;&amp;lt;OuterContainerDiv&amp;gt; // created by the ModalPopupBehavior&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;PopupControl&amp;gt; // what the user passes as the Popup&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DragHandleDiv /&amp;gt; // control that the user would like to see as the DragHandle&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/PopupControl&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DropShadowDiv /&amp;gt; // DropShadow div created by the behavior&lt;/P&gt;
&lt;P&gt;&amp;lt;/OuterContainerDiv&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;BackGroundDiv /&amp;gt;&lt;/P&gt;
&lt;P&gt;What do I have so far? The ResizableBehavior has been added to the PopupControl and&amp;nbsp;tracking is turned on, on the DropShadow so that it gets redrawn when PopupControl is resized. Overflow is set to "auto" on the PopupControl. The problem is that the resize handle gets hidden behind the scroll bars, which means that I need to scroll to bring it into view before I can resize it. If only the resize handle could be placed right at the intersection of the two scroll bars! &lt;/P&gt;
&lt;P&gt;A better, but more long winded option would be to&amp;nbsp;write a ResizableScrollBar extender that adds custom scroll bars to panels if&amp;nbsp;necessary just like the built-in html overflow support and allows the panel to be resized as well. In which case the user would have more control on the resize handles and scroll bars. The &lt;A class="" title="Slider demo" href="http://ajax.asp.net/ajaxtoolkit/Slider/Slider.aspx" mce_href="http://ajax.asp.net/ajaxtoolkit/Slider/Slider.aspx"&gt;Slider&lt;/A&gt; behavior could be repurposed to be an html scroll bar perhaps and&amp;nbsp;the extender would have to perform the calculations&amp;nbsp;to scroll&amp;nbsp;properly.&amp;nbsp;Any other ideas to dismiss this "modal" issue?&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=738060" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/kirtid/archive/tags/Toolkit/default.aspx">Toolkit</category><category domain="http://blogs.technet.com/kirtid/archive/tags/ModalPopup/default.aspx">ModalPopup</category></item></channel></rss>