Showing posts with label explain. Show all posts
Showing posts with label explain. Show all posts

Wednesday, March 28, 2012

treeview in Multiview clientscript problem in new beta

Hi,

I have a problem with one of my web page... for debugging purpose I created a simple test webpage to explain the problem.
Here it is:
An updatepanel containing a multiview.
In this multiview there's 2 view, each containing a tree view and a button to go to the other view.
The default activeview is the first one.

My problem is that only the treeview in the first view works.
The treeview in the 2nd view crashes with error "Microsoft JScript: 'TreeView2_Data' is undefined." when I click a node.
Of course if I set the enableclientscript property of the treeview to off then it works okay but it does a partial postback at each node collapse-expand...

My guess is that the clientscript is not injected correctly on view change but how can I fix that ?
Btw it used to work before I updated to Beta 1.0

Thanks a lot !

Jean-Sébastien Roy

I was able to repro it and report it to the developer..

thanks for the report....

Andres


Hi,

The TreeView control is not supported inside UpdatePanels in Atlas 1.0. A future release of Atlas will support this scenario. In Atlas 1.0 you can have the TreeView outside the UpdatePanel.

Thanks,

Eilon


Thanks to you both for the fast answers !

Placing a TreeView inside an UpdatePanel is not supported on the Beta. Please look a the following documentation page (under the "UpdatePanel Compatible Controls"):http://ajax.asp.net/docs/Overview/intro/partialpagerendering/updatepanelOverview.aspx. Full support for all controls will be available on the next release of ASP.NET.

Thanks,
Federico


I had a same problem. Seems like its not supported in Beta version. Does anyone know of a workaround?

Thanks


Hi,

UpdatePanel control is used for only partial updating/partial_page rendering. You can not use the updatePanel control for Treeview and someother controls like MenuView and FileUpload.

If you need more help on this check in below link under UpdatePanel Control.

http://ajax.asp.net/default.aspx

Pradeep Kumar

Monday, March 26, 2012

treeview, accordion and updatepanels ;)

hello, here is my problem, i'll try to explain my page structure

on my site, i use treeviews (filled by code from hierarchical database) in several accordion panes to navigate on my page

so, i've :

<cc1:Accordion ...>

<Panes>

<cc1:AccordionPane>

<asp:TreeView>...</asp:TreeView>

</cc1:AccordionPane>

.. 2nd pane with a treeview, and so on...

</Panes>

</cc1:Accordion>

my accordion acts like a "menu" to choose which type of data you want to browse

when my user clicks on a node of one of my treeviews (the one which is in the active accordion pane obviously), it sets the value of an HiddenField to the selected node value

in the main part of the page, i've a formview which displays data (with the select parameter bound to the hiddenfield value)

and it's worksWink

but sometimes, some data changes made in the formview need to be done in the treeviews too (node label for instance)

but I don't how to do that

currently, my treeviews are in an accordion which is NOT is an updatepanel

but if i put the accordion (containing the treeviews) is an updapanel, it don't work, clearly there is a problem with the HiddenField (which links treeviews and formview)

I've tried to put the hiddenfield at different level (inside/outside the updatepannel), no result

please help me to choose a nice way to "ajax"-reload treeviews inside accordion on item updated event of the formview

thanks


Hi Zarzar,

My understanding of your issue is that you want to implement this function. When click on the TreeView node , the main part where a FormView is located will be refreshed. Meanwhile , when the FormView changes , it selected TreeNode will changed correspond to the FormView in turn. Your Accordion + TreeView act like a navigate bar. If I have misunderstood , please feel free to let me know.

As far as I know, TreeView is incompatible with UpdatePanel.

Controls that Are Not Compatible with UpdatePanel Controls

The following ASP.NET controls are not compatible with partial-page updates, and are therefore not supported inside anUpdatePanel control:

TreeView andMenu controls.

Web Parts controls. For more information, seeASP.NET Web Parts Controls.

FileUpload controls when they are used to upload files as part of an asynchronous postback.

GridView andDetailsView controls when their EnableSortingAndPagingCallbacks property is set totrue. The default isfalse.

Login,PasswordRecovery,ChangePassword, andCreateUserWizard controls whose contents have not been converted to editable templates.

TheSubstitution control.

Validation controls, which includes theBaseCompareValidator,BaseValidator,CompareValidator,CustomValidator,RangeValidator,RegularExpressionValidator,RequiredFieldValidator, andValidationSummary control.


thanks for answering

Jonathan Shen – MSFT:

My understanding of your issue is that you want to implement this function. When click on the TreeView node , the main part where a FormView is located will be refreshed. Meanwhile , when the FormView changes , it selected TreeNode will changed correspond to the FormView in turn. Your Accordion + TreeView act like a navigate bar. If I have misunderstood , please feel free to let me know.

well, perfect understanding!

it seems clear that Treeview is not the best friend of UpdatePanelStick out tongue

if I understand, I've to remove my FormView from the UpdatePanel if I want a synchronous postback to be launched and my trees to be refreshed ?


Hi Zarzar,

zarzar:

if I understand, I've to remove my FormView from the UpdatePanel if I want a synchronous postback to be launched and my trees to be refreshed ?

Yes, as far as I know. It is the easiest way though not your willing.

