简体   繁体   English

新网址下的MVC区域

[英]MVC area under new URL

I have two projects what were developed separated and now i need to merge the second one with the first. 我有两个分开开发的项目,现在我需要将第二个项目与第一个项目合并。

The first one is just a website and the second is English test that will have his on 'inside' URL's. 第一个只是一个网站,第二个是英语测试,它将在“内部” URL上进行。 What i need is the test to run in a URL like: 我需要的是在URL中运行的测试,例如:

mywebsite.com/english-test/begin
mywebsite.com/english-test/questionary

The thing is, my website project's routes works on a different way, i have a database that has my URL's and i check it to see if it's a valid URL. 问题是,我的网站项目的路由以不同的方式工作,我有一个包含我的URL的数据库,然后检查它是否是有效的URL。 This is the route that will call my class: 这是将调用我的课程的路线:

routes.MapRoute(
    "Default",
    "{*RedirectUrl}"
).RouteHandler = new RouteHandler();

This is my RouteHandler class (i'm gonna put it on a pastebin because the code is kind of big): http://pastebin.com/nFfciyBe . 这是我的RouteHandler类(由于代码有点大,我将其放置在pastebin上): http : //pastebin.com/nFfciyBe

And this is my class that researches the DB for the URL: http://pastebin.com/sCEEKL9b 这是我的课程,研究URL的数据库: http : //pastebin.com/sCEEKL9b

The English test will have his 'authorized' URL's on this same database, it will work just as the website. 英文测试将在同一数据库上具有其“授权” URL,它将与网站一样工作。

在使用MVC Areas并在RouteHandler类上进行了一些更改以使其检查数据库上的区域之后,设法使其工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM