日期:2014-05-20  浏览次数:20385 次

使用session验证,如何返回要进入的页面?
1、
我有三个页面a.aspx;b.aspx,c.aspx
其中a.aspx中包含一个iframe:d.aspx;

我欲在a中的d(iframe)中点击一个连接进入b.
进入b页面时Page_Load中验证是否具有权限,无权限则需要经过c的验证后才能进入.
在c中我使用了session验证,验证通过后,使用Response.Redirect(Request.ServerVariables[ "HTTP_REFERER "])在返回;可是返回后得到的页面却是只有一个d页面的窗口.   无法返回我想要的b页面.
请问高手们这个Response.Redirect()应该怎么写?

2、
关于排版的问题:

<td   width=500>
        <asp:label   id= "content "> </asp:label>
</td>

我欲把content整体在td中居中,且只当td的90%的width,content中显示的文件要向左靠齐.如果:
<td   width=500   align=center>
          <asp:label   id= "content "   width=450> </asp:label>
</td>
则content中的内容都居中了.
如果:
<td   width=500   align=center>  
        <div   align=left>  
                  <asp:label   id= "content "   width=450> </asp:label>
        </div>  
</td>
则content中的内容是向靠左,可是content整体在td中也都靠左了,没有达到我想要的居中效果.
很迷惑,td   中的align和div中的align到底如何控制内容的排版?td的排版应该是控制div排版,而不会控制到content中的内容,content中的内容排版由div   的align控制,难道不是这样吗?????

谢谢大家



------解决方案--------------------
这样配置:
<authentication mode= "Forms ">
<forms name= ".ASPXUSERDEMO " loginUrl= "Login.aspx " protection= "All " timeout= "30 "/>
</authentication>
<authorization>
<deny users= "? "/>
</authorization>

public void Button_click(object sender, System.EventArgs e)
{
if( txtUserName == "King " && txtPsd == "123 ")
{
//query.aspx)
Web.Security.FormsAuthentication.RedirectFromLoginPage(txtUserName, true);
}
else
{
Response.Redirect( "Login.aspx ") "
}
}

------解决方案--------------------
1、c.aspx?url=b.aspx

2、 <table align=center> <tr> <td align=center> </td> </tr> </table>