CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 2/9/2007 7:35:29 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 33 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
hsl001
Asp.Net User
Master page with Treeview2/9/2007 7:35:29 PM

0/0

Hi All,

 I created a Master Page with a Treeview,  in the page_load() I got the following...

Partial

Class Report

Inherits System.Web.UI.MasterPage

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim Child1 As TreeNode = New TreeNode()

Dim Root1 As TreeNode = New TreeNode()

If Not IsPostBack Then

Root1.Text =

"My Reports"

Child1 =

New TreeNode()

Child1.Text =

"Report #1"

Root1.ChildNodes.Add(Child1)

TreeView1.Nodes.Add(Root1)

End If

End Sub

End

Class

I also created a test4.aspx web page that use this Report.Master and when I ran the page I got the following error.

 

Server Error in '/OTP_Checklist' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 12:                   Child1.Text = "Report #1"
Line 13:                   Root1.ChildNodes.Add(Child1)
Line 14:                   TreeView1.Nodes.Add(Root1)
Line 15:             End If
Line 16: 

Source File: C:\Documents and Settings\slau\My Documents\Visual Studio 2005\OTP_Checklist\Report.master.vb    Line: 14

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Report.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\slau\My Documents\Visual Studio 2005\OTP_Checklist\Report.master.vb:14
   System.Web.UI.Control.OnLoad(EventArgs e) +80
   System.Web.UI.Control.LoadRecursive() +49
   System.Web.UI.Control.LoadRecursive() +132
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3745


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

 

How could I control or display the nodes of the treeview in the master page?

 TIA

Steve

Zhao Ji Ma - MS
Asp.Net User
Re: Master page with Treeview2/12/2007 8:54:53 AM

0/0

Hi,

Have you drag and drop a TreeView control in design view, please check if your aspx code already define a TreeView control called TreeView1.

 


Zhao Ji Ma
Sincerely,
Microsoft Online Community Support

?Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ?
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional Authors: Matthew MacDonald, Pages: 954, Published: 2007
Visual Web Developer 2005 Express Edition For Dummies Authors: Alan Simpson, Pages: 358, Published: 2005
Beginning ASP.NET 2.0 Authors: Chris Hart, John Kauffman, Chris Ullman, David Sussman, Pages: 759, Published: 2005
Beginning ASP.NET 3.5 in VB 9.0: From Novice to Professional Authors: Matthew MacDonald, Pages: 1149, Published: 2007
ASP.NET 2.0: A Developer's Notebook Authors: Wei Meng Lee, Pages: 326, Published: 2005
Learning ASP.NET 3.5 Authors: Jesse Liberty, Dan Hurwitz, Brian MacDonald, Pages: 576, Published: 2008
Beginning ASP.NET 2.0 in VB 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1063, Published: 2006
Beginning ASP.NET 2.0 in C# 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1148, Published: 2006
Beginning ASP.NET 2.0 with C# Authors: Chris Hart, John Kauffman, David Sussman, Chris Ullman, Pages: 735, Published: 2006
ASP.NET 3.5 For Dummies Authors: Ken Cox, Pages: 404, Published: 2008

Web:
Prevent treeview control from reinitialising on master page for ... I have a master page that has a treeview control on it (inside an ascx ... master page takes this as a new page and resets the treeview ...
Masterpage with treeview sitemap and contentpanel - ASP.NET Forums If I have set masterpage with treeview in panel in the masterpage, this treeview is coming from the db and will refresh after selected ...
Shalvin - Microsoft .Net Blogs: Asp.Net 2.0 Master Page and TreeView Lets continue out discussion on Master Page. In this blow we will take up TreeView also which can be used for having a consistent navigation option. ...
MSDN .NET Framework Setup Treeview in a masterpage Hello friends i am using a master page and i want to keep a treeview in that master page where treeview will be dynamically populated according to different ...
TreeView in master page - telerik Forum I have a treeview control where each branch is populated on demand. The tree resides in a masterpage. When I click on a node I want to see ...
treeview in master page loses state when new page is selected ... treeview in master page loses state when new page is selected. Get answers to your questions in our .NET ASP forum.
Master Page and TreeView - ASP.NET Forums I have a Master Page,and some child pages connected to that Master page, I have a TreeView in Master page. When I use hyperlinks inside TreeView every thing ...
TreeView and Master Pages 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 ...
ASP.NET Having it in a Master Page Sof if you have a treeview that loads each time a page is loaded, it doesn't matter whether it's on a MasterPage or on the Page that uses the Master. ...
Find controls in a userControl that is in a masterPage : control ... I have a userControl with a treeView in a masterPage. I need information from the selected node of the treeView in the under lying page.

Videos:
RCxhet - Como crear un menu,treeview ASP .net Part 2 RCxhet - Como crear un menu,treeview y un site map en asp.net Ancho de un contentPlaceHolder Agregar imagen de master page en pagina que esta en subc...




Search This Site:










passing extra data when dynamically loading treeview

how do i use the public function i clarified in master page, and use it in other web forms?

changing text via themes and skins

master content page issue

applying a theme to a custom created webpart in asp.net 2.0

problems

treeview...change individual treenode style?

masterpage (and annoyingly so) refresh when using tree view

treeview not binding

dynamic menu bug in safari

menu control on master pages

treeview icons and lines can't be together?

masterpage, viewstate & wizards control

capture prerender for the content page

display node only to authenticated users

menu with css

menu control hiding content in floating div's in ie 6

wat theme or starter kit should i used for developing site for cable operetor website

treeview presentation

highlighting treenodes

initializecomponent: is that normal behaviour?

to call n html template

create webpage with sitemap data

javascript and master page problem

applying a different master page to a different part of the site

page.controls don't exist in page from masterpage

changing page.title when header isn't runat=server

masterpage,actions, and url rewriting

calender control doesnot working in master page

hi, i have a problem with a stylesheet when i place it in the app_themes asp,net folder. can somebody please help me?

  Privacy | Contact Us
All Times Are GMT