We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Issue with asp.net routing

Thread ID:

Created:

Updated:

Platform:

Replies:

123490 Mar 22,2016 02:17 PM UTC Mar 23,2016 09:11 PM UTC ASP.NET MVC 1
loading
Tags: General
soumya
Asked On March 22, 2016 02:17 PM UTC

The thing is that I have one account controller and in that, I have 2 methods as below and created the routes as like below in global.asax
Global.asax:-
routes.MapRoute("RouteAccountNewAccount", GlobalData.accountRoute + "/NewAccount/{language}/{email}",
              new
              {
                  controller = GlobalData.AccountControllerName,
                  action = "NewAccount"                  
              },

              new
              {
                  httpMethod = new HttpMethodConstraint("GET")
              });
            routes.MapRoute("RouteAccountNewAccountForInvalidEmail", GlobalData.accountRoute + "/NewAccountForInvalidEmail/{language}",
             new
             {
                 controller = GlobalData.AccountControllerName,
                 action = "NewAccountForInvalidEmail"
             },

             new
             {
                 httpMethod = new HttpMethodConstraint("GET")
             });

In Account controller:-

public ActionResult NewAccountForInvalidEmail(AccountViewModel model, string language)
        {
........
return View("NewAccount");
        }

public ActionResult NewAccount(AccountViewModel model, string language, string email)
        {
.......
return Json(response, JsonRequestBehavior.AllowGet);
}

It is working fine in development environment. But when we moved the same code to prod, we are facing an error as like"index.cshtml is not found".

Could you please let me know whether the order of routing in global.asax file is creating the problem?


Sasikala Nagarajan [Syncfusion]
Replied On March 23, 2016 09:11 PM UTC

Hi Soumya,

Thanks for contacting Syncfusion support,

We have checked with your query and given code example. While analyzing more with your reported issue, we suspect that the  issue may be caused due to the  “Index.cshtml” view page file is missed under the views section in an application when index file is called from that corresponding controller action result.  Please refer the below code example

public class HomeController : Controller

    {

        public ActionResult Index()

        {

            return View();

// This will search for view page (index.cshtml) under the Home folder in Views section to load in a browser, if this file is missed then the issue will arise as you reported
        }


So can you please ensure with your application whether you have added the all required cshtml  files under the view section and returned the views from controller with proper naming.
Still if you are facing any difficulties please provide more information about your sample with controller section, route map configuration details, so that we can check  in our side and provide the better solution

Please let us know if you need any further assistance,

Regards,

Sasikala Nagarajan



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;