0

So I'm trying to learn how MapPageRoute works, and I was wondering: "How do you read the parameters given in an url?".

So far I've tried this:

 routes.MapPageRoute(
           "exportparts",
           "exportparts/{company}/{ditono}",
           "~/Source/1UI/ExportParts.aspx");

But when I try to read the parameters like this:

string company = (string)Page.RouteData.DataTokens["company"];

the dictionary is empty. How do I read parameters?

Michael Tot Korsgaard
  • 3,892
  • 11
  • 53
  • 89

1 Answers1

2

I Suppose you want to access the values ? It's done like below Page.RouteData.Values["company"].ToString();

Read more about it here

Community
  • 1
  • 1
Deeptechtons
  • 10,945
  • 27
  • 96
  • 178