How can i manage a “ASP.NET MVC Actionlink” control to link to an action of a controller and data-toggle transactions at the same time?










0















I am new to ASP.NET MVC so sometimes I have questions about it.This is one of them.



I have an actionlink and i want to link to an action of a controller and data-toggle transactions at the same time.



I added the code snippet below.



@Html.ActionLink("Connections", "ConnectionIndex", "Connection", null, new data_target = "#connectionSubmenu", data_toggle = "collapse", aria_expanded = "false", @class = "dropdown-toggle" )
<ul class="collapse list-unstyled main" id="connectionSubmenu">
<li></li>
<li></li>
<li></li>
</ul>


When I use the ActionLink in this way, only transaction of data-toggle runs but it doesn't link to the "view" that I give.



What can i do to manage that?Please help me.










share|improve this question
























  • Could you clarify something - is your goal to make the ConnectionIndex View appear inside the ul with the id of connectionSubmenu? when the data toggle link is clicked?

    – Alistair Findlay
    Nov 14 '18 at 10:43











  • I want to make the "ul" expanded only and go to the view (ConnectionIndex) that i give at the same time.

    – Barsblue
    Nov 14 '18 at 10:46











  • ActionLink is supposed to link to an action method in a controller. It is up the action method to return the view you expect or not. May be you're barking to the wrong tree.

    – derloopkat
    Nov 14 '18 at 10:46











  • yes sorry,i have written wrong.I want to go to an action of a controller.

    – Barsblue
    Nov 14 '18 at 10:51











  • @Barsblue, when you call ActionLink, the action is "ConnectionIndex" and controller is "Connection" so it should render something like <a aria-expanded="false" class="dropdown-toggle" data-target="#connectionSubmenu" data-toggle="collapse" href="/Connection/ConnectionIndex">Connections</a> So what's the problem? The controller/action is there. If the link is correct perhaps you have some Javascript code messing up.

    – derloopkat
    Nov 14 '18 at 10:59
















0















I am new to ASP.NET MVC so sometimes I have questions about it.This is one of them.



I have an actionlink and i want to link to an action of a controller and data-toggle transactions at the same time.



I added the code snippet below.



@Html.ActionLink("Connections", "ConnectionIndex", "Connection", null, new data_target = "#connectionSubmenu", data_toggle = "collapse", aria_expanded = "false", @class = "dropdown-toggle" )
<ul class="collapse list-unstyled main" id="connectionSubmenu">
<li></li>
<li></li>
<li></li>
</ul>


When I use the ActionLink in this way, only transaction of data-toggle runs but it doesn't link to the "view" that I give.



What can i do to manage that?Please help me.










share|improve this question
























  • Could you clarify something - is your goal to make the ConnectionIndex View appear inside the ul with the id of connectionSubmenu? when the data toggle link is clicked?

    – Alistair Findlay
    Nov 14 '18 at 10:43











  • I want to make the "ul" expanded only and go to the view (ConnectionIndex) that i give at the same time.

    – Barsblue
    Nov 14 '18 at 10:46











  • ActionLink is supposed to link to an action method in a controller. It is up the action method to return the view you expect or not. May be you're barking to the wrong tree.

    – derloopkat
    Nov 14 '18 at 10:46











  • yes sorry,i have written wrong.I want to go to an action of a controller.

    – Barsblue
    Nov 14 '18 at 10:51











  • @Barsblue, when you call ActionLink, the action is "ConnectionIndex" and controller is "Connection" so it should render something like <a aria-expanded="false" class="dropdown-toggle" data-target="#connectionSubmenu" data-toggle="collapse" href="/Connection/ConnectionIndex">Connections</a> So what's the problem? The controller/action is there. If the link is correct perhaps you have some Javascript code messing up.

    – derloopkat
    Nov 14 '18 at 10:59














0












0








0








I am new to ASP.NET MVC so sometimes I have questions about it.This is one of them.



I have an actionlink and i want to link to an action of a controller and data-toggle transactions at the same time.



I added the code snippet below.



@Html.ActionLink("Connections", "ConnectionIndex", "Connection", null, new data_target = "#connectionSubmenu", data_toggle = "collapse", aria_expanded = "false", @class = "dropdown-toggle" )
<ul class="collapse list-unstyled main" id="connectionSubmenu">
<li></li>
<li></li>
<li></li>
</ul>


When I use the ActionLink in this way, only transaction of data-toggle runs but it doesn't link to the "view" that I give.



What can i do to manage that?Please help me.










share|improve this question
















I am new to ASP.NET MVC so sometimes I have questions about it.This is one of them.



I have an actionlink and i want to link to an action of a controller and data-toggle transactions at the same time.



I added the code snippet below.



@Html.ActionLink("Connections", "ConnectionIndex", "Connection", null, new data_target = "#connectionSubmenu", data_toggle = "collapse", aria_expanded = "false", @class = "dropdown-toggle" )
<ul class="collapse list-unstyled main" id="connectionSubmenu">
<li></li>
<li></li>
<li></li>
</ul>


