locked
Mvc Remove Querystring RRS feed

  • Question

  • User197255166 posted

    Hi,

    How can I remove querystring parameters url. 

    url : https://localhost:44390/check-out/address?orderid=30789213

    I want to do : https://localhost:44390/check-out/address

    how can I capture this orderid. Address.cshtml

    Address Controller

    public ActionResult Address(FormCollection form, int orderid=0)

    In my project, I will send the checkout controller id parameters with the button. "should also be nullable"

    For example on this button payment page. Payment.cshtml

     <button type="submit" name="backtoaddress" class="button-1" onclick="location.href='@Url.Action("TscAddress", "TscCheckout", new { orderid = ViewBag.Order })'" style="width:100%;" id="backtoaddress">
                               Address
                            </button>

    Friday, June 19, 2020 5:30 AM

All replies

  • User475983607 posted

    Use standard ASP.NET state management.; Session, cookies, hidden imports, database, etc.

    Friday, June 19, 2020 10:54 AM