SlideShare a Scribd company logo
.Net training In gandhinagar 
12/17/14 http://shreedhoon.com/training/aspNetTraining.php 
1 
.
C#/.NET 
Basics 2 
.net training in gandhinagar 
Some code is from “C# in a 
Nutshell” and “Programming C#” 
http://shreedhoon.com/training/aspNetTraining.php 2 
12/17/14
This week 
• Event Handling and delegates 
• ASP.NET Web Forms 
• ASP.NET Web Services 
http://shreedhoon.com/training/aspNetTraining.php 3 
12/17/14
Event Handling Model 
• Delegates listen for the events and call 
registered handlers 
• Each component has a delegate for every 
event it can raise 
• We register a method with the delegate 
and the delegate will call the method 
asynchronously 
http://shreedhoon.com/training/aspNetTraining.php 4 
12/17/14
Delegates (1) 
• A Button, for example, needs to notify 
some object when it is pushed 
• We don’t want to hardwire (in the button) 
which object to call 
• A delegate is a reference type used to 
encapsulate a method with particular 
parameter types 
http://shreedhoon.com/training/aspNetTraining.php 5 
12/17/14
Delegate (2) 
using System; 
delegate String Foo(String x); // create a delegate class 
class Test { 
public static void Main() { 
Foo f = new Foo(ConvertToUpperCase); // create a delegate 
object 
String answer = f("abcd"); // call the method in the 
// object 
Console.WriteLine(answer); 
} 
public static String ConvertToUpperCase(String s) { 
return s.ToUpper(); 
http://shreedhoon.com/training/aspNetTraining.php 6 
} 
}12/17/14
Delegate (3) 
public class Form1 : System.Windows.Forms.Form { 
private System.Windows.Forms.Button multiplyButton; 
public void foo() { 
this.multiplyButton = new System.Windows.Forms.Button(); 
this.multiplyButton.Text = "Multiply"; 
this.multiplyButton.Click += 
new System.EventHandler(this.multiplyButton_Click); 
} 
private void multiplyButton_Click(object sender, System.EventArgs e) 
http://shreedhoon.com/training/aspNetTraining.php 7 
{ 
textBox3.Clear(); 
string op1Str = op1.Text; 
string op2Str = op2.Text; 
: 
} 
Delegate reference 
Delegate 
Encapsulated 
method 
12/17/14
Multicast Delegate 
using System; // From C# In A Nutshell 
delegate void MethodInvoker(); // define delegate class 
class Test { 
static void Main() { // create a Test object 
// and call its constructor 
new Test(); 
} 
http://shreedhoon.com/training/aspNetTraining.php 8 
12/17/14
http://shreedhoon.com/training/aspNetTraining.php 9 
Test() { 
MethodInvoker m = null; 
m += new MethodInvoker(Foo); // overloaded += 
m += new MethodInvoker(Goo); // delegate holds 
m(); // pointers to two 
} // methods 
m 
MethodInvoker 
void Foo() 
void Goo() 
12/17/14
http://shreedhoon.com/training/aspNetTraining.php 10 
void Foo() { 
Console.WriteLine("Foo"); 
} 
void Goo() { 
Console.WriteLine("Goo"); 
} 
} 
Output: 
Foo 
Goo 
12/17/14
ASP.NET Web Forms (1) 
• Web Forms bring rapid appplication 
development to the web 
• Similar technology is available on J2EE 
platforms (struts, Java Server Faces) 
• Drag and drop development for the web 
tier – write event handlers as in Windows 
Forms 
• User interacts with the sever via a 
standard browser 
12/17/14 
http://shreedhoon.com/training/aspNetTraining.php 11
ASP.NET Web Forms (2) 
• Web pages are dynamically generated 
• Standard HTML is sent to the browser 
• Notepad would work but Visual Studio 
makes life easy 
• The user interface code is in an .aspx file 
• The logic (C# code) is stored in a separate 
file (containing event handling code) 
• Every .aspx file has this “code-behind” file 
12/17/14 
http://shreedhoon.com/training/aspNetTraining.php 12
ASP.NET Web Forms (3) 
• Postback events are handled on the server with 
an HTTP request. For example, the submit 
button is clicked. 
• Non-postback events are not handled by the 
server immediately. For example, text is entered 
into a form or the mouse is moved. 
• State is automatically added to an otherwise 
stateless protocol. .NET maintains the user’s 
session. 
http://shreedhoon.com/training/aspNetTraining.php 13 
12/17/14
Web Form Life Cycle 
• Complicated series of activities similar to 
what is found in J2EE struts and JSF 
• For this class let’s just say that a lot of pre-and 
post-processing goes on for each web 
http://shreedhoon.com/training/aspNetTraining.php 14 
request 
12/17/14
Creating A Web Form(1) 
• Prerequisites: IIS and Front Page Server 
Extensions (use Internet Service Manager 
and right click on the web site/All 
Tasks/Configure Server Extensions) 
• Start/Microsoft Visual Studio .NET/ New 
Project/Visual C#/ASP.NET Web 
Application/BinomialTreeWebApp 
• Generated code goes into 
c:InetpubwwwrootBinomialTreeWebApp 
http://shreedhoon.com/training/aspNetTraining.php 15 
12/17/14
Creating A Web Form(2) 
• Two files generated 
- The .aspx file holds the HTML 
- The aspx.cs file holds the C# 
• To see the C# code right click the form 
and select view code 
• Note that you can see the design view or 
the HTML view (tabs on bottom) 
http://shreedhoon.com/training/aspNetTraining.php 16 
12/17/14
Web Form Step-by-step(1) 
(1) Start with a simple C# program – Divider.cs 
using System; 
public class Divider { 
public int divide(int a, int b) { 
return a / b; 
} 
public static void Main(String[] args) { 
Divider s = new Divider(); 
Console.WriteLine(s.divide(10,5)); 
} 
} 
http://shreedhoon.com/training/aspNetTraining.php 17 
12/17/14
Web Form Step-by-step(2) 
(2) Compile to a .dll 
csc –t:library Divider.cs 
(3) Run .NET 
New Project 
choose C# 
select .NET Web Application 
enter location: http://localhost/ADivider 
http://shreedhoon.com/training/aspNetTraining.php 18 
12/17/14
Web Form Step-by-step(3) 
(4) Paint the screen in design mode 
(5) Right click to get to backing code 
(6) Add a reference to the .dll with 
Project/Add Reference 
(7) Use the class 
http://shreedhoon.com/training/aspNetTraining.php 19 
12/17/14
Web Services 
“The internet is evolving from a collection 
of isolated web sites and applications into 
a general communication bus for 
distributed applications.” 
Pradeep Tapadiya, author of “.NET Programming” 
http://shreedhoon.com/training/aspNetTraining.php 20 
12/17/14
ASP.NET Web Services(1) 
0) Check if IIS is running by attempting to visit 
http://localhost 
1) If it's not running click Start/Settings/Control 
Panel/Add Remove Programs/ 
Add Remove Windows Components and 
enable IIS. 
2) If .NET was installed after IIS reconfigure IIS by 
running aspnet_regiis.exe /i from a command 
prompt. 
http://shreedhoon.com/training/aspNetTraining.php 21 
12/17/14
ASP.NET Web Services(2) 
(1) Start with a simple C# program – Divider.cs 
using System; 
public class Divider { 
public int divide(int a, int b) { 
return a / b; 
} 
public static void Main(String[] args) { 
Divider s = new Divider(); 
Console.WriteLine(s.divide(10,5)); 
} 
} 
http://shreedhoon.com/training/aspNetTraining.php 22 
12/17/14
ASP.NET Web Services(3) 
(2) Compile to a .dll 
csc –t:library Divider.cs 
(3) Run .NET 
New Project 
choose C# 
select ASP .NET Web Service 
enter location: http://localhost/ADividerWS 
http://shreedhoon.com/training/aspNetTraining.php 23 
12/17/14
ASP.NET Web Services(4) 
(4) Add a reference to the .dll with 
Project/Add Reference 
(5) Edit the web service sample so that it 
provides the correct signature and calls 
the divide method 
(6) Get the WSDL document from a 
http://shreedhoon.com/training/aspNetTraining.php 24 
browser 
(7) Run wsdl, compile the result, and write a 
client 
12/17/14
.net training in gandhinagar 
12/17/14 http://shreedhoon.com/training/aspNetTraining.php 25
For more visit 
• Website : 
• www.shreedhoon.com 
• Blogs: 
• http://dotnettrainingingandhinagar.blogspot.in/ 
• http://dotnettrainingingandhinagar.tumblr.com/ 
• http://shreedhoontraining.weebly.com/ 
• http://shreedhoontraining.weebly.com/about.html 
12/17/14 http://shreedhoon.com/training/aspNetTraining.php 26
Thank you for visiting 
12/17/14 http://shreedhoon.com/training/aspNetTraining.php 27

