[SOLVED] URL-Format with question mark


I have this update method in controller, and this url works:

Is there a way I can make the url include question mark and parameters so that it’ll be on this form:


        public async Task<ActionResult> Update(int id, bool newStatus)
            some code.....


The parameters that come after the ? are the same ones you pass as a part of the URL. Meaning if you say {id:int}, I can type the same thing as ?id=123 as a part of the URL. It’s just a way to format the URL to an SEO and human-friendly format. So no, there’s no way you could be able to control what is passed to you. You can, however, validate the inputs that are passed to your action.

Answered By – Alireza Noori

Answer Checked By – Clifford M. (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *