Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

MVC Route Tables Update Via Reflection?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
coconet - 11 Mar 2008 18:36 GMT
I have several hardcoded paths in my global.asax.cs, declaring how and
what controllers should do in my ASP.NET 3.5 MVC code.

Is it possible to read from the current assembly and pick out the
controllers and their parameters and dynamically make the Route Table
mapping?

Thanks.
Steven Cheng - 12 Mar 2008 02:17 GMT
Hi Coconet,

Are you using the new beta MVC model or implement your own MVC code logic
in ASP.NET? For general url rewriting in ASP.NET you can surely put the
redirection rule in web.config or other config file. Here is a tech article
mentioned such approach (when performing url rewriting):

#URL Rewriting in ASP.NET
http://msdn2.microsoft.com/en-us/library/ms972974.aspx

Also, for your MVC processing, what's your current code logic in
global.asax?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we

can improve the support we provide to you. Please feel free to let my
manager know what you think of

the level of service provided. You can send feedback directly to my manager
at: msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response

from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take

approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution.

The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump

analysis issues. Issues of this nature are best handled working with a
dedicated Microsoft Support

Engineer by contacting Microsoft Customer Support Services (CSS) at

http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>NNTP-Posting-Date: Tue, 11 Mar 2008 12:36:54 -0500
>From: coconet <coconet@community.nospam>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>Subject: MVC Route Tables Update Via Reflection?
>Date: Tue, 11 Mar 2008 13:36:52 -0400

>I have several hardcoded paths in my global.asax.cs, declaring how and
>what controllers should do in my ASP.NET 3.5 MVC code.
[quoted text clipped - 4 lines]
>
>Thanks.
Steven Cheng - 17 Mar 2008 10:02 GMT
Hi Coconet,

Have you got progress on this or any further questions that need help?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: stcheng@online.microsoft.com ("Steven Cheng")
>Organization: Microsoft
>Date: Wed, 12 Mar 2008 01:17:47 GMT
>Subject: RE: MVC Route Tables Update Via Reflection?

>Hi Coconet,
>
[quoted text clipped - 69 lines]
>>
>>Thanks.
coconet - 18 Mar 2008 04:09 GMT
I am using the March 2008 MVC release. I have 8 controllers, each with
7 methods. I do not want to write 56 entries in my global.asax for
IIS7 (I develop in Vista) and then another 56 entries when the code
goes to IIS6 (server is Win 2003). I think there should be a way to
register all of the public methods with their parameters automatically
in the RouteTable - how to do it?

Thanks.
Steven Cheng - 19 Mar 2008 03:48 GMT
Hi Coconet,

Just do some further research and found the following article maybe helpful
to you:

#ASP.NET MVC RouteBuilder HTTPModule released!
http://codeeleven.blogspot.com/2007/12/aspnet-mvc-routebuilder-httpmodule.ht
ml

Also, I think such configuration feature will surely be strengthed when the
MVC model become more popular and stable. Currently it is still at early
stage, the developers may still focus on the other runtime performance
things.

Steven Cheng
Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>NNTP-Posting-Date: Mon, 17 Mar 2008 22:09:40 -0500
>From: coconet <coconet@community.nospam>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>Subject: Re: MVC Route Tables Update Via Reflection?
>Date: Mon, 17 Mar 2008 23:09:40 -0400

>I am using the March 2008 MVC release. I have 8 controllers, each with
>7 methods. I do not want to write 56 entries in my global.asax for
[quoted text clipped - 4 lines]
>
>Thanks.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.