@Url in Mvc4. Action How to read the value of a JavaScript variable

Source: Internet
Author: User

JS in   function Search()  {      var businessDate = GetSelectedBusinessDate( "#businessYear" "#businessMonth" );      var ul= ‘  @Url.Action("Query", "FileImport", new { BusinessDate = businessDate })‘      $( ‘#dg‘ ).datagrid({ url: url }); }The value of businessdate needs to be obtained from getselectedbusinessdate, but the above code does not seem to be executing, prompting:
The name "Businessdate" solution does not exist in the current context function Search () {
var businessdate = getselectedbusinessdate ("#businessYear", "#businessMonth");
var url = ' @Url. Action ("Query", "fileimport") ' + '?businessdate= "+businessdate;
$ (' #dg '). DataGrid ({Url:url});
} <iframe src= "@Html.raw(Url.action ("Edit", "Home", new {@Id=13,@Name= "Lizikang"}) "></iframe>, <iframe src=" @Html.raw(Url.action ("Edit", "Home", new {id=13,name= "Lizikang"})) "></iframe> Suppose your Url is
ABC/EFG? Aa=bb&cc=dd&&eefff=aaa "
You can write that.
Url.action ("EFT", "ABC") +? Aa=bb&cc=dd&&eefff=aaa "
If you must use the official
Can write like this public RouteValueDictionary ParseQueryStringToRouteValues( string queryString)          {              var parsed = HttpUtility.ParseQueryString(queryString);              Dictionary< string object > querystringDic = parsed.AllKeys                  .ToDictionary(k => k, k => ( object )parsed[k]);              return new RouteValueDictionary(querystringDic);          } var url = Url.Action( "eft" , "ABC" ,ParseQueryStringToRouteValues( "AA=bb&cc=dd&&eefff=aaa" )) ; new {} 形式好像不行, 至少用 return RedirectToAction( "CouponGrant" , ParseQueryStringToRouteValues( "Couponid=" + cg.CouponId)); 取不到参数

@Url in Mvc4. Action How to read the value of a JavaScript variable

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.