Showing posts with label contents. Show all posts
Showing posts with label contents. Show all posts

Wednesday, March 28, 2012

Dynamic content for modal popup

Hi -

I want to change the contents of a modal popup dynamically through client side script. For that purpose, I've included a div element and change it's innerhtml property. When I test whether the change got done I can read the new value through javascript but the modal popup extender shows the old html (which loaded when the page was loaded). I think I may have to call a method to let the modal popup extender know I updated the content, but I don't know how to do that.

Any help is greatly appreciated!!

Oliver

I thought I'd add some code so you know what I am talking about.

Thanks,

Oliver

 function showpopup() { event.bubble = false; var d = document.getElementById("popupcontent"); d.innerhtml='<img src="images/spinner.gif" alt="Please wait ..." />'; var popup =$find('BMPNoShow'); popup.show(); alert(d.innerhtml); }<ajaxToolkit:ModalPopupExtender ID="MPNoShow" BehaviorID="BMPNoShow" runat="server" CancelControlID="BNoShowCancel" DropShadow="true" PopupControlID="PNoShow" PopupDragHandleControlID="PNoShow" TargetControlID="PNoShow"> </ajaxToolkit:ModalPopupExtender> <asp:Panel ID="PNoShow" runat="server" Style="background: white; border-color: Gray; border-style: solid; width: auto; padding: 10px" EnableViewState="false"> <div id="popupcontent"> </div> <br /> <asp:Button ID="BNoShowCancel" runat="server" Text="Cancel" UseSubmitBehavior="false" /> <asp:Button ID="BNoShowConfirm" runat="server" Text="Mark as no-show" UseSubmitBehavior="false" /> <asp:HiddenField ID="HFNoShowRequest" runat="server" /> </asp:Panel>

Take a look at the Dynamic* properties of the modalpopup, which allow you to load the content of a modalpopup dynamically using a web service. This will automatically load the content into the modalpopup when it is shown without you having to do anything.


Thanks - that's even better than what I was trying to do :)

dynamic cascaded drop down

Hi..

well in my web page based on a parameter user selects i need to create contents dynamically

for eg if A is passed than page will have only 1 drop down but if B is passed it might have 7 8 drop downs in it..

this is one part of the problem..once i am able to create them i need to address there selection index change even which will call again some fucntion

which will reload all othr drop dwon whch were created dynamically

so its kind of generating cascaded drop down dynamically and the parent control id could be more than one

Can some one help me out

in case any one is here wondering what happened to the problem

the solution is same as

http://forums.asp.net/t/1090354.aspx

Wednesday, March 21, 2012

DropDownExtender: Refresh content

I have a drop-down extender, where the control ID references a Panel, which contains a TreeView. When I update the contents of the TreeView, and hit the drop-down button, the treeview shown is not refreshed. Is there any way that I can force a refresh?

Thanks - Bennie

How are you updating the treeview?

Ron


I am adding/removing tree nodes in a public method of the treeview.


Is the TreeView in an UpdatePanel? I'm trying to determine how all of the controls in question are composed. Could you post a snippit of the aspx?


this is the DropDownExtender:

<

ajaxToolkit:DropDownExtenderrunat="server"ID="DDE"TargetControlID="bookmarksTextLabel"DropDownControlID="DropPanel"/>

This is the DropPanel:

<asp:PanelEnableViewState="false"ID="DropPanel"ForeColor="#747678"runat="server"Style="text-align:left;padding-bottom:0px;padding-top:0px;margin-bottom:0px;margin-top:0px;display:none;visibility:hidden;">

<divstyle="border-color:Blue; border-width: 1px; border-style:solid; padding: 1px,1px,1px,1px;">

<bmt:BookmarksTreeid="tvBookmarks"runat="server"/></div></asp:Panel>

I tried enabling/disabling ViewState, but to no avail.


Does it work without using the drop-down extender? Please verify that the tree is populating correctly without the extender on the page. Is all of this content within an UpdatePanel?

It does work without the DropDownExtenter. No, there is no outer UpdatePanel.