Showing posts with label click. Show all posts
Showing posts with label click. Show all posts

Wednesday, March 28, 2012

modal popup and login

i have a login link, upon clicking it, the modalpopup extender will appear, the problem is the validation of the data...when i click on the login buton, nothing is happening..im very new in using asp.net ajax and not that familiar with javscript. should i create a javascript to pass the validation?or is there any other easy way to do this?

thank you.Smile

Hi,

According to my test, the validation in the login control works when it's placed in a modal popup panel.

Here is my code:

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void Button3_Click(object sender, EventArgs e) { TextBox tb = new TextBox(); Panel1.Controls.Add(tb); ModalPopupExtender1.Show(); } protected void Page_Load(object sender, EventArgs e) { } protected void Button6_Click(object sender, EventArgs e) { ModalPopupExtender1.Hide(); }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title> <script type="text/javascript"> function changeID(newOkControlID) { var ext = $find("ModalPopupExtender1"); if (ext._OkControlID) { $removeHandler($get(ext._OkControlID), 'click', ext._okHandler); ext._okHandler = Function.createDelegate(ext, ext._onOk); ext._OkControlID = newOkControlID; $addHandler($get(ext._OkControlID), 'click', ext._okHandler); } } </script></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> </div> <asp:Button ID="Button1" runat="server" Text="Popup via client" /> <asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="Popup via Server" />  <input id="Button5" type="button" value="Change OK Button ID" onclick="changeID('button4');" /> <asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px"> <asp:Panel ID="Panel2" runat="server" Style="cursor: move;background-color:#DDDDDD;border:solid 1px Gray;color:Black"> <div> <p>Choose the paragraph style you would like:</p> </div> </asp:Panel> This is popup control<asp:Login ID="Login1" runat="server"> </asp:Login> <br /> <input id="Button2" type="button" value="button" /> <input id="Button4" type="button" value="button" /> <asp:Button ID="Button6" runat="server" OnClick="Button6_Click" Text="Hide via Server" /></asp:Panel>     <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" OkControlID="Button2" PopupDragHandleControlID="Panel2" PopupControlID="Panel1" runat="server" TargetControlID="Button1"> </ajaxToolkit:ModalPopupExtender> <script type="text/javascript"> Sys.Application.add_load(modalSetup); function SetFocusOnControl() { $get("Login1_UserName").focus(); } function modalSetup() { var modalPopup = $find('ModalPopupExtender1'); modalPopup.add_shown(SetFocusOnControl); // modalPopup.show(); }</script> </form></body></html>

Modal Popup and Formview. first click not responding

i'm running into an issue when i put a modal popup in a formview where when i first click on the linkbutton, the modalpopup does not appear but instead it postbacks. But then on the second click and any clicks after that, the modalpopup will appear.

anyone run into this problem before and does anyone know how i could fix this issue? thanks.

My Immediate suggestion would be wrap the gridview and formview .Net UI code in a ajax Update Panel. Unless you are handling the select and the display of the FormView servser-side - it would be safe to assume that would be the default behavior. The reason I say that is until the Modal is actually invoked - its not really resident - just part of the DOM and not part of the ASP.Net page... If you tie what event you are using to invoke the formview to showing the modal using the serverside show() hide() methods - and you have that all wrapped up into a updatepanel on the UI side - you should get a seamless ModalPopUp experience... There may be better ways - but that is at least how I handle it...


http://forums.asp.net/thread/1441672.aspx might be relevant, too.

Modal Popup awith datagrid

I m using Button click to show Datagrid.

When Button is clicked Modal popup appears showing updating as status for 4 secs..and side by side in server side Datagrid is filled.

Now the issue is that Modal up Appears for 4 sec but Datagrid is not displayed.

Query for Fetching the data from Database is running Fine and do bind the data to Data grid but grid is not displayed.

I have update Panel where i put Button (To be clicked),Update Progress and Modal Popup

I have not put Datagrid in Update Panel.

Can this be problem??

