简体   繁体   中英

Passing values from View to Action Method using href = Url.Action()

i am trying to passing those values to Confirmation action result but i have

syntax error :missing ;

 var url = '@Url.Action("Confirmation", "BookReservation")/?record_locator=' + record_locator +'&hid='@Request.QueryString["hid"] ;

    window.location.href = url;

is their any wrong with this code

any advice

First you create the url

var url = @Url.Action("Confirmation", "BookReservation");

And then you add the parameters

window.location.href = url + '?record_locator=' + record_locator + '&hid=' + @Request.QueryString["hid"] ;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM