473,658 Members | 2,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TreeView and Master Pages

I need to know how to maintain de status (nodes expanded and selected) of a
treeview in a master page.

I have a master page with a treeview. I have a default page, when the
treeview is expanded and a node is selected then redirects to a another page

Response.Redire ct("Page2.aspx" )

And run's ok, but the treeview in this page is colapsed. The treeview
maintain its aspect, the images for the nodes, etc, but is colapsed and
nothing node is selected

Many thanks for your help
Dec 13 '05 #1
5 3112
Juanjo,

Store the selected node number in viewstate and on page loads check that
viewstate parameter and if a selected node exists set the treeview to
display it as selected.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Juanjo" <Ju****@discuss ions.microsoft. com> wrote in message
news:E5******** *************** ***********@mic rosoft.com...
I need to know how to maintain de status (nodes expanded and selected) of a
treeview in a master page.

I have a master page with a treeview. I have a default page, when the
treeview is expanded and a node is selected then redirects to a another
page

Response.Redire ct("Page2.aspx" )

And run's ok, but the treeview in this page is colapsed. The treeview
maintain its aspect, the images for the nodes, etc, but is colapsed and
nothing node is selected

Many thanks for your help

Dec 13 '05 #2
OK Justin,

I do it.

In the master page code

Protected Sub TreeView1_Selec tedNodeChanged( ByVal sender As Object, ByVal e
As System.EventArg s) Handles TreeView1.Selec tedNodeChanged

ViewState("Sele ctedNode") = TreeView1.Selec tedNode.Value
Response.Redire ct("Page2.aspx" )

End Sub

And in the Page2_Load

If Me.ViewState("S electedNode").T oString = "Perfiles" Then

'Code for selected node

End If

But now the problem is that ViewState("Sele ctedNode") is nothing. Not exists

What I'm doing wrong?
"S. Justin Gengo" wrote:
Juanjo,

Store the selected node number in viewstate and on page loads check that
viewstate parameter and if a selected node exists set the treeview to
display it as selected.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Juanjo" <Ju****@discuss ions.microsoft. com> wrote in message
news:E5******** *************** ***********@mic rosoft.com...
I need to know how to maintain de status (nodes expanded and selected) of a
treeview in a master page.

I have a master page with a treeview. I have a default page, when the
treeview is expanded and a node is selected then redirects to a another
page

Response.Redire ct("Page2.aspx" )

And run's ok, but the treeview in this page is colapsed. The treeview
maintain its aspect, the images for the nodes, etc, but is colapsed and
nothing node is selected

Many thanks for your help


Dec 13 '05 #3
Juanjo,

A response.redire ct clears the viewstate. Either store the parameter in a
session variable (if that will be allright for your application) or use
Server.Transfer and store the value in a context variable instead. If you
need any clarification on how session variables or server.transfer and the
context object works let me know.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Juanjo" <Ju****@discuss ions.microsoft. com> wrote in message
news:DE******** *************** ***********@mic rosoft.com...
OK Justin,

I do it.

In the master page code

Protected Sub TreeView1_Selec tedNodeChanged( ByVal sender As Object, ByVal
e
As System.EventArg s) Handles TreeView1.Selec tedNodeChanged

ViewState("Sele ctedNode") =
TreeView1.Selec tedNode.Value
Response.Redire ct("Page2.aspx" )

End Sub

And in the Page2_Load

If Me.ViewState("S electedNode").T oString = "Perfiles" Then

'Code for selected node

End If

But now the problem is that ViewState("Sele ctedNode") is nothing. Not
exists

What I'm doing wrong?
"S. Justin Gengo" wrote:
Juanjo,

Store the selected node number in viewstate and on page loads check that
viewstate parameter and if a selected node exists set the treeview to
display it as selected.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Juanjo" <Ju****@discuss ions.microsoft. com> wrote in message
news:E5******** *************** ***********@mic rosoft.com...
>I need to know how to maintain de status (nodes expanded and selected)
>of a
> treeview in a master page.
>
> I have a master page with a treeview. I have a default page, when the
> treeview is expanded and a node is selected then redirects to a another
> page
>
> Response.Redire ct("Page2.aspx" )
>
> And run's ok, but the treeview in this page is colapsed. The treeview
> maintain its aspect, the images for the nodes, etc, but is colapsed and
> nothing node is selected
>
> Many thanks for your help


