views:

90

answers:

4

I am converting an old html based website to ASP.NET, so that we can include more features like AJAX, Databases later on to the site. Currently my task is to create a new .aspx page for each older html page. To keep the layout persistent i have made a master page.

So currently i am building a content page from the master page, then renaming the content page and adding the text from the html page to the content placeholder area. However i was wondering if can cannot write a system, which can act as a Page Thrower.

Each hyperlink when clicked goes to a serverside code, where it requests the page it wants to load. Typically a webserver expects that the pagelink specified in the hyperlink does exist physically, but here what i am trying to do is that. Say the link is for the page "TravelDetails", the page need not exist physically, but the content of it is present in a file in (html format). so the Page Thrower gathers the data to display for that page, it has a master page already, it adds the html of it there and then throws the custom page. This way i don't have to keep 100+ aspx pages, i can do with a single page and maintain another data structure to store the content (static data) for each page. any guidance if my approach is right, and how to go about it?

Thanks

A: 

Take a look at ASP.NET MVC. It uses ASP.NET Routing, which may help you.

Alternatively you can use ASP.NET Routing without MVC, too.

Matthias

Mudu
hi i am aware of the routing feature, idea is that i don't want multiple pages for each item. I want to maintain a single file which contains the markers from where the data can be fetched and displayed based on the link which the user has clicked.
Anirudh Goel
I think you can do this using MVC and Routing: A single page is one record in your DB, thus the controller can pass the record (page content) to the view. This requires just one single view that accepts a page content object as a parameter. See "The List Action, View" in http://blogs.msdn.com/brada/archive/2008/01/29/asp-net-mvc-example-application-over-northwind-with-the-entity-framework.aspx for an example.
Mudu
A: 

Just a thought. Create a page linked to the Master Page. In the content place holder add a Panel. Let your Page thrower decide which page to display, retrieve the html data & add it to the panel at runtime.

Ganesh R.
Exactly this is what i'm looking for. however from where can i find some sample which already implements an idea like this!
Anirudh Goel
on a further thought, i can add these to a database (the html markup) and it can fetch from the database and add here!
Anirudh Goel
+2  A: 

I think you should try some cms avaialable in market like dotnetnuke. Because every time you need to have to create a web page for a html page. In future if there will be any changes then it will take time. While in cms like dotnetnuke you just need to paste your html in existing system. You don't need to do coding again.

DotNetNuke is a free one. There are other Content Management System also available as well. Another advantage is that dotnetnuke is having skin features. So if you change skin at one place. You need not to do it for all the places.

jalpesh
A: 

Why don't you create the pages dynamically and then use asp.net caching in order to increase throughput.

RubbleFord