Asp.net 3.5 は、仮想ディレクトリでホストされている7 NHibernet www.sample.com ウェブサイトをIISASP.NET MVC 2.0 IIS 7.0と404エラー
その「/サンプル/ホーム/インデックスのようなURLを生成/ホーム/インデックスも 『
「代わりに』、アプリケーションは上記のURLに取り組んでいるが、私はcasecadeのdropdwonlistのような任意のAjaxのデータを呼び出すときに、私は404
アクションが正常に動作しているが、私が戻るときにのみ返しますJson(データ)が返す404. 私はwiを試しました
コード
[HttpPost]
public ActionResult GetSubCategories2(int id)
{
var data = from subCat in CategoryService.GetChildByParentCategory(
CategoryService.GetCategoryByID(id))
select new { Value = subCat.ID, Text = subCat.CategoryName };
return Json(data);
}
をGETとPOSTの両方番目の私はすべてのもの上記以外の1つのセキュリティフィルタ&エラーハンドラ
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method
, Inherited = true, AllowMultiple = false)]
public class HandelRecordNotFound : HandleErrorAttribute
{
public override void OnException(ExceptionContext filterContext)
{
if (filterContext.Exception.Message.IndexOf("No row with the given identifier exists") > -1)
{
//filterContext.HttpContext.Response.Redirect("~/Admin/InvalidRequestOrRecordNotFound");
filterContext.Result = new RedirectResult("~/Admin/InvalidRequestOrRecordNotFound");
filterContext.ExceptionHandled = true;
}
if (filterContext.Exception.Message.IndexOf("The DELETE statement conflicted") > -1)
{
//filterContext.HttpContext.Response.Redirect("~/Admin/InvalidRequestOrRecordNotFound");
filterContext.Result = new RedirectResult("~/Admin/InvalidRequestOrRecordNotFound");
filterContext.ExceptionHandled = true;
}
//filterContext.Exception.Message
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method
, Inherited = true, AllowMultiple = false)]
public class AdminAuthorization : AuthorizeAttribute
{
protected override bool AuthorizeCore(HttpContextBase httpContext)
{
base.AuthorizeCore(httpContext);
object userTypeObject = httpContext.Session["UserType"];
if (userTypeObject == null ||
(UserTypes)Enum.ToObject(typeof(UserTypes), userTypeObject) != UserTypes.Administrator)
{
return false;
}
return true;
}
}
が正常である持っています。
んが、私のクライアントのメインウェブサイトは、ルート上で実行されていません。私は通常、 "http://client.wayzsoft.com"のようなサブドメインとして私自身のドメインで私の仕事を実演しています。私は生成されたURLに "wayzsoft"や "client"が見つかりませんでした。私も思うように、サブドメインさえも仮想ディレクトリとしてホストされています。私はActionResultとコンテンツではないJsonResultとの問題を持っています –