跳转到其它页面
//根据一个站点ID跳转到其个人平台项目页面
private void Page_Load(object sender, System.EventArgs e)
{
if(!this.IsPostBack)
{
string strId = this.Request.QueryString["id"];
if(strId != "")
{
try
{
long lId = Convert.ToInt64(strId);
Go(lId);
}
catch
{
this.Response.Redirect("Index.aspx");
}
}
else
this.Response.Redirect("Index.aspx");
}
}
private void Go(long p_lId)
{
EntryInfoF uEntryInfoF = new EntryInfoF();
EntryInfo uEntryInfo = uEntryInfoF.GetEntryInfo(p_lId.ToString());
string strDomain = uEntryInfo.Domain;
string strPath = "/Index.aspx";
if(strDomain != "")
strPath = strDomain + strPath;
else
{
strPath = uEntryInfo.Url + strPath;
}
//this.Response.Redirect(strPath);
this.GoPage(strPath);
}
private void GoPage(string p_strPagePath)
{
string strScript = "<SCRIPT language=\"JavaScript\">window.navigate(\"{0}\")</SCRIPT>";
strScript = string.Format(strScript,p_strPagePath);
this.RegisterStartupScript("GoPage",strScript);
}
//根据一个站点内的文章ID跳转到其个人平台项目中的文章详细页面
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!this.IsPostBack)
{
string strId = this.Request.QueryString["id"];
if(strId != "")
{
try
{
long lId = Convert.ToInt64(strId);
Go(lId);
}
catch
{
this.Response.Redirect("Index.aspx");
}
}
else
this.Response.Redirect("Index.aspx");
}
}
private void Go(long p_lId)
{
EntryInfoF uEntryInfoF = new EntryInfoF();
long lEntryId = uEntryInfoF.GetEntryIdByArticleId(p_lId);
EntryInfo uEntryInfo = uEntryInfoF.GetEntryInfo(lEntryId.ToString());
string strDomain = uEntryInfo.Domain;
string strPath = "/InPage/ArticleDetail.aspx?id=" + p_lId.ToString();
if(strDomain != "")
strPath = strDomain + strPath;
else
{
strPath = uEntryInfo.Url + strPath;
}
//this.Response.Redirect(strPath);
this.GoPage(strPath);
}
private void GoPage(string p_strPagePath)
{
string strScript = "<SCRIPT language=\"JavaScript\">window.navigate(\"{0}\")</SCRIPT>";
strScript = string.Format(strScript,p_strPagePath);
this.RegisterStartupScript("GoPage",strScript);
}