Showing posts with label course. Show all posts
Showing posts with label course. Show all posts

Monday, March 26, 2012

Modal Popup Hide Not showing Drop Downs again

HI

I am calling .Hide on my modal popup which does hide the modal popup but the drop downs dont appear again.
This is of course only an IE6 issue but there are a fair few people out there with that!

I have tried chaning the visibility style attribute of the drop downs on the server but no joy.

Any ideas?

Steve

My IE 6.0.2900.2180 service pack 2 is running fine... below is my test code.

<%@.Page

Language="C#"%>

<%@.Register

Assembly="AtlasControlToolkit"

Namespace="AtlasControlToolkit"

TagPrefix="atlasToolkit"%>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<scriptrunat="server">

protectedvoid Page_Load(objectsender,EventArgs e)

{

}

protectedvoid Okay_Validate(objectsender,EventArgs e)

{

if(DummyBox.Text =="")

{

ErrorMessage.Visible =true;

ErrorMessage.Text ="DummyBox is required";

ModalPopupProperties1.Show();

}

else

{

//do yourstuffs.

}

}

protectedvoid HideViaServer_Click(objectsender,EventArgs e)

{

ModalPopupProperties1.Hide();

}

</script>

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>UntitledPage</title>

<styletype="text/css">

.modalBackground

{

background-color:Gray;

filter:alpha(opacity=70);

opacity:0.7;

}

.modalPopup

{

background-color:#ffffdd;

border-width:3px;

border-style:solid;

border-color:Gray;

padding:3px;

width:250px;

}

</style>

</head>

<body>

<formid="form1"runat="server">

<atlas:ScriptManagerID="ScriptManager"runat="server"EnablePartialRendering="true"/>

<div>

<atlas:UpdatePanelID="Update"runat="server"Mode="Always">

<ContentTemplate>

<asp:ButtonID="Button1"runat="server"Text="Popup"/>

<br/>

<asp:PanelID="Panel1"runat="server"CssClass="modalPopup">

<asp:LabelID="ErrorMessage"runat="server" Visible="false"/>

<asp:DropDownListID="testdropdown"runat="Server">

<asp:ListItem>test1</asp:ListItem>

<asp:ListItem>test2</asp:ListItem>

</asp:DropDownList>

Dummy Box :<asp:TextBoxID="DummyBox"runat="server"/>

<br/>

<asp:ButtonID="FakeOk"style="display:none" runat="server"Text="OK"/>

<asp:ButtonID="FakeCancel"style="display:none" runat="server"Text="Cancel"/>

<br/>

<asp:ButtonID="TheRealDeal_Ok"runat="server"Text="OK Validate"OnClick="Okay_Validate"/>

<asp:ButtonID="TheRealDeal_Cancel"runat="server"Text="Hide"OnClick="HideViaServer_Click"/>

</asp:Panel>

<atlasToolkit:ModalPopupExtenderID="ModalPopupExtender1"runat="server">

<atlasToolkit:ModalPopupProperties

TargetControlID="Button1"

PopupControlID="Panel1"

BackgroundCssClass="modalBackground"

OkControlID="FakeOk"

CancelControlID="FakeCancel"

ID="ModalPopupProperties1"

/>

</atlasToolkit:ModalPopupExtender>

</ContentTemplate>

</atlas:UpdatePanel>

</div>

</form>

</body>

</html>


I have exactly the same problem and my IE6 build is the same as the poster above.

I noticed from his code however that he has put his dropdownlist in an updatepanel, mine was in a table for easy positioning.

surrounded the table in an updatepanel and the problem went away, the dropdownlist still hides when you show the modal poup, but it reappears again when the modalpopup is hidden.

hopefully there will be a fix for this nasty bug soon.

Si

Wednesday, March 21, 2012

ModalPopup - closing after every click event (need help)

My ModalPopupExtender show a Panel with GridView, TextBox - txtSearchParam, Button - btnSearch and of course also OkButton - btnOK and CancelButton- btnCancel. What I wannt to do is this:

1) in that gridview is displayed simple list of customers

2) user cann type in txtSearchParam some name and with click on btnSearch performs a SEARCH for typed name

Every time when user clicks on SEARCH BUTTON (btnSearch) my ModalPopup will be closed. It seems like ModalPopup ignores both settings for OKControlID = "btnOK" and CancelControlID="btnCancel".

Why is that ModalPopup closed after every Click in panel with gridView ?


What am I doing wrong ? Please help and sorry for my english :-)

Because btnSearch is posting back, I think that is the reason.

I also faced the same problem, upon google, i found that I have to use updatepanel and keep the btnSearch inside updatepanel's content.

It solved the problem, I can get the results wih different search criteria... but after that If I click cancel it is messing my page's dropdown cotrols.

Any idea?


I am having the same problem. I've tried everything I can think of... putting the TargetControl inside an UpdatePanel, putting it outside an UpdatePanel... with no luck.

Here, specifically, is what I'm trying to do:

I have a Panel ( we'll call it "Panel1"). The panel contains an UpdatePanel. The Updatepanel contains a User Control that has text boxes, buttons... all sorts of things that perform postbacks. If this is on a page by itself, everything works just fine; the updatepanel performs the partial postbacks and everything works.

However, I need it to appear as if it were a highly interactive modal dialog box. So, I attached a ModalPopupExtender to "Panel1". It pops up just fine, but whenever any of the controls within my user control fire, the entire modal popup vanishes. It doesn't seem to matter that I set the OkButton and CancelButton properties to buttons that are not within my user control... in fact, I set them to "hidden" buttons that are on the outer page, outside of the whole Panel1 that I'm displaying modally.

Someone please help... I'm at my wits end trying to figure this out.


Thx champ ! That was it...it works OK with UPDATEPANEL :-)
Can you elaborate on how you got it working? I still cannot.

Hi RobertBeach,

Do you still need a sample code , let me know...


yes, sure...let's share it with us please :-)

Hi,

Make sure that popup panel's OkControlID and CancelControlID are outside the update panel. Postback buttons should be inside the update panel.

For Example:

<cc1:modalpopupextender id="mdlPopup" runat="server" targetcontrolid="btnDummy1" popupcontrolid="pnlPopup" backgroundcssclass="modalBackground" okcontrolid="OkButton1" dropshadow="true" popupdraghandlecontrolid="pnlHeaderPopup" /><%-- PopupP anel--%><asp:Panel ID="pnlPopup" runat="server" Style="display: none" CssClass="modalPopup" Width="500px"><%-- Popup Panel Header--%> <asp:Panel ID="pnlHeaderPopup" runat="server"><%-- OK Control ID--%> <asp:ImageButton ID="OkButton1" runat="server" BorderStyle="None" ImageAlign="AbsMiddle" ImageUrl="~/App_Images/close_icon.gif" /> </asp:Panel> <Ajax:UpdatePanel ID="upLeaveDetails" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:FormView ID="frmView" runat="server" DataSourceID="ds1" Width="100%"> <EditItemTemplate><%-- Buttons that postback--%> <asp:Button ID="btnUpdate" runat="server" CausesValidation="True" CommandName="Update" CssClass="btn" OnClick="btnUpdate_Click" Text="Update" /> <asp:Button ID="btnCancel" runat="server" CausesValidation="True" CommandName="Cancel" CssClass="btn" OnClick="btnCancel_Click" Text="Cancel" /> </EditItemTemplate> </asp:FormView> </ContentTemplate> </Ajax:UpdatePanel></asp:Panel>

For more information refer to:

http://blogs.technet.com/kirtid/archive/2007/05/03/using-updatepanels-with-modalpopups.aspx

Hope it helps.