WebForm Repeater: Repetition device

Source: Internet
Author: User
Tags repetition

The morning did not learn new content, do register interface, with JS write verification

<script type= "Text/javascript" >
Window.onload = function () {
document.getElementById ("Button1"). onclick = function () {
User name validation starts
var unameok = true;
var ouname = document.getElementById ("Username_textbox"). Value;
if (Ouname = = "") {
document.getElementById ("Usererror_label"). InnerHTML = "User name cannot be empty";
Unameok = false;
}
else {
document.getElementById ("Usererror_label"). InnerHTML = "";
Unameok = true;
}
End of user name verification

Password verification starts, password two times is consistent
var Pwdok = true;
var oPwd1 = document.getElementById ("Pwd1_textbox"). Value;
var oPwd2 = document.getElementById ("Pwd2_textbox"). Value;
if (oPwd1! = oPwd2) {
document.getElementById ("Pwderror_label"). InnerHTML = "two times password inconsistent!" ";
Pwdok = false;
}
else {
document.getElementById ("Pwderror_label"). InnerHTML = "";
Pwdok = true;
}

End of password verification


if (Unameok = = False | | pwdok = = FALSE) {
return false;
}
};
};
</script>

Afternoon study of the repeater: the repetition, there are five major templates

1.HeaderTemplate-Header template content is displayed at the beginning

2.ItemTemplate-How many bars of data are displayed for the item template

3.FooterTemplate-The content of the foot template is displayed at the end

4.AlternatingItemTemplate-Alternating item template with ItemTemplate

-----------------------------------------------

Data binding

List<users> Li =new usersdata (). Select ();

Repeater1.datasource=li;
Repeater1.databind ();

Data content Display

Page data Display location: <% #Eval ("property name")%>

1. Display final data

Field extension

2. Marker color Display

Encapsulate Fields

public string Red

{

get{

If (age>16)

{return '

}

Else{return "";}

}

}

Style= "<% #Eval (" Red ")%>"

3:
The light bar effect, and retains the original color.

Mouse move out when the mouse to assign the color before the move!

<script type= "Text/javascript" >
var oitems = document.getelementsbyclassname ("Tr_item");
for (var i = 0; i < oitems.length; i++)
{
var oldcolor = "";
Oitems[i].onmouseover = function ()

{
Oldcolor = This.style.backgroundColor;
This.style.backgroundColor = "Yellow";
};

Oitems[i].onmouseout = function ()

{
This.style.backgroundColor = Oldcolor;

};
}

WebForm Repeater: Repetition device

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.