Yes you might be right. Try by putting the DataGrid inside the UpdatePanel. And for more details can you post your code, so that it will be easy to diagnolise the problem.


Hi Varun,

In your situation, when click on the Button which is inside the UpdatePanel , it will post all the elements back to the server and returns all to the client but only refresh the content which is inside the UpdatePanel. So you should put the DataGrid inside the UpdatePanel. My suggestion is when updating shows UpdateProgress and when it finished ,we force the ModalPopupExtender to be shown.The DataGrid is moved into the Panel which is associated with ModalPopupExtender.

For example:

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

function EndRequestHandler(sender, args){
$find("ModalPopupExtender's BehaviorID").show();

}

Best regards,

Jonathan

Modal PopUp control needs dynamic data on button click

greetings,

Have a modal popup control as follows:

<

cc1:ModalPopupProperties
TargetControlID="lb_verify"
PopupControlID="P_popup"
BackgroundCssClass="modalBackground"
DropShadow="true"
OkControlID="lb_ok1"
OnOkScript="onOk()"
CancelControlID="lb_cancel1"/>
</cc1:ModalPopupExtender>

What I'm trying to do is to populate a gridview full of options (that is on the p_popup panel) when the user clicks the lb_verify link button. This gridview will be populated based on a textbox entry, so it's dynamic.

When I try to do this on the lb_verify.click action, the sub does not fire... only the popup modal...

Following is my lb_verify sub just in case that will help...

Protected

Sub lb_verify_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)Handles lb_verify.Click
Dim AVAs AddressVerification =New AddressVerification
Dim APAs AddressProperties =New AddressProperties
With AP
.address1 = tb_address1.Text
.city = tb_city.Text
.state = tb_state.Text
.zip = tb_zip.Text
EndWith
Dim resultAsString = AV.AddressVerified(AP)
SelectCase result
Case"M"
L_msg.Text ="modal popup / pick from grid"
gv_verify.DataSource = AV.GetAddressAlternates(AP)
gv_verify.DataBind()
CaseElse
L_msg.Text = result
EndSelect
EndSub

Let me know and thanks.

Rock

This sounds like work item 207 which is not yet implemented.

Modal Popup Extender

hi

i have used ModalPopupExtender on my web page and it is really good but the problem is if i click any button then it close the panel.

is it possible to use some validation control on the panel like i want to insert data into database, also i want to add a close button on the panel, without click close button that panel will be enable on the page.

thanks is advance

You can add a UpdatePanel in your panel, and put your detailviews in this UpdatePanel.

All the behavior you do in the UpdatePanel will not effect other controls that out side of this Panel.

Modal Popup extender

Hi,

I have one page on that one button is there, when I click the button am calling one function and after executing that function am using Response.write method to show popup and download the genreated file by that function.

But problem iss when I click upon that button am showing modal popup but that pop is not going off when response.end occurs.

I used one function in client script and tried to call with code as,

Page.ClientScript.RegisterStartupScript(Me.GetType(),"Sample", _

"<script language=""javascript"" type=""text/javascript"">" & vbNewLine & _

"Sample()" & vbNewLine & _

"</script>")

ans that sample function code is,

function Sample()

{

var modal = $find('ModalPopupExtender2');

modal.hide();

}

but this function is not getting called.

My main concern is to hide that modal popup when that save/download dialog gets disappered or cancelled.

Can anybody give me the solution over this.

Please.

Thanks,

Rohit

Hi Rohit,

Would you please use these code?

Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "SampleKey", "sample()", true);

If it doesn't work, please review its generated HTML code. You can post your workable and tiny repro here.

Best regards,

Jonathan

Monday, March 26, 2012

Modal Popup inside DataList?

Hey guys,
Has anyone ever tried using the Modal Popup Extender inside the DataList? If want to create something similar to Netflix. When you click a button inside a DataList, a modal popup shows up and allows the user to perform certain operations.

I tried doing so but it kept on throwing JavaScript errors. I was just wondering if anyone tried the same.

