ASP.NET MVC RouteTable question

Discussion in 'ASP .Net' started by laziers@gmail.com, Apr 8, 2008.

  1. Guest

    Hi,
    Anyone know how to set the RouteTable to do some think like this:

    solution explorer:

    +Views
    ---+Products
    -----+List.aspx
    -----+Add.aspx
    ---+Clients
    ------+List.aspx
    ---+Cms <---
    ------+News
    ---------+List.aspx

    here we have a directory cms, that have news directory, with List.aspx
    file

    when I write url: site/cms/

    the error appear:

    Could not find an ASPX view at '~/Views/News/List.aspx'.

    ok I understand why, but what I must do, to redirect to directory: '~/
    Views/Cms/News/List.aspx'

    ?
     
    , Apr 8, 2008
    #1
    1. Advertising

  2. You need to add another branch in your route and order it so it gets fired
    first. This new route takes in account the Cms folder. To make it simple,
    you can name this a News controller, although it seems you have a bit of the
    basics of mapping down.

    Without seeing more, I am just shooting fish in the dark.

    --
    Gregory A. Beamer
    MVP, MCP: +I, SE, SD, DBA

    Subscribe to my blog
    http://gregorybeamer.spaces.live.com/lists/feed.rss

    or just read it:
    http://gregorybeamer.spaces.live.com/

    *************************************************
    | Think outside the box!
    |
    *************************************************
    <> wrote in message
    news:...
    > Hi,
    > Anyone know how to set the RouteTable to do some think like this:
    >
    > solution explorer:
    >
    > +Views
    > ---+Products
    > -----+List.aspx
    > -----+Add.aspx
    > ---+Clients
    > ------+List.aspx
    > ---+Cms <---
    > ------+News
    > ---------+List.aspx
    >
    > here we have a directory cms, that have news directory, with List.aspx
    > file
    >
    > when I write url: site/cms/
    >
    > the error appear:
    >
    > Could not find an ASPX view at '~/Views/News/List.aspx'.
    >
    > ok I understand why, but what I must do, to redirect to directory: '~/
    > Views/Cms/News/List.aspx'
    >
    > ?
     
    Cowboy \(Gregory A. Beamer\), Apr 10, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rmn190
    Replies:
    2
    Views:
    2,467
    Arne Vajhøj
    Jan 10, 2008
  2. jm
    Replies:
    1
    Views:
    292
    Michael Nemtsev [MVP]
    Jun 10, 2008
  3. Paulo
    Replies:
    3
    Views:
    508
    Peter Bromberg [C# MVP]
    Dec 4, 2008
  4. Crazy Cat
    Replies:
    1
    Views:
    720
    schepp
    Sep 3, 2009
  5. PJ6
    Replies:
    0
    Views:
    286
Loading...

Share This Page