Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my routeConfig fle I have this procedure
Public Sub RegisterRoutes(ByVal routes As RouteCollection)
		routes.IgnoreRoute("{resource}.axd/{*pathInfo}")

		'This informs MVC Routing Engine to send any requests for .aspx page to the WebForms engine
		routes.IgnoreRoute("{resource}.aspx/{*pathInfo}")
		routes.IgnoreRoute("{resource}.aspx")

		' Important change here removed 'controller = "Home"' from defaults. This is the key for loading
		' root default page. With default setting removed '/' is NOT matched, so 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 order to send the pointer there but it throws me the error of:
: grFlagsBtn_Click' is undefined

And one more issue I've noticed the program remains on `Home/Index` environment. And there is no any Index file there.
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`
Please is some one to give me some help on this?

What I have tried:

Nothing more than the above actions
Posted
Updated 8-Feb-19 6:50am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900