取得URL传回来的参数,在同一个页面显示不同的面页效果
如:
ReturnUrl=1.aspx或者ReturnUrl=2.aspx
根据取得ReturnUrl的值判断,如果是1.aspx显示
<html>
<body bgcolor="#F0F0E8">
<table border="0" width="30%" cellspacing="1" height="6" align="center">
<tr>
<td width="100%" height="57">
登陆成功,请选择菜单进行操作!
</td>
</tr>
</table>
</body>
</html>
如果是2.aspx显示
<html>
<body bgcolor="#F0F0E8">
<table border="0" width="30%" cellspacing="1" height="6" align="center">
<tr>
<td width="100%" height="57">
登陆不成功!
</td>
</tr>
</table>
</body>
</html>
就是把两个网页整合成一个页面,是不是可以用Panel这个控件做?,不知道如何下手,请教!
如:
ReturnUrl=1.aspx或者ReturnUrl=2.aspx
根据取得ReturnUrl的值判断,如果是1.aspx显示
<html>
<body bgcolor="#F0F0E8">
<table border="0" width="30%" cellspacing="1" height="6" align="center">
<tr>
<td width="100%" height="57">
登陆成功,请选择菜单进行操作!
</td>
</tr>
</table>
</body>
</html>
如果是2.aspx显示
<html>
<body bgcolor="#F0F0E8">
<table border="0" width="30%" cellspacing="1" height="6" align="center">
<tr>
<td width="100%" height="57">
登陆不成功!
</td>
</tr>
</table>
</body>
</html>
就是把两个网页整合成一个页面,是不是可以用Panel这个控件做?,不知道如何下手,请教!
if(ReturnUrl == "1.aspx")
{
lblTitle.Text = "登陆成功,请选择菜单进行操作!";
}
else if(ReturnUrl == "2.aspx")
{
lblTitle.Text = "登陆不成功!"
}
<html>
<body bgcolor="#F0F0E8">
<table border="0" width="30%" cellspacing="1" height="6" align="center">
<tr>
<td width="100%" height="57">
登陆成功,请选择菜单进行操作!
</td>
</tr>
</table>
</body>
</html>
<html>
<body bgcolor="#F0F0E8">
<table border="0" width="30%" cellspacing="1" height="6" align="center">
<tr>
<td width="100%" height="57">
登陆不成功!
</td>
</tr>
</table>
</body>
</html>
<html>
<body bgcolor="#F0F0E8">
<table border="0" width="30%" cellspacing="1" height="6" align="center">
<tr>
<td width="100%" height="57">
<asp:Label id=lblTitle runat="server">
</asp:Label>
</td>
</tr>
</table>
</body>
</html>
if(ReturnUrl == "1.aspx")
{
Response.Write("<script language='javascript'>");
Response.Write("Show(1);");
Response.Write("</script>");}
else if(ReturnUrl == "2.aspx")
{
Response.Write("<script language='javascript'>");
Response.Write("Show(2);");
Response.Write("</script>");
}
js函数
function Show(n)
{
if(n==1)
{
document.table1.style.display="inline";
}
if(n==2)
{
document.table2.style.display="inline";
}
}
以前在asp时,在同一个页可以放好几个body,但是现在asp.net里不行会报错
我上面给的例子的意思是:在Login.aspx里实现如下功能
<asp:Panel id=p1>
<html>
<body bgcolor="#F0F0E8">
<table border="0" width="30%" cellspacing="1" height="6" align="center">
<tr>
<td width="100%" height="57">
登陆成功,请选择菜单进行操作!
</td>
</tr>
</table>
</body>
</html>
</asp:Panel>
<asp:Panel id=p2>
<html>
<body bgcolor="#F0F0E8">
<table border="0" width="30%" cellspacing="1" height="6" align="center">
<tr>
<td width="100%" height="57">
登陆成功,请选择菜单进行操作!
</td>
</tr>
</table>
</body>
</html>
</asp:Panel>
能不能用<asp:Panel>控件把<html></html>也包含进去?
lab控制放在login.aspx 頁面中
如果成功
lab.Text = "成功";如果失敗
lab.Text = "失敗";這樣不就行了
如下:<html>
<body bgcolor="#F0F0E8">
<table border="0" width="30%" cellspacing="1" height="6" align="center">
<tr>
<td width="100%" height="57">
<asp:Panel id=P_Setup1 Runat=server>
登陆成功,请选择菜单进行操作!</asp:Panel>
<asp:Panel id=P_Setup2 Runat=server Visible=False>登陆不成功!</asp:Panel> </td>
</tr>
</table>
</body>
</html>你在後台,用一個條件去判斷是哪一種情況
如下:
if(ReturnUrl == "1.aspx")
{
P_Setup1.Visible=true;
P_Setup2.Visible=false;
}
else if(ReturnUrl == "2.aspx")
{
P_Setup1.Visible=false;
P_Setup2.Visible=true;
}這樣可以把多個網頁整合成一個網頁!!!!