Problem with Routing in MVC Core 2 RRS feed

  • Question

  • I have a call
    @Url.Action("index", "Controller", new {id = 1})
    After if concludes, I am calling
    @Url.Action("Index", "Controller") 
    I want the method to run with a null id parameter but it is retaining the id = 1.
    In my Controller Index method, I have specified that id is a nullable int. Also, in the route, id is a nullable int.
    How do I fix this?

    Carolyn Schroeder

    • Moved by Fei Hu Wednesday, December 20, 2017 1:38 AM From C#
    Tuesday, December 19, 2017 12:35 AM

All replies

  • Hi Carolyn,

    According to your description, your issue is more related about ASP.NET MVC. And this forum is discussing and asking questions about the C# programming language, IDE, libraries, samples and tools, it will be more appropriate to ask your question at ASP.NET Forum.

    Thank you for your understanding.



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, December 20, 2017 1:33 AM