Thanks
Anup
Hi,

what kind of JavaScript errors are you getting?

I'm interested in this as well, not because I'm getting javascript errors, but because I'm getting multiple modal popup windows when clicking on a single button. I assume that I need to pass an ID to only open a single modal, but I'm not sure how to go about it. Once I'm able to get the number of popups down to one per person (this is a roster page), I'm planning on populating it with database driven content for each person in the list. Does anyone have ideas on how to go about this?

Source code:

1 <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" RepeatColumns="1"2 RepeatDirection="Horizontal" OnSelectedIndexChanged="DataList1_SelectedIndexChanged">3 <ItemTemplate>4 <div class="membercard2">5 <table width="100%">6 <tr>7 <td valign="top" width="30%" align="center">8 <asp:Image ID="RankImage" runat="server" ImageUrl='<%# "~/images/t_" & Cstr(Eval("Rank")) & ".gif"%>' />9 </td>10 <td width="70%">11 <h3>12 <asp:HyperLink ID="emailLink" runat="server" NavigateUrl='<%# "mailto:" & Cstr( Eval("Email"))%>'13 Text='<%# Cstr(Eval("FirstName")) & " " & """" & Cstr(Eval("Callsign")) & """" & " " &Cstr(Eval("LastName")) %>' />14 </h3>15 <asp:Panel runat="server" ID="panel1" CssClass="actionbuttons" Visible='<%# User.IsInRole("Administrators") %>'>16 <Club:RolloverLink ID="editbtn2" runat="server" Text="Edit" NavigateURL='<%# "Roster_edit.aspx?Action=Edit&PilotID=" & Cstr(Eval("PilotID"))%>' />17 </asp:Panel>18 <asp:Panel runat="server" ID="panel2" CssClass="actionbuttons" Visible='<%# User.IsInRole("Administrators") %>'>19 <Club:RolloverLink ID="RolloverLink1" runat="server" Text="Remove" NavigateURL='<%# "Roster_edit.aspx?Action=Remove&PilotID=" & Cstr(Eval("PilotID"))%>' />20 </asp:Panel>21 <h3>22 <asp:Label ID="TitleLabel" runat="server" Text='<%# Cstr(Eval("Title"))%>' />23 </h3>24 <h3>25    ICQ:26 <asp:Label ID="ICQLabel" runat="server" Text='<%# Cstr(Eval("ICQNum")) %>' />27 </h3>28 <h3>29    Location:30 <asp:Label ID="LocationLabel" runat="server" Text='<%# Cstr(Eval("Location"))%>' />31<br /><br />32<center>33<Club:RolloverLink ID="Button1" runat="server" Text="View Profile" />34</center>353637 </h3>38 <div class="dashedline">39  </div>40 </td>41 </tr>42 <div class="clearcard">43 </div>44 </table>45 </div>46<AjaxToolkit:ModalPopupExtender ID="ModalPopupExtender2" runat="server"47TargetControlID="Button1" PopupControlID="ModalPanelOuter1" CancelControlID="Cancel"48OkControlID="OK" DropShadow="False" BackgroundCssClass ="modalBackground" />4950<AjaxToolkit:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server"51TargetControlID="ModalPanelInner1" BorderColor="black" Radius="6" />52 </ItemTemplate>5354 </asp:DataList>5556<asp:Panel ID="ModalPanelOuter1" runat="server" CssClass="modalPopupOuter" Style="display:none;">5758 <asp:Panel ID="ModalPanelInner1"59 runat="server" DefaultButton="Ok" ScrollBars="Auto" Height="150px" Width="350px"60 CssClass="modalPopup">Text goes here!<br /><br />61 <asp:Button ID="Ok" runat="server" Style="position: static" Text="Ok" />62 <asp:Button ID="Cancel" runat="server" Style="position: static" Text="Cancel" />63 </asp:Panel>6465</asp:Panel>

Bump. Anyone have ideas?


Here how i did it.