More Related Content

Viewers also liked (20)

PDF
A comparison between C# and Java
Ali MasudianPour
 
PPT
Php i basic chapter 3
Muhamad Al Imran
 
PPSX
Microsoft C# programming basics
Prognoz Technologies Pvt. Ltd.
 
PPTX
2.overview of c#
Raghu nath
 
PPT
Difference between C++ and Java
Ajmal Ak
 
PPTX
C sharp
sanjay joshi
 
PPT
Basics of c# by sabir
Sabir Ali
 
PPTX
C vs c++
ZTE Nepal
 
PPT
ASP.NET Session 1
Sisir Ghosh
 
PPTX
Java v/s .NET - Which is Better?
NIIT India
 
PPTX
Java script basic
Vithushan Vinayagamoorthy
 
PPTX
C# basics
sagaroceanic11
 
PDF
Python overview
Hemant Kumar Tiwary
 
PPTX
Java vs .net
Tech_MX
 
PPTX
visual basic .net
ronald_a_go
 
PPTX
Java vs .net (beginners)
Ravi Vishwakarma
 
PPTX
Wellcome to python
Nanra Sukedy
 
PPTX
C++ vs C#
sudipv
 
PDF
Java vs. C/C++
Azul Systems Inc.
 
A comparison between C# and Java
Ali MasudianPour
 
