Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

creating html pages dynamically with C#

  • 04-11-2006 4:05pm
    #1
    Registered Users, Registered Users 2 Posts: 872 ✭✭✭


    Hi,

    I'm starting to build a hotel site that needs to be very search engine friendly.

    Instead of having e.g. hotelPage.aspx?id=35 i want to make a page like clarence-hotel.html when creating entering hotels in the backend.

    I know how to create files and put content into them with C# but im wondering the best way to do it so editing the files later is easy. I.e. when someone edits a page stuff from the relevant html tags is put into certain text boxes for editing.

    Could i use xml or xslt for this to make it easier ?

    Any advice is great.


Comments

  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭amen


    I would use an app to allow the users to enter/edit the hotel data and store in a database.
    Then have a program that generates the html page based on xml from the db and transform with xsl.

    But for search engines do you want to generate the page on the fly or just generate once something has change and store on a server?


  • Registered Users, Registered Users 2 Posts: 885 ✭✭✭clearz


    Well ive had little C# experience as I'm a Java developer but this is how I'd do it.

    I would create the HTML page and make sure it is XHTML compliant. Then once the Add/Update button is clicked on in the CMS I'd use whatever classes are available to me in the System.XML namespace to load the html file and navigate the DOM making the relevant changes. Id also store the changes in a database so the next time the site admin goes back to the CMS the current dynamic information will be visible there.


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    I would generate the pages dynamically, like you said having a HotelPage.aspx?id=35 and so on, but on the main page of the site have a link to 'list all pages' which would point at a page ListAll.aspx or similar, ListAll.aspx would then read through the database and display a link to each possible page giving something like

    <a href="hotelPage.aspx?id=1">Clarence Hotel</a>
    <a href="hotelPage.aspx?id=2">Shelbourne Hotel</a>
    ...
    <a href="hotelPage.aspx?id=x">etc etc</a>

    I'm not entirely sure this would work, but I'm fairly sure a search engine would then index these just aswell as static pages. Creating the pages dynamically from database content then makes it so much easier to add new entries, update existing ones, search, and maintain your links to each hotel.


  • Registered Users, Registered Users 2 Posts: 872 ✭✭✭grahamor


    Thanks for the replys

    stevenmu im not really sure what you mean. I want to avoid pages like hotelPage.aspx?id=32 . Ill make sure it's still easy to administer the site.

    clearz ill check out that xml stuff and let you know how i get on.

    cheers


  • Registered Users, Registered Users 2 Posts: 872 ✭✭✭grahamor


    I just found this article on URL rewriting (something which i never even knew about)

    http://msdn2.microsoft.com/en-us/library/ms972974.aspx

    could be useful for what im trying to achieve.


  • Advertisement
Advertisement