Link to home
Start Free TrialLog in
Avatar of nicedone
nicedone

asked on

can you explain me how to pass query string parameter in url vs. passing parameter as example /param1/2

hi,

i am trying to learn if i want to pass a parameter as param1/3   vs replies?param1=3

i would like to learn how to generate each of them what should i do, and which 1 i should prefer in my coding?

thanks
Avatar of Alexandre Simões
Alexandre Simões
Flag of Switzerland image

The first one is the classic querystring way supported natively by ASP.net:
replies?param1=3

The second is based on routes, which is a commonly used in the MVC designs.
You can still use routes in ASP.net webforms, but ASP.net MVC makes it easier to implement.

So to put it simple, the choice is much related to how you want to build your site, Web Forms or MVC? :)
Avatar of nicedone
nicedone

ASKER

thanks for the explaination,

1) if i use mvc which i do at the moment and prefer to pass in

replies?param1=3 can i do that? if so could you show a little code snippet that accomplishes that

if i want to use param1/3 as in routes could you share a small code to accomlish that insted too
ASKER CERTIFIED SOLUTION
Avatar of Alexandre Simões
Alexandre Simões
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial