ASP .NET Training 2017
Prepared By: Moutasm Tamimi
Using C# language
Microsoft visual studio
version 2008-2010-2012-2014
Web Form applications
Part 1 & 2
Speaker Information
 Moutasm tamimi
Independent consultant , IT Researcher , CEO at ITG7
Instructor of: Project Development.
DBMS.
.NET applications.
Digital marketing.
Email: tamimi@itg7.com
LinkedIn: click here.
Concepts
 ASP.NET is an open-source server-side web application framework
designed for web development to produce dynamic web pages. It was
developed by Microsoft to allow programmers to build dynamic web sites,
web applications and web services.
 C# (pronounced "C sharp") is a programming language that is designed
for building a variety of applications that run on the .NET Framework. C# is
simple, powerful, type-safe, and object-oriented.
Concepts
 Server-side scripting is a technique used in web development
which involves employing scripts on a web server which produce a
response customized for each user's (client's) request to the
website. The alternative is for the web server itself to deliver a static
web page.
 Client-side refers to operations that are performed by the client in
a client–server relationship in a computer network. Typically,
a client is a computer application, such as a web browser, that runs
on a user's local computer or workstation and connects to a server
as necessary.
Web Technologies
 HTTP / HTTPS (URL, GET/POST)
 Client-side:
 HTML / XHTML (Extensible HyperText Markup Language)
 JavaScript / VBScript (client-side scripting)
 Applets / ActiveX controls
 Server-side:
 PHP
 Phython
 JSP (Java Server Pages)
 ASP (Active Server Pages)
 ASP.NET (next generation of ASP)
Create web application
Step 1: Creating the Web Application Project
Select File > New Web Site... and choose ASP.NET Empty Web Site in the Templates pane.
Select File System from the drop-down list closest to Location.
Set the Language to Visual C#, and click OK.
Create web application
‫اللغة‬ ‫اختيار‬
‫المشروع‬ ‫نوع‬
‫ومكانه‬ ‫المشروع‬ ‫اسم‬
Add an element to the project solution
‫المشروع‬ ‫محتوى‬ ‫على‬ ‫عنصر‬ ‫اضافة‬
Items type
‫اختيار‬
‫اللغة‬
‫الصفحات‬
‫مشترك‬ ‫تصميم‬ ‫لعمل‬
‫صفحات‬ ‫لعدة‬
‫بلغة‬ ‫للبرمجة‬
C#
Runtime page
‫منفرد‬ ‫بشكل‬ ‫الموقع‬ ‫على‬ ‫الصفحة‬ ‫تشغيل‬
Important toolbox
‫في‬ ‫الخاصة‬ ‫العناصر‬
server side
Properties
‫البرمجي‬ ‫االسم‬
‫للمستخدم‬ ‫الضاهر‬ ‫االسم‬
Properties
‫العمل‬ ‫حيز‬ ‫لون‬
‫العمل‬ ‫حدود‬ ‫لون‬
‫الخط‬ ‫لون‬
CSS - Style
CSS Code
‫التصاميم‬ ‫من‬ ‫محتوى‬ ‫عمل‬
‫صفحات‬ ‫مجموعة‬ ‫او‬ ‫لصفحة‬
Build style
‫معين‬ ‫تصميم‬ ‫النشاء‬
CSS Files
‫ملف‬ ‫انشاء‬
style 1
Style sheets ‫الموبايل‬ ‫تصاميم‬
‫والتابلت‬
‫على‬ ‫الوب‬ ‫تصاميم‬
‫الحاسوب‬ ‫اجهزة‬
Using CSS
<head runat="server">
<title>Test1</title>
<link href="Style/StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="lebel1">
<asp:RadioButton ID="RadioButton1” runat="server" />
</div>
</body>
‫الكالس‬ ‫ربط‬ ‫طريقة‬
‫في‬ ‫انشائها‬ ‫تم‬ ‫التي‬
‫عمل‬ ‫المراد‬ ‫الصفحة‬
‫تصميماليها‬
‫الكالس‬ ‫تنفيذ‬ ‫طريقة‬
‫في‬ ‫كتبت‬ ‫التي‬
‫المستدعى‬ ‫الملف‬
‫داخل‬ ‫الملف‬ ‫مكان‬
‫المشروع‬
Master page
1
2
3
4
5
• 1-4 code in master page
• 5 code of inner page
related with master page
Add inner page related with master page
inner page
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<link href="Style/StyleSheet.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div>Test</div>
</asp:Content>
Like Head
Like Body
Master page body
 <body>
 <form id="form1" runat="server">
 <div>
 <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

 </asp:ContentPlaceHolder>
 </div>
 </form>
 </body>
 </html>
