This is a migrated thread and some comments may be shown as answers.

[Solved] Custom Route on Menu

0 Answers 45 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Vijay
Top achievements
Rank 1
Vijay asked on 13 Apr 2011, 09:39 PM
Hi

I am using the following menu and its giving error object reference is not to instance of object.  Basically I have to use ASP.NET Webforms for reporting(SSRS Reporting Viewer) purpose and ASP.NET MVC side by side.  In the Global.asax file i have mentioned the following Routes.  on the menu control i have added Route("ReportRoute") for the run reports menu.  When i Click RunReport i have to redirects to RunReports.aspx page on the CommonReports Folder.  Can you please look into this and let us the know solutions


 routes.MapPageRoute(
             "ReportRoute",                         // Route name
             "ReportRoute/{reportname}",                // URL
             "~/CommonReports/{reportname}.aspx"   // File
             );

routes.MapRoute(
                "Default",                          // Route name
                "{controller}/{action}/{id}",       // URL with parameters
                new
                {
                    controller = "Home",
                    action = "Index",
                    id = UrlParameter.Optional
                }                                   // Parameter defaults
            );

@Html.Telerik().Menu().Name("MyMenu").Items(items =>
                                        {
                                            items.Add().Text("Home").Url("/Home");
                                            items.Add().Text("Lease Administration").Items
                                                (sub1 =>
                                                    {
                                                        sub1.Add().Text("Import Landlord Info").Url("/Lease/ImportLandlord");
                                                        sub1.Add().Text("Maintain Lease").Url("/Lease/MaintainLease");
                                                        sub1.Add().Text("Landlord Reports").Url("/Lease/ImportLandlord");
                                                        sub1.Add().Text("Utility Reports").Url("/Lease/MaintainLease");
                                                    }
                                                );
                                            items.Add().Text("Lease Accounting").Items
                                                (sub1 =>
                                                {
                                                    sub1.Add().Text("Acccounting Details").Url("/Lease/MaintainLease");
                                                    sub1.Add().Text("Reports").Url("/Lease/MaintainLease");
                                                    sub1.Add().Text("Journal Entries").Url("/Lease/MaintainLease");
                                                    sub1.Add().Text("Reconciliation").Url("/Lease/MaintainLease");
                                                }
                                                );
                                           
                                            items.Add().Text("Reporting").Items
                                               (sub1 =>
                                               {
                                                   sub1.Add().Text("Report Dashboard").Url("/Dashboard/");
                                                   sub1.Add().Text("Run Reports").Url("/RunReport/").Route("ReportRoute");
                                               }
                                               );
                                            items.Add().Text("Contact Us").Url("/Home/ContactUs");
                                        }
                                        )
Tags
Menu
Asked by
Vijay
Top achievements
Rank 1
Share this question
or