When you are building a Windows-like Program When using the top menu frame, you may use two frames in Asp.net. One frame is used for serving a single frame on the top and the other is used for clicking the menu to open the page below. the page implementation is very simple. When you run a single task, you will find that the frame where you put the menu blocks the following menu and cannot reach the frame below. to solve the blocking problem, frame cannot be used. By placing a menu and an IFRAME in a separate Asp.net page, the drop-down menu will not be blocked at this point, there is another new problem, that is, the height of the IFRAME. If it is forced to die, it is unacceptable. if yes? The solution is to use JavaScript to control the IFRAME height in the onload and onsized events of the body. Code Solve the problem above.
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "default5.aspx. cs" inherits = "default5" %>
<HTML>
<Head runat = "server">
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> No title page </title>
<Script language = "JavaScript" type = "text/JavaScript">
Function AAAAA ()
{
Document. getelementbyid ('f1'). Height = Document. Body. clientHeight-80;
}
</SCRIPT>
</Head>
<Body Onload = "AAAAA ()" onresize = "AAAAA ()" scroll = "no" Style = "margin: 0">
<Form ID = "form1" runat = "server">
<Table>
<Tr>
<TD Height = "80">
<Asp: menu id = "menu1" runat = "server" orientation = "horizontal" backcolor = "# e3eaeb"
Dynamichorizontaloffset = "2" font-names = "verdana" font-size = "0.8em" forecolor = "#666666"
Staticsubmenuindent = "10px">
<Staticselectedstyle backcolor = "#1c5e55"/>
<Staticmenuitemstyle horizontalpadding = "5px" verticalpadding = "2px"/>
<Dynamichoverstyle backcolor = "#666666" forecolor = "white"/>
<Dynamicmenustyle backcolor = "# e3eaeb"/>
<Dynamicselectedstyle backcolor = "#1c5e55"/>
<Dynamicmenuitemstyle horizontalpadding = "5px" verticalpadding = "2px"/>
<Statichoverstyle backcolor = "#666666" forecolor = "white"/>
<Items>
<Asp: menuitem text = "new item 1" value = "new item 1">
<Asp: menuitem text = "new item" value = "new item"> </ASP: menuitem>
<Asp: menuitem text = "new item" value = "new item"> </ASP: menuitem>
<Asp: menuitem text = "new item" value = "new item"> </ASP: menuitem>
<Asp: menuitem text = "new item" value = "new item"> </ASP: menuitem>
<Asp: menuitem text = "new item" value = "new item"> </ASP: menuitem>
<Asp: menuitem text = "new item" value = "new item"> </ASP: menuitem>
<Asp: menuitem text = "new item" value = "new item"> </ASP: menuitem>
<Asp: menuitem text = "new item" value = "new item">
<Asp: menuitem text = "new item" value = "new item"> </ASP: menuitem>
</ASP: menuitem>
<Asp: menuitem text = "new item" value = "new item"> </ASP: menuitem>
<Asp: menuitem text = "new item" value = "new item"> </ASP: menuitem>
<Asp: menuitem text = "new item" value = "new item"> </ASP: menuitem>
<Asp: menuitem text = "new item" value = "new item"> </ASP: menuitem>
<Asp: menuitem text = "new item" value = "new item"> </ASP: menuitem>
<Asp: menuitem text = "new item" value = "new item"> </ASP: menuitem>
</ASP: menuitem>
<Asp: menuitem text = "new item 2" value = "new item 2"> </ASP: menuitem>
<Asp: menuitem text = "new item 3" value = "new item 3"> </ASP: menuitem>
</Items>
</ASP: menu>
</TD>
</Tr>
</Table>
<IFRAME id = "f1" scrolling = "Auto" width = "100%" Height = "200" src = "htmlpage5.htm"> </iframe>
</Form>
</Body>
</Html>