Showing posts with label children. Show all posts
Showing posts with label children. Show all posts

Wednesday, March 28, 2012

Treeview & UpdatePanel - Assertion failed - cant find last / in base url

Hi,

I am using a TreeView and couple of server controls. The treeview children are dynamically added on click of a node. I have the treeview control inside an update panel. Everything works if I access the page in a normal IE window. When I try to access the same page through a modal dialog, during postback, it opens a new window. To avoid that, I've added<base target = "_self" />.

Now I'm getting another error with Atlas. On click of tree node, it says "Assertion Failed : Can't find last / in base url. If I remove the <base..> it doesn't work.

Looking for an immediate solution. I've spent almost a day in googling. But no luck yet.

Many Thanks,
Mani.

hello.

you can also try using an iframe inside your popup page (ie, put only an iframe inside your popoup window which loads the page that shows the content)...maybe it'll solve that problem.


Mani,

Add:<basetarget="_self"href="http://localhost/***/***/"runat="server"/>

because our dear js function check if u have base tag , then try to concat with href value. in your case you don't have it.

T.


what if i'm using a Master Page - i can't hard code a path in the href. Is there any way to accomplish this? Plus - even if i hard code, the paging on my grid view does not work now.

trans642:

Mani,

Add:<basetarget="_self"href="http://localhost/***/***/"runat="server"/>

because our dear js function check if u have base tag , then try to concat with href value. in your case you don't have it.

T.

GOOD THANKS !


trans642:

Mani,

Add:<basetarget="_self"href="http://localhost/***/***/"runat="server"/>

because our dear js function check if u have base tag , then try to concat with href value. in your case you don't have it.

T.

GOOD THANKS !


Try this, without hard code urlSmile
 <base target="_self" href="<%=Request.Url.OriginalString%>" />

works perfect ... Thanks.

Monday, March 26, 2012

TreeView with checkboxes

Hi

As you know the nativ TreeView control does not populate the check state (when the attributeShowCheckBoxes="All") to his children nodes for perfomance reason.

Is it a way with Ajax and a timer to do the thing ?

I wrote this but i got flickering on the lines redraw of the TreeView

Any help ?

<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:Timer ID="Timer1" OnTick="Timer1_Tick" runat="server" Interval="500" />
<asp:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" />
</Triggers>
<ContentTemplate>
<asp:TreeView ID="TreeView1" runat="server" ShowCheckBoxes="All" ShowLines="true" OnTreeNodeCheckChanged="OnSelectPlayer">
</asp:TreeView>
<br />
<asp:Button ID="Button1" runat="server" OnClick="OnSelect" Text="Valider la sélection" Width="127px" />
</ContentTemplate>
</asp:UpdatePanel>

Thank you a lot

Hi,

Please specify <compilation debug="false"> in web.config.

In asp.net, when in debug mode, images and javascript files severed from a web resource handler won't be cached on client.

Hope this helps.

TreeView, UpdatePanel PopulateOnDemand problem

When I use a PopulateOnDemand TreeView inside an UpdatePanel - when I click on the root node to populate its immediate children, it expands with the child nodes displayed. If I then click on any of the child nodes, the root node collapses. This does not happen if not in an UpdatePanel.

Also, if I click on the root node again and then click on an immediate child to populate its children, it has the same behavior. After the root node automatically collapses, if I click on the root node again, all child nodes that were expanded will still be expanded.

Does anyone know how I can get the root node to not automatically collapse when I click on any of its descendent nodes?

The TreeView isn't supported inside an UpdatePanel, see the last bullet point on this blog and follow the UpdatePanel doc link:http://blogs.visoftinc.com/archive/2007/09/23/asp.net-ajax--updatepanel-not-working--common-problems.aspx

PopulateOnDemand PopulateNodesFromClient actually uses client script as it is.

-Damien


Thanks for the response. When you say that it uses client script, what does that mean? PopulateOnDemand seems to cause full page refreshes - even when I use EnableClientScript and PopulateNodesFromClient...


That's what PopulateNodesFromClient does:http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.treeview.populatenodesfromclient.aspx.

The example states:"The following code example demonstrates how to use thePopulateNodesFromClient property to enable client-side population of the nodes in theTreeView control. Notice that when client-side node population is enabled, nodes are populated dynamically on the client, without the need to post back to the server."

-Damien


Thanks. My point was that it still caused a full page refresh. If it was happening on the client (using Ajax), then I wouldn't see a full page refresh. It turns out that I had to take out my TreeNodeExpanded and TreeNodeCollapsed event handlers to get rid of the full page refresh. After doing that, though, child nodes (that definitely have a parent node) have their Parent property set to null.

I am making headway though...thanks for your help.


You may want to check out this:http://steveorr.net/articles/Ajax.aspx

-Damien


Thanks. Good article. But it still does not explain why the Parent property is null on a child node. Again, this only happens with EnableClientScript, PopulateNodesFromClient and without TreeNodeExpanded and TreeNodeCollapsed event handlers. I need the Parent node for context so I can populate nodes more than 2 deep.