62,050
社区成员
发帖
与我相关
我的任务
分享
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["id"] != null)
{
atrilID = Convert.ToInt32(Request.QueryString["id"]);//得到文章id
article = bllArticle.GetModel(atrilID);
if (article==null) //输入的id不存在。
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert(' 错误文章ID,面页即将关闭!');this.close()", true);
}
else
{
asArticle();
}
}
else
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert(' 错误文章ID,面页即将关闭!');this.close()", true);
}
}
public int id
{
get
{
if (!string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.QueryString["id"]))
{
return int.Parse(System.Web.HttpContext.Current.Request.QueryString["id"].ToString());
}
else
{
return 0;
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
if (id>0)
{
atrilID = Convert.ToInt32(Request.QueryString["id"]);//得到文章id
article = bllArticle.GetModel(atrilID);
if (article==null) //输入的id不存在。
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert(' 错误文章ID,面页即将关闭!');this.close()", true);
}
else
{
asArticle();
}
}
else
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert(' 错误文章ID,面页即将关闭!');this.close()", true);
}
}
}
public int id
{
get
{
if (!string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.QueryString["id"]))
{
return int.Parse(System.Web.HttpContext.Current.Request.QueryString["id"].ToString());
}
else
{
return 0;
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (id>0)
{
atrilID = Convert.ToInt32(Request.QueryString["id"]);//得到文章id
article = bllArticle.GetModel(atrilID);
if (article==null) //输入的id不存在。
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert(' 错误文章ID,面页即将关闭!');this.close()", true);
}
else
{
asArticle();
}
}
else
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert(' 错误文章ID,面页即将关闭!');this.close()", true);
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
return;//加上这个
if (Request.QueryString["id"] != null)
{
atrilID = Convert.ToInt32(Request.QueryString["id"]);//得到文章id
article = bllArticle.GetModel(atrilID);
if (article==null) //输入的id不存在。
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert(' 错误文章ID,面页即将关闭!');this.close()", true);
}
else
{
asArticle();
}
}
else
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "alert(' 错误文章ID,面页即将关闭!');this.close()", true);
}
}