Header
Footer
Page
specific
Master page with many pages
References:
 https://www.w3schools.com/
ASP .NET Training 2017
Prepared By: Moutasm Tamimi
Using C# language
Microsoft visual studio
version 2008-2010-2012-2014
Web Form applications
Part 2
Code behind in c#
Editing the WebTime.aspx
 When the project loads for the first time, the Web Forms Designer displays the
autogenerated ASPX file in Source mode.
 Design mode indicates the XHTML element where the cursor is currently located.
 You can also view both the markup and the web-page design at the same time by
using Split mode
 Right click the ASPX file in the Solution Explorer
and select View Code to open the code-behind file
Web.config Data Source=.;
Initial Catalog=Blood_Units;
Page events
‫اهمها‬
‫عن‬ ‫تلقائيا‬ ‫تنفذ‬ ‫والتي‬‫د‬
‫الصفحة‬ ‫تشغيل‬
Code behind in c#
‫ال‬ ‫ملف‬
BZ business layer
‫ال‬ ‫ملف‬
DA Data access
layer
1
2
‫الكالسات‬ ‫من‬ ‫مجموعة‬
‫البعض‬ ‫ببعضها‬ ‫مرتبطة‬
‫الوصول‬ ‫الرئيسي‬ ‫للهدف‬
‫البيانات‬ ‫قاعدة‬ ‫الى‬
‫عمليات‬ ‫اجراء‬ ‫ثم‬
‫االضافة‬
‫التعديل‬
‫الحذف‬
‫البحث‬
‫الدخول‬ ‫وتسجيل‬
‫اخرا‬ ‫عمليات‬ ‫هناك‬ ‫علما‬
‫اهمها‬ ‫هذة‬ ‫لكن‬
How the code run in the object oriented
programming using 3-tier layers
System architecture using 3-tier layer
Application Layers
Data access layer
Business layer
Presentation Layer
Database Structure
Tables
Procedures
Request To connection DB
Response To connection DB
Send Transaction (Read/write)
1
2
3
4
5
Response Transaction
(Read/write)
DA Data access layer Data base table
Class properties
Class method
Data grid view example: book
Id: GV_ book
Search
Fill Dropdown list
 Subjects_BZ obj = new Subjects_BZ();
 DDL_Subject_Id.DataSource = obj.Subjects_Search("");
 DDL_Subject_Id.DataTextField = "";
 DDL_Subject_Id.DataValueField = "Id";
 DDL_Subject_Id.DataBind();
‫على‬ ‫الحصول‬ ‫المراد‬ ‫الكالس‬ ‫اسم‬
‫اسم‬ ‫على‬ ‫تدل‬ ‫والتي‬ ‫منها‬ ‫قيم‬
‫القاعدة‬ ‫في‬ ‫الجدول‬
‫بحث‬ ‫عملية‬ ‫خالل‬ ‫من‬
Data Source ‫تعبئة‬
DataValueField
‫اختيار‬ ‫تم‬ ‫الذي‬ ‫العنصر‬ ‫رقم‬
‫اسمة‬
DataTextField DataValueField
Science 2
Math 7
Clear data()
‫المستخدم‬ ‫قبل‬ ‫من‬ ‫تعبئتها‬ ‫التي‬ ‫الحقول‬ ‫افراغ‬
Convert to integer
 int id = 0;
 int.TryParse(lbl_Id.Text, out id);
 //‫رقم‬ ‫الى‬ ‫نص‬ ‫من‬ ‫المتغير‬ ‫قيمة‬ ‫تحويل‬ ‫طريقة‬

