guest2013-1
guest
- Joined
- Aug 22, 2003
- Messages
- 19,800
- Reaction score
- 13
So I'm messing around with MVC and getting it modular in a way (by using Areas)
I've found the template for C# and VB.NET differs slightly when it comes to Namespaces, in C# it will work beautifully, but in VB.NET it's more retard than I'd like to admit. A lot of Googling left me with no real answers, only that it has something to do with Namespaces or something left out of the template when creating the project and 99% of the people knowing exactly where to fix it. (because everyone running into this problem is a genius and doesn't care to show code examples of the changes they made for it to work)
But I'm more "F5 till it works smart" than "Ah duhr, this is the inner workings lets trace and write exam papers and manuals smart" (lol)
So here is what I've learned, in your AreaRegistration.vb file you need to specify the Namespace like so:
And that's about it hey. The important part appears to be the ".*"
I had it "MyTest.TestArea" which didn't seem to work at all (tried it a few billion different ways), then saw some random post with ".*" and figured, I'm going to give up anyway, might as well try this bull****. And it worked.
Not sure if this is correct or not, but it produced the result I wanted. Will see once I get further into the project if there's any more issues.
I've found the template for C# and VB.NET differs slightly when it comes to Namespaces, in C# it will work beautifully, but in VB.NET it's more retard than I'd like to admit. A lot of Googling left me with no real answers, only that it has something to do with Namespaces or something left out of the template when creating the project and 99% of the people knowing exactly where to fix it. (because everyone running into this problem is a genius and doesn't care to show code examples of the changes they made for it to work)
But I'm more "F5 till it works smart" than "Ah duhr, this is the inner workings lets trace and write exam papers and manuals smart" (lol)
So here is what I've learned, in your AreaRegistration.vb file you need to specify the Namespace like so:
Code:
context.MapRoute( _
"TestArea_default", _
"TestArea/{controller}/{action}/{id}", _
New With {.controller = "TestAre", .action = "Index", .id = UrlParameter.Optional}, _
[b]New String() {"TestArea.*"}[/b] _
)
And that's about it hey. The important part appears to be the ".*"
I had it "MyTest.TestArea" which didn't seem to work at all (tried it a few billion different ways), then saw some random post with ".*" and figured, I'm going to give up anyway, might as well try this bull****. And it worked.
Not sure if this is correct or not, but it produced the result I wanted. Will see once I get further into the project if there's any more issues.