Repeater: repeat Device
<HeaderTemplate></HeaderTemplate> -Header Template: When the loop starts, its contents are printed only once
<ItemTemplate></ItemTemplate> -item Template: Repeat to print its contents
<AlternatingItemTemplate></AlternatingItemTemplate> -Alternating templates: Alternate printing with item templates
<FooterTemplate></FooterTemplate> -foot template: At the end of the loop, its contents will only be printed once
<%@ Page language="C #"autoeventwireup="true"codefile="Default.aspx.cs"inherits="_default"%><! DOCTYPE html>"http://www.w3.org/1999/xhtml">"Server"> <meta http-equiv="Content-type"Content="text/html; Charset=utf-8"/> <title></title> <style type="Text/css">#tab1 {width: -%; Text-Align:center; Background-color:#808080; } #t-Head {color:white; Font-Weight:bold; } #t-Item {Background-color: #d773fa; } #t-Item:hover {background-color:red; } #t-item1 {background-color: #69f79c; } #t-Item1:hover {background-color:red; } </style>"Form1"runat="Server"> <asp:repeater id="Repeater1"runat="Server"> <HeaderTemplate> <table id="TAB1"> <tr id="T-head"> <td> numbering </td> <td> user name </td> <td> password </td> <td> nickname </td> <td> sex </td> <td> Birthdays </td> <td> nationalities </td> <TD&G t; classes </td> </tr> </HeaderTemplate> <ItemTemplate> <tr id="T-item"> <td><% #Eval ("Ids")%></td> <td><% #Eval ("UserName")%></td> <td><% #Eval ("Pass")%></td> <td><% #Eval ("Nickname")%></td> <td><% #Eval ("Sexstr")%></td> <td><% #Eval ("Birthday","{0:yyyy mm month DD Day}")%></td> <TD style="<% #Eval ("Nationc")%>"><% #Eval ("Nationname")%></td> <td><% #Eval ("ClassName")%></td> </tr> </ItemTemplate> <AlternatingItemTemplate> <tr id="t-item1"> <td><% #Eval ("Ids")%></td> <td><% #Eval ("UserName")%></td> <td><% #Eval ("Pass")%></td> <td><% #Eval ("Nickname")%></td> <td><% #Eval ("Sexstr")%></td> <td><% #Eval ("Birthday","{0:yyyy mm month DD Day}")%></td> <TD style="<% #Eval ("Nationc")%>"><% #Eval ("Nationname")%></td> <td><% #Eval ("ClassName")%></td> </tr> </AlternatingItemTemplate> <footertemplate> ; </table> </FooterTemplate> </asp:Repeater> </form></body>Previous paragraph Public Partial class _default:system.web.ui.page{ protectedvoid Page_Load (object sender, EventArgs e) { new UserData (). Select (); Repeater1.databind (); }}
Backstage Request-Gets the requested object
A value specifically used to pass over
request["Key"]
1. Get the value passed by the address bar get
2, get the table only son passed the parameter value post
Example: TextBox1.Text = request["abc"];
Hello, http://localhost:1806/Default.aspx?abc=2017.
Note:& Pass multiple values
QueryString -Get Submit method/Address bar Pass Value
After the address bar? key=value&key=value
Advantages: No memory consumption, fast, can pass multiple values
Cons: Poor security
reponse - Response Request Object
Reponse.redirect ("Address")-page redirection, only open other pages on this page (print text at the top of the page)
Reponse.white ("JS code")-Print, if string text is displayed at the top (pop-up window)
WebForm Repeater, Address bar pass value, Response