Php i basic chapter 3
Muhamad Al Imran
 
Microsoft C# programming basics
Prognoz Technologies Pvt. Ltd.
 
2.overview of c#
Raghu nath
 
Difference between C++ and Java
Ajmal Ak
 
C sharp
sanjay joshi
 
Basics of c# by sabir
Sabir Ali
 
C vs c++
ZTE Nepal
 
ASP.NET Session 1
Sisir Ghosh
 
Java v/s .NET - Which is Better?
NIIT India
 
Java script basic
Vithushan Vinayagamoorthy
 
C# basics
sagaroceanic11
 
Python overview
Hemant Kumar Tiwary
 
Java vs .net
Tech_MX
 
visual basic .net
ronald_a_go
 
Java vs .net (beginners)
Ravi Vishwakarma
 
Wellcome to python
Nanra Sukedy
 
C++ vs C#
sudipv
 
Java vs. C/C++
Azul Systems Inc.
 

Similar to Dot net guide for beginner (20)

PDF
Bn1001 demo ppt advance dot net
conline training
 
PDF
Net course content
mindq
 
PDF
Dot net syllabus book
Papitha Velumani
 
DOCX
Net Development
daveparky
 
PDF
Asp.net
elshiekh1980
 
PDF
. Net Training Institute in Noida/NCR
Tech Mentro
 
PPTX
Dot net online training
onlinetrainingsindia
 
PPTX
.NET ONLINE TRAINING COURSE CONTENT
raaviraja
 
PPTX
.net online training
onlinetrainingshyderabad
 
PPS
08 gui 11
Niit Care
 
PPT
Dot net Online Training | .Net Training and Placement online
Garuda Trainings
 
PDF
Asp.net brochure
Zabeel Institute
 
PPT
ASP.NET Session 5
Sisir Ghosh
 
PDF
Dot net training bangalore
IGEEKS TECHNOLOGIES
 
PPTX
Dot Net Online training in uk and usa
almaandrea
 
PPT
c# training | c# training videos | c# object oriented programming | c# course
Nancy Thomas
 
PPTX
Dotnet Online Training
Summa Mcclane
 
PDF
Dot net-course-curriculumn
Amit Sharma
 
PPTX
Web techh
SangeethaSasi1
 
PPTX
Web tech
SangeethaSasi1
 
Bn1001 demo ppt advance dot net
conline training
 
Net course content
mindq
 
Dot net syllabus book
Papitha Velumani
 
Net Development
daveparky
 
Asp.net
elshiekh1980
 
. Net Training Institute in Noida/NCR
Tech Mentro
 
Dot net online training
onlinetrainingsindia
 
.NET ONLINE TRAINING COURSE CONTENT
raaviraja
 
.net online training
onlinetrainingshyderabad
 
