SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile ASP 2.0 and XML Question

    Hey guys, my first post and hope i chose the right thread, i'm excited to be here, been looking for a place to find answers and discuss different things to do and such (outside of googling, lol) Anyway my question...


    Right now i'm working on a webpage for a my uncle, and granted i'm not a complete newbie on web pages but we all learn news things all the time right What i'm trying to do is, Have ONE main aspx file, and ONE main xml file, (it's a car site) so when they click on the car they are interested in, say carinfo.aspx, it goes off what was clicked and pulls that info off a section of the XML file.

    I have it right now where it's one XML file but multiple aspx files reading from it (based on the selection) and i'm trying to just have one so i just maintain the xml file and not 50 million aspx files, lol..

    I hope that made sense

  2. #2
    SitePoint Addict Poiesis01's Avatar
    Join Date
    Jun 2007
    Location
    Cape Town
    Posts
    233
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How many different selections can they make? Make, model, year? If they click on make use the query string ?make=nissan; if they click on model use the query string ?model=skyline, etc. On the page, use different hidden repeaters for each selection if the data they pull are different. Then in code behind evaluate the query string to find what repeater to unhide and check the parameter of the query sting to pull the data.

  3. #3
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yikes, I don't think i thought of making that complex (at least not yet, he doesn't have that many cars ) Here's one section on the xml file, maybe it'll help

    --------
    <CarInfo>
    <c00043
    title="2002 BMW 325 Cic"
    stock="00043"
    type="2 Door Convertible"
    exterior="Silver Metallic"
    interior="Full Cashmere Leather"
    trans="Auto"
    engine="DOHC 24v 6cyc"
    miles="50,000"
    price="$22,995"
    vin="***"
    />
    <p00043>
    <id>01</id>
    <title></title>
    </p00043>
    </Carinfo>

    --------

    So what i'm doing is having the aspx file look in the xml file for the correct car section "c00043", then it will display the data in it info and pics. But right now i have it hard-coded into each car file "00043.aspx, 00044.aspx, etc.." to where that file just looks for it's own numbered section and pull from that.

    That make better sense of what i'm trying to do?

  4. #4
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,653
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I would really re-engineer this. Having one XML file acting as a data source is workable--unless the file is really, really large. But having one page do everything has alot of drawbacks. First, the more things you try and do in a particular page, the more difficult it becomes to maintain. This goes double for developers without too much experience. Second, for search engines, information architecture and overall usability, having separate pages is generally a better thing.

    How you can handle this is to make a "CarDetail.aspx" page that uses the querystring, so a request would look like CarDetail.aspx?ID=xyz. You would then query your data source (Xml in this case) for the value of the query string and bind the data.

    Also, on your XML, a more traditional way to do it would be to make something like:

    Code:
    <CarInfo id="c00043" title="2002 BMW 325 Cic" . . . . />
    The way you have it now makes doing many things with the xml difficult.

  5. #5
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, i think i understand what your saying... I'll stick to the multi pages to 1 xml.

    and on the traditional way, are you talking about just have everything in one line?

    I will have to research querystrings...


  6. #6
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,653
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    No, I mean not changing the tag name for every vehicle. The format of the data, or schema should remain the same, throughout your XML. Just the specifics should change.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •