当前位置 >> 测试练习 >> 章节练习 >> 第6章 课后练习    

章节练习

    第6章 课后练习     

   1. 解释代码:请解释下述代码的含义。
LoginEx.aspx :
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
&nbsp;</div>
</form>
</body>
</html>
--------
LoginEx.vb :

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate

End Sub
End Class

   2. 解释代码:请解释下述代码的含义。
MenuEx.aspx :
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Menu ID="Menu1" runat="server" BackColor="#F7F6F3" DynamicHorizontalOffset="2"
Font-Names="Verdana" Font-Size="0.8em" ForeColor="#7C6F57" Orientation="Horizontal"
StaticSubMenuIndent="10px">
<StaticSelectedStyle BackColor="#5D7B9D" />
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
<DynamicMenuStyle BackColor="#F7F6F3" />
<DynamicSelectedStyle BackColor="#5D7B9D" />
<DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
<Items>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="主页" Value="主页"></asp:MenuItem>
<asp:MenuItem Text="个人信息" Value="个人信息"></asp:MenuItem>
<asp:MenuItem Text="相册" Value="相册">
<asp:MenuItem Text="管理相册" Value="管理相册"></asp:MenuItem>
<asp:MenuItem Text="上传文件" Value="上传文件"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="博客" Value="博客"></asp:MenuItem>
<asp:MenuItem Text="链接" Value="链接"></asp:MenuItem>
</Items>
</asp:Menu>

</div>
</form>
</body>
</html>
--------
MenuEx.vb :

Partial Class _Default
Inherits System.Web.UI.Page

End Class


                     
参考答案