Showing posts with label ive. Show all posts
Showing posts with label ive. Show all posts

Monday, March 26, 2012

Treeview inside update panel

I've got a treeview on my page and I tried to make it works inside an update panel.

For some reasons after the selected event and inserted the value in my db, I'm not able to expend the treeview anymore

Any Idea

PS: Everything is working fine if I remove the UpdatePanel


Thanks for your help

Franck

The TreeView isn't currently supported in an UpdatePanel.

Saturday, March 24, 2012

Trigger updatepanel update from a nested gridview

Hello,

I've got a DataList (Categories) that has a nested GridView (Sub-Categories) in its ItemTemplate. The GridView has a ButtonField (command name = "Select") that, when clicked, I would like to have update an UpdatePanel elsewhere on the page (which will show items within the selected Sub Category). The Sub Categories GridView is created in the ItemDataBound event of the Categories DataList. The problem I'm running into is that when the GridView's SelectedIndexChanged event is fired, the entire page is refreshed instead of just the UpdatePanel.

The UpdatePanel is set up with an UpdateMode of "Conditional" and no triggers are set up declaratively. In the DataList's ItemDataBound event, I'm creating and populating the GridView controls and am setting the UpdatePanel's triggers:

GridView grdItems = (GridView)e.Item.FindControl("grdItems");if (grdItems !=null){ grdItems.DataSource = ; grdItems.DataBind(); AsyncPostBackTrigger trig =new AsyncPostBackTrigger(); trig.ControlID = grdItems.UniqueID.ToString(); trig.EventName ="SelectedIndexChanged"; pnlRight.Triggers.Add(trig);}

Then, in the GridView's SelectedIndexChange event, I query the database and set all of the control values in the UpdatePanel and call the UpdatePanel's Update() method. Is there a piece somewhere that I'm missing that will keep the entire page from posting back? Thanks in advance for your help!

One more thing I noticed: it looks like the first time I click an item in the GridView, the UpdatePanel updates correctly. It's only on subsequent GridView events that the entire page is posted back.

Hi,

Please note that:

Programmatically addingAsyncPostBackTrigger controls is not supported. Use theRegisterAsyncPostBackControl(Control) method of theScriptManager control to programmatically register a postback control, and then call theUpdate() method of theUpdatePanel when the control posts back.

http://asp.net/ajax/documentation/live/mref/T_System_Web_UI_AsyncPostBackTrigger.aspx


Thanks Raymond! By making the changes you mentioned and by calling theRegisterAsyncPostBackControl method in the GridView's init method (instead of the parent control's ItemDataBound method), everything is working like it should!

-Brian

Trigger-Problem with GridView RowCommand

Hello,

I've got a Problem after Migrating to the new AJAX.DLL. The Trigger doesn't work for the Gridview anymore.

I set

<asp:UpdatePanelID="udpanel"runat="server"UpdateMode="Conditional"ChildrenAsTriggers="true"RenderMode="Inline">

<ContentTemplate>

<asp:Gridview ... />

</ContentTemplate>

<Triggers>

<asp:AsyncPostBackTriggerControlID="gview"EventName="RowCommand"/>

</Triggers>

</asp:UpdatePanel>

The RowCommand-Event in the Codebehind doesn't be fired.

Thanks a lot!

Paul

You really do not need to set a AysnchPostBackTrigger on the Event - unless the ChildrenAsTriggers is false (default is true) then everything is already thrown into the update controls collection.

Problems arise when you duplicate triggers as it will remove both of them if they have the same ref I believe...

Wednesday, March 21, 2012

Trouble installing Ajax Control Toolkit

Hi all, I've not managed to install the toolkit properly. Is there a specific folder that I should extract the files to? Thanks.

Andy

I am not sure what exactly the problem is but any how ...You might havn't installed the prerequisites as well.

You need to install Extensions package as well. from the same donwload page.......

Then there is dll file in the bin folder where you installed the setup you can use it in your pages then easily...

Regards

Muhammad Tabish Sarwar


Hi,

I'd like to add something to Muhammad's post.

To use it, just place the AjaxControlToolkit.dll assembly in the bin folder of you web site.

Trouble with CalendarExtender into Multiview into UpdatePanel

Hi, I've a problem with an CalendarExtender control.
I've the CalendarExtender control in Multiview's view; in turn, the Multiview control is into updatepanel control.
The code would be roughly as follows:

<asp:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true"EnableScriptGlobalization="true"EnableScriptLocalization="true">

</asp:ScriptManager>

<asp:UpdatePanelrunat="server"ID="upprueba"UpdateMode="Conditional">

<ContentTemplate>

<asp:MultiViewrunat="server"ID="mv1">

<asp:Viewrunat="server"ID="vista0">

nada

</asp:View>

<asp:Viewrunat="server"ID="View1">

<uc1:ctlAnteced_1ID="CtlAnteced_1_1"runat="server"IdPaciente="130"/>

</asp:View>

</asp:MultiView>

<asp:Buttonrunat="server"ID="boton1"Text="Vista1"/>

<asp:Buttonrunat="server"ID="boton2"Text="Vista2"/>

</ContentTemplate>

</asp:UpdatePanel>

Note: CtlAnteced_1_1 contains a CalendarExtender control.


The problem occurs in IE 6.0 (for Windows XP SP2) only; in IE 7.0 and IE 6.0 for Windows Server 2003 it works correctly. If not select a default view, then the CalendarExtender control shows backgroundless. In contrast, if I select a default view, the CalendarExtender control shows correctly.
I think this problem is because the updatepanel is preventing the script of CalendarExtender be updated on the page; but, why this doesn't happen in IE 7.0? There is something I can do to make this work in IE 6.0?

Thanks!!

What version of the AjaxControlToolkit are you using?


Hi jaimedp!! thank you for reply. I'm using september 20 AJAX Control Toolkit version's.


I was watching versions of ajax control toolkit and I discovered that the published verision that was prior to 09/20/2007. I updated the reference and it works fine now.

Thank you for your help!!Wink


I hope this thread is still fresh enough.

I am having the same problem with the calendarextender control. The symptoms:

1. It works fine in a simple web form, e.g., a web form containing only a text box and the calendar extender.

2. It works in the very first View of a MultiView control, which is set as the default view at Page_Load. It does not work in any other View.

3. If I create a simple User Control with only a textbox and the calendar extender, then embed this user control in an aspx page, it does not work. Seems that the OP dj_javi707 had it work from a User Control, would you mind giving us a little hint? Thanks.

When it does not work, the javascript error message is always:

Error: 'AjaxControlToolkit' is undefined.
Code: 0

I think it maybe because the scriptmanager of ajax control toolkit is not loaded if the control is placed in a non-default view or when the user control is loaded.

Any idea to share?


Is you scriptmanager inside the multiview? in this case I think it will not work for anyother view that does not have the scriptmanager since it's not sent to the browser.