MVC Route Tables Update Via Reflection?

  • Thread starter Thread starter coconet
  • Start date Start date
C

coconet

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.
 
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: (e-mail address removed).

==================================================
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.

--------------------
 
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:
(e-mail address removed).
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
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.
 
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:
(e-mail address removed).

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

--------------------
 
Back
Top