Click here to Skip to main content
15,665,942 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello i am creating a website using mvc2 c#,in that i have created a menu.Now i want to connect it with view .how to connect it by passing it to the controller.
<td class="style2" valign="top">
             <table style="width: 100%; height: 100%">
                     <td class="style4" valign="top">
                         <div class="urbangreymenu">
                             <h3  runat="server" id="a4" class="headerbar">
                                 <li  runat="server" id="a1"><a href="">My Accounts</a></li>
                                 <li  runat="server" id="a3"><a href="#">My System Settings</a></li>
                             <h3  runat="server" id="a5" class="headerbar">
                                 Control Panel</h3>
                                 <li  runat="server" id="a6"><a href="../Admin/Index.aspx">Student Management</a></li>
                                 <li  runat="server" id="a7"><a href="#">Tutor Management</a></li>

I have tried with conventional menu linking but its not worth for this mvc framework.So i just googled it ,most of them says about dynamic menu update and all ..its also not in an understandable form.So how i implement this?
Zoltán Zörgő 31-Oct-13 14:40pm    
The key sentence:
"Now i want to connect it with view .how to connect it by passing it to the controller."
makes no sense. Please clarify!

PS: forget MVC2... use MVC4
Member 10370658 31-Oct-13 14:44pm    
When we click a menu Say "Dashboard" it will show the dashboard page.For that we can use href="dashboard.aspx" .like this how we use it in mvc?How the controller will handle the request

1 solution

As I see, you are really at the beginning. MVC is not WebForms.
I suggest you start a tutorial. The official ones are really good:[^]. I also suggest you simply open the template in Visual Studio and study the generated code too.

Please note, that the answer to your question is dependent on the rest of the ASP.NET MVC platform, thus it won't help you on it's own. But here you have it: use Html.ActionLink[^] method in the view. It will make the correct link to the action in the controller, taking into account the routing you have used in your application.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900