Showing posts with label provide. Show all posts
Showing posts with label provide. Show all posts

Wednesday, March 28, 2012

Treeview in Ajax.Net

Hi,

I want to use Treeview control using Ajax.Net, that should refreshed without postback.
Please provide me guidance or sample code.

Thanks in Advance.

The Treeview control is not supported in the current release of ASP.NET Ajax. I have heard of people getting it working though by manually doing changes in the prerender event, although when we tried that there were always some errors. I would suggest the telerik Tree control, although it isn't free..

Saturday, March 24, 2012

Triggers

Can you provide a short example, or point me in the direction, of how to use the "ControlEventTrigger" - I think I have the "Control ValueTrigger" figured out - responds to a value of a control changing (right?), but I'm not sure how the EventTrigger is used - I assume it responds to an event...

Thanks,


Ed

Here is an example. The supervisor dropdown gets updated once a manager is chosen.

<asp:DropDownListID="ddlManager"runat="server"DataSourceID="odsManager"DataTextField="Manager"DataValueField="ManagerID"AutoPostBack="True"></asp:DropDownList>

<atlas:UpdatePanelID="p2"runat="server"Mode="Conditional">

<ContentTemplate>

<asp:DropDownListID="ddlSupervisor"runat="server"DataSourceID="odsSupervisor"

DataTextField="Supervisor"DataValueField="Supervisor">
</asp:DropDownList>

</ContentTemplate>

<Triggers>

<atlas:ControlEventTriggerControlID="ddlManager"EventName="SelectedIndexChanged"/> </Triggers>

</atlas:UpdatePanel>


A sample of using ControlEventTrigger is included in the ASP.Net Atlas First Look webcast (Nikhil Kothari)

Download ASP.NET "Atlas" First Look demo video

Hope this helps...


Thank you Nta and dip!
Hi,

what is the magic behind a ControlEventTrigger? well, suppose that you are using the SelectedIndexChanged event of a DropDownList as a trigger, like in the example posted by Nta.

What the trigger does is attaching an event handler to the SelectedIndexChanged event. When you make a selection in the ddl, the ddl does a postback, the SelectedIndexChanged event fires and the handler attached by the trigger is executed.

When the trigger's handler is executed, the corresponding UpdatePanel is forced to perform an update.