In Post
Controller , URL is like this :
http://127.0.0.1/post/5006/some-text-for-seo-friendly
{contoller}/{id}/{seo}
public ViewResult Index(){
.....
}
I used Ajax.BeginForm
in index view and mapped it to AddComment
action in the same controller.
@using (Ajax.BeginForm("AddComment", "Post", new AjaxOptions()
{
HttpMethod = "GET",
InsertionMode = InsertionMode.InsertAfter,
UpdateTargetId = "comment-container"
}))
{
<textarea cols="2" rows="2" name="comment" id="comment"></textarea>
<input type="submit" value="Add Comment" />
}
and in controller
public PartialViewResult AddComment(string comment){
// how can I get 5006 {id} here
}
my question is how can I get the {id} [5006]
in AddComment
action.
注:难以使用<代码>查询。 UrlReferer, 并按/
和选定表格阵列分别列出。