Showing posts with label process. Show all posts
Showing posts with label process. 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.

Wednesday, March 21, 2012

ModalPopup - Dropdown List item change

I have a modal popup with a DDL on it. I want to capture what the new selected item and pass it to the server-side so I can process. How do I do this?

Thanks,

http://forums.asp.net/ShowPost.aspx?PostID=1379165

Thanks for the reply. Found the post you refer to, but it didn't fully answer my question. Exactly *how* does one code the client-side javascript to capture the DDL SelectedItem Change event?

The way the code is currently setup, it fires the server-side click event for the btnNoteSave button, and I can grab the content of the text boxes. You'll notice a hidden label field on the popup, i was hoping to use it to store the result of the selected item change from the dropdown.

The big question is, how do I do that?

Here is the code for the modal popup. THere is an ASCX control embedded in the note, Code for the ASCX is below.

 <asp:PanelID="pnlNewNote"runat="server"CssClass="modalPopup"Width="225px"><tablecellpadding="0"cellspacing="1"border="0"width="225px"class="tblSection">

<tr><tdcolspan="3"><uc1:NoteCtrlID="newNoteItem"runat="server"/></td></tr><trstyle="height:5px"><td></td></tr><tr><tdcolspan="3"style="text-align:center"><asp:ButtonID="btnNoteSave"runat="server"Text="Save"Width="50px"OnClick="btnNoteSave_Click"/><imgsrc="images/spacer.gif"style="width:15px"alt="space"/><asp:ButtonID="btnNoteCancel"runat="server"Text="Cancel"Width="50px"/></td></tr><trstyle="height:2px"><td></td></tr></table>

</

asp:Panel><cc1:ModalPopupExtenderID="newNotePopup"runat="server"TargetControlID="btnNewNote"DropShadow="true"PopupControlID="pnlNewNote"BackgroundCssClass="modalBackground"CancelControlID="btnNoteCancel"

/>

THE ASCX CONTROL:

<

tableborder="0"cellspacing="1"><tr><tdalign="right"><asp:LabelID="lblNoteDate"runat="server"Width="35px"CssClass="lblFormField">Date: </asp:Label></td><tdalign="left"><asp:TextBoxID="txtNoteDate"runat="server"Width="150px"CssClass="txtFormField"/></td></tr><tr><tdalign="right"><asp:LabelID="lblCallType"runat="server"CssClass="lblFormField">Call Type: </asp:Label></td><tdalign="left"><asp:DropDownListID="ddlCallTypes"runat="server"Width="155px"OnSelectedIndexChanged="ddlCallTypes_SelectedIndexChanged"/></td></tr><tr><tdalign="right"><asp:LabelID="lblUser"runat="server"CssClass="lblFormField">User: </asp:Label></td><td><asp:LabelID="lblUserData"runat="server"CssClass="txtFormField"/></td></tr><tr><tdcolspan="2"><asp:TextBoxID="txtNotes"runat="server"TextMode="MultiLine"Width="200px"Rows="5"CssClass="txtFormField"/></td></tr>

</

table>

<

divstyle="visibility:hidden"><asp:LabelID="lblCallTypeValue"runat="server"Text="Label"></asp:Label>

</

div>


The DropDownList.SelectedItemChanged event is a server-side event, not a client-side event.