Showing posts with label loaded. Show all posts
Showing posts with label loaded. Show all posts

Monday, March 26, 2012

Trigger ModalPopupExtender from LoadPage Event instead of Control

Is it possible to have the modal dialog appear when a page is first loaded? It appears that it only works from a control (TargetControlID) like a button.

Create a LinkButton that has style="display: none;" and make this the target control of the ModalPopup. Then call the server side Show() or the client side show() method to display the modal popup manually whenever you need to.

Saturday, March 24, 2012

Trigger UpdatePanel after Page is loaded

HI, i was wondering if UpdatePanel could be trigger after the page is loaded.
Im trying to load a grid view inside an update panel without using any button event.

Thanks!

you could use a timer:

<asp:Timer ID="refreshTimer" runat="server" Interval="1000">
</asp:Timer>

<asp:UpdatePanel>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="refreshTimer" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>

The update panel will be refreshed every 1 second, so you could decide what to show in it without any button events.


Thanks Yani for the reply, but using the timer will always refresh may updatepanel and this will create/increase server process a lot.

Still havent found a solution to my problems thru self coding. Looks like im going to use xmlhttp to load a div tag and put it inside an update panel so that when a year list box is changed it will reload the div content via javascript again.

Is there an alternative way in doing this?


Use Year select box(DropDownList) as an AsyncPostbackTrigger And put the Gridview inside update panel.


If I'm understanding correctly, you want to load the page initially with an empty UpdatePanel and then immediately do an async postback to load the contents of the UpdatePanel, right? (I assume this is because it takes a long time to load the data for that UpdatePanel.)

Check out my latest blog post:http://smarx.com/posts/delayed-load-with-an-updatepanel.aspx.