Basic question about the design structure
-
Hello, i have for several years been using asp when making homepages. I am about to jump on the asp.net train. But have a couple of questions / considerations before i start out with my first homepage. From asp i am used to using the header/footer princip where i have one file with the layout, and split it up into parts. I then include the layout file into all my other files and call the appropiate functions whenever i need them (i will call header to start with, then i will write the unique content for the page and then call footer to finish the page). I am thinking about how my approach should be when i start of with my first ASP.Net homepage. I have a couple of variations in mind. I could go with making one class which contain the design, all pages which is a part of the homepage extends this class and inherit the basic methods. This will look a lot like what i am used to, and i will keep the flexibility soo i should only change the design one place if i need to make changes. Also i have the possibility to split the homepage into different files. But as ASP.NET is used different that simple asp, will this be possible ? As far as i know i will no longer in the html code (aspx file) be able to just call header() in the top, and footer() at the bottom whenever i need it to write out the html content like i am used to. simple example header(); // write out tags .. and soo on ...
Blablalaalla content for this specific page
footer(); // ends ... and rest of the design.. i really like this way of doing it, and it would be even more simple with asp.net if it is possible. But maybe i blind and not able to see why this should be a stupid way to do it. Another possibility which i was told by a guy who have been programming asp.net for some time was to only have 1 file for the whole page. Personally i dont like the idea with only one file (default.aspx), i like to split the page up into different files. The idea was that this default.aspx and cs just looks at the querystring / parameters from the browser and makes an instance of some class you want to show and write it out on the page. Here the layout will just be in the default.aspx file. Then i could have a content
or something like that. soo that div gets filled with the right "data" depending on what is written in the querystring. This means that everytime the page is run / loaded it have to look at the querystring and run it through a big switch / case to
-
Hello, i have for several years been using asp when making homepages. I am about to jump on the asp.net train. But have a couple of questions / considerations before i start out with my first homepage. From asp i am used to using the header/footer princip where i have one file with the layout, and split it up into parts. I then include the layout file into all my other files and call the appropiate functions whenever i need them (i will call header to start with, then i will write the unique content for the page and then call footer to finish the page). I am thinking about how my approach should be when i start of with my first ASP.Net homepage. I have a couple of variations in mind. I could go with making one class which contain the design, all pages which is a part of the homepage extends this class and inherit the basic methods. This will look a lot like what i am used to, and i will keep the flexibility soo i should only change the design one place if i need to make changes. Also i have the possibility to split the homepage into different files. But as ASP.NET is used different that simple asp, will this be possible ? As far as i know i will no longer in the html code (aspx file) be able to just call header() in the top, and footer() at the bottom whenever i need it to write out the html content like i am used to. simple example header(); // write out tags .. and soo on ...
Blablalaalla content for this specific page
footer(); // ends ... and rest of the design.. i really like this way of doing it, and it would be even more simple with asp.net if it is possible. But maybe i blind and not able to see why this should be a stupid way to do it. Another possibility which i was told by a guy who have been programming asp.net for some time was to only have 1 file for the whole page. Personally i dont like the idea with only one file (default.aspx), i like to split the page up into different files. The idea was that this default.aspx and cs just looks at the querystring / parameters from the browser and makes an instance of some class you want to show and write it out on the page. Here the layout will just be in the default.aspx file. Then i could have a content
or something like that. soo that div gets filled with the right "data" depending on what is written in the querystring. This means that everytime the page is run / loaded it have to look at the querystring and run it through a big switch / case to
In asp.net you can use usercontrol for your header ad for your footer. These can work as include files. I am sure thry will do what you want to accomplish. I use them to separate different parts of my webpage. I use them mostly for navigation that can br static or dynamic since controls are programmable and executed on the server zimcoder What Democracy?? Jesus Christ is King and if you do not like it... well you can go to hell!
-
Hello, i have for several years been using asp when making homepages. I am about to jump on the asp.net train. But have a couple of questions / considerations before i start out with my first homepage. From asp i am used to using the header/footer princip where i have one file with the layout, and split it up into parts. I then include the layout file into all my other files and call the appropiate functions whenever i need them (i will call header to start with, then i will write the unique content for the page and then call footer to finish the page). I am thinking about how my approach should be when i start of with my first ASP.Net homepage. I have a couple of variations in mind. I could go with making one class which contain the design, all pages which is a part of the homepage extends this class and inherit the basic methods. This will look a lot like what i am used to, and i will keep the flexibility soo i should only change the design one place if i need to make changes. Also i have the possibility to split the homepage into different files. But as ASP.NET is used different that simple asp, will this be possible ? As far as i know i will no longer in the html code (aspx file) be able to just call header() in the top, and footer() at the bottom whenever i need it to write out the html content like i am used to. simple example header(); // write out tags .. and soo on ...
Blablalaalla content for this specific page
footer(); // ends ... and rest of the design.. i really like this way of doing it, and it would be even more simple with asp.net if it is possible. But maybe i blind and not able to see why this should be a stupid way to do it. Another possibility which i was told by a guy who have been programming asp.net for some time was to only have 1 file for the whole page. Personally i dont like the idea with only one file (default.aspx), i like to split the page up into different files. The idea was that this default.aspx and cs just looks at the querystring / parameters from the browser and makes an instance of some class you want to show and write it out on the page. Here the layout will just be in the default.aspx file. Then i could have a content
or something like that. soo that div gets filled with the right "data" depending on what is written in the querystring. This means that everytime the page is run / loaded it have to look at the querystring and run it through a big switch / case to
First off, I would do it with web user controls. They are the #Includeds of the older technologies without all the hassles. For some ideas, check out this article of mine on a simple control to template a web site with a primary page and the content of each page being web user controls that you simply swap in. http://www.codeproject.com/aspnet/RJContentPanel.asp[^] Rocky <>< www.HintsAndTips.com - Includes Developer Tips www.MyQuickPoll.com - 2004 Election poll is #33
-
First off, I would do it with web user controls. They are the #Includeds of the older technologies without all the hassles. For some ideas, check out this article of mine on a simple control to template a web site with a primary page and the content of each page being web user controls that you simply swap in. http://www.codeproject.com/aspnet/RJContentPanel.asp[^] Rocky <>< www.HintsAndTips.com - Includes Developer Tips www.MyQuickPoll.com - 2004 Election poll is #33
Thanks for the answers. I better have a closer look to web user controls. I can see the idea in your example, but i dont like that you call only one file/page and then use the querystring to define which page to show. I like to split my page up soo i can have http://someaddress.com/ , http://someaddress.com/Shop/ , /Auction/ , /Contact/ , and soo on ... then they all need to use the same basic layout but with different content. Soo i will need to find a way to include the layout in the content pages and not include the content in the layout (like you do). Hope you understand what i mean. Martin... :-)