08 gui 11
Niit Care
 
Dot net Online Training | .Net Training and Placement online
Garuda Trainings
 
Asp.net brochure
Zabeel Institute
 
ASP.NET Session 5
Sisir Ghosh
 
Dot net training bangalore
IGEEKS TECHNOLOGIES
 
Dot Net Online training in uk and usa
almaandrea
 
c# training | c# training videos | c# object oriented programming | c# course
Nancy Thomas
 
Dotnet Online Training
Summa Mcclane
 
Dot net-course-curriculumn
Amit Sharma
 
Web techh
SangeethaSasi1
 
Web tech
SangeethaSasi1
 
Ad

Recently uploaded (20)

PPTX
A Portfolio as a Job Search Tool July 2025
Bruce Bennett
 
PPTX
Enhanced_Career_Guidance_Presentation.pptx
truefollower1
 
PDF
NotificationForTheTeachingPositionsAdvt012025.pdf
sunitsaathi
 
PDF
Ch7.pdf fghjkloiuytrezgdrsrddfhhvhjgufygfgjhfugyfufutfgyufuygfuygfuytfuytftfy...
SuKosh1
 
PPTX
Plant Growth and Development-Part I, ppt.pptx
7300511143
 
PDF
Bilal Ibrar | Digital Marketing Expert | Resume | CV
Bilal Ibrar
 
PDF
Sarkari Job Alerts in Marathi & English – Majhi Naukri
Reeshna Prajeesh
 
PDF
hr generalist course in pune.pdf........
a25075044
 
PPTX
The Future of Law.ppptttttttttttttttttttttttttttttttttttttttttttttttttttttttt...
sahatanmay391
 
PDF
Rediscovering Classic Illustration Techniques.pdf
Bruno Amezcua
 
PDF
Smarter Site Monitoring with BIM + Drones, up-to-date progress tracking and n...
SDI_Schools
 
PPTX
原版英国牛津大学毕业证(Oxon毕业证书)如何办理
Taqyea
 
PDF
Visa Interview Questions in 2025 – Expert Tips from Amit Kakkar Easy Visa
Amit Kakkar
 
PPTX
Adaptive Leadership Model 2025 – AI-Generated PowerPoint by Presentify.ai
presentifyai
 
PDF
Smarter Private Job Search Starts with Formwalaa
Reeshna Prajeesh
 
PPTX
Student_Support_Services_Presentation.pptx
Muhammad439928
 
PDF
Web Developer Jobs in Jaipur Your Gateway to a Thriving Tech Career in Rajast...
vinay salarite
 
PDF
OM Logistics & Warehouse Executive Program
The Learn Skills
 
PPTX
CBSE Experiential Learning.pptx9999999999
manpreetshah1995
 
PDF
Buy Twitter Accounts_ Boost Your Brand and Reach in 2025 - Copy - Copy.pdf
Buy Old Twitter Accounts-100% Secure Aged With Followers
 
A Portfolio as a Job Search Tool July 2025
Bruce Bennett
 
Enhanced_Career_Guidance_Presentation.pptx
truefollower1
 
NotificationForTheTeachingPositionsAdvt012025.pdf
sunitsaathi
 
Ch7.pdf fghjkloiuytrezgdrsrddfhhvhjgufygfgjhfugyfufutfgyufuygfuygfuytfuytftfy...
SuKosh1
 
Plant Growth and Development-Part I, ppt.pptx
7300511143
 
Bilal Ibrar | Digital Marketing Expert | Resume | CV
Bilal Ibrar
 
Sarkari Job Alerts in Marathi & English – Majhi Naukri
Reeshna Prajeesh
 
hr generalist course in pune.pdf........
a25075044
 
The Future of Law.ppptttttttttttttttttttttttttttttttttttttttttttttttttttttttt...
sahatanmay391
 
Rediscovering Classic Illustration Techniques.pdf
Bruno Amezcua
 
Smarter Site Monitoring with BIM + Drones, up-to-date progress tracking and n...
SDI_Schools
 
原版英国牛津大学毕业证(Oxon毕业证书)如何办理
Taqyea
 
Visa Interview Questions in 2025 – Expert Tips from Amit Kakkar Easy Visa
Amit Kakkar
 
Adaptive Leadership Model 2025 – AI-Generated PowerPoint by Presentify.ai
presentifyai
 