Another way is use Javascript to find the Node and change its CSS style to make it as "selected", when the FormView is modified and a synchronous postback has been lauched. (Make sure that you have removed the TreeView out of the UpdatePanel).

See here is the generated HTML of a TreeNode.

<table cellpadding="0" cellspacing="0" style="border-width:0;">
<tr>
<td><div style="width:20px;height:1px"></div></td><td><div style="width:20px;height:1px"></div></td><td><div style="width:20px;height:1px"></div></td><td><img src="http://pics.10026.com/?src=/ControlToolkitTest/WebResource.axd?d=MYZni0kLx_fLYO5SLREkCaFRyyDbYHURF369ULcvgUM1&t=633223348596789238" alt="" /></td><td style="white-space:nowrap;"><a class="CourseFSTreeView_0" href="http://links.10026.com/?link=javascript:__doPostBack('CourseFSTreeView','sMy Computer\\Favorites\\Technology\\Microsoft')" onclick="TreeView_SelectNode(CourseFSTreeView_Data, this,'CourseFSTreeViewt6');" id="CourseFSTreeViewt6">Microsoft</a></td>
</tr>
</table>

You can use Javascript to get all <a> element by using document.getElementByTagName("a") , then find the selected item by traversing the array(for example , use a.innerText =="Microsoft"). Now, you can change its CSS style(Make sure not to click on it , or it will be refreshed by sending a postback).

This solution sounds great ,but it is so complex to give a whole sample. We should consider the cross-browser issues. For example in IE we can use a.innerText , but we should use a.textContent on Firefox.

So , in my opnion , you should take the former one. Good luck.Surprise

Hope this help.

Best regards,

Jonathan

Saturday, March 24, 2012

Trigger stops working after first postback

Hi,

First let me explain the basic situation. I have a page with 2 list boxes (there are more, but for the sake of argument, take 2). The Box A contains a list of items. The Box B contains the list of items chosen by the user. There is an imagebutton that when clicked, moves the selected ListItem from Box A to Box B, and there is another imagebutton that moves a selected item from Box B to Box A.

Pretty straightforward. The list boxes are in separate update panels because they each have other triggers associated with them that are not common to the other. Here is what happens, when the move button is clicked the first time, the transfer works. After that, it's as if there is no postback at all.

Here is how I have it setup:

<

atlas:UpdatePanelID="LeftColPanel"runat="server"Mode="Conditional">
<ContentTemplate>
<asp:ListBoxID="LeftCol"runat="server"Rows="10"Width="140"/>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTriggerControlID="MoveToLeftCol"EventName="Click"/>
</Triggers>

<

asp:ImageButtonID="MoveToLeftCol"runat="server"ImageUrl="pics/left.gif"OnClick="MoveToLeft"/>

and similarly for the second List Box.

What I don't understand is why it works the first time, and not after that? Any help would be appreciated.

Thanks,

i also have the same problem with a gridview
i don't know the solution yet but do you have some strange character in your listbox?
like single quote, or something else

or maybe you already found the solution :)

if yes please let me know

thanks

Wednesday, March 21, 2012

Trouble with code-behind accessing form controls

Hey everyone. I'm having a problem in VS2008 and the toolkit. It's kind of hard to explain but I will do my best.

I'm having trouble with accessing properties from an AJAX entended ASP.NET control in the code-behind file. It happens on both my own project and in every project that uses code-behind in the SampleWebSite.

I'm using the Toolkit 3.5, no custom build, using the binary from the 3.5 SampleWebSite bin directory.

I took several screenshots to help show what I mean.

This first screen just shows the panel (login panel) that i want to have popup in the Modal extender.

There is a ScriptManager and a ModalPopupExtender in the HTML code (see below)

<ajaxToolkit:ToolkitScriptManagerID="ScriptManager1"runat="server"/>

<ajaxToolkit:ModalPopupExtenderID="ScriptManager1_ModalPopupExtender"

runat="server"TargetControlID="btnSignIn"

PopupControlID="pnlLoginModal"CancelControlID="btnModalCancel"

DropShadow="True"OkControlID="btnModalOk"

BackgroundCssClass="modalBackground"PopupDragHandleControlID="pnlModalDrag">

</ajaxToolkit:ModalPopupExtender>

The second screenshot shows what happens when I try to get the "Text" property of the Textbox inside the modal panel (not in run time, in code)

Notice the tooltip. Is this a normal behavior for AJAX or am I doing something wrong? I don't understand because every time the code-behind files in the SampleWebSite try and use a property is shows as an invalid symbol also.

Thanks for any help.

--Matt

I don't know if there is any signifigance to this but, I tried and opened the SampleWebSite for the .NET 2.0 runtime and the code-behind works fine. Is there something in the 3.5 reference list that needs to be changed when working with 3.5 and the toolkit designed for 3.5 or what?

Here is another screenshot with the Control toolkit solution opened and the CascadingDropDown code-behind showing (unaltered by myself). Notice all the invalid symbols..

I'm using VS2008 with all .NET runtimes installed on XP sp2. I really need to figure out what's going on so any suggestions would be great. Thanks,

--Matt


Nevermind; I found out what was going on after researching for a few hoursAngry It turns out ReSharper from Jetbrains doesn't like AJAX in the current build hence it flags its properties as illegal. It builds fine but still annoying.

Thanks to all who read my post..

--Matt