using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Security;
using System.Security.Principal;
namespace omg
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
jamneh94479
0 Points
14 Posts
mvc web.config
Jan 22, 2013 05:58 AM|LINK
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Security;
using System.Security.Principal;
namespace omg
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"UpcomingProducts",
"products/Page={page}",
new { controller = "products", action = "Index" }
);
routes.MapRoute(
"MBGridNext",
"Marangburu/{action}/Page={page}",
new { controller = "Marangburu", action = "Index" });
routes.MapRoute(
"ListBrowse",
"products/Browse/Click_Category={Click_Category}_Click_MCategory={Click_MCategory}_Page={page}",
new { controller = "products", action = "Browse", Click_Category = "", Click_MCategory = "" });
routes.MapRoute(
"MyNext",
"products/My={page}",
new { controller="products", action="My"});
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "products", action = "Index", id = "" } // Parameter defaults
);
routes.MapRoute(
"Marangburu",
"{Marangburu}/{action}/{id}",
new { controller = "Marangburu", action = "i" }
);
routes.MapRoute(
"OpenIdDiscover",
"Auth/Discover");
}
public override void Init()
{
this.AuthenticateRequest+=new EventHandler(MvcApplication_AuthenticateRequest);
this.PostAuthenticateRequest+=new EventHandler(MvcApplication_PostAuthenticateRequest);
base.Init();
}
protected void Application_Start()
{
RegisterRoutes(RouteTable.Routes);
}
void MvcApplication_PostAuthenticateRequest(object sender, EventArgs e)
{
HttpCookie authCookie = HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName];
if (authCookie != null)
{
string encTicket = authCookie.Value;
if (!String.IsNullOrEmpty(encTicket))
{
FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(encTicket);
OfferOceanIdentity id = new OfferOceanIdentity(ticket);
GenericPrincipal prin = new GenericPrincipal(id, null);
HttpContext.Current.User = prin;
}
}
}
void MvcApplication_AuthenticateRequest(object sender, EventArgs e)
{
}
}
}
this is routing rule, when hosted a site: but site give any error
Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.
and yes i am using ajax, javascript..
can someone please tell me where i am going wrong
pon_prabhu
Participant
828 Points
185 Posts
Re: mvc web.config
Jan 22, 2013 06:53 AM|LINK
http://forums.asp.net/t/1829195.aspx/1
jamneh94479
0 Points
14 Posts
Re: mvc web.config
Jan 22, 2013 08:12 AM|LINK
i didn,t get it, may you please be specific.. what to do?
goel.ankit
Contributor
2531 Points
513 Posts
Re: mvc web.config
Jan 22, 2013 08:25 AM|LINK
It may happen if there is infinite loop in your redirection. You would need to debug the code to find out if there is any looping happening.
One thing I would do in your routes is Move the default route at the end.
Please provide the URL which is falling.
Ankit
(Please select 'Mark as Answer' if my response has helped you.)
jamneh94479
0 Points
14 Posts
Re: mvc web.config
Jan 23, 2013 12:13 PM|LINK
I resolve this issue, by using another jquery library..but now i have new issue..url-->offerocean.com,
please help