Dec 13 '05 #4
OK, thanx

Exists another way to load the page2.aspx without response.redire ct command?

I'm a newbie in asp.net

"S. Justin Gengo" wrote:
Juanjo,

A response.redire ct clears the viewstate. Either store the parameter in a
session variable (if that will be allright for your application) or use
Server.Transfer and store the value in a context variable instead. If you
need any clarification on how session variables or server.transfer and the
context object works let me know.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Juanjo" <Ju****@discuss ions.microsoft. com> wrote in message
news:DE******** *************** ***********@mic rosoft.com...
OK Justin,

I do it.

In the master page code

Protected Sub TreeView1_Selec tedNodeChanged( ByVal sender As Object, ByVal
e
As System.EventArg s) Handles TreeView1.Selec tedNodeChanged

ViewState("Sele ctedNode") =
TreeView1.Selec tedNode.Value
Response.Redire ct("Page2.aspx" )

End Sub

And in the Page2_Load

If Me.ViewState("S electedNode").T oString = "Perfiles" Then

'Code for selected node

End If

But now the problem is that ViewState("Sele ctedNode") is nothing. Not
exists

What I'm doing wrong?
"S. Justin Gengo" wrote:
Juanjo,

Store the selected node number in viewstate and on page loads check that
viewstate parameter and if a selected node exists set the treeview to
display it as selected.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Juanjo" <Ju****@discuss ions.microsoft. com> wrote in message
news:E5******** *************** ***********@mic rosoft.com...
>I need to know how to maintain de status (nodes expanded and selected)
>of a
> treeview in a master page.
>
> I have a master page with a treeview. I have a default page, when the
> treeview is expanded and a node is selected then redirects to a another
> page
>
> Response.Redire ct("Page2.aspx" )
>
> And run's ok, but the treeview in this page is colapsed. The treeview
> maintain its aspect, the images for the nodes, etc, but is colapsed and
> nothing node is selected
>
> Many thanks for your help


Dec 13 '05 #5
Juanjo,

Yes, the other way is to use Server.Transfer .

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Juanjo" <Ju****@discuss ions.microsoft. com> wrote in message
news:14******** *************** ***********@mic rosoft.com...
OK, thanx

Exists another way to load the page2.aspx without response.redire ct
command?

I'm a newbie in asp.net

"S. Justin Gengo" wrote:
Juanjo,

A response.redire ct clears the viewstate. Either store the parameter in a
session variable (if that will be allright for your application) or use
Server.Transfer and store the value in a context variable instead. If you
need any clarification on how session variables or server.transfer and
the
context object works let me know.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Juanjo" <Ju****@discuss ions.microsoft. com> wrote in message
news:DE******** *************** ***********@mic rosoft.com...
> OK Justin,
>
> I do it.
>
> In the master page code
>
> Protected Sub TreeView1_Selec tedNodeChanged( ByVal sender As Object,
> ByVal
> e
> As System.EventArg s) Handles TreeView1.Selec tedNodeChanged
>
> ViewState("Sele ctedNode") =
> TreeView1.Selec tedNode.Value
> Response.Redire ct("Page2.aspx" )
>
> End Sub
>
>
>
> And in the Page2_Load
>
> If Me.ViewState("S electedNode").T oString = "Perfiles" Then
>
> 'Code for selected node
>
> End If
>
> But now the problem is that ViewState("Sele ctedNode") is nothing. Not
> exists
>
> What I'm doing wrong?
> "S. Justin Gengo" wrote:
>
>> Juanjo,
>>
>> Store the selected node number in viewstate and on page loads check
>> that
>> viewstate parameter and if a selected node exists set the treeview to
>> display it as selected.
>>
>> --
>> Sincerely,
>>
>> S. Justin Gengo, MCP
>> Web Developer / Programmer
>>
>> www.aboutfortunate.com
>>
>> "Out of chaos comes order."
>> Nietzsche
>> "Juanjo" <Ju****@discuss ions.microsoft. com> wrote in message
>> news:E5******** *************** ***********@mic rosoft.com...
>> >I need to know how to maintain de status (nodes expanded and
>> >selected)
>> >of a
>> > treeview in a master page.
>> >
>> > I have a master page with a treeview. I have a default page, when
>> > the
>> > treeview is expanded and a node is selected then redirects to a
>> > another
>> > page
>> >
>> > Response.Redire ct("Page2.aspx" )
>> >
>> > And run's ok, but the treeview in this page is colapsed. The
>> > treeview
>> > maintain its aspect, the images for the nodes, etc, but is colapsed
>> > and
>> > nothing node is selected
>> >
>> > Many thanks for your help
>>
>>
>>


