0 Replies - 5719 Views - Last Post: 20 October 2011 - 03:46 AM

#1 marius.mutescu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 02-January 11

MVC3 routing issue

Posted 20 October 2011 - 03:46 AM

Hy!

I have this controller
public ViewResult Hotel(string hotelSupplierCode, bool displayAllRooms, bool resend)
        {
            HotelModel model;
            if (resend)
            {
                model = (HotelModel)Session["HotelDetails"];
                HotelManager.ResendHotel(model.Hotel.Id);
                model.Hotel.Status = 1;
            }
            else
            {
                model = HotelModel.GetGotel(hotelSupplierCode, displayAllRooms);
            }
            Session["HotelDetails"] = model;
            return View("Hotel", model);
        }


and this routing

 routes.MapRoute(
                "Hotel", // Route name
                "{controller}/{action}/{hotelSupplierCode}/{displayAllRooms}/{resend}", // URL with parameters
                new { controller = "Hotel", action = "Hotel", hotelSupplierCode = UrlParameter.Optional, displayAllRooms = UrlParameter.Optional, resend = UrlParameter.Optional }



The problem is that when I access the view the returned URL is soemthing like that
http://localhost:495...se&resend=False, but I want to look like that
http://localhost:495...711/False/False.

If I put the last link manualy it works fine. How can I hide the parameters name from URL?

Is This A Good Question/Topic? 0
  • +

Page 1 of 1