Showing posts with label page. Show all posts
Showing posts with label page. Show all posts

Wednesday, March 28, 2012

Modal popup and continue to run server code

I have a linkbutton that causes a postback for a lengthy process on the server - then the page redirects to a different page for fianl processing - when the linkbutton is pressed I would like a modal popup to appear showing that something is happening and just have a spinnier or something on it - nothing fancy.

However if I wire the modal popup extender to the linkbutton it disrupts the postback - of course if I have the server post code to show the popup by the time it gets to the client the process is done and that is useless - is there a way to show the modal popup and have the postback occur leaving the modla popup visible untill the page redirects or the page finishes its postback

You could use the Dynamic* properties of the modalpopup to use a web service method to do the server side processing. You can then hookup to the populated event so that after the processing has completed, you can redirect to another page.

Modal popup and Combo box

Hi.

I have a combo box on my web page. When Modal popup is shown, then this combo box is not disabled. How to fix it?

Piotrek

This problem should be fixed in the 60626 release of the Toolkit. Please try that.


Thanks David.

Where can I find Toolkit release number?


http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=AtlasControlToolkit

Modal Popup and MasterPage

I have several modalpopups on a page that is inside of a MasterPage. The popups work fine, but in IE, the modalpopup opens inside the content area rather than over the entire page. I've searched these forums and have not come up with a solution. Does anyone have any ideas?


http://forums.asp.net/ShowPost.aspx?PostID=1357977 - and maybe vote on the work item to address this.

Modal Popup causing double page load

I'm having a problem where it seems that the Modal Popup is causing my pages to double load. I have a simple Master page file which just has my modal popup on it and my pages create the event handlers for the images on the modal popup. When i put a break point on page load i can clearly see that my pages are loading two times.

I'm wondering if anyone else has had this problem and if so is there a simple solution?

Thanks,
Kam

I seem to have answered my own question. I had ImageButtons inside the target panel and those were causing the page to load twice. when i set the visible to false so that they don't render on the page the page doesn't double load.

This might be a bug. Can someone else test it and see if you get the same results?

Thanks,
Kam


I also have a similar problem. I didnt understand all of your answer.

I have a modal popup with an updatepanel with 2 DDL's, 2 image buttons

and 2 text boxes..the DDL's and text boxes have theirautopostback=false

and the DDL's also havecausesvalidation=true.When I click either button,

the code behind fires twice..?? Happy to post the markup if you want..when

do you set thevisible=trueon your buttons? How does that cause a double load?

Thanks..


This can occur if the page is the default page for the application (e.g. default.aspx) and an image or imagebutton is missing the imageurl attribute.

Ok..no help for me..I'm not on the default page, and

my urls are specified..any idea why the code behind

for the 2 imagebuttons fires twice for each click?

Thanks..


Could also be due to a double up with autoeventwireup and manual wiring up of the events:http://forums.asp.net/thread/1287221.aspx

Jason:

I left a detailed response for you at the same link.

Spent the entire weekend trying to get it going by all

combinations of true & false for both the page and the control..Tongue Tied

no luck..Crying

http://forums.asp.net/thread/1287221.aspx

Thanks for your input..Cool

modal popup and update panel

hi there, i have a login button that when it is clicked, the modal popup will trigger and was able to logon to the system. the page has two link buttons, when i click on the 2nd link, the update panel will display the items assiciated with that link, and when i click on the 1st link, the update panel will display the items associated to the 1st link, its lakie i have a tabs..the problem is, when i added the modal popup on that page, and clicked on the 2nd link, it will not display the items of that link, i mean, it will not trigger any event at all...but when i remove the modal popup extender on that link, it will toggle..what am i missing here??please help.

thank you .Smile

Can you show me some code so that I can reproduce it?

Modal Popup events?

Okay I call a modal popup in my page and then reposition the popup to appear over the elemnt clicked using the $get, getlocation and setLocation in the AJAX library - however inside my modal popup I have an update panel that updates the contents based on selecting a link button in the popup - when the popup returns the new content it automatically recenters itself like it reinitalizes

My question is is there a event or method that I cna use to repostion my popup after this happens or is there a way to prevent it from doing this?

TIA

The update panel should be inside the modal popup not embedding it so that only that markup(the link button and the content) is refreshed and the entire modal popup is not re-rendered. Could you post a small code snippet that demonstrates what you are doing?

the update panel is inside the modal popup (it doesnt work otherwise i found) when the content in side that update panel is refresehed the modal popup is not rerendered (that i can see) but it moves to its centered position

my code to move the modal popup is this javascript

1<script>2function pageLoad()3{4 var popup = $find('dnn_LOGIN1_ModalPopupExtender');5popup.add_shown(SetFocus);6}7function SetFocus()8{9var login_button = $get('dnn_LOGIN1_hypLogin');10var loginscreen = $get('dnn_LOGIN1_Panel1');11var position = Sys.UI.DomElement.getLocation(login_button);12Sys.UI.DomElement.setLocation(loginscreen,position.x-170,position.y+12);13$get('dnn_LOGIN1_txtUsername').focus();14}15</script>

(is that enough?)

