mirahsani
سه شنبه 02 آبان 1391, 16:18 عصر
با سلام
من تو سایتم از ایلیاس استفاده می کنم. داخل لوکال هاست کاملا درست اجرا میشه. ولی تو سرور که اجرا می کنم ارور 404 می گیرم. این هم کدی که نوشتم:
dakhele golobal.asax:
protectedvoid Application_BeginRequest(object sender, EventArgs e)
{
string fullOrigionalpath = Request.Url.ToString();
{
int index = fullOrigionalpath.IndexOf("/", 8);
string st = fullOrigionalpath.Remove(0, index + 1);
try
{
string URL = DataLayer.Alias.SelectURLfromAlias(st.Replace("-", " ")).Tables[0].Rows[0]["URL"].ToString();
Context.RewritePath("/"+URL);
}
catch { }
}
}
من تو سایتم از ایلیاس استفاده می کنم. داخل لوکال هاست کاملا درست اجرا میشه. ولی تو سرور که اجرا می کنم ارور 404 می گیرم. این هم کدی که نوشتم:
dakhele golobal.asax:
protectedvoid Application_BeginRequest(object sender, EventArgs e)
{
string fullOrigionalpath = Request.Url.ToString();
{
int index = fullOrigionalpath.IndexOf("/", 8);
string st = fullOrigionalpath.Remove(0, index + 1);
try
{
string URL = DataLayer.Alias.SelectURLfromAlias(st.Replace("-", " ")).Tables[0].Rows[0]["URL"].ToString();
Context.RewritePath("/"+URL);
}
catch { }
}
}