Dec 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1587
by: James | last post by:
I have a web based application that is populating a treeview with data from a SQL Database. This is nested in a contentplaceholder on the master page. I have content pages associated with another contentplaceholder on the same master page. What I am trying to do is not have the page refresh everytime a linkbutton or a link within the treeview is clicked on. In ASP.Net 1.0/1.1, i didn't use master page and things were different. I was able...
0
1163
by: Greg | last post by:
Hi, I'm trying to use the TreeView control in .NET 2.0 along with master pages and have encountered a problem. I have a master page for my site... pretty standard... on that page I have my treeview wrapped inside a <FORM> because it is required that reads from a .sitemap file. However - on one of my pages I want to have a contact form... but I can only have 1 form on a page. On my other pages I do not want to have a contact form.
2
1776
by: damiensawyer | last post by:
Hello all, I'm wondering if someone can help me with an issue. I have a master page that has a treeview control on it (inside an ascx file). Also on the master page I have a content placeholder which contains the various pages of my application. I wish to have the treeview control displayed at all times during the application.
0
1311
by: BillE | last post by:
PROBLEM SUMMARY -- I use "Response.Cache.SetCacheability(HTTPCacheability.NoCache)" to force a page to reload instead of displaying cached content. However, I don't really want to reload the page since the data may still be inconsistent, if the page was called from a url and based on values in a querystring. I'm using VS 2005, VB.NET. DETAILS --
1
1570
by: Vincenzo Milazzo | last post by:
Hi, I have a master page with a treeview control on the left. The treeview's nodes are populated ondemand (property Value and NavigateUrl). When I click on the node the property NavigateUrl loads a content page on the right. The problem is that the treeview doesn't save the state and I must click the treeview's nodes again to open the tree. How can I save the treeview state ? I don't want to populate the tree's nodes everytime I click...
1
1495
by: Rick | last post by:
Hi guys! I have a problem with a master page that has a treeview control as menu, i have a root node, 5 parents and each parent has 10 leafs, 50 pages in total, each page is linked to master page, when i select a node in treeview it redirects to N page, its ok, but i want each time i select a page in the treeview it expand the tree to current node selected, i can't do it, each time i select a node, treeview appears as originally i...
3
1636
by: RayK50 | last post by:
I am developing a web site in vb.net 2.0 using a master page, with a custom Treeview control populated by a database query. Clicking on a certain Treeview menu item opens a page with a 3rd-party viewer in a content placeholder, using a simple Response.Redirect on the TreeView1_SelectedNodeChanged event. Now, I need to call a javascript function (from the 3rd-party) to retrieve and load a drawing image into the viewer. As soon as I insert...
1
4874
by: =?Utf-8?B?QnJpYW4=?= | last post by:
I have a master page that contains a simple treeview populated using a SiteMapDataSource so the data is static. Here is my problem. When I expand the menu to show the 2nd level treeview items and then click on one to move to the selected page, when the new page is displayed the treeview has reverted back to it's original non-expanded state. What is the best way to maintain the expanded/collapsed state of the master page treeview while...
0
1305
by: vingomail | last post by:
Good Morning, I have two site map: "common.sitemap, loginuser.sitemap", two master page:" common.master, loginuser.master", in common.master, there is a Navigation control: TreeView TreeView--- Sitemapdatasource---common.sitemap in Loginuser.master, there is another Navigation control: TreeView TreeView---sitemapdatasource---loginuser.sitemap
0
8330
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8523
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6178
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2749
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.