Try-Catch Block to Catch Exceptions
 Try {
.
.
} catch(Exception Ex)
{
}
Finally
{
}
‫صحتها‬ ‫من‬ ‫التحقق‬ ‫المراد‬ ‫االكواد‬ ‫كتابة‬
‫نوع‬ ‫ينقل‬ ‫خطأ‬ ‫اكتشاف‬ ‫تم‬ ‫حال‬ ‫في‬
‫الى‬ ‫الخطاء‬
catch
‫و‬ ‫االخطاء‬ ‫على‬ ‫الحصول‬ ‫منطقة‬
‫بها‬ ‫االحتفاظ‬
‫على‬ ‫يحتوي‬ ‫كان‬ ‫لو‬ ‫حتى‬ ‫الكود‬ ‫بتنفيذ‬ ‫الرغبة‬ ‫حال‬ ‫في‬ ‫االكواد‬ ‫فيها‬ ‫يكتب‬ ‫منطقة‬
‫برمجية‬ ‫اخطاء‬
IsPostBack
 if (!IsPostBack)
 {
 }
 Gets a value that indicates whether the page is being rendered for the first time or
is being loaded in response to a postback.
File upload control
Add if (id=0), update if (id not equal 0)

Update, delete
Dear students- Please check the updates
to the course every time
https://www.slideshare.net/moutasmtamimi/
ASP .NET Training 2017
Prepared By: Moutasm Tamimi
Using C# language
Microsoft visual studio
version 2008-2010-2012-2014
Web Form applications
Part 1 & 2