Add the following to the item that will popup the modal popup for each item dataitem:

onclientclick='$find('Details').show();' where Details is the name of your modal popup extender. This will open the popup in javascript.

If you require server processing also wire up the event and in the commandarguments pass the following:

<%# DataBinder.Eval(Container, "ItemIndex") %>

This is pass the current row index to the server side event. From there you can pass the row index to get the row that fired the event.

To avoid postback on clicks make sure the control opening the popup is in an update panel.

The completed item should look similar to this:

<asp:LinkButtonID="CourseLink"runat="server"Text='your button text'

OnClick="TestLink_Click"OnClientClick="$find('[Your modal popup extender id]').show();"

CommandArgument='<%# DataBinder.Eval(Container, "ItemIndex") %>'>

</asp:LinkButton>

One final thing is to remove the modal popup extenders and panel to outside the datalist and bind the targetcontrolid to a hidden dummy button.


Have a look at this article. Hope you might get better idea. the url ishttp://www.aspdotnetcodes.com/Ajax_ModalPopup_PostBack_GridView.aspx


Thanks for the great info! I'll check it out and see if I can figure it out.

Kevin


ameenkpn -

With the exception of the update function (I don't really need to do that right now), that looks exactly like what I'm trying to do. Now, one problem. That article seems to use a mix of C and Javascript (right?), and my app is written in VB (I'm using the clubsite starter kit - YES, I'm new and NOT a developer!). I *think* I have the web service built in my app, but I'm struggling with the DisplayResult section. Is that javascript or C? Does it go in the script section of my page, or somewhere else? I assume I need to convert it to VB, but not sure where to start. Thanks again for the link, I think I'm close on getting it where I want it.

Kevin


The article i suggest you is not mix of C and JavaScript. Its purely C# and JavaScript. There is many tools availbele to convert C# code to VB.NET. Or else you go to microsoft site, they the keyword you want to convert to VB, you can see the equivalent VB code also in the code section.

Please Mark the Post as 'Answered' if you got solution.


I'm still working on this problem. I haven't been able to get it to work yet, and I don't think I'm close yet. I just can't figure out exactly where everything needs to go yet, and would love to see the actual aspx code implemented that he's got in his article. That would definitely help more than seeing code snippets. I saw a comment on the article asking for the same thing, so hopefully someone can supply it!

Kevin


Hi Kevin,

When i read that artcile i dont really find any problem. I try to implement it the same way it explained. It works well for me. Where is your problem in implementing the code snippet? hope atleast i can help you.

Thanks


The problem is that I really have no idea what I'm doing. Stick out tongue If you could take a look at my page and see where I'm missing it, that would be helpful. I've uploaded it to my site, you can grab it here: http://www.308thvfs.com/files/roster_view.zip

That contains the page that I'm attempting to add the modal to, as well as the web service. Again, I don't want to do the update talked about in the article, I'm just trying to get the modal to popup "read only" to view a database field associated with the selected member. I'm not exactly clear what goes where, that's where I'm having the trouble. For example, you see that I don't have the "function DisplayResult" called anywhere, because I really have no idea where to put it.

My site is built in VB, and I've gotten a C# to VB converter tool (from herehttp://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx).

Any help you can give would be appreciated. I'm NOT a developer, I'm just trying to use starter kits and code samples to make my way through this site, and trying to pick things up as I go...

Thanks,
Kevin

Modal Popup Problem Inside Multiview

I have a multiview with six views. Each view has a date field with a imagebutton beside it. When you click the imagebutton is should open a modal popup. The modal popup holds a canledar control. When I bring up this page with the multiview I get the following error: "Assertion Failed: Could not find an HTML element with ID "ImageButton ....." for control of type "sys.UI.Image".

I understand why I get this error, and that's because the imagebutton control exists on the second view that is hidden (because it works on the first view if it's the only one defined to use modal popup) . So then I tried to move the ModalPopupExtender to be within the views. Then when I move to the second view I get "null or not null object" error in the WebResource.axd line 110. The actual statement is "$(_CancelControlID).detachEvent('onclick', _cancelHandler);". I really need to get this working ASAP. If I can make this work with just the Popup (not Modal Popup) that would also be OK, but I have to call the popup from the ImageButton....

