codingdir logo sitemap sitemap |
Home
PHP
C#
C++
ANDROID
JAVA
JAVASCRIPT
PYTHON

Page.RouteData.Values["parameter"] not working


By : , Category : c#

I have tested your code, and no problems for me on ASP.NET 4.0.

Try defining default values, like

routes.MapPageRoute("surveyquestions",
    "survey/questions/{q}", "~/Survey.aspx",
    false,
    new RouteValueDictionary 
        { { "q", String.Empty } });

Did that resolve your problem?

ReLated :

Try to use Page.RouteData.Values instead.

I am pretty new to url routing, but I think I ran into a similar problem and also found the solution. Have you tried:

routes.MapPageRoute("ListDetails/{Location}/{ZipCode}/", "ListDetails/{Location}/{ZipCode}/", "~/List.aspx");

instead of

routes.MapPageRoute("List/{Location}/{ZipCode}/", "List/{Location}/{ZipCode}/", "~/List.aspx");

?

In my case I had:

routes.MapPageRoute(
    "ImageDelete",
    "Admin/Images/Delete/{nameToKill}",
    "~/Admin/Images.aspx"
);

which showed Page.RouteData.Values always empty.

When I changed it to

routes.MapPageRoute(
    "ImageDelete",
    "Admin/Image/Delete/{nameToKill}", // mind the missing 's'
    "~/Admin/Images.aspx"
);

it worked!

I think the route may not start with the URL of a site that actually exists.

I believe you have to remove providers: [RouteData] from the @Component

@Component({
    selector: 'header-title',
    template: 'title: {{title}}'
})

If your route table has entry like this: {controller}/{action}/{id} where {id} is optional, then you should visit your page by using url "http://yourdomain.com/index/1?xxx=yyy&aaa=bbb Therefore xxx=yyy and aaa=bbb becomes value in filtersVal.

Comments


Message :
Login to Add Your Comments .
How to disable registered OpenCL platforms on Windows?
Is Observable broken in Angular 2 Beta 3?
Cross-thread operation not valid when using Invoke
How to pass an IEnumerable or queryable list of properties from Controller to View
Finding numbers after a certain keyword using Python
Pocketsphinx recognizes random phrases in a silence
Passing non-thread-safe objects through thread-safe containers
React scroll nav
BizTalk WCF-BasicHttp Adapter does not allow Empty string for Service Certificate Props
Why property ''cause" of Exception is repeating forever?
Privacy Policy 2017 © codingdir.com All Rights Reserved .