I have an Update panel and I want to Update it on th server code when an Event occure.
How can I do this?
when I use Update1.update();
my update panel dont Update;
please help me!!!!!
Make sure you have a script manager on the page
<atlas:ScriptManager runat="server" EnablePartialRendering="true" ID="updateManager">
You need to wire up a button to the update panel with the Triggers tag. Ex:
<atlas:UpdatePanel ID="atlasPanel" runat="server" RenderMode="Inline" Mode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="drpCountry" runat="server"
DataTextField="DESCRIPTION" DataValueField="PK" AutoPostBack="True">
</asp:DropDownList>
<asp:DropDownList ID="drpProvince" runat="server"
DataTextField="DESCRIPTION" DataValueField="PK" AutoPostBack="True">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="btnReload" EventName="Click" />
</Triggers>
</atlas:UpdatePanel>
Check UpdateMode property, set it to "Conditional". Register your control in Page_Load method
ScriptManager1.RegisterAsyncPostBackControl(ControlName);
Let me know if this helps you
thanks for your help
but i want updating occur when a Event is occur
for example i want when sqlnotification event is occur my gridview will update Automatically
in my code i use SqlDependency and SqlDependency Rise an Event (onchangedataSource)
i want update my GridView in this time
excuse me i can't write english good
Hi,
Please note that UpdatePanel is used for events that originates from a page. If the events isn't from a specific page, then the updatePanel isn't able to update the contents on a page.
You may add a timer on the page and use it to fire events continuously on current page. And in the tick event handler of the timer, update the Gridview if necessary.
Hope this helps.
Thanks for your help.
and one more questuin:
i want emplement a web chat like Gmail web Chat what is the best Course of implemention for this kind of web chating?
I think it can be done in this way:
1. add a hiddenField on the page to keep the latest time of messages on current page
2. use window.setInterval to call a web service periodically and pass the latest time as the parameter
3. the web service returns all messages that is created later then the parameter
4. use javascript to display those results on the page
Thanks for Yor help
No comments:
Post a Comment