TIA

Modal popup dont work

Hi,

I update to new version of toolkit but my 2 modal popup on my application don't work correctly.

The modal popups work correctly after first page load...but if I first click on another button or do another operation on my page and next I try to open the modal popup it don't appear.

Why?

Thanks for help.

Can you show some code of the code opening Modal dialogs? This is a weird behavior!

Regards


Ok.

This is the extender:

 <cc1:ModalPopupExtender ID="MPE1" runat="server" TargetControlID="filterBtn" CancelControlID="CancelButton" OkControlID="OkButton2" DropShadow="true" BackgroundCssClass="modalBackground" PopupControlID="filtroPanel" > </cc1:ModalPopupExtender>

the modal popup is opened when I click on "filterBtn" button


and this is the panel:

1<asp:Panel ID="filtroPanel" runat="server" CssClass="modalPopup" HorizontalAlign="Center"2 Style="display: none">3 <asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional" >4 <Triggers>5 <asp:AsyncPostbackTrigger ControlID="divisioneDdl" EventName="SelectedIndexChanged" />6 <asp:AsyncPostbackTrigger ControlID="classeDdl" EventName="SelectedIndexChanged" />7 <asp:AsyncPostbackTrigger ControlID="famigliaDdl" EventName="SelectedIndexChanged" />8 <asp:AsyncPostbackTrigger ControlID="ClearFilterBtn" EventName="Click" />9 <asp:AsyncPostbackTrigger ControlID="filterBtn" EventName="Click" />10 </Triggers>11 <ContentTemplate>12 <table>13 <tr>14 <td style="width: 100px; text-align: right">15 Tipo Erbario</td>16 <td style="width: 100px; text-align: left">17 <asp:DropDownList ID="ErbarioDdl" runat="server" Width="150px">18 <asp:ListItem Selected="True">Tutti</asp:ListItem>19 </asp:DropDownList></td>20 </tr>21 <tr>22 <td style="width: 100px; text-align: right">23 Divisione</td>24 <td style="width: 100px; text-align: left">25 <asp:DropDownList ID="divisioneDdl" runat="server" AutoPostBack="True" OnSelectedIndexChanged="divisioneDdl_SelectedIndexChanged"26 Width="150px">27 <asp:ListItem Selected="True">Tutti</asp:ListItem>28 </asp:DropDownList></td>29 </tr>30 <tr>31 <td style="width: 100px; text-align: right">32 Classe</td>33 <td style="width: 100px; text-align: left">34 <asp:DropDownList ID="classeDdl" runat="server" AutoPostBack="True" OnSelectedIndexChanged="classeDdl_SelectedIndexChanged"35 Width="150px">36 <asp:ListItem Selected="True">Tutti</asp:ListItem>37 </asp:DropDownList></td>38 </tr>39 <tr>40 <td style="width: 100px; text-align: right">41 Famiglia</td>42 <td style="width: 100px; text-align: left">43 <asp:DropDownList ID="famigliaDdl" runat="server" AutoPostBack="True" OnSelectedIndexChanged="famigliaDdl_SelectedIndexChanged"44 Width="150px">45 <asp:ListItem Selected="True">Tutti</asp:ListItem>46 </asp:DropDownList></td>47 </tr>48 <tr>49 <td style="width: 100px; text-align: right">50 Genere</td>51 <td style="width: 100px; text-align: left">52 <asp:DropDownList ID="genereDdl" runat="server" AutoPostBack="True" Width="150px">53 <asp:ListItem Selected="True">Tutti</asp:ListItem>54 </asp:DropDownList></td>55 </tr>56 </table>57 <br />58 <asp:Button ID="OkButton" runat="server" OnClick="OkButton_Click" OnClientClick="clickbtn()"59 Text="OK" />60    61 <asp:Button ID="CancelButton" runat="server" Text="Cancel" OnClientClick="clickbtn()" />6263 </ContentTemplate>646566 </asp:UpdatePanel>676869 <asp:Button ID="OkButton2" runat="server" Style="visibility: hidden"/>70 </asp:Panel>

OkButton2 is a button that is clicked by a javascript function, to close the popup.

In the page there are some update panel.


Anyone?

Help meCrying


I'm having the same issue with HoverMenuExtender and PopupControlExtender.
This sounds a lot likehttp://forums.asp.net/thread/1441672.aspx - try upgrading to Beta 2/61121.

Modal Popup Extender and Iframe

Hi @dotnet.itags.org.all, misters

I would like to show a ModalPopupExtender in my page. I have an iframe in the page that shows an PDF file.

The trouble for me, when ModalPopup is shown the iframe appears above it and I cannot see contents of Modal Popup (only dropdownlist appears above)

Thanks in advance for any help. I have lastest version of Ajax Toolkit.

Greetings

I dont Quite have the same problem but it does involve the modal popup extender and i have an IFrame. I would like to display te modal popup in the parent of the IFrame. In other words when clicking on the link in the IFrame the popup should cover the whole screen not just the Iframe. I would also then need to select a value from the popup and pass it back to the Iframe. Is this possible anyone, its killing me. While im at another problem im having is that i have the ajax slider control inside a scrolling DIV but when that DIV is scrolled the ajax slider moves with the scroll instead of just staying wher it belongs. Help me please


