0

I am new to MVC3

I am having a page with webgrid and some searching options on httpget my webgrid is blank as mine functionality is like that webgrid will have some data after my searching(means after page posts and upto this its working fine). now, I am using that webgrid with some custom search filters. When ever I click, paging or sorting in GRID, it goes to HttpGet and not to HttpPost and from HttpGet its returns null value and grid disappears.

I hope I didn't confuse you all.

Thanks..

Vicky Kumar
  • 13
  • 1
  • 6
  • 1
    You'll need to provide some code for us to look at. – Simon Whitehead Feb 01 '13 at 05:21
  • What have you tried, please post us some code . Also for your reference [check this](http://www.elylucas.net/post/Using-a-grid-that-can-sort-page-and-filter-in-AspNet-MVC3e28093Part-1e28093Using-the-WebGrid-WebHelper.aspx) – Karthik Chintala Feb 04 '13 at 05:49

1 Answers1

0

Mark the controller action as [HttpPost],and make sure you are posting your data by submitting form.

[HttpGet]
public ActionResult Search()
{

}

[HttpPost]
[ActionName("Search")]
public ActionResult SearchPost(/* search params*/)         //this method should get called
{
 /*your code*/`enter code here`
}
Cris
  • 12,799
  • 5
  • 35
  • 50