When I use the ActionLink in this way, only transaction of data-toggle runs but it doesn't link to the "view" that I give.



What can i do to manage that?Please help me.







c# asp.net-mvc actionlink






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 10:50







Barsblue

















asked Nov 14 '18 at 10:09









BarsblueBarsblue

368




368












  • Could you clarify something - is your goal to make the ConnectionIndex View appear inside the ul with the id of connectionSubmenu? when the data toggle link is clicked?

    – Alistair Findlay
    Nov 14 '18 at 10:43











  • I want to make the "ul" expanded only and go to the view (ConnectionIndex) that i give at the same time.

    – Barsblue
    Nov 14 '18 at 10:46











  • ActionLink is supposed to link to an action method in a controller. It is up the action method to return the view you expect or not. May be you're barking to the wrong tree.

    – derloopkat
    Nov 14 '18 at 10:46











  • yes sorry,i have written wrong.I want to go to an action of a controller.

    – Barsblue
    Nov 14 '18 at 10:51











  • @Barsblue, when you call ActionLink, the action is "ConnectionIndex" and controller is "Connection" so it should render something like <a aria-expanded="false" class="dropdown-toggle" data-target="#connectionSubmenu" data-toggle="collapse" href="/Connection/ConnectionIndex">Connections</a> So what's the problem? The controller/action is there. If the link is correct perhaps you have some Javascript code messing up.

    – derloopkat
    Nov 14 '18 at 10:59


















  • Could you clarify something - is your goal to make the ConnectionIndex View appear inside the ul with the id of connectionSubmenu? when the data toggle link is clicked?

    – Alistair Findlay
    Nov 14 '18 at 10:43











  • I want to make the "ul" expanded only and go to the view (ConnectionIndex) that i give at the same time.

    – Barsblue
    Nov 14 '18 at 10:46











  • ActionLink is supposed to link to an action method in a controller. It is up the action method to return the view you expect or not. May be you're barking to the wrong tree.

    – derloopkat
    Nov 14 '18 at 10:46











  • yes sorry,i have written wrong.I want to go to an action of a controller.

    – Barsblue
    Nov 14 '18 at 10:51











  • @Barsblue, when you call ActionLink, the action is "ConnectionIndex" and controller is "Connection" so it should render something like <a aria-expanded="false" class="dropdown-toggle" data-target="#connectionSubmenu" data-toggle="collapse" href="/Connection/ConnectionIndex">Connections</a> So what's the problem? The controller/action is there. If the link is correct perhaps you have some Javascript code messing up.

    – derloopkat
    Nov 14 '18 at 10:59

















Could you clarify something - is your goal to make the ConnectionIndex View appear inside the ul with the id of connectionSubmenu? when the data toggle link is clicked?

– Alistair Findlay
Nov 14 '18 at 10:43





Could you clarify something - is your goal to make the ConnectionIndex View appear inside the ul with the id of connectionSubmenu? when the data toggle link is clicked?

– Alistair Findlay
Nov 14 '18 at 10:43













I want to make the "ul" expanded only and go to the view (ConnectionIndex) that i give at the same time.

– Barsblue
Nov 14 '18 at 10:46





I want to make the "ul" expanded only and go to the view (ConnectionIndex) that i give at the same time.

– Barsblue
Nov 14 '18 at 10:46













ActionLink is supposed to link to an action method in a controller. It is up the action method to return the view you expect or not. May be you're barking to the wrong tree.

– derloopkat
Nov 14 '18 at 10:46





ActionLink is supposed to link to an action method in a controller. It is up the action method to return the view you expect or not. May be you're barking to the wrong tree.

– derloopkat
Nov 14 '18 at 10:46













yes sorry,i have written wrong.I want to go to an action of a controller.

– Barsblue
Nov 14 '18 at 10:51





yes sorry,i have written wrong.I want to go to an action of a controller.

– Barsblue
Nov 14 '18 at 10:51













@Barsblue, when you call ActionLink, the action is "ConnectionIndex" and controller is "Connection" so it should render something like <a aria-expanded="false" class="dropdown-toggle" data-target="#connectionSubmenu" data-toggle="collapse" href="/Connection/ConnectionIndex">Connections</a> So what's the problem? The controller/action is there. If the link is correct perhaps you have some Javascript code messing up.

– derloopkat
Nov 14 '18 at 10:59






@Barsblue, when you call ActionLink, the action is "ConnectionIndex" and controller is "Connection" so it should render something like <a aria-expanded="false" class="dropdown-toggle" data-target="#connectionSubmenu" data-toggle="collapse" href="/Connection/ConnectionIndex">Connections</a> So what's the problem? The controller/action is there. If the link is correct perhaps you have some Javascript code messing up.

– derloopkat
Nov 14 '18 at 10:59













0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53297649%2fhow-can-i-manage-a-asp-net-mvc-actionlink-control-to-link-to-an-action-of-a-co%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53297649%2fhow-can-i-manage-a-asp-net-mvc-actionlink-control-to-link-to-an-action-of-a-co%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3

Museum of Modern and Contemporary Art of Trento and Rovereto