I have exactly the same problem, the PDF object is covering my ModalPopup, I tried setting the modalpopu z-index higher than the iframe, but that didn't work, have anyone a working solution?Thanks!WL

Modal Popup Extender - how to set values on main page

Hi

I've got a Modal Popup Extender that shows a Pane and greys out the main page in the background. The main page has a Label (Label1) on it and the Pane (Pane1) that is being popped up has a Text Box (Text1) on it.

I want the user to fill in some text in the Text Box on the popped up Pane, and when the user clicks Button1 (the OK button on the Pane), it should take TextBox1.Text and place it in Label1.Text.

How do I do this? I'm using C#. Sorry, I know this is a basic questions for all you AJAX guru's out there. :)

Thanks in advance!

Regards
Edward

try javascript,

label1.value = textbox1.value;

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

I am trying to show and hide a modal popup in auser control which is called under contentpage of masterpage , as aseparate page the sample works fine but when embed this sample in usercontrol or content page or master page i get the error say this._popupis null or not an object

The following is the code
<script type="text/javascript" language="javascript">
var _popup;

function validate(){
// find the popup behavior
this._popup = $find('mdlPopup');
// show the popup
this._popup.show();
// kick-off the webservice, registering our callback
PageMethods.ValidateCreditCard($get('txtNumber').value, this.callback);
}

function callback(result){
// hide the popup
this._popup.hide();

// let the user know if their credit card was validated
if(result){
alert('congrats, your Number is valid!');
}
else{
alert('sorry, your Number is not valid!');
}
}

</script>
<script runat="server">
/// <summary>
///
/// </summary>
/// <param name="number"></param>
/// <returns></returns>
[System.Web.Services.WebMethod]
public static bool ValidateNumber(string Number)
{

bool isValid = false;
try
{

if(Number=="234")
{
isValid=true;
}

}
catch {}

return isValid;
}
</script>

Thanks

Are you using the $find command correctly? See the documentation:http://www.asp.net/ajax/documentation/live/ClientReference/Sys/ApplicationClass/SysApplicationFindComponentMethod.aspx.

It states "Use the findComponent method to get a reference to a Component object that has been registered with the application through theaddComponent method.".

Also, your problem could be that the client ID isn't 'mdlPopup' since it is a apart of a container control.

-Damien

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

Modal Popup Extender Flash

I'm using the MPE to display a panel that contains a gridview.
It works fine, except that when the page loads (whether it be IE or Mozilla), the panel containing the gridview is visible for a split second and then the MPE hides it. It's kind of confusing to a user - does anybody know how to fix this?

Surround the panel with a div as such:

<div id="divModalPopup" style="display:none"> <asp:Panel ID="pnlModalPopup" runat="server" Height="50px" Width="667px" BackColor="White"><!-- Some content --> </asp:Panel></div>

Thanks,
Chad

Modal Popup Extender blinks on page on initial page load

Hello,

I am getting some undesirable behavior from the modal popup extender control. Everything works fine except for the fact that when i load or reload the page, you can see the modal popup box at the bottom of the page blink for about 1 second and then disappear. Why does it do this? Has anyone else seen this before? I would rather not see the box blink at the bottom of the page when loading the page, it just looks weird. Other than that, it appears fine when i click my button. Its just annoying to see it on the page load.

Any ideas here?

usually you need to set the style='display:none'


awsome...that did the trick...in the panel tag i did this:

<asp:Panel ID="pnlModalCheckUser" runat="server" Height="110px" Width="250px" CssClass="modalPopup"style="display:none">

even though style didn't come up as a valid property for the asp:panel tag in intellisense. But it works, i'm assuming it just passed the style along to the processed div tag.

Thanks a bunch!

Modal Popup Extender and validation

Hi All,

I have a page utilising the ModalPopupExtender and was hoping that someone could give me some guidance as to how I can get, if it is possible, the client side validation to fire before the ModalExtender does?

I.e. I would like the Modal Popup to only display if validation passes.

Any thoughts would be greatly appreciated

Pete

Is there a way to set the event firing order or a dependecy for an ajax event event? e.g. before you do B you must successfully do A first.

Surely the validation rules must be honoured?


I just answered a very similar question:http://forums.asp.net/ShowPost.aspx?PostID=1505722

Hi

The above link no longer works - any chance of reposting the solution to this please?

Thanks

Ben

Modal Popup Extender and Page Refresh ?

I use Modal Popup Extender and there are two buttons, login button and cancel button...Everytime any of the buttons are clicked whole page is refreshed. I want to stop that for cancel button, but don't know how that will work for login as I want some underlying events to happen when that is clicked.

How can I achieve the above functionality ?

Wrap the modalpopup in an updatepanel to take advantage of partial postbacks. You can also assign the cancel button as the cancelcontrolid of the modalpopup so that it will close the popup using JS without a postback.

Modal Popup Extender and OkControID

Hello misters,

I have a page ASPX with ModalPopupExtender control, with the following properties:

