intro2.aspx.cs (without using code render blocks)
using System;
namespace WebApplication1 {
public partial class WebForm1 : System.Web.UI.Page {
protected void Page_Load( object sender, EventArgs e ) {
}
protected void Lookup_Click( object sender, EventArgs e ) {
for ( int i = 0; i < 8; i++ )
Result.Text += "<font size='" + i.ToString( ) +
"'>Welcome to ASP.NET</font>";
}
}
} |
intro2.aspx (using code render blocks)
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="intro1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
<!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" >
<body><center>
<form ID="form1" runat="server">
<h3>Name: <asp:TextBox ID="Name" runat="server">
Category:
<asp:DropDownList ID="Category" runat="server">
<asp:ListItem Selected="True">psychology</asp:ListItem>
<asp:ListItem>business</asp:ListItem>
<asp:ListItem>popular_comp</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Lookup" Text="Lookup"
OnClick="Lookup_Click" runat="server" />
<p>
<% for ( int i = 0; i < 8; i++ ) { %>
<font size="<% =i %>">Welcome to ASP.NET</font>
<% } %>
</p>
</h3>
</form>
</center></body>
</html> |
|
Web
|