WebForm Repeater, Address bar pass value, Response

Source: Internet
Author: User

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> &LT;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> &LT;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> &LT;TD style="<% #Eval ("Nationc")%>"><% #Eval ("Nationname")%></td> <td><% #Eval ("ClassName")%></td> </tr> </AlternatingItemTemplate> <footertemplate&gt                ; </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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.