Text Box: Control Structure in C#
Text Box: Control Structure in C#
Text box
<Asp: textbox Run AT = “Server” id= “txt” />
Button
<Asp: button Run At = “Server” id = “btn” />
Label
<Asp: label Run At = “Server” id = “label” />
Master page:
<%@ master language = “c#” code file = “def.master.cs” inherits = “_def.” %>
Form:
Contentplaceholder:
<Asp: content placeholder Id = “cnt1” Run At = “server”>
%>
IF:
If(a>b)
Else
For:
For (starting (in it); condition; increment/decrement)
Int i=1;
Int i[]={1,2,3,4}
For (each int j in i)// j which array’s value will copy and I where it will copy
Control Lists:
1. Bullet list
2. List box
3. Check box list
4. Radio button list
5. Drop down list
These are inherits from List Control
Then
Checkbox list:
Name and id will same in check box list
Radio Button:
Multiple option single selection
IF we want to add any check box at run time that will be added
in file.aspx.cs file
By this method.
Protected void Add list () {
List Item li = new list item (“MSIT”, “3”);
List Item li = new list item (“BSIT”, “4”);
Chkl1.item.add (li)
Chkl1.item.add (li2)
OR
Response.write(“j.Value”)
OR
Response.write(“j.text”)
OR
Response.write(“j.selected”)// it will return true or false.