As you note, different panels of a MultiView are in many ways like completely separate pages. I like your idea of moving the MPE into the same view as the target control. Does that layout work if you remove the MultiView entirely? If not, then maybe it's something else getting in the way.

Saturday, March 24, 2012

Modal pop-up questions

First, I'd like to display a modal pop-up programatically instead of it being triggered by a button click event or similar.

Secondly, if the user clicks OK, I'd like it to trigger a server-side function.

I've tried several approaches to doing these and have not had much success. Could anyone provide some direction?

Thanks

To show and hide the modal popup programatically:

ModalPopupExtender1.Show() and ModalPopupExtender1.Hide() ' Change "ModalPopupExtender1" to whatever yours is called.

To get your "Okay" button to fire normal server-side code, just don't specify an OkControlID for the ModalPopupExtender. Handle the button's click event normally and just use the above .Hide() method to close the popup.

Modal Popup Window is being closed with every button click

Hello,

I have a weird problem withModalPopupExtender. Every time a press any server sidebutton or link on my modal window themodal window is being closed. Is it normal behavior or I do something wrong ?


I need to implement the following scenario

1. Modal window withuser data is shown on the modal window. There are multiple buttons on the window something like assign location to a user etc….All of them require server side functionality.

Thank you,

Tory

Thank you,

Tory

Hi Tory,

This is expected. ModalPopup closes itself on a full postback - and regular button clicks will cause full postbacks. The solution is to wrap the contents of your ModalPopup inside an UpdatPanel so those other button clicks are just treated as partial postbacks.

Thanks,
Ted

ModalDialog Switch Panel content on click

I was wondering if there was a way to change the inner content of the modal panel when the user clicks a certain button. Is this a job for the UpdatePanel?

As it stands, I'm just binding to a TargetControlID, and I can Ok/Cancel, but would like the content to change onOk.

I'm quite new to this whole atlas way of thinking, so I'm not sure how to co-mingle all this client/server stuff.

Any help would be appreciated.

-Ty

Hi,

you can also use the DynamicPopulateExtender to load new content inside a panel.

Regards
Marc André

Wednesday, March 21, 2012

modalpopup

hii need to use a modalpopup to add an item to my dropdownlist.my dropdownliste extract the itmes from an oracle database.

the client click on a botton to add the new item in the database and i want that the ddl refreshe.

can u help me plez.

1<asp:Panel runat="server" id="pnl_add">2 <asp:TextBox runat="server" id="txt_name" />3 <asp:RequiredFieldValidator runat="server" id="rfv_name"4 ControlToValidate="txt_name"5 ToolTip="Please enter a name"6 ErrorMessage=" *" />7 <asp:Button runat="server" id="btn_ok"8 Text="Ok" />9 <asp:Button runat="server" id="btn_cancel"10 Text="Cancel" />11</asp:Panel>12<ajaxToolkit:ModalPopupExtender runat="server" id="mpe_add"13 TargetControl="btn_add"14 PopupControlID="pnl_add"15 CancelControlID="btn_Cancel" />1617<asp:UpdatePanel runat="server" id="up_items"18 RenderMode="block"19 UpdateMode="conditional">20 <Triggers>21 <asp:AsyncPostBackTrigger22 ControlID="btn_Ok"23 EventName="Click" />24 </Triggers>25 <ContentTemplate>26 <asp:DropDownList runat="server" id="ddl_items" />27 </ContentTemplate>28</asp:UpdatePanel>
1Protected Sub btn_Ok_Click(sender asObject, e as EventArgs) handles btn_Ok.Click2'insert into database34 up_items.Update()5End Sub

ModalPopUp - Getting value from DropDownList

