title: How to bind .Url(Url.Action()) property to toolbar in kendo ui grid(html)
body: <p>i have a grid developed using kendo ui and asp.net mvc4 razor.in there i have used the html syntax for kendo grid instead of asp.net mvc.</p>
  
  <p>this is the code of my grid</p>
  
  <pre><code>    &lt;div id="example" class="k-content"&gt;
      &lt;div id="batchgrid"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;script type="text/javascript" lang="javascript"&gt;
      $("#batchGrid").click(function () {
          var crudServiceBaseUrl = "http://demos.kendoui.com/service",
                          dataSource = new kendo.data.DataSource({
                              transport: {
                                  read: {
                                      url: crudServiceBaseUrl + "/Products",
                                      dataType: "jsonp"
                                  },
                                  update: {
                                      url: crudServiceBaseUrl + "/Products/Update",
                                      dataType: "jsonp"
                                  },
                                  destroy: {
                                      url: crudServiceBaseUrl + "/Products/Destroy",
                                      dataType: "jsonp"
                                  },
                                  create: {
                                      url: crudServiceBaseUrl + "/Products/Create",
                                      dataType: "jsonp"
                                  },
                                  parameterMap: function (options, operation) {
                                      if (operation !== "read" &amp;&amp; options.models) {
                                          return { models: kendo.stringify(options.models) };
                                      }
                                  }
                              },
                              batch: true,
                              pageSize: 20,
                              schema: {
                                  model: {
                                      id: "ProductID",
                                      fields: {
                                          ProductID: { editable: false, nullable: true },
                                          ProductName: { validation: { required: true} },
                                          UnitPrice: { type: "number", validation: { required: true, min: 1} },
                                          UnitsInStock: { type: "number", validation: { min: 0, required: true} },
                                          Discontinued: { type: "boolean" },
                                          TotalStock: { type: "number" }
                                      }
                                  }
                              },
                              //                            group: {
                              //                                field: "UnitPrice", aggregates: [
                              //                                        { field: "UnitPrice", aggregate: "sum" },
                              //                                        { field: "TotalStock", aggregate: "sum" }
                              //                                     ]
                              //                            },
                              aggregate: [{ field: "TotalStock", aggregate: "sum"}]
  
                          });
  
          $("#batchgrid").kendoGrid({
              dataSource: dataSource,
              dataBound: onDataBound,
  
              navigatable: true,
  
              filterable: {
                  messages: {
                      and: "And",
                      or: "Or",
                      filter: "Apply filter",
                      clear: "Clear filter",
                      info: "Filter by"
                  },
                  extra: false, //do not show extra filters
                  operators: { // redefine the string operators
                      string: {
                          contains: "Contains",
                          doesnotcontain: "Doesn't contain",
                          startswith: "Starts With",
                          endswith: "Ends"
                      },
                      number: {
                          eq: "Is Equal To",
                          neq: "Not equal to",
                          gte: "Greater than or equal to",
                          lte: "Less than or equal to",
                          gt: "Greater than",
                          lt: "Less than"
                      }
                  }
              },
  
              reorderable: true, //not working
  
              selectable: "multiple",
  
              pageable: {
                  refresh: true,
                  pageSizes: [5, 10, 20, 50, 100]
              },
  
              height: 430,
              width: 300,
  
              toolbar: [
                      {
                          name: "my-create",
                          text: "Add new record"
                      },
                      {
                          name: "save",
                          text: "save changes"
                      },
                      {
                          name: "cancel",
                          text: "cancel changes"
                      },
                      {
                          name: "export",
                          text: "Export To Excel"
                      }
              ],
  
              columns: [
              //                            { field: "ProductID", title: "No", width: "90px" },
                              {title: "No", template: "#= ++record #", width: 45 },
                              { field: "ProductName", title: "Product Name", width: "350px" },
                              { field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "130px" },
                              { field: "UnitsInStock", title: "Units In Stock", width: "150px" },
                              { field: "Discontinued", title: "Purchase", width: "110px" },
                              { field: "TotalStock", title: "Total Stock", width: "150px", footerTemplate: "Total : #= kendo.toString(sum, 'C') #", format: "{0:c2}" }
              //{ command: ["destroy"], title: "&amp;nbsp;", width: "175px" }
              ],
  
  
              export: {
                  cssClass: "k-grid-export-image",
                  title: "people",
                  createUrl: "/Home/ExportToExcel",
                  downloadUrl: "/Home/GetExcelFile"
              },
  
              groupable: {
                  messages: {
                      empty: "Drop columns here"
                  }
              }, //not working
  
              columnMenu: {
                  sortable: true,
                  filterable: true,
                  messages: {
                      columns: "Hide/Show Columns",
                      filter: "Apply filter",
                      sortAscending: "Sort (asc)",
                      sortDescending: "Sort (desc)"
                  }
              },
  
              resizable: true,
  
              dataBinding: function () {
                  record = (this.dataSource.page() - 1) * this.dataSource.pageSize();
              },
  
              sortable: {
                  mode: "multiple"
              },
              sort: { field: "ProductID", dir: "asc" },
  
              editable: { mode: "incell", createAt: "bottom" }
          });
  
          //custom global variables
          newRowAdded = false;
          checkedOnce = false;
  
          var grid = $("#batchgrid").data("kendoGrid");
          $(".k-grid-my-create", grid.element).on("click", function (e) {
  
              window.newRowAdded = true;
  
              var dataSource = grid.dataSource;
              var total = dataSource.data().length;
              dataSource.insert(total, {});
              dataSource.page(dataSource.totalPages());
              grid.editRow(grid.tbody.children().last());
          });
  
          grid.bind("saveChanges", function () {
              window.newRowAdded = false;
              //                        var grid = $("#batchgrid").data("kendoGrid");
              //                        grid.dataSource.sort({ field: "ProductID", dir: "asc" });
              //            GetValOf();
  
              //            var grid = $('#batchgrid').data("kendoGrid");
              //            var total = 0;
              //            $.each(grid.dataSource.view(), function () {
              //                total += this.TotalStock;
              //            });
              //            alert(total);
          });
  
          grid.bind("cancelChanges", function () {
              window.newRowAdded = false;
          });
  
          $(".k-grid-export", "#batchgrid").bind("click", function (ev) {
              // your code
              //            alert("Hello");
              var grid = $("#batchgrid").data("kendoGrid");
              grid.dataSource.pageSize(parseInt($("#batchgrid").data("kendoGrid").dataSource.data().length));
              excelImport();
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>but i got some example code for importing grid data to excel and in there they used asp.net mvc syntax.</p>
  
  <p>here is the code.</p>
  
  <pre><code>@(
   Html.Kendo().Grid(Model).Name("Grid")
                  .DataSource(ds =&gt; ds.Ajax()
                                  .Model(m =&gt;
                                  {
                                      m.Id(p=&gt;p.ProductID);                              
                                  })
                          .Read(r =&gt; r.Action("Read", "Home"))
                  )
                  .ToolBar(toolBar =&gt; 
                      toolBar.Custom()
                          .Text("Export To Excel")
                          .HtmlAttributes(new { id = "export" })
                          .Url(Url.Action("Export", "Home", new { page = 1, pageSize = "~", filter = "~", sort = "~" }))
                  )
                  .Columns(columns =&gt;
                  {
                      columns.Bound(p =&gt; p.ProductID);
                      columns.Bound(p =&gt; p.ProductName);
                      columns.Bound(p =&gt; p.UnitPrice).Format("{0:c}");
                      columns.Bound(p =&gt; p.QuantityPerUnit);
                  })
                  .Events(ev =&gt; ev.DataBound("onDataBound"))
                  .Pageable()
                  .Sortable()
                  .Filterable()
  )
  </code></pre>
  
  <p>but my problem is i need to add below line of code to my grid(in first code mentioned above).</p>
  
  <pre><code>.ToolBar(toolBar =&gt; 
                          toolBar.Custom()
                              .Text("Export To Excel")
                              .HtmlAttributes(new { id = "export" })
                              .Url(Url.Action("Export", "Home", new { page = 1, pageSize = "~", filter = "~", sort = "~" }))
                      )
  </code></pre>
  
  <p>but im stucked with this single line</p>
  
  <pre><code>.Url(Url.Action("Export", "Home", new { page = 1, pageSize = "~", filter = "~", sort = "~" }))
  </code></pre>
  
  <p>can somebody please tell me that how to use this code in my html grid..</p>