I just play with ASP.NET MVC 2 for training. I can transfer my models for viewing, but after spending 1-2 hours I was unsuccessful in transferring data for viewing. For instance:
www.example.com/home/show/asdf I'm trying to get the asdf string to show it on the screen.
public ActionResult Test(string ID) { return View(ID); }
With this method, I am trying to capture it. Then return the view. In my opinion, I am using <%: Html.LabelFor (m => m as a string)%>. It might look stupid. I think all the strings are for matching URLs to methods, but not integers, so I think I need to use a question mark like example.com/home/Test?asdf? I will try to do it too.
Edit:
Passing an integer value by url to a method argument confuses me. Example.com/home/test/2 in this url, 2 will be the argument of the testing method, so I thought the same for the string. I think that we can only pass an integer and cannot do something with any other values. So I think I can only catch the values with querystring, so how can I pass a simple string type to look at?
source share