Showing posts with label hidden. Show all posts
Showing posts with label hidden. Show all posts

Monday, March 26, 2012

Modal Popup Issues

I have a couple of issues with the modal popup extender control.

1- When the popup shows, any dropdown list on the form behind gets hidden.

2- I can't add vb code (not script) under the buttons on the popup that are selected as either the ok or cancel controls of the popup extender.

3- To get around problem # 2, i didn't specify an ok or cancel button on the extender, and have code i want to run under the _click event of the buttons on the popup panel. The problem with that is, when the popup hides, all my dropdown lists on the base form remain hidden.

So the three problems are related in my scenario.

Thanks

Hi,

the ModalPopupExtender hides the select elements (DropDownList-Controls) when you use an Internet Explorer < 7.0. That is necessary, because the select elements always on top. This behavior is normal.

See my post:http://forums.asp.net/thread/1555265.aspx for your issue 3.

Regards
Marc André


Thanks,

I was able to solve this problem by hidding the popup panel using client side javascript.

Saturday, March 24, 2012

Modal window with update panel stops working after its shown and hidden once

I'm having some trouble with the modal window tool. It behaves perfectly the first time i show it, and the first time I hide it, then although the updatepanel postback behaviour still works (and the text field in the example below is still updated) the modal window doesn't fire the onOkScript or hide as it does the firsttime.

Does anyone have any ideas?

<div><asp:LinkButtonID="lbCommunityProfile"runat="server">Community Profile</asp:LinkButton></div><atlas:UpdatePanelID="updatePanel2"runat="server"Mode="Always"><ContentTemplate><asp:LabelID="lTest"runat="server"Text="NoneSet"></asp:Label></ContentTemplate></atlas:UpdatePanel><atlasToolkit:ModalPopupExtenderID="ModalPopupExtender1"runat="server"><atlasToolkit:ModalPopupPropertiesTargetControlID="lbCommunityProfile"PopupControlID="Panel1"BackgroundCssClass="modalBackground"DropShadow="true"OkControlID="OkButton"onOkScript="__doPostBack('ctl00$ContentPlaceHolder$lbCommunityProfile','');alert('go');"CancelControlID="CancelButton"/></atlasToolkit:ModalPopupExtender><asp:PanelID="Panel1"CssClass="modalPopup"runat="server"><atlas:UpdatePanelID="updatePanel1"runat="server"Mode="Conditional"><ContentTemplate>

This is panel 1

<asp:TextBoxID="tbTest"runat="server"></asp:TextBox><asp:ButtonID="OkButton"runat="server"Text="OK"OnClick="OkButton_Click"UseSubmitBehavior="false"></asp:Button><asp:ButtonID="CancelButton"runat="server"Text="Cancel"></asp:Button></ContentTemplate></atlas:UpdatePanel></asp:Panel>

and in the aspx.cs file

protectedvoid OkButton_Click(object sender,EventArgs e)

{

string str = tbTest.Text;

lTest.Text =

"set" + tbTest.Text +"end";

}

Also just wondering what the javascript is to close a modal window. I understand you can use the ok and cancel buttons. I'd like to have a x in the top right of my window and have that close.


Is this with the June CTP of Atlas?
yes the most recent ctp

yes the july ctp


The June CTP is currently (this may change very soon) the most recent Atlas release. It has a problem whereby UpdatePanel updates under Firefox break all extenders. It sounds like you're hitting this problem. Atlas is aware of it and should have a new release out soon to correct the problem. Thanks for your patience!

Just wondering if any progress has been made on this topic?


The July CTP of Atlas fixes the problem mentioned above.
I am experiencing this problem with the July CTP. Appears to notnecessarilybe fixed. I've got a lot of other things goin on in the same page... I'm going to try and issolate the issue.

Wednesday, March 21, 2012

ModalPopup & Screen Flicker

Just as with the other controls, when the page first loads you briefly see the controls before they are hidden. However, with the modal if you set the control's visibility to hidden, it will not display when it's poped up.

Is this a known bug? or someting else?

This behavior happens to me too...
My popup panel is declared as follow, the same as the sample included in the toolkit:

<asp:Panel ID="MoveItemDialogPanel" runat="server" CssClass="modalPopup" style="display:none;" >
...

Urhh ... it's not a bug in Atlas or the toolkit ... it's a problem with the style sheets / CSS that you used. Most, if not all, of the samples work properly as shipped. Hundreds of different posts in the forum over this particular issue.

I've run into the same problem with Collapsible, Hover and ModalPopup. What you have to be really careful of ... is ensuring that if you do copy & paste (which I did) that you ensure that you've got all of the CSS in place as well.

What Atlas (and other Ajax frameworks) are doing is taking advantage of the evolution of browsers and CSS. You get the "fast" response and neat effects in the browser(s) because the markup is already their in the DOM ... it's simply not visible and/or had its behaviors (event sinks) hooked up until necessary. This coupled with "smarter" postbacks (i.e don't post back every possible input field on the page, hidden viewstate, etc) ... result in less over-the-wire data movement ... less processing at the server and an overall "snappier" user experience.

All of this has been doable for years ... it's just really hard to hand-write all that markup and javascript ... and get all the edge cases correct.

ModalPopup add_hidden event

I am trying to hook the hidden event of the ModalPopup. I am getting it work sporadically. It seems that there is a timing issue when the javascript runs.

If I wrap up the add_pageLoaded in a setTimeout it works, actually it only works after I refresh the page. How/When can I hook this event. Below is what I have so far.

Specifically, pop is null. The find is not locating my modal popup properly.

<script language='javascript'>Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(AMModalPopupPageLoaded);function AMModalPopupPageLoaded(sender, args){ var pop = $find('<%= ModalPopup1.ClientID%>_ajaxModalPopup'); if (pop != null) pop.add_hidden(function(){alert('hidden');}); else alert ('nope'); Sys.WebForms.PageRequestManager.getInstance().remove_pageLoaded(AMModalPopupPageLoaded);}</script>
You could specify a BehaviorID on the extender and retrieve it using that.

That sounds good, however, i don't know how to do thatHuh? Can you provide me a sample or the location of the documentation?

thanks!


Ok, I simply changed:
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(AMModalPopupPageLoaded)
To:
Sys.Application.add_load(AMModalPopupPageLoaded);
And everything works perfectly!