以下是我写的代码:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
File_Two filetwo = new File_Two();
int twoId = Convert.ToInt32(Request.QueryString["uid"]);
int tid = filetwo.MaxId(twoId); DataTable dt = filetwo.GetList("FThreeId='" + tid + "'").Tables[0];
string path = dt.Rows[0]["FSwfPath"].ToString();
name = path.Substring(path.LastIndexOf('/'));
}
else
{
int fid = Convert.ToInt32(Request.QueryString["ThreeIdByMenu"]);
File_Two filetwo = new File_Two();
DataTable dt = filetwo.GetList("FThreeId='" + fid + "'").Tables[0];
string path = dt.Rows[0]["FSwfPath"].ToString();
name = path.Substring(path.LastIndexOf('/'));
}
}
请问我这样写能实现么。理论上我是想,第二次重载时执行else里的语句,可是调试的时候却怎么也无法执行
else中的语句。哦,对了,这里套用了一个母版页,else中的fid是从母版页中传来的,
我想我这大概就是它的原因吧
可是,我要怎么样才能实现我想要的结果呢?
请各位大侠帮帮忙!
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
File_Two filetwo = new File_Two();
int twoId = Convert.ToInt32(Request.QueryString["uid"]);
int tid = filetwo.MaxId(twoId); DataTable dt = filetwo.GetList("FThreeId='" + tid + "'").Tables[0];
string path = dt.Rows[0]["FSwfPath"].ToString();
name = path.Substring(path.LastIndexOf('/'));
}
else
{
int fid = Convert.ToInt32(Request.QueryString["ThreeIdByMenu"]);
File_Two filetwo = new File_Two();
DataTable dt = filetwo.GetList("FThreeId='" + fid + "'").Tables[0];
string path = dt.Rows[0]["FSwfPath"].ToString();
name = path.Substring(path.LastIndexOf('/'));
}
}
请问我这样写能实现么。理论上我是想,第二次重载时执行else里的语句,可是调试的时候却怎么也无法执行
else中的语句。哦,对了,这里套用了一个母版页,else中的fid是从母版页中传来的,
我想我这大概就是它的原因吧
可是,我要怎么样才能实现我想要的结果呢?
请各位大侠帮帮忙!
Request.QueryString["ThreeIdByMenu"]母板页传值