473,587 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I do this?

ma
Hello,

I am new in ASP.NET. I read several books and know the concept but since
I am a C++ programmer I am lost in programming methodology in ASP.NET. Here
is my problem:

I have a page which consists of two sections. A tree view on left and a
detail view on right. The tree view would get its data from a database. For
simplicity I wrote a C# class to fill the tree with some dummy data. When
user click on any node, based on the node depth and also node content and
user name, the detail section should display some information. To do this I
created a master page. Since tree view would shows on all pages I put it on
master page. I fill the tree on master page load event.

When the user clicks on any node, I redirect the user to a new page based on
the depth of node.

Everything is working well till this point but the problem started from here
and they are:

1-Every time that user redirected to a new page, tree is populated. This
process is slow. The content of tree is not changed in any session but
master page load event is called for all child pages of this master page and
hence the tree is filled un necessarily.

2- Since the tree is populated when a new page is shown, it loses its state.

3- Since tree looses its state when user is redirected to a new page, I can
not detect what I need to show in the new page.

Now my questions:

1- Where is the best place to fill the tree view?

2- Is there any sample web program similar to what I want to create that I
can download and look at?

3- Is there any way that only detail section be rendered during a post back
and not the tree view itself? I read about AJAX and Atlas. Are they any
good? Can I use them with ASP.NET? Where can I read more about them and how
they are compared with each other?

4- Any other suggestion.

Regards


Aug 24 '07 #1
6 1646
ma wrote:
Hello,

I am new in ASP.NET. I read several books and know the concept but since
I am a C++ programmer I am lost in programming methodology in ASP.NET. Here
is my problem:

I have a page which consists of two sections. A tree view on left and a
detail view on right. The tree view would get its data from a database. For
simplicity I wrote a C# class to fill the tree with some dummy data. When
user click on any node, based on the node depth and also node content and
user name, the detail section should display some information. To do this I
created a master page. Since tree view would shows on all pages I put it on
master page. I fill the tree on master page load event.

When the user clicks on any node, I redirect the user to a new page based on
the depth of node.

Everything is working well till this point but the problem started from here
and they are:

1-Every time that user redirected to a new page, tree is populated. This
process is slow. The content of tree is not changed in any session but
master page load event is called for all child pages of this master page and
hence the tree is filled un necessarily.
Judging by this comment, I believe that it's safe to assume that the
contents of your pages are contained within a single rendered page. In
other words, you're not using frames of any kind. If that's so, did you
remember to put the binding of the DataSource of the tree inside of a
similar block?

if (!IsPostBack)
{
...
}
2- Since the tree is populated when a new page is shown, it loses its state.
Are you using the TreeView control or is this something custom you
rolled out? Either way, hopefully the above fixes it.
3- Since tree looses its state when user is redirected to a new page, I can
not detect what I need to show in the new page.
How are you doing this, anyhow? I would recommend that your links have
a query string value containing the ID of the content you wish to
display. For example http://www.mysite.com/mypage.aspx?ContentId=12345.

Hope that helps,

--
Sean
Aug 24 '07 #2
"ma" <ma@nowhere.com wrote in message
news:ec******** ******@TK2MSFTN GP03.phx.gbl...

Following on from Sean's comments, I wonder if you're confusing ASP.NET
MasterPages with HTML framesets - they are quite different...

With traditional HTML framesets, the user clicks a hyperlink in the 'menu'
frame and this causes a new page to be displayed in the 'main' frame.

However, MasterPages don't work like that at all. In fact, a MasterPage is
nothing more than a UserControl... MasterPages allow common look and feel
(and sometimes functionality) across several content pages - think of them
as templates. When a content page loads, it loads the MasterPage every time.
Therefore, if you have a TreeView in a MasterPage and click on one of its
nodes, it redirects to that file which in turn loads up the MasterPage...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 24 '07 #3
ma

"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:OL******** *****@TK2MSFTNG P05.phx.gbl...
"ma" <ma@nowhere.com wrote in message
news:ec******** ******@TK2MSFTN GP03.phx.gbl...

Following on from Sean's comments, I wonder if you're confusing ASP.NET
MasterPages with HTML framesets - they are quite different...

With traditional HTML framesets, the user clicks a hyperlink in the 'menu'
frame and this causes a new page to be displayed in the 'main' frame.

However, MasterPages don't work like that at all. In fact, a MasterPage is
nothing more than a UserControl... MasterPages allow common look and feel
(and sometimes functionality) across several content pages - think of them
as templates. When a content page loads, it loads the MasterPage every
time. Therefore, if you have a TreeView in a MasterPage and click on one
of its nodes, it redirects to that file which in turn loads up the
MasterPage...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Thanks Sean and Mark.

I have a table in my master page: header, footer, treeview and detail view.
should I use frameset here? If yes how? If now how do you design such
things?
I want when user click on a node in tree, only detail view is updated and
not the whole page. Is there any sample application that shows how this can
be implemented?

Regards
Aug 24 '07 #4
>should I use frameset here

Not if you can help it. Frames have a time and a place but generally
they are regarded as an outdated method and they can cause more
problems than necessary.
>I want when user click on a node in tree, only detail view is updated and not the whole page.
This is a scenario where an AJAX method may be useful as it allows you
to update certain parts of the page. If you haven't already seen it,
visit http://ajax.asp.net to see some samples and decide whether this
would be useful in your application.

