2.0 Fundamentals Ebook
2.0 Fundamentals Ebook
Stringlive
B.C ( Tech ) ( Hons:)
Web site : https://programmingwiki.org
Facebook : https://www.facebook.com/netprogwiki
CHAPTER 1
CHAPTER 2
CHAPTER 3
CHAPTER 4
4.1 Validators
4.2 Web User Control, Custom Control, Composite Control
CHAPTER 5
5.1 State Management Technologies
CHAPTER 6
6.1 ADO.Net
CHAPTER 1
1.1 .Net Framework
- C# ၏ "C sharp"
- C# Programmer Application Microsoft ၏
Programming Language
- C#.Net
Visual Studio VS.Net 2002 VS.Net 2003 VS.Net 2005 VS.Net 2005 VS.Net 2008
Framework Netfx v1.0 Netfx v1.1 Netfx v2.0 Netfx v3.0 Netfx v3.5
Engine ( CLR ) CLR v1.0 CLR v1.1 CLR v2.0 Same version Same version
1.5 Client Server Architecture
Window Application
Web Application
Web Service
Console Application
Mobile Application
Asp.Net Application Asp.Net Page
Pre_init ( Initialize )
Init ( Page Initialize )
InitComplete ( Page Initialize )
Pre_Load ( Page Load )
Load (Page Load )
LoadComplete ( Page Load )
PreRender ( Page processing )
RenderComplete ( Page processing )
Unload ( Page )
1.9 Asp.Net File Types
.aspx
.aspx Web page ၏ Design
.cs
.cs code-behind module Design ၏
C# Language File extension
C# Language ( pagename.aspx.cs )
VB Language ( pagename.aspx.vb )
.ascx
User controls File extension
.asmx
Web services File extension
.resx
Resources File extension
Application Develop Resource File
Global resource Local Resource Resource
Global.asax
Application Session ၏
Web.config
Application ၏ Web.config
Database web.config
CHAPTER 2
Label lbl
TextBox txt
ListBox lst
Image img
Adrotator adr
CheckBox chk
Calendar cld
LinkButton lnkbut
ImageButton imgbut
HyperLink hylnk
Panel pnl
RadioButtonList rbutlst
User Name TextBox Control
DropDownList Control
<asp:DropDownList ID=”ddlUser” runat=”server “ > < /asp:DropDownList >
(Ctrl+Shift+F9)
CHAPTER 3
MyVariable D “H W ” string
MyVariable
string MyVariable = "Hello World!";
3.3 Constructor
Function Name Class Name return type Constructor
Constructor
1. Default Constructor
2. Argument Constructor
}
}
}
}
3.4 Method and Parameters
Parameters Method
protected void Page_Load(object sender,EventArgs e)
{
SetPageTitle();
}
void SetPageTitle()
{
this.Page.Title= “ Test Page”;
}
Parameters Method
private int AddNumbers ( int A , int B)
{
return A + B ;
}
3.5 Operators
Operators
Primary x++ x-- x++ x ၁
x-- x ၁
Unary ++x --x ++ x x ၁
--x x ၁
Multiplicative * / % * / %
Additive + - + -
Equality = = != ==( ) != ( )
Conditional AND &&
Conditional OR ||
Conditional c?x:y c x y
Assignment = += -= *= /= Assign
3.6 Function and Variable Scope
Declared Meaning
Public Class
Private Class
int A = 10;
double dblA;
dblA = (double)A;
int intA;
string strA = "10";
// Convert the string "10" to the numeric value 10.
intA = Int32.Parse( strA ) ;
3.8 Statements
3.9 Loops
Statements Loops “C# Programming Fundamentals”
EBook
CHAPTER 4
4.1 Validators
1. Require Field Validator
2. Range Validator
3. Regular Expression Validator
4. Compare Validator
5. Custom Validator
6. Validation Summary
2.Range Validator
User Data
1 to 110
Range Validator ၏ Properties
- ControlToValidate
- ErrorMessage
- Minimum
- Maximum
- Type
- Text
- Operator
5.Custom Validator
Validator Control
Custom Validator ၏ Properties
- ControlToValidate
- ErrorMessage
- ClientValidationFunction
- Text
Event
- ServerValidate
6.Validation Summary
Validation ErrorMessage
Custom Controls
----------------------
1 . Project Class Library
2. .cs
3 . DLL Visual Studio 2005/2008 ၏ ToolBox
4. Asp.Net Control
Composite Controls
--------------------------
Custom Control Asp.net Controls
1 . Project Class Library
2. .cs
3 . DLL Visual Studio 2005/2008 ၏ ToolBox
4. Asp.Net Control
CHAPTER 5
5.1 State Management Technologies
6.1 ADO.Net
Connected Approach
- Connection Database
- Command Database Connection Object
Command
ExecuteNonQuery( )
Return Value
INSERT, UPDATE, or DELETE
ExecuteReader( )
Database Query Result Set
DataReader object
SELECT
ExecuteXMLReader( )
XML File
ExecuteScalar( )
Database query Single value