TargetControlID="btnAnyadirObs"
PopupControlID="Panel1"


OkControlID="btnAnyadirObsAceptar"
CancelControlID="btnAnyadirObsCancel"
OnOkScript="onYes()"
OnCancelScript="onCancel()"

I have a Panel (Panel1) with two buttons: btnAnyadirObsAceptar and btnAnyadirObsCancel.

The buttons have Click event (code-behind .cs).

My trouble is that it is not execute Click event for button btnAnyadirObsAceptar (the OkControlID). I want to press the button OK in modal popup extender and I call Click event (server event of code-behind, file .cs).

Only execute onYes function javascript but it fails because typeof(Sys.WebForms.PostBackAction) == "undefined"

For javascript function onCancel() , $("Label1") fails.

See all code below, please.


The code begins here:

<asp:Label ID="Label1" runat="server" />

... more code...

<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"

TargetControlID="btnAnyadirObs"
PopupControlID="Panel1"
OkControlID="btnAnyadirObsAceptar"
CancelControlID="btnAnyadirObsCancel"
OnOkScript="onYes()"
OnCancelScript="onCancel()"

DropShadow="true" PopupDragHandleControlID="Panel3">
</cc1:ModalPopupExtender>

<asp:Panel ID="Panel1" runat="server" Style="display: none">

<asp:Panel ID="Panel3" runat="server"><div>TITLE</div></asp:Panel>


<filtros:EmbeddedUserControlLoader ID="UCObservacionesPopup" runat="server" AssemblyName="TareaRetenida.UC"
ControlClassName="UCRetenidaCentrolControlObservacionesPopup" ControlNamespace="TareaRetenida.UC" />


<controles:Boton ID="btnAnyadirObsAceptar" runat="server" CausesValidation="false" Text="Resx OK" OnClick="btnAnyadirObsAceptar_Click" />

<controles:Boton ID="btnAnyadirObsCancel" runat="server" CausesValidation="false" Text="Resx Cancel" OnClick="btnAnyadirObsCancel_Click" />


</asp:Panel>

The javascript functions:

function onYes()

{

var idBoton= "MY CLIENTID OF BUTTON OK";
if (typeof(Sys.WebForms.PostBackAction) != "undefined")
{
var postBack = new Sys.WebForms.PostBackAction();
postBack.set_target(idBoton);
postBack.set_eventArgument('');
postBack.performAction();
}

}

function onCancel()
{
//no postback necessary
try
{
$('Label1').innerText = 'Action canceled';
}
catch(err)
{
alert('onCancel' + "Error " + err.description);
}
}

Thanks in advanced, greetings regards

Hi,

you need to clear the OKControlID property otherwise the postback won't be propagated to the server.

Grz, Kris.


I am having the same issue. I cleared the OKControlID and now my js is not running? Is there something else I need to do?

Hi Alice,

myNameIsAlice:

I cleared the OKControlID and now my js is not running?

which js isn't running? Know that clearing the OKControlID just makes it a normal postbacking control again.

Grz, Kris.

Monday, March 26, 2012

Modal Popup extender need help PLEASE - URGENT

I am having quite an issue with the modal popup extender, and I fear my situation is very unique.

I have an aspx page that has 2 update panels. The first update panel contains a dropdown box with a list of locations, I'll call this UPD1. The second update panel contains a webpart that contains a user control that lists contact information for the location selected, I'll call this UPD2. On this user control is a modal popup ajax control that displays a dialog to add new contacts for the location and it is loaded by clicking a button. When the page is first displayed and I click the add button in UPD2 the modal dialog displays just fine. If I change the loaction in UPD1, which causes UPD2 to be updated with contact information for the new location selected in UPD1 the add button in UPD2 no loger displays the modal dialog, but, causes a postback.

If I change the page containg these 2 update panels and remove the webpart from UPD2 and just place gthe user control in UPD2 the page works fine.

Any ideas? I am really stuck on this one.

Thanks,

Here as my user control.ascx code

<%@.ControlLanguage="VB"

AutoEventWireup="false"

CodeFile="NotificationList.ascx.vb"

Inherits="NotificationList"

%>

<%@.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="cc1" %>

<%@.RegisterAssembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

Namespace="System.Web.UI"TagPrefix="asp" %>

<scripttype="text/javascript">

var vClearFields;

function fLoadRecipDialog(vNotificationID)

{

var vFirstName = document.getElementById("CMNFirstName" + vNotificationID);

alert ("vFirstName Is " + vFirstName);

alert ("vFirstName Value Is " + vFirstName.value);

var vLastName = document.getElementById("CMNLastName" + vNotificationID);

var vTitle = document.getElementById("CMNTitle" + vNotificationID);

var vEMail = document.getElementById("CMNEMail" + vNotificationID);

var vFrequency = document.getElementById("CMNFrequency" + vNotificationID);

var vFirstNameField = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_txtRecipFirstName");

vFirstNameField.value = vFirstName.value;

var vLastNameField = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_txtRecipLastName");

vLastNameField.value = vLastName.value;

var vTitleField = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_txtRecipTitle");

vTitleField.value = vTitle.value;

var vEMailField = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_txtRecipEMail");

vEMailField.value = vEMail.value;

var vFrequencyField = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_drpFrequency");

vFrequencyField.selectedIndex = parseFloat(vFrequency.value) - 1;

var vNotificationIDField = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_hdnNotificationID");

vNotificationIDField.value = vNotificationID;

vClearFields="N";

document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_btnAddRecipient").click();

}