--
Mark Smith
http://aspnetlibrary.com

Aug 24 '07 #5
ma

"ca****@aspnetl ibrary.com" <ma************ **@gmail.comwro te in message
news:11******** **************@ x40g2000prg.goo glegroups.com.. .
>>should I use frameset here

Not if you can help it. Frames have a time and a place but generally
they are regarded as an outdated method and they can cause more
problems than necessary.
>>I want when user click on a node in tree, only detail view is updated
and not the whole page.

This is a scenario where an AJAX method may be useful as it allows you
to update certain parts of the page. If you haven't already seen it,
visit http://ajax.asp.net to see some samples and decide whether this
would be useful in your application.

--
Mark Smith
http://aspnetlibrary.com
Thanks mark,I am going to study AJAX. Is there any other way to do this?
If you open MSDN on web, you can see something similar to what I want to
develop ( the difference is that right section in MSDN is a static HTML but
in my case it is a dynamic one). How that ASP.NET is working? Are they using
AJAX? how they manage to update only the right side of screen without
refreshing the whole screen?

Regards

Aug 24 '07 #6
they use a combination of ajax and iframes. note with an iframe you need
to write javascript to handle resizes, and content can not be displayed
outside the frame boundary, so they don't work for flyout menus.

-- bruce (sqlwork.com)

ma wrote:
"ca****@aspnetl ibrary.com" <ma************ **@gmail.comwro te in message
news:11******** **************@ x40g2000prg.goo glegroups.com.. .
>>>should I use frameset here
Not if you can help it. Frames have a time and a place but generally
they are regarded as an outdated method and they can cause more
problems than necessary.
>>>I want when user click on a node in tree, only detail view is updated
and not the whole page.
This is a scenario where an AJAX method may be useful as it allows you
to update certain parts of the page. If you haven't already seen it,
visit http://ajax.asp.net to see some samples and decide whether this
would be useful in your application.

--
Mark Smith
http://aspnetlibrary.com

Thanks mark,I am going to study AJAX. Is there any other way to do this?
If you open MSDN on web, you can see something similar to what I want to
develop ( the difference is that right section in MSDN is a static HTML but
in my case it is a dynamic one). How that ASP.NET is working? Are they using
AJAX? how they manage to update only the right side of screen without
refreshing the whole screen?

Regards
Aug 24 '07 #7

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

Similar topics

4
3345
by: James | last post by:
I have a from with 2 fields: Company & Name Depening which is completed, one of the following queries will be run: if($Company){ $query = "Select C* From tblsample Where ID = $Company Order By Company ASC";
5
2745
by: Scott D | last post by:
I am trying to check and see if a field is posted or not, if not posted then assign $location which is a session variable to $location_other. If it is posted then just assign it to $location_other I keep getting "Notice: Undefined index: location_other" referring to (!($_POST)) { $location_other = $location; } else
2
2717
by: Nick | last post by:
Can someone please tell me how to access elements from a multiple selection list? From what ive read on other posts, this is correct. I keep getting an "Undefined variable" error though... Form page************************************************************ <form action="/process.php" method="get" name="formOne" id="formOne"> <select...
2
2534
by: Alexander Ross | last post by:
I have a variable ($x) that can have 50 different (string) values. I want to check for 7 of those values and do something based on it ... as I see it I have 2 options: 1) if (($x=="one") || ($x=="two") || ... || ($x=="seven")) ... or 2) switch ($x){ case("one"):
0
3266
by: Dan Foley | last post by:
This script runs fine, but I'd like to know why it's so slow.. Thanks for any help out there on how i can make it faster (it might take up to 5 min to write these 3 export files whith 15 records each!!!) Dan ==================== <style> body, table, tr, td { font-family: 'verdana'; font-size: 12px;
5
3205
by: Lee Redeem | last post by:
Hi there I've created abd uploaded this basic PHP script: <html> <head> <title>PHP Test</title> </head> <body> <H1 align="center">
5
10043
by: christopher vogt | last post by:
Hi, i'm wondering if there is something like $this-> to call a method inside another method of the same class without using the classname in front. I actually use class TEST { function func1()
6
2657
by: Phil Powell | last post by:
Ok guys, here we go again! SELECT s.nnet_produkt_storrelse_navn FROM nnet_produkt_storrelse s, nnet_produkt_varegruppe v, nnet_storrelse_varegruppe_assoc sv, nnet_produkt p WHERE s.nnet_produkt_storrelse.id = sv.nnet_produkt_storrelse_id AND sv.nnet_produkt_varegruppe_id = v.nnet_produkt_varegruppe_id AND sv.nnet_produkt_varegruppe_id IN (...
1
2188
by: Michel | last post by:
a site like this http://www.dvdzone2.com/dvd Can you make it in PHP and MySQL within 6 weeks? If so, send me your price 2 a r a (at) p a n d o r a . b e
11
3150
by: Maciej Nadolski | last post by:
Hi! I can`t understand what php wants from me:( So: Cannot send session cache limiter - headers already sent (output started at /home/krecik/public_html/silnik.php:208) in /home/krecik/public_html/silnik.php on line 251 Line 208: print ( "error: " . mysql_error()); Line 251: session_register("uprawnienia", "zalogowany"); I can...
0
7918
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
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...
0
8206
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8340
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...
1
7967
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...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6621
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...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.