Asp.net Programming Training (Web design, Web development)

  • 1.
    ASP .NET Training2017 Prepared By: Moutasm Tamimi Using C# language Microsoft visual studio version 2008-2010-2012-2014 Web Form applications Part 1 & 2
  • 2.
    Speaker Information  Moutasmtamimi Independent consultant , IT Researcher , CEO at ITG7 Instructor of: Project Development. DBMS. .NET applications. Digital marketing. Email: [email protected] LinkedIn: click here.
  • 4.
    Concepts  ASP.NET isan open-source server-side web application framework designed for web development to produce dynamic web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, web applications and web services.  C# (pronounced "C sharp") is a programming language that is designed for building a variety of applications that run on the .NET Framework. C# is simple, powerful, type-safe, and object-oriented.
  • 5.
    Concepts  Server-side scriptingis a technique used in web development which involves employing scripts on a web server which produce a response customized for each user's (client's) request to the website. The alternative is for the web server itself to deliver a static web page.  Client-side refers to operations that are performed by the client in a client–server relationship in a computer network. Typically, a client is a computer application, such as a web browser, that runs on a user's local computer or workstation and connects to a server as necessary.
  • 6.
    Web Technologies  HTTP/ HTTPS (URL, GET/POST)  Client-side:  HTML / XHTML (Extensible HyperText Markup Language)  JavaScript / VBScript (client-side scripting)  Applets / ActiveX controls  Server-side:  PHP  Phython  JSP (Java Server Pages)  ASP (Active Server Pages)  ASP.NET (next generation of ASP)
  • 9.
    Create web application Step1: Creating the Web Application Project Select File > New Web Site... and choose ASP.NET Empty Web Site in the Templates pane. Select File System from the drop-down list closest to Location. Set the Language to Visual C#, and click OK.
  • 10.
    Create web application ‫اللغة‬‫اختيار‬ ‫المشروع‬ ‫نوع‬ ‫ومكانه‬ ‫المشروع‬ ‫اسم‬
  • 11.
    Add an elementto the project solution ‫المشروع‬ ‫محتوى‬ ‫على‬ ‫عنصر‬ ‫اضافة‬
  • 12.
    Items type ‫اختيار‬ ‫اللغة‬ ‫الصفحات‬ ‫مشترك‬ ‫تصميم‬‫لعمل‬ ‫صفحات‬ ‫لعدة‬ ‫بلغة‬ ‫للبرمجة‬ C#
  • 13.
    Runtime page ‫منفرد‬ ‫بشكل‬‫الموقع‬ ‫على‬ ‫الصفحة‬ ‫تشغيل‬
  • 14.
    Important toolbox ‫في‬ ‫الخاصة‬‫العناصر‬ server side
  • 15.
  • 16.
    Properties ‫العمل‬ ‫حيز‬ ‫لون‬ ‫العمل‬‫حدود‬ ‫لون‬ ‫الخط‬ ‫لون‬
  • 17.
    CSS - Style CSSCode ‫التصاميم‬ ‫من‬ ‫محتوى‬ ‫عمل‬ ‫صفحات‬ ‫مجموعة‬ ‫او‬ ‫لصفحة‬
  • 18.
  • 19.
    CSS Files ‫ملف‬ ‫انشاء‬ style1 Style sheets ‫الموبايل‬ ‫تصاميم‬ ‫والتابلت‬ ‫على‬ ‫الوب‬ ‫تصاميم‬ ‫الحاسوب‬ ‫اجهزة‬
  • 20.
    Using CSS <head runat="server"> <title>Test1</title> <linkhref="Style/StyleSheet.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="lebel1"> <asp:RadioButton ID="RadioButton1” runat="server" /> </div> </body> ‫الكالس‬ ‫ربط‬ ‫طريقة‬ ‫في‬ ‫انشائها‬ ‫تم‬ ‫التي‬ ‫عمل‬ ‫المراد‬ ‫الصفحة‬ ‫تصميماليها‬ ‫الكالس‬ ‫تنفيذ‬ ‫طريقة‬ ‫في‬ ‫كتبت‬ ‫التي‬ ‫المستدعى‬ ‫الملف‬ ‫داخل‬ ‫الملف‬ ‫مكان‬ ‫المشروع‬
  • 21.
    Master page 1 2 3 4 5 • 1-4code in master page • 5 code of inner page related with master page
  • 22.
    Add inner pagerelated with master page
  • 23.
    inner page <asp:Content ID="Content1"ContentPlaceHolderID="head" Runat="Server"> <link href="Style/StyleSheet.css" rel="stylesheet" type="text/css" /> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <div>Test</div> </asp:Content> Like Head Like Body
  • 24.
    Master page body <body>  <form id="form1" runat="server">  <div>  <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">   </asp:ContentPlaceHolder>  </div>  </form>  </body>  </html> Header Footer Page specific
  • 25.
    Master page withmany pages
  • 26.
  • 27.
    ASP .NET Training2017 Prepared By: Moutasm Tamimi Using C# language Microsoft visual studio version 2008-2010-2012-2014 Web Form applications Part 2
  • 28.
  • 29.
    Editing the WebTime.aspx When the project loads for the first time, the Web Forms Designer displays the autogenerated ASPX file in Source mode.  Design mode indicates the XHTML element where the cursor is currently located.  You can also view both the markup and the web-page design at the same time by using Split mode  Right click the ASPX file in the Solution Explorer and select View Code to open the code-behind file
  • 30.
  • 31.
    Page events ‫اهمها‬ ‫عن‬ ‫تلقائيا‬‫تنفذ‬ ‫والتي‬‫د‬ ‫الصفحة‬ ‫تشغيل‬
  • 32.
    Code behind inc# ‫ال‬ ‫ملف‬ BZ business layer ‫ال‬ ‫ملف‬ DA Data access layer 1 2 ‫الكالسات‬ ‫من‬ ‫مجموعة‬ ‫البعض‬ ‫ببعضها‬ ‫مرتبطة‬ ‫الوصول‬ ‫الرئيسي‬ ‫للهدف‬ ‫البيانات‬ ‫قاعدة‬ ‫الى‬ ‫عمليات‬ ‫اجراء‬ ‫ثم‬ ‫االضافة‬ ‫التعديل‬ ‫الحذف‬ ‫البحث‬ ‫الدخول‬ ‫وتسجيل‬ ‫اخرا‬ ‫عمليات‬ ‫هناك‬ ‫علما‬ ‫اهمها‬ ‫هذة‬ ‫لكن‬
  • 33.
    How the coderun in the object oriented programming using 3-tier layers
  • 34.
    System architecture using3-tier layer Application Layers Data access layer Business layer Presentation Layer Database Structure Tables Procedures Request To connection DB Response To connection DB Send Transaction (Read/write) 1 2 3 4 5 Response Transaction (Read/write)
  • 35.
    DA Data accesslayer Data base table
  • 36.
  • 37.
  • 38.
    Data grid viewexample: book Id: GV_ book
  • 39.
  • 40.
    Fill Dropdown list Subjects_BZ obj = new Subjects_BZ();  DDL_Subject_Id.DataSource = obj.Subjects_Search("");  DDL_Subject_Id.DataTextField = "";  DDL_Subject_Id.DataValueField = "Id";  DDL_Subject_Id.DataBind(); ‫على‬ ‫الحصول‬ ‫المراد‬ ‫الكالس‬ ‫اسم‬ ‫اسم‬ ‫على‬ ‫تدل‬ ‫والتي‬ ‫منها‬ ‫قيم‬ ‫القاعدة‬ ‫في‬ ‫الجدول‬ ‫بحث‬ ‫عملية‬ ‫خالل‬ ‫من‬ Data Source ‫تعبئة‬ DataValueField ‫اختيار‬ ‫تم‬ ‫الذي‬ ‫العنصر‬ ‫رقم‬ ‫اسمة‬ DataTextField DataValueField Science 2 Math 7
  • 41.
    Clear data() ‫المستخدم‬ ‫قبل‬‫من‬ ‫تعبئتها‬ ‫التي‬ ‫الحقول‬ ‫افراغ‬
  • 42.
    Convert to integer int id = 0;  int.TryParse(lbl_Id.Text, out id);  //‫رقم‬ ‫الى‬ ‫نص‬ ‫من‬ ‫المتغير‬ ‫قيمة‬ ‫تحويل‬ ‫طريقة‬ 
  • 43.
    Try-Catch Block toCatch Exceptions  Try { . . } catch(Exception Ex) { } Finally { } ‫صحتها‬ ‫من‬ ‫التحقق‬ ‫المراد‬ ‫االكواد‬ ‫كتابة‬ ‫نوع‬ ‫ينقل‬ ‫خطأ‬ ‫اكتشاف‬ ‫تم‬ ‫حال‬ ‫في‬ ‫الى‬ ‫الخطاء‬ catch ‫و‬ ‫االخطاء‬ ‫على‬ ‫الحصول‬ ‫منطقة‬ ‫بها‬ ‫االحتفاظ‬ ‫على‬ ‫يحتوي‬ ‫كان‬ ‫لو‬ ‫حتى‬ ‫الكود‬ ‫بتنفيذ‬ ‫الرغبة‬ ‫حال‬ ‫في‬ ‫االكواد‬ ‫فيها‬ ‫يكتب‬ ‫منطقة‬ ‫برمجية‬ ‫اخطاء‬
  • 44.
    IsPostBack  if (!IsPostBack) {  }  Gets a value that indicates whether the page is being rendered for the first time or is being loaded in response to a postback.
  • 45.
  • 46.
    Add if (id=0),update if (id not equal 0) 
  • 47.
  • 48.
    Dear students- Pleasecheck the updates to the course every time https://www.slideshare.net/moutasmtamimi/
  • 49.
    ASP .NET Training2017 Prepared By: Moutasm Tamimi Using C# language Microsoft visual studio version 2008-2010-2012-2014 Web Form applications Part 1 & 2

Editor's Notes

  • #21 https://www.w3schools.com/css/default.asp
  • #34 كيفية تشغيل التعليمات البرمجية في البرمجة الموجهة الكائن باستخدام طبقات من 3 طبقات
  • #45 للحصول على قيمة تشير إلى ما إذا كانت الصفحة يتم عرضها للمرة الأولى أو يتم تحميلها استجابة لإعادة النشر.