This is a migrated thread and some comments may be shown as answers.

[Solved] Post and ServerBinding in Grid

3 Answers 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kira
Top achievements
Rank 1
Kira asked on 13 Apr 2010, 10:00 PM
Hello! I wonder how I can make a call to a method "Post" (the Controller) using ServerBinding (in Grid component). I can not use AJAX in this case.

I prefer to use Post method for the parameters be not visible in the URL.

.DataBinding(databinding => databinding.Server().Select("MyAction", "MyController", new { param1 = "value1"param2 = "value2" })) 

3 Answers, 1 is accepted

Sort by
0
IQworks
Top achievements
Rank 1
answered on 14 Apr 2010, 01:28 AM
Hi Kira, 
   Please excuse me, I didnt understand this sentence... 
   "I prefer to use Post method for the parameters be not visible in the URL"
   But here is a link on server binding 
   http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-grid-server-binding.html
   and another example as well   
<% Html.Telerik()  
       .Grid(Model)  
       .Name("customers")  
       .PrefixUrlParameters(false)  
       .Columns(columns => 
                {  
                    columns.Add(c => 
                                {  
                                    %> 
                                        <%= Html.ActionLink("Edit", "Edit", new { id = c.CustomerID })%> 
                                        <%= Html.ActionLink("Delete", "Delete", new { id = c.CustomerID })%> 
                                    <%  
                                }).Title("Action");  
 
                    columns.Add(c => c.CompanyName).Width(200);  
                    columns.Add(c => c.ContactName);  
                    columns.Add(c => c.Address);  
                    columns.Add(c => c.City);  
                    columns.Add(c => c.PostalCode);  
                    columns.Add(c => c.Country);  
                    columns.Add(c => c.Phone);  
                    columns.Add(c => c.Fax);  
                })  
        .Filterable()  
        .Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn))  
        .Pageable()  
        .Scrollable(scrolling => scrolling.Height(250))  
        .Render(); %> 
0
Kira
Top achievements
Rank 1
answered on 14 Apr 2010, 12:44 PM
The URL I mentioned looks like this:

"http://demos.telerik.com/aspnet-mvc/Grid?ajax=False&theme=vista&Grid-page=2&Grid-orderBy=ContactName-asc"

Well, anyway I saw the link and this line is my question: 

"By default the Telerik Grid for ASP.NET MVC will perform server side requests (HTTP GET) when doing paging, sorting and filtering. This is called "Server binding".

Instead of performing an HTTP GET, it is possible to perform an HTTP Post?

Thank you very much for the response! =)

0
Accepted
Atanas Korchev
Telerik team
answered on 14 Apr 2010, 01:00 PM
Hi Kira,

No, it is not possible to use HTTP POST with server binding. You can use Ajax binding instead - it is doing HTTP POST behind the curtain.

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Kira
Top achievements
Rank 1
Answers by
IQworks
Top achievements
Rank 1
Kira
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or