I have a dropdownlist in my modal pop up and when I click the submit button the page posts back but DropDownList.SelectedValue is empty. I need that value so that I can submit to the database when the btnSubmit_Click method is fired.

My modal extender:

<atlasToolkit:ModalPopupExtenderID="ModalPopupExtender_AddEntity"runat="server"><atlasToolkit:ModalPopupPropertiesTargetControlID="imgBtn_AddEntity"DropShadow="true"PopupControlID="pnlAddEntityModal"CancelControlID="btnCancelEntity"BackgroundCssClass="modalBackground"OkControlID="btnAddEntity"/></atlasToolkit:ModalPopupExtender>

My Submit button:

<

asp:Buttonid="btnAddEntity"Width="110"runat="server"Text="Submit"CssClass="button"OnClick="btnSubmit_Click"UseSubmitBehavior="false"/>Might you be hitting the issue outlined in the following post:http://forums.asp.net/thread/1316941.aspx?

Actually I was able to solve the problem using this bit of Javascript and C#. BUT, it seems that the selected value of the dropdownlist is not always there. It seems a littl buggy. Can someone look at my code and let me know if I am missing something:

<scripttype="text/javascript">var selectedEntity;var selectedProperty;//var selectedValues;function onOk() {

selectedEntity = document.getElementById(

'ddlEntity').value +"-" + document.getElementById('ddlProperty').value;//selectedProperty = document.getElementById('ddlProperty').value;//selectedValues = selectedEntity + "-" + selectedProperty;

__doPostBack(

'btnAddEntity',selectedEntity);

}

</script>

<atlasToolkit:CascadingDropDownID="CascadingDropDown1"runat="server"><atlasToolkit:CascadingDropDownPropertiesTargetControlID="ddlEntity"Category="Entity"PromptText="<-- Selected an Entity -->"ServicePath="webservices/ws_Timetracking.asmx"ServiceMethod="GetEntites"/><atlasToolkit:CascadingDropDownPropertiesTargetControlID="ddlProperty"ParentControlID="ddlEntity"PromptText="<-- Select a Property -->"ServiceMethod="GetPropsForEntity"ServicePath="webservices/ws_Timetracking.asmx"Category="Property"/></atlasToolkit:CascadingDropDown>

<atlasToolkit:ModalPopupExtenderID="ModalPopupExtender_AddEntity"runat="server"><atlasToolkit:ModalPopupPropertiesTargetControlID="imgBtn_AddEntity"DropShadow="true"PopupControlID="pnlAddEntityModal"CancelControlID="btnCancelEntity"BackgroundCssClass="modalBackground"OkControlID="btnAddEntity"OnOkScript="onOk()"/></atlasToolkit:ModalPopupExtender>

Sorry, I'm not seeing the empty SelectedValue issue on my end with the recent 60626 release. If you still see it with that release, could you please post a small, simple example of the problem so we can look into it further? Thanks!


You're talking about the AtlasControlKit release, right? I have 1.0.60504.0. Do I just download the lastest version and Add Reference to the AtlasControlKit.dll into my project?

Yes, the AtlasControlToolkit release 60626 which can be downloaded from here:http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=AtlasControlToolkit&ReleaseId=70

You download it and extract the files and you'll see an environment very much like the 60504 release, except with additional controls, some fixes, automated testing, etc.. You should be able to substitute the new 60626 versions of AtlasControlToolkit.dll and Microsoft.AtlasControlExtender.dll for the old 60504 versions without any problems. Just remove the references to the old DLLs and add references to the new ones and you should be set!

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.

ModalPopUp (Position in a MasterPage)

Hi all...

Well, I Have a Linkbutton in a MasterPage that calls a ModalPopUp...

My Problem is... when I click in the linkbutton my Panel (modalPopup) opens outside of the my screenTongue Tied and when I put the Panel in my Webform, it happens too...

Can Someone to help-me ?

cyaa

Hi Cyaa,

Can you show me a repro?

A stripped version is preferred.