0

1234_307150451322 is ID of LotNumber, I don't want to display ID in URL What I need to Do,

To Load Data From DataBase and to Set in Table format My URL is

http://www.xyz.com/FieldInspection/SearchIndex

when i click on Perticular LotNumber it Generates Foloowing URL

http://www.xyz.com/LotNumber/Index/1234_307150451322

Please help me, Thanks in Advance, Sorry for My Bad English

Dangerous Dev
  • 487
  • 3
  • 7
  • 20
  • You could use jquery/ajax to do a post request instead. Check out [this question](http://stackoverflow.com/questions/2048778/asp-net-mvc-actionlink-and-post-method) for lost of good info on how to do that – Forty-Two Mar 04 '13 at 13:55

1 Answers1

0

It seems you have MapRoute like this:

routes.MapRoute(
 "Default",
 "{controller}/{action}/{id}",
 new { controller = "Home", action = "Index", id = "" }
);

So, now your item ID corresponds to id parameter.
These urls work equally:
www.xyz.com/LotNumber/Index/1234_307150451322
www.xyz.com/LotNumber/Index?id=1234_307150451322

It means you use method GET when you call your controller for extracting information about current item.

If you don't want to see item ID as a parameter in url string, you could use method POST for sending your item ID.

You could use some javascript function as click event for sending POST request.

Volodymyr Machula
  • 1,564
  • 1
  • 15
  • 20