Users Pricing

forum

home / developersection / forums / how to maproute and querystings in mvc?

How to maproute and querystings in mvc?

Manoj Bhatt 2059 30 Oct 2014
I have two routes:
routes.MapRoute(
            "FetchVenue",                                    
            "venue/fetchlike/{q}",                                    
            new { controller = "venue", action = "fetchlike" }     
       );
 
       routes.MapRoute(
            "venue",                                        
            "venue/{venueId}",                                 
            new { controller = "Venue", action = "Index" }  
        );

The url /venue/fetchlike/test is passed to the correct controller The url /venue/fetchlike/?q=test is however passed to the index action.

I want to be able to pass data as a querystring.


Manoj Bhatt

Other


1 Answers