function fClearFields()

{

if (vClearFields !="N")

{

var vFirstNameField = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_txtRecipFirstName");

vFirstNameField.value ="";

var vLastNameField = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_txtRecipLastName");

vLastNameField.value ="";

var vTitleField = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_txtRecipTitle");

vTitleField.value ="";

var vEMailField = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_txtRecipEMail");

vEMailField.value ="";

var vFrequencyField = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_drpFrequency");

vFrequencyField.selectedIndex = parseFloat("0");

var vNotificationID = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_hdnNotificationID");

vNotificationID.value ="0";

}

// vTestObject = $find("TestExtender");

// alert(vTestObject);

// vTestObject.show();

vClearFields="Y";

returnfalse;

}

function fSaveRecip()

{

var vActionField = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_hdnAction");

var vIDField = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList1_hdnID");

vActionField.value ="Save";

vIDField.value ="";

document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_lnkDoPost").click();

}

function fDeleteRecip(vID)

{

var vActionField = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_hdnAction");

var vIDField = document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_hdnID");

vActionField.value ="Delete";

vIDField.value = vID;

document.getElementById("WebPartManager1_gwpNotificationList_NotificationList_lnkDoPost").click();

}

</script>

<divclass="wpContent">

<asp:TableID="tblNotifications"runat="server"BorderStyle="solid"BorderWidth="1"Width="100%">

</asp:Table>

<center>

<asp:ButtonID="btnAddRecipient"runat="server"Text="Add"onclientclick='javascript: return fClearFields();'/>

<asp:LinkButtonID="lnkDoPost"runat="server"></asp:LinkButton>

<asp:LabelID="LabelCausedRefresh"runat="server"Width="184px"></asp:Label>

<asp:HiddenFieldID="hdnAction"runat="server"/>

<asp:HiddenFieldID="hdnID"runat="server"/>

</center>

<cc1:ModalPopupExtenderBehaviorID="TestExtender"ID="ModalPopupExtender1"runat="server"TargetControlID="btnAddRecipient"popupControlID="modalPanel"BackgroundCssClass="modalBackground"DropShadow="true"OkControlID="btnRecipSave"OnOkScript="fSaveRecip()"CancelControlID="btnRecipClose">

</cc1:ModalPopupExtender>

<divclass="modalPanel"id="modalPanel"style="display: none">

<asp:PanelID="pnlAddRecipient"runat="server"BorderWidth="1"Width="368px">

<tableborder="0"width="100%">

<tr>

<tdcolspan="2"align="center">

<b>Location Management - Notification Recipient</b>

</td>

</tr>

<tr>

<td>

</td>

<td>

</td>

</tr>

<tr>

<td>

<b>Location:</b>

</td>

<td>

<asp:LabelID="lblRecipLocationName"runat="server"Text="Label"Width="208px"></asp:Label>

</td>

</tr>

<tr>

<td>

<b>Name:</b>

</td>

<tdstyle="height: 26px">

<asp:TextBoxID="txtRecipFirstName"runat="server"Width="72px"></asp:TextBox>

<asp:TextBoxID="txtRecipLastName"runat="server"Width="128px"></asp:TextBox>

</td>

</tr>

<tr>

<td>

<b>Title:</b>

</td>

<td>

<asp:TextBoxID="txtRecipTitle"runat="server"Width="210px"></asp:TextBox>

</td>

</tr>

<tr>

<td>

<b>E-mail:</b>

</td>

<td>

<asp:TextBoxID="txtRecipEMail"runat="server"Width="210px"></asp:TextBox>

</td>

</tr>

<tr>

<td>

<b>Frequency:</b>

</td>

<td>

<asp:DropDownListID="drpFrequency"runat="server">

<asp:ListItemValue="1">Weekly</asp:ListItem>

<asp:ListItemValue="2">Bi-Weekly</asp:ListItem>

<asp:ListItemValue="3">Monthly</asp:ListItem>

</asp:DropDownList></td>

</tr>

<tr>

<tdcolspan="2"align="center">

<asp:LinkButtonID="btnRecipSave"runat="server">Save</asp:LinkButton>

<asp:LinkButtonID="btnRecipClose"runat="server">Close</asp:LinkButton>

<asp:HiddenFieldID="hdnNotificationID"runat="server"></asp:HiddenField>

</td>

</tr>

</table>

</asp:Panel>

</div>

</div>


Here is my ascx.vb code

Imports System.Data.SqlClient

Imports System.Data.OleDb

PartialClass NotificationList

Inherits System.Web.UI.UserControl

Dim cnRetailCommerceAs SqlConnection =Nothing

