Javascript Anchor Tag and Url Redirecting to MVC action. RRS feed

  • Question

  • Hi Team

    <div id="div1" class="dd" style="display:none;">

    <a href="@Url.Action("Index", "Test")" onclick="return open1();" title="Test" class="links" id="tstLink">


    Is it possible to change the style for div1 to display block before redirecting to MVC action.

    As it is not working.after redirection div1 showing  display none only.

    function open1() {

                document.getElementById("div1").style.display = "inline-block";

                //window.location = "Test/Index";


    Wednesday, June 12, 2019 8:06 AM

All replies

  • ASP.NET MVC issues can be discussed at the ASP.NET forums.


    Wednesday, June 12, 2019 8:24 AM
  • Hi Adry,

    Thank you for posting here.

    Since this thread is related to asp.net MVC, you could post it in the following forum.


    The Visual C# forum discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.

    Best Regards,


    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, June 12, 2019 8:31 AM