Smarter Private Job Search Starts with Formwalaa
Reeshna Prajeesh
 
Student_Support_Services_Presentation.pptx
Muhammad439928
 
Web Developer Jobs in Jaipur Your Gateway to a Thriving Tech Career in Rajast...
vinay salarite
 
OM Logistics & Warehouse Executive Program
The Learn Skills
 
CBSE Experiential Learning.pptx9999999999
manpreetshah1995
 
Buy Twitter Accounts_ Boost Your Brand and Reach in 2025 - Copy - Copy.pdf
Buy Old Twitter Accounts-100% Secure Aged With Followers
 
Ad

Dot net guide for beginner

  • 1. .Net training In gandhinagar 12/17/14 http://shreedhoon.com/training/aspNetTraining.php 1 .
  • 2. C#/.NET Basics 2 .net training in gandhinagar Some code is from “C# in a Nutshell” and “Programming C#” http://shreedhoon.com/training/aspNetTraining.php 2 12/17/14
  • 3. This week • Event Handling and delegates • ASP.NET Web Forms • ASP.NET Web Services http://shreedhoon.com/training/aspNetTraining.php 3 12/17/14
  • 4. Event Handling Model • Delegates listen for the events and call registered handlers • Each component has a delegate for every event it can raise • We register a method with the delegate and the delegate will call the method asynchronously http://shreedhoon.com/training/aspNetTraining.php 4 12/17/14
  • 5. Delegates (1) • A Button, for example, needs to notify some object when it is pushed • We don’t want to hardwire (in the button) which object to call • A delegate is a reference type used to encapsulate a method with particular parameter types http://shreedhoon.com/training/aspNetTraining.php 5 12/17/14
  • 6. Delegate (2) using System; delegate String Foo(String x); // create a delegate class class Test { public static void Main() { Foo f = new Foo(ConvertToUpperCase); // create a delegate object String answer = f("abcd"); // call the method in the // object Console.WriteLine(answer); } public static String ConvertToUpperCase(String s) { return s.ToUpper(); http://shreedhoon.com/training/aspNetTraining.php 6 } }12/17/14
  • 7. Delegate (3) public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.Button multiplyButton; public void foo() { this.multiplyButton = new System.Windows.Forms.Button(); this.multiplyButton.Text = "Multiply"; this.multiplyButton.Click += new System.EventHandler(this.multiplyButton_Click); } private void multiplyButton_Click(object sender, System.EventArgs e) http://shreedhoon.com/training/aspNetTraining.php 7 { textBox3.Clear(); string op1Str = op1.Text; string op2Str = op2.Text; : } Delegate reference Delegate Encapsulated method 12/17/14
  • 8. Multicast Delegate using System; // From C# In A Nutshell delegate void MethodInvoker(); // define delegate class class Test { static void Main() { // create a Test object // and call its constructor new Test(); } http://shreedhoon.com/training/aspNetTraining.php 8 12/17/14
  • 9. http://shreedhoon.com/training/aspNetTraining.php 9 Test() { MethodInvoker m = null; m += new MethodInvoker(Foo); // overloaded += m += new MethodInvoker(Goo); // delegate holds m(); // pointers to two } // methods m MethodInvoker void Foo() void Goo() 12/17/14
  • 10. http://shreedhoon.com/training/aspNetTraining.php 10 void Foo() { Console.WriteLine("Foo"); } void Goo() { Console.WriteLine("Goo"); } } Output: Foo Goo 12/17/14
  • 11. ASP.NET Web Forms (1) • Web Forms bring rapid appplication development to the web • Similar technology is available on J2EE platforms (struts, Java Server Faces) • Drag and drop development for the web tier – write event handlers as in Windows Forms • User interacts with the sever via a standard browser 12/17/14 http://shreedhoon.com/training/aspNetTraining.php 11
  • 12. ASP.NET Web Forms (2) • Web pages are dynamically generated • Standard HTML is sent to the browser • Notepad would work but Visual Studio makes life easy • The user interface code is in an .aspx file • The logic (C# code) is stored in a separate file (containing event handling code) • Every .aspx file has this “code-behind” file 12/17/14 http://shreedhoon.com/training/aspNetTraining.php 12
  • 13. ASP.NET Web Forms (3) • Postback events are handled on the server with an HTTP request. For example, the submit button is clicked. • Non-postback events are not handled by the server immediately. For example, text is entered into a form or the mouse is moved. • State is automatically added to an otherwise stateless protocol. .NET maintains the user’s session. http://shreedhoon.com/training/aspNetTraining.php 13 12/17/14
  • 14. Web Form Life Cycle • Complicated series of activities similar to what is found in J2EE struts and JSF • For this class let’s just say that a lot of pre-and post-processing goes on for each web http://shreedhoon.com/training/aspNetTraining.php 14 request 12/17/14
  • 15. Creating A Web Form(1) • Prerequisites: IIS and Front Page Server Extensions (use Internet Service Manager and right click on the web site/All Tasks/Configure Server Extensions) • Start/Microsoft Visual Studio .NET/ New Project/Visual C#/ASP.NET Web Application/BinomialTreeWebApp • Generated code goes into c:InetpubwwwrootBinomialTreeWebApp http://shreedhoon.com/training/aspNetTraining.php 15 12/17/14
  • 16. Creating A Web Form(2) • Two files generated - The .aspx file holds the HTML - The aspx.cs file holds the C# • To see the C# code right click the form and select view code • Note that you can see the design view or the HTML view (tabs on bottom) http://shreedhoon.com/training/aspNetTraining.php 16 12/17/14
  • 17. Web Form Step-by-step(1) (1) Start with a simple C# program – Divider.cs using System; public class Divider { public int divide(int a, int b) { return a / b; } public static void Main(String[] args) { Divider s = new Divider(); Console.WriteLine(s.divide(10,5)); } } http://shreedhoon.com/training/aspNetTraining.php 17 12/17/14
  • 18. Web Form Step-by-step(2) (2) Compile to a .dll csc –t:library Divider.cs (3) Run .NET New Project choose C# select .NET Web Application enter location: http://localhost/ADivider http://shreedhoon.com/training/aspNetTraining.php 18 12/17/14
  • 19. Web Form Step-by-step(3) (4) Paint the screen in design mode (5) Right click to get to backing code (6) Add a reference to the .dll with Project/Add Reference (7) Use the class http://shreedhoon.com/training/aspNetTraining.php 19 12/17/14
  • 20. Web Services “The internet is evolving from a collection of isolated web sites and applications into a general communication bus for distributed applications.” Pradeep Tapadiya, author of “.NET Programming” http://shreedhoon.com/training/aspNetTraining.php 20 12/17/14
  • 21. ASP.NET Web Services(1) 0) Check if IIS is running by attempting to visit http://localhost 1) If it's not running click Start/Settings/Control Panel/Add Remove Programs/ Add Remove Windows Components and enable IIS. 2) If .NET was installed after IIS reconfigure IIS by running aspnet_regiis.exe /i from a command prompt. http://shreedhoon.com/training/aspNetTraining.php 21 12/17/14
  • 22. ASP.NET Web Services(2) (1) Start with a simple C# program – Divider.cs using System; public class Divider { public int divide(int a, int b) { return a / b; } public static void Main(String[] args) { Divider s = new Divider(); Console.WriteLine(s.divide(10,5)); } } http://shreedhoon.com/training/aspNetTraining.php 22 12/17/14
  • 23. ASP.NET Web Services(3) (2) Compile to a .dll csc –t:library Divider.cs (3) Run .NET New Project choose C# select ASP .NET Web Service enter location: http://localhost/ADividerWS http://shreedhoon.com/training/aspNetTraining.php 23 12/17/14
  • 24. ASP.NET Web Services(4) (4) Add a reference to the .dll with Project/Add Reference (5) Edit the web service sample so that it provides the correct signature and calls the divide method (6) Get the WSDL document from a http://shreedhoon.com/training/aspNetTraining.php 24 browser (7) Run wsdl, compile the result, and write a client 12/17/14
  • 25. .net training in gandhinagar 12/17/14 http://shreedhoon.com/training/aspNetTraining.php 25
  • 26. For more visit • Website : • www.shreedhoon.com • Blogs: • http://dotnettrainingingandhinagar.blogspot.in/ • http://dotnettrainingingandhinagar.tumblr.com/ • http://shreedhoontraining.weebly.com/ • http://shreedhoontraining.weebly.com/about.html 12/17/14 http://shreedhoon.com/training/aspNetTraining.php 26
  • 27. Thank you for visiting 12/17/14 http://shreedhoon.com/training/aspNetTraining.php 27