ProtectedSub Page_Load(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.Load

Dim dsConsManageAsNew System.Data.DataSet

Dim cmdSelectAsNew SqlCommand

Dim parmCLocationAsNew SqlParameter("@.P_CLOCATION", Data.SqlDbType.VarChar, 50)

Dim daConsManageAsNew SqlDataAdapter

Dim tblRowAs TableRow

Dim tblCellAs TableCell

Dim m_aryFrequencies(3)AsString

m_aryFrequencies(1) ="Weekly"

m_aryFrequencies(2) ="Bi-Weekly"

m_aryFrequencies(3) ="Monthly"

LabelCausedRefresh.Text = Request.Form("__EventTarget")cnRetailCommerce =New SqlConnection(Session("CONNECTION"))

cnRetailCommerce.Open()

IfMe.IsPostBackThen

If Request.Form("__EventTarget").Contains("lnkDoPost")Then

SelectCase hdnAction.Value

Case"Delete"

DeleteConManageLocNotification()

Case"Save"

If hdnNotificationID.Value.ToString ="0"Then

CreateConManageLocNotification()

Else

UpdateConManageLocNotification()

EndIf

EndSelect

EndIf

EndIf

parmCLocation.Direction = Data.ParameterDirection.Input

parmCLocation.Value = Session("CMLocation")

cmdSelect.Connection = cnRetailCommerce

cmdSelect.CommandType = Data.CommandType.StoredProcedure

cmdSelect.CommandText ="USP_CONSMANAGEGETLOCNOTIFICATIONS"

cmdSelect.Parameters.Add(parmCLocation)

daConsManage.SelectCommand = cmdSelect

daConsManage.Fill(dsConsManage,"Notifications")

Dim dvConsManageAsNew System.Data.DataView(dsConsManage.Tables("Notifications"))

Dim drRowAs System.Data.DataRow

dvConsManage.RowFilter ="EMail='" & Session("EMAIL").ToString &"'"

If dvConsManage.Count = 0Then

tblRow =New TableRow

tblNotifications.Rows.Add(tblRow)

tblCell =New TableCell

tblCell.Text =" "

tblRow.Cells.Add(tblCell)

tblCell =New TableCell

tblCell.Text ="<a href='javascript:fLoadRecipDialog(" & Chr(34) &"0" & Chr(34) &");'>Add Me</a>"

tblRow.Cells.Add(tblCell)

tblCell =New TableCell

tblCell.Text ="<input type='hidden' name='CMNFirstName0' id='CMNFirstName0' value='" & Session("FIRSTNAME") &"'><input type='hidden' name='CMNLastName0' id='CMNLastName0' value='" & Session("LASTNAME") &"'><input type='hidden' name='CMNTitle0' id='CMNTitle0' value='" & Session("TITLE") &"'><input type='hidden' name='CMNEMail0' id='CMNEMail0' value='" & Session("EMAIL") &"'><input type='hidden' name='CMNFrequency0' id='CMNFrequency0' value='1'>"

tblRow.Cells.Add(tblCell)

EndIf

dvConsManage.Dispose()

If dsConsManage.Tables("Notifications").Rows.Count = 0Then

CreateDefaultConManageLocNotification()

EndIf

ForEach drRowIn dsConsManage.Tables("Notifications").Rows

If drRow("UserManageable") =TrueThen

tblRow =New TableRow

tblNotifications.Rows.Add(tblRow)

tblCell =New TableCell

tblCell.Text ="<a href='javascript:fDeleteRecip(" & Chr(34) & drRow("NotificationID") & Chr(34) &");'><IMG Src='images\red_x_trans.gif' border='0' height='10px' width='10px'></a>"

tblRow.Cells.Add(tblCell)

tblCell =New TableCell

tblCell.Text ="<a href='javascript:fLoadRecipDialog(" & Chr(34) & drRow("NotificationID") & Chr(34) &");'>" & drRow("FirstName") &" " & drRow("LastName") &"</a>"

tblRow.Cells.Add(tblCell)

tblCell =New TableCell

tblCell.Text = m_aryFrequencies(drRow("Frequency")) &"<input type='hidden' name='CMNFirstName" & drRow("NotificationID") &"' id='CMNFirstName" & drRow("NotificationID") &"' value='" & drRow("FirstName") &"'><input type='hidden' name='CMNLastName" & drRow("NotificationID") &"' id='CMNLastName" & drRow("NotificationID") &"' value='" & drRow("LastName") &"'><input type='hidden' name='CMNTitle" & drRow("NotificationID") &"' id='CMNTitle" & drRow("NotificationID") &"' value='" & drRow("Title") &"'><input type='hidden' name='CMNEMail" & drRow("NotificationID") &"' id='CMNEMail" & drRow("NotificationID") &"' value='" & drRow("EMail") &"'><input type='hidden' name='CMNFrequency" & drRow("NotificationID") &"' id='CMNFrequency" & drRow("NotificationID") &"' value='" & drRow("Frequency") &"'>"

tblRow.Cells.Add(tblCell)

EndIf

Next

tblRow =New TableRow

tblNotifications.Rows.Add(tblRow)

tblCell =New TableCell

tblCell.Text = hdnAction.Value

tblRow.Cells.Add(tblCell)

tblCell =New TableCell

tblCell.Text = Now.ToString

tblRow.Cells.Add(tblCell)

tblCell =New TableCell

tblCell.Text = hdnID.Value

tblRow.Cells.Add(tblCell)

dsConsManage.Dispose()

daConsManage.Dispose()

cnRetailCommerce.Close()

cnRetailCommerce.Dispose()

hdnID.Value =""

hdnAction.Value =""

EndSub

PrivateSub CreateDefaultConManageLocNotification()

Dim cmdUpdateAsNew SqlCommand

Dim parmCLocationAsNew SqlParameter("@.P_CLOCATION", Data.SqlDbType.VarChar, 50)

Dim parmFirstNameAsNew SqlParameter("@.P_FIRSTNAME", Data.SqlDbType.VarChar, 20)

Dim parmLastNameAsNew SqlParameter("@.P_LASTNAME", Data.SqlDbType.VarChar, 50)

Dim parmTitleAsNew SqlParameter("@.P_TITLE", Data.SqlDbType.VarChar, 50)

Dim parmEMailAsNew SqlParameter("@.P_EMAIL", Data.SqlDbType.VarChar, 255)

Dim parmFrequencyAsNew SqlParameter("@.P_FREQUENCY", Data.SqlDbType.Int)

Dim parmUserManageableAsNew SqlParameter("@.P_USERMANAGEABLE", Data.SqlDbType.Int)

parmCLocation.Direction = Data.ParameterDirection.Input

parmCLocation.Value = Session("CMLocation")

parmFirstName.Direction = Data.ParameterDirection.Input

parmFirstName.Value ="John"

parmLastName.Direction = Data.ParameterDirection.Input

parmLastName.Value ="Romeo"

parmTitle.Direction = Data.ParameterDirection.Input

parmTitle.Value ="AWT Consignment Inventory Manager"

parmEMail.Direction = Data.ParameterDirection.Input

parmEMail.Value ="JRomeo@.harsco.com"

parmFrequency.Direction = Data.ParameterDirection.Input

parmFrequency.Value = 1

parmUserManageable.Direction = Data.ParameterDirection.Input

parmUserManageable.Value = 0

cmdUpdate.Connection = cnRetailCommerce

cmdUpdate.CommandType = Data.CommandType.StoredProcedure

cmdUpdate.CommandText ="USP_CONSMANAGECREATELOCNOTIFICATIONS"

cmdUpdate.Parameters.Add(parmCLocation)

cmdUpdate.Parameters.Add(parmFirstName)

cmdUpdate.Parameters.Add(parmLastName)

cmdUpdate.Parameters.Add(parmTitle)

cmdUpdate.Parameters.Add(parmEMail)

cmdUpdate.Parameters.Add(parmFrequency)

cmdUpdate.Parameters.Add(parmUserManageable)

cmdUpdate.ExecuteNonQuery()

cmdUpdate.Dispose()

EndSub

PrivateSub CreateConManageLocNotification()

Dim cmdUpdateAsNew SqlCommand

Dim parmCLocationAsNew SqlParameter("@.P_CLOCATION", Data.SqlDbType.VarChar, 50)

Dim parmFirstNameAsNew SqlParameter("@.P_FIRSTNAME", Data.SqlDbType.VarChar, 20)

Dim parmLastNameAsNew SqlParameter("@.P_LASTNAME", Data.SqlDbType.VarChar, 50)

Dim parmTitleAsNew SqlParameter("@.P_TITLE", Data.SqlDbType.VarChar, 50)

Dim parmEMailAsNew SqlParameter("@.P_EMAIL", Data.SqlDbType.VarChar, 255)

Dim parmFrequencyAsNew SqlParameter("@.P_FREQUENCY", Data.SqlDbType.Int)

Dim parmUserManageableAsNew SqlParameter("@.P_USERMANAGEABLE", Data.SqlDbType.Int)

parmCLocation.Direction = Data.ParameterDirection.Input

parmCLocation.Value = Session("CMLocation")

parmFirstName.Direction = Data.ParameterDirection.Input

parmFirstName.Value = txtRecipFirstName.Text

parmLastName.Direction = Data.ParameterDirection.Input

parmLastName.Value = txtRecipLastName.Text

parmTitle.Direction = Data.ParameterDirection.Input

parmTitle.Value = txtRecipTitle.Text

parmEMail.Direction = Data.ParameterDirection.Input

parmEMail.Value = txtRecipEMail.Text

parmFrequency.Direction = Data.ParameterDirection.Input

parmFrequency.Value = drpFrequency.SelectedValue

parmUserManageable.Direction = Data.ParameterDirection.Input

parmUserManageable.Value = 1

cmdUpdate.Connection = cnRetailCommerce

cmdUpdate.CommandType = Data.CommandType.StoredProcedure

cmdUpdate.CommandText ="USP_CONSMANAGECREATELOCNOTIFICATIONS"

cmdUpdate.Parameters.Add(parmCLocation)

cmdUpdate.Parameters.Add(parmFirstName)

cmdUpdate.Parameters.Add(parmLastName)

cmdUpdate.Parameters.Add(parmTitle)

cmdUpdate.Parameters.Add(parmEMail)

cmdUpdate.Parameters.Add(parmFrequency)

cmdUpdate.Parameters.Add(parmUserManageable)

cmdUpdate.ExecuteNonQuery()

cmdUpdate.Dispose()

EndSub

PrivateSub DeleteConManageLocNotification()

Dim cmdUpdateAsNew SqlCommand

Dim parmNotificationIDAsNew SqlParameter("@.P_NOTIFICATIONID", Data.SqlDbType.Int)

parmNotificationID.Direction = Data.ParameterDirection.Input

parmNotificationID.Value = hdnID.Value

cmdUpdate.Connection = cnRetailCommerce

cmdUpdate.CommandType = Data.CommandType.StoredProcedure

cmdUpdate.CommandText ="USP_CONSMANAGEDELETELOCNOTIFICATIONS"

cmdUpdate.Parameters.Add(parmNotificationID)

cmdUpdate.ExecuteNonQuery()

cmdUpdate.Dispose()

EndSub

PrivateSub UpdateConManageLocNotification()

Dim cmdUpdateAsNew SqlCommand

Dim parmNotificationIDAsNew SqlParameter("@.P_NOTIFICATIONID", Data.SqlDbType.Int)

Dim parmCLocationAsNew SqlParameter("@.P_CLOCATION", Data.SqlDbType.VarChar, 50)

Dim parmFirstNameAsNew SqlParameter("@.P_FIRSTNAME", Data.SqlDbType.VarChar, 20)

Dim parmLastNameAsNew SqlParameter("@.P_LASTNAME", Data.SqlDbType.VarChar, 50)

Dim parmTitleAsNew SqlParameter("@.P_TITLE", Data.SqlDbType.VarChar, 50)

Dim parmEMailAsNew SqlParameter("@.P_EMAIL", Data.SqlDbType.VarChar, 255)

Dim parmFrequencyAsNew SqlParameter("@.P_FREQUENCY", Data.SqlDbType.Int)

parmNotificationID.Direction = Data.ParameterDirection.Input

parmNotificationID.Value = hdnNotificationID.Value

parmCLocation.Direction = Data.ParameterDirection.Input

parmCLocation.Value = Session("CMLocation")

parmFirstName.Direction = Data.ParameterDirection.Input

parmFirstName.Value = txtRecipFirstName.Text

parmLastName.Direction = Data.ParameterDirection.Input

parmLastName.Value = txtRecipLastName.Text

parmTitle.Direction = Data.ParameterDirection.Input

parmTitle.Value = txtRecipTitle.Text

parmEMail.Direction = Data.ParameterDirection.Input

parmEMail.Value = txtRecipEMail.Text

parmFrequency.Direction = Data.ParameterDirection.Input

parmFrequency.Value = drpFrequency.SelectedValue

cmdUpdate.Connection = cnRetailCommerce

cmdUpdate.CommandType = Data.CommandType.StoredProcedure

cmdUpdate.CommandText ="USP_CONSMANAGEUPDATELOCNOTIFICATIONS"

cmdUpdate.Parameters.Add(parmNotificationID)

cmdUpdate.Parameters.Add(parmCLocation)

cmdUpdate.Parameters.Add(parmFirstName)

cmdUpdate.Parameters.Add(parmLastName)

cmdUpdate.Parameters.Add(parmTitle)

cmdUpdate.Parameters.Add(parmEMail)

cmdUpdate.Parameters.Add(parmFrequency)

cmdUpdate.ExecuteNonQuery()

cmdUpdate.Dispose()

EndSub

EndClass


Bump - I have a huge need to get this working. can someone please help?

Modal popup extender inside another modal popup extender

Hi all,

I would like to know if this is possible.

Lets say a have a page with modalpopup extender and with update panel.

Onto that modal popup extender I dynamically and with async postback load a UserControlA. That UserControlA also contains modal popup extender and updatepanel, which loads UserControlBdynamically (sort of modal popup inheritance:) )


Is this at least possible in theory? To show another modalpopup in the first modalpopup? Because right now, trigerring modalpopup in UserControlA, modalpopup in page closes

UI would be something like this:

Modalpopup image

The problem is that i was designing everything with user controls, and then reusing them. And now there is such a problem:)

Hi,

I think it's quite possible theoretically. Please try to implement it as you planed first, and feel free to ask if you meet any problem.

Modal popup extender shows before page is done rendering ?

Hi

My page consists of a single linkbutton triggering the modal popup extender and a panel containing the popups controls. This is all working except one tiny thing, on each submit postback it quickly shows->hides the popup. How can I get rid of this problem?

"mpeProjects" runat="server"
TargetControlID="lbnProjects"
PopupControlID="pnlProjects"
DropShadow="false"
OkControlID="btnProjectsOK"
CancelControlID="btnProjectsCancel"
BackgroundCssClass="DialogPopupBackGround"
OnOkScript="onOK()"
>

 

Hi,

Please make sure you have the style attribute of the pnlProjects panel set to "display:none".

If you already have some value in the style attribute, just add the above at the end of the attribute value.

Kind regards,

sbogus.