ASP.Net/Page/Import Directives — различия между версиями

Материал из .Net Framework эксперт
Перейти к: навигация, поиск
м (1 версия)
 
м (1 версия)
 
(нет различий)

Текущая версия на 11:53, 26 мая 2010

Import Directives in a page

<%@ Page Language=VB Debug=true %>
<%@ Import Namespace="System.Web.Mail" %>
<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="System.Data.OLEDB"%>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
End Sub
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
End Sub
</script>
<HTML>
<HEAD>
<TITLE>Using the Import Directive</TITLE>
</HEAD>
<Body LEFTMARGIN="40">
<form runat="server">
<asp:label id="lblDataEntered" runat="server"
/>
<BR><BR>
Enter your Name:<BR>
<asp:textbox 
    id="txtName" 
    columns="25"
    maxlength="30"
    runat=server 
/>
<BR><BR>
<asp:button 
    id="butOK"
    text="  OK  "
    onclick="SubmitBtn_Click" 
    runat="server"
/>
</Form>
</BODY>
</HTML>



Using the Page Directive: Buffer

<%@ Page 
    Language=VB
    EnableSessionState=false 
    Debug=true 
    Buffer=true
    Explicit=true
    Strict=false
    Description="Sample Page directive page."
%>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
End Sub
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
End Sub
</script>
<HTML>
<HEAD>
<TITLE>Using the Page Directive</TITLE>
</HEAD>
<Body LEFTMARGIN="40">
<form runat="server">
<asp:label
    id="lblDataEntered" 
    runat="server"
/>
<BR><BR>
Enter your Name:<BR>
<asp:textbox 
    id="txtName" 
    columns="25"
    maxlength="30"
    runat=server 
/>
<BR><BR>
<asp:button 
    id="butOK"
    text="  OK  "
    onclick="SubmitBtn_Click" 
    runat="server"
/>
</Form>
</BODY>
</HTML>



Using the Page Directive: Debug

<%@ Page 
    Language=VB
    EnableSessionState=false 
    Debug=true 
    Buffer=true
    Explicit=true
    Strict=false
    Description="Sample Page directive page."
%>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
End Sub
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
End Sub
</script>
<HTML>
<HEAD>
<TITLE>Using the Page Directive</TITLE>
</HEAD>
<Body LEFTMARGIN="40">
<form runat="server">
<asp:label
    id="lblDataEntered" 
    runat="server"
/>
<BR><BR>
Enter your Name:<BR>
<asp:textbox 
    id="txtName" 
    columns="25"
    maxlength="30"
    runat=server 
/>
<BR><BR>
<asp:button 
    id="butOK"
    text="  OK  "
    onclick="SubmitBtn_Click" 
    runat="server"
/>
</Form>
</BODY>
</HTML>



Using the Page Directive: Description

<%@ Page 
    Language=VB
    EnableSessionState=false 
    Debug=true 
    Buffer=true
    Explicit=true
    Strict=false
    Description="Sample Page directive page."
%>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
End Sub
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
End Sub
</script>
<HTML>
<HEAD>
<TITLE>Using the Page Directive</TITLE>
</HEAD>
<Body LEFTMARGIN="40">
<form runat="server">
<asp:label
    id="lblDataEntered" 
    runat="server"
/>
<BR><BR>
Enter your Name:<BR>
<asp:textbox 
    id="txtName" 
    columns="25"
    maxlength="30"
    runat=server 
/>
<BR><BR>
<asp:button 
    id="butOK"
    text="  OK  "
    onclick="SubmitBtn_Click" 
    runat="server"
/>
</Form>
</BODY>
</HTML>



Using the Page Directive: EnableSessionState

<%@ Page 
    Language=VB
    EnableSessionState=false 
    Debug=true 
    Buffer=true
    Explicit=true
    Strict=false
    Description="Sample Page directive page."
%>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
End Sub
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
End Sub
</script>
<HTML>
<HEAD>
<TITLE>Using the Page Directive</TITLE>
</HEAD>
<Body LEFTMARGIN="40">
<form runat="server">
<asp:label
    id="lblDataEntered" 
    runat="server"
/>
<BR><BR>
Enter your Name:<BR>
<asp:textbox 
    id="txtName" 
    columns="25"
    maxlength="30"
    runat=server 
/>
<BR><BR>
<asp:button 
    id="butOK"
    text="  OK  "
    onclick="SubmitBtn_Click" 
    runat="server"
/>
</Form>
</BODY>
</HTML>



Using the Page Directive: Explicit

<%@ Page 
    Language=VB
    EnableSessionState=false 
    Debug=true 
    Buffer=true
    Explicit=true
    Strict=false
    Description="Sample Page directive page."
%>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
End Sub
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
End Sub
</script>
<HTML>
<HEAD>
<TITLE>Using the Page Directive</TITLE>
</HEAD>
<Body LEFTMARGIN="40">
<form runat="server">
<asp:label
    id="lblDataEntered" 
    runat="server"
/>
<BR><BR>
Enter your Name:<BR>
<asp:textbox 
    id="txtName" 
    columns="25"
    maxlength="30"
    runat=server 
/>
<BR><BR>
<asp:button 
    id="butOK"
    text="  OK  "
    onclick="SubmitBtn_Click" 
    runat="server"
/>
</Form>
</BODY>
</HTML>



Using the Page Directive: Language

<%@ Page 
    Language=VB
    EnableSessionState=false 
    Debug=true 
    Buffer=true
    Explicit=true
    Strict=false
    Description="Sample Page directive page."
%>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
End Sub
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
End Sub
</script>
<HTML>
<HEAD>
<TITLE>Using the Page Directive</TITLE>
</HEAD>
<Body LEFTMARGIN="40">
<form runat="server">
<asp:label
    id="lblDataEntered" 
    runat="server"
/>
<BR><BR>
Enter your Name:<BR>
<asp:textbox 
    id="txtName" 
    columns="25"
    maxlength="30"
    runat=server 
/>
<BR><BR>
<asp:button 
    id="butOK"
    text="  OK  "
    onclick="SubmitBtn_Click" 
    runat="server"
/>
</Form>
</BODY>
</HTML>



Using the Page Directive: Strict

<%@ Page 
    Language=VB
    EnableSessionState=false 
    Debug=true 
    Buffer=true
    Explicit=true
    Strict=false
    Description="Sample Page directive page."
%>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
End Sub
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
End Sub
</script>
<HTML>
<HEAD>
<TITLE>Using the Page Directive</TITLE>
</HEAD>
<Body LEFTMARGIN="40">
<form runat="server">
<asp:label
    id="lblDataEntered" 
    runat="server"
/>
<BR><BR>
Enter your Name:<BR>
<asp:textbox 
    id="txtName" 
    columns="25"
    maxlength="30"
    runat=server 
/>
<BR><BR>
<asp:button 
    id="butOK"
    text="  OK  "
    onclick="SubmitBtn_Click" 
    runat="server"
/>
</Form>
</BODY>
</HTML>