asp.net mvc - Using MVC Routes as Shortcodes -


we have been trying implement shortcodes on asp.net mvc web app allow users uniquely invoke given article/page using assigned short code.

for e.g.: www.mysite.com/power map actual url: www.mysite.com/power/home/.

i have created various routes throughout site map these shortcodes various actions , controllers within application. shortcode/route point of view, working great.

i, however, noticed couple of interesting things. have hyperlinks use url.action method generate url pointing pages. many of these pages have short codes associated them. e.g.: have link says:

 <a href="<%= url.action("index", "home", new { area = "power" })%>"> go power page</a> 

this page has mentioned short-code assigned it. when use url.action, ideally expect create link /power/home/index or /power/home, since have route constraint mapped it, generates link /power.

is there way can use actual link url when generating links? want short-codes when sending out emails etc. want site generate actual urls.

this may or may not possible, wanted see if there ideas out there use.

anup

index , home defined in route table defaults action , controller element. when generate url wont include defaults if aren't needed.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -