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