I build a web site with MVC4, and in my routeConfig
file I have this procedure:
Public Sub RegisterRoutes(ByVal routes As RouteCollection)
routes.IgnoreRoute("{resource}.axd/{*pathInfo}")
routes.IgnoreRoute("{resource}.aspx/{*pathInfo}")
routes.IgnoreRoute("{resource}.aspx")
default.aspx will load instead
routes.MapRoute(
name:="Default",
url:="{controller}/{action}/{id}",
defaults:=New With {.controler = "Home", .action = "Index", .id = UrlParameter.Optional}
)
End Sub
In my HomeControler
I have this function:
Function Index() As ActionResult
Return View("Default")
End Function
Thus my Default.aspx
is working just fine. But.
When I'm trying to click
a button cannot Handle the onclick
event (never goes to the sub.
So I use a OnClientClick
in aspx
to raise up this event.
But throws me the error of:
grFlagsBtn_Click' is undefined
And one more issue... I've noticed the program remains on Home/Index
environment. Where there is no any Index file at this area.
But the Url in my browser says href="http://localhost:49224/Home/Index"
I found that very much strange, because the program should be in /Home/Default
.. I think, I'm not of that.
Please is some one to give me some help on this?