[Mono-aspnet-list] Pro ASP.NET MVC Framework Problems

Kevin Monceaux Kevin at RawFedDogs.net
Mon Apr 5 13:13:08 EDT 2010


Mono ASP.NET Fans,

I've been working my way through the Pro ASP.NET Framework book by Steven
Sanderson.  Are there any books on the market that don't assUme that one is
using Visual {Studio, Web Developer Express} on Windows?  I finally gave in
and installed Windows and Visual Web Developer Express under VirtualBox to
make following the examples easier. 

I have the early examples working on Windows with SQL Server Express(without
Mono), and Linux via Mono with both PostgreSQL and MySQL.  On page 107 where
the book has one change the routes to:

routes.MapRoute(
    null, // Don't bother giving this route entry a name
    "", // Matches the root URL, i.e. ~/
    new { controller = "Products", action = "List", page = 1 } // Defaults
);

routes.MapRoute(
    null, // Don't bother giving this route entry a name
    "Page{page}", // URL pattern, e.g. ~/Page683
    new { controller = "Products", action = "List"}, // Defaults
    new { page = @"\d+" } // Constraints: page must be numerical
);

They would not work as above under Mono.  Routes such as /Page2 which should
match the second route were being handled by the first route with page = 1.
If I reverse the above two entries they seem to to work.  Should they work
as they are in the book?

A few pages further in the book where the PageLinks HTML helper is
implemented I'm encountering another problem.  All the page links are being
rendered with href="" instead of the expected URL.  For testing I tried
adding some hard coded page links to the page, such as:

Page:
<%= Html.ActionLink("1", "List", new { page = 1 }) %>
<%= Html.ActionLink("2", "List", new { page = 2 }) %>

and they produce the same results:

Page:
<a href="">1</a>
<a href="">2</a>

Is this a problem caused by the above routes?  Being an MVC framework newbie
I'm probably overlooking something simple.  I've only tried the PageLinks
HTML helper code under Linux/Mono.

I'm running Mono 2.6.3/MonoDevelop 2.2.2 on OpenSuSe.


-- 

Kevin
http://www.RawFedDogs.net
http://www.WacoAgilityGroup.org
Bruceville, TX

What's the definition of a legacy system?  One that works! 
Si hoc legere scis nimium eruditionis habes.
Longum iter est per praecepta, breve et efficax per exempla!!!



More information about the Mono-aspnet-list mailing list