Session
Each computer to access the server, there are independent session,key values are the same, the content is different.
1.session is saved on the server.
2.session has no durability, the save cycle is 20 minutes.
Focus: Session do not abuse, do not use, misuse will cause server overflow, do not cause waste of resources.
Assign value: session["key" = value;
Value: String a = session["key"];
Clear: session["key"]=null;
Application
application["Key" is all users get the same value in this key, no save cycle, he will always be saved, usually as a version number
Assign value: application["key"]= value;
Value: Application.get ("key");
command action for repeater:
- ItemCommand Event--all controls that can trigger events in Repeater will trigger this event
- commandname--judge what button is clicked, E.commandname
- commandargument--the primary key value data that is passed by the triggering event, place the face boundary face value binding with the single quote E.
- ItemCreated-This event is executed once the HTML code is generated in the item template
- ItemDataBound-Item Template performs this event once after data is bound
Example:
<ItemTemplate>
<tr class= "Tr_item" style= <% #Eval ("Blue")%> ">
<td><% #Eval (" UserName ")%></td>
<td><% #Eval (" Password ")%></td>
<td><% #Eval (" Nickname ")%></td>
<td><% #Eval (" Sexname ")%></td>
<td><% #Eval (" Birthdayn ")%></td>
<td><% #Eval (" Age ")%></td>
<td><% #Eval (" Nationname ")%></td>
<td><asp:button id=" Button1 "runat=" server "text=" delete "Commandname=" Delete "commandargument= ' <% #Eval (" UserName ")%> '/> <asp:button id= ' Button2 ' runat= '
server ' text= ' Modify the "commandname=" Xiugai "commandname=" delete "commandargument= ' <% #Eval (" UserName ")%> '/>
</td>
</tr>
</ItemTemplate>
Background code:
if (E.commandname = = "Delete")//delete button
{
new Userda (). Delete (e.commandargument.tostring ());
Repeater1.datasource = new Userda (). Select ();
Repeater1.databind ();
}
if (E.commandname = = "Xiugai")
{
new Userda (). Select (E.commandargument.tostring ());
Repeater1.datasource = new Userda (). Select ();
Repeater1.databind ();
}
Through this article, I hope to help you understand this part of the knowledge, thank you for your support to this site!