1 CS387/CS587: Note04 Lab 3. 2 Master Page All Web pages will be similar Should be created before other web pages Add New Items Controls on the Master.

Slides:



Advertisements
Similar presentations
11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
Advertisements

User Controls, Master Pages, GridView. Content User Controls Styles, Themes, Master Pages Working with Data GridView Muzaffer DOĞAN - Anadolu University2.
11 ASP.NET Controls II Beginning ASP.NET 4.0 in C# 2010 Chapter 6.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Introduction to ASP.Net ISYS 350. ASP.NET ASP.NET is a server-side technology for creating dynamic web pages. ASP.NET allows you to use a selection of.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
ASP.NET Part 4 Instructor: Charles Moen CSCI/CINF 4230.
Navigating database with windows forms.. Tiered applications  Provide a means to develop many presentations of the same app  Makes changes to the back.
INSPIRING CREATIVE AND INNOVATIVE MINDS Module 4: Adding Code to a Microsoft ASP.NET Web Form Implementing Code-Behind Pages Adding Event Procedures to.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
© Minder Chen, ASP.NET 2.0: Introduction - 1 ASP.NET 2.0 Minder Chen, Ph.D. Framework Base Class Library ADO.NET: Data & XML.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
1/36 Database Programming with Visual Basic.Net and MS Access IKE Lab. Yunho Song Database Management and Analysis.
Needs for Accessing Database To make your web site more dynamic and maintainable, you can display information on your web pages that are retrieved from.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
CSCI 6962: Server-side Design and Programming Introduction to Active Server Pages.
1 Data Bound Controls II Chapter Objectives You will be able to Use a Data Source control to get data from a SQL database and make it available.
Internet Technologies and Web Application Web Services With ASP.NET Tutorial: Introduction to.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
1 CS 3870/CS 5870: Note 11 Authentication and Authorization Membership Provider.
Working with GridView Control: Adding Columns. Adding Buttons to a Bound GridView: 1. Drag the WebProduct table from Data connection to a page 2. Demo.
1 CS 3870/CS 5870 Note04 Session Variables and Post Back.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
1 Chapter 12 – Web Applications 12.1 Programming for the Web, Part I 12.2 Programming for the Web, Part II 12.3 Using Databases in Web Programs.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Unit 3: Adding Code to a Microsoft ASP.NET Web Form.
1 CS 3870/CS 5870: Note 13 Lab 6 Authentication and Authorization Roles Management.
1 CS 3870/CS 5870: Note 07 Lab 3 Lab 4 Test 1: Two Tables.
Module 7: Creating a Microsoft ASP.NET Web Application.
 Page_Init  Page_Load  cmdINew_Click  cmdISave_Click  cmdIDelete_Click  cmdISubmit_Click  cmdIClear_Click  gridLineItem_RowEditing  gridLineItem_RowDeleting.
ASP.NET More on searching databases 1ASP.NET, More on searching databases.
1 CS 3870/CS 5870: Note05 Prog3 Web Application with Database.
TRAINING SESSIONS.NET Controls.  Standard Controls  Label  Textbox  Checkbox  Button, Image Button, Image control  Radio Button  Literal  Hyperlink.
Week Developing Web Applications 12. Programming for the Web A Web Application Runs on a Web Server and Presents Its Content to the User Across a Network,
ASP.Net, Web Forms and Web Controls 1 Outline Session Tracking Cookies Session Tracking with HttpSessionState.
1 CS 3870/CS 5870: Note 19 SiteMap and AJAX Lab 8.
1 CS 3870/CS 5870: Note 20 Web Service. 2 What is Web Service? Providing functionality online to other applications, Web and Windows applications. The.
1 CS387/CS587: Note 08 Shopping Bag DataTable. 2 DataClass Public Shared Function NewShoppingBag() As Data.DataTable Dim bag As New Data.DataTable bag.Columns.Add("Product.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
1 CS387/CS587: Note05 Lab 3. 2 Global.asax Must not be under any sub-folder Application_Start Application_End Application_Error Session_Start Session_End.
1 CS 3870/CS 5870: Note 12 Authentication and Authorization Membership Provider.
1 Chapter 10 – Database Management 10.1 An Introduction to Databases 10.2 Editing and Designing Databases.
1 CS 3870/CS 5870: Note 16 Web User Controls. Prog 7 Copy Prog6 to Prog7 Modify all files for Prog7 Remove Web.config from sub-folders Make sure Prog7.
1 CS 3870/CS 5870: Note 13 Web Service. 2 What is Web Service? Providing functionality online to other Web applications SOAP Simple Object Access Protocol.
1 CS 3870/CS 5870: Note07 Prog 4. Master Pages Creating a master page based on another master page MainMasterPage –For all Progs and Tests Prog4MasterPage.
1 CS 3870/CS 5870: Note07 Prog 4. Master Pages Creating a master page based on another master page MainMasterPage –For all Progs and Tests Prog4MasterPage.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
11 Getting Started with ASP.NET Beginning ASP.NET in C# and VB Chapters 1 and 2.
Data tastes like chicken, if chicken was data.. Databinding What is it? Associating a set of data with a control Why use it? Its much easier than associating.
Working with ASP.NET Controls What is ASP.NET Using server controls in your pages Allowing users to create their own accounts Creating a login page Letting.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
Murach's ASP.NET 4.5/C#, C4© 2013, Mike Murach & Associates, Inc.Slide 1.
1. Prog3 Try and Catch Testing 2 Catching Database Errors Protected Sub DetailsView1_ItemDeleted( sender As Object, e As DetailsViewDeletedEventArgs)
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 11 Creating Web Applications and Writing Data to a Database.
Creating Data Base & Sql Data Source
CS 3870/CS 5870 Web Service.
Web Application with Database
CS 3870/CS 5870 Web User Controls.
Session Variables and Post Back
Web Application with Dataase
Web Development in Microsoft Visual Studio 2013
CS 3870/CS 5870 Web User Controls Events (II).
Using List Controls with SQL Server
Creating Data Base & Sql Data Source
CS 3870/CS 5870 Test 2 (50 points) Thursday
Web Application with Dataase
Web Form Introduction.
MIS 3200 – Unit 6.1 Moving between pages by redirecting
Presentation transcript:

1 CS387/CS587: Note04 Lab 3

2 Master Page All Web pages will be similar Should be created before other web pages Add New Items Controls on the Master page ContentPlaceHolder Leave ContentPlaceHolder empty Add controls before ContentPlaceHolder Adding a label Adding a TreeView

3 TreeView Controls Navigation Tab Property Nodes (Collection) –Root Nodes –Child Nodes –Node Properties Text NagivateUrl (Can be set later)

4 Content Page Should be created after master page Check Select Master Page Adding controls inside ContentPlaceHolder

5 TreeView on Master Page Creating master page Adding TreeView control Setting TreeView properties, but not NagivateUrl Creating content pages Setting NagivateUrl of TreeView on master page

Navigating all pages of Lab 3 6

ASP.NET Folders Solution Explorer Right click Web site Add ASP.NET Folder App_Code App_Data... 7

8 Accessing Database

9 Database File UWPCS3870.accdb How to upload data file Right click Apps_Data folder Select Add An Existing Item

10 Accessing Database Data Controls –SqlDataSource –AccessDataSource –... Code class –Connection –Command –DataAdpater –AdapterBuilder

DataClass Code class in folder App_Code No code module All variables and procedures should be Shared Otherwise, need to create object 11

Variables Private Const ConStr As String = "Provider=Microsoft.ACE.OLEDB.12.0; ” & _ “Data Source=|DataDirectory|\UWPCS3870.accdb" Private Shared prodAdapter As System.Data.OleDb.OleDbDataAdapter Private Shared prodBuilder As System.Data.OleDb.OleDbCommandBuilder Private Shared prodCmd As New Data.OleDb.OleDbCommand Private Shared con As New Data.OleDb.OleDBConnection Public Shared tblProduct As New Data.DataTable The objects are available all the time. 12

Setup Command and Adapter ‘ Sets up the connection, command and adapter Public Shared Sub setupAdapter() con.ConnectionString = ConStr prodCmd.Connection = con prodCmd.CommandType = Data.CommandType.Text prodCmd.CommandText = "Select * from Product order by ProductID" prodAdapter = New System.Data.OleDb.OleDbDataAdapter(prodCmd ) End Sub 13

Retrieve Data Records ‘ Gets the table records and the table schema Public Shared Sub getAllProdcts() ‘ Need to reset the command prodCmd.CommandText = "Select * from Product order by ProductID" prodAdapter.Fill(tblProduct) prodAdapter.FillSchema(tblProduct, Data.SchemaType.Source) End Sub 14

Calling Subs in DataClass and Binding Gridview Protected Sub Page_Load(...) Handles Me.Load DataClass.setup() DataClass.getAllProducts() GridView1.DataSource = DataClass.tblProducts GridView1.DataBind() End Sub Refill the data table for each page request. 15

Processing of Dynamic Web Pages Build Web Site: Compiling code-behind classes to a DLL file No exe file ASP.NET instantiates class objects ASP.NET processes the class object ASP.NET generates a page IIS accepts page requests and sends the generated pages back to client 16

Page Shopping Textchanged event of Textbox txtID id = txtID.Text.Trim index = -1 For x = 0 To DataClass.tblProducts.Rows.Count - 1 If DataClass.tblProducts.Rows(x)(0) = id Then index = x Exit For End If Next If index <> -1 Then txtName.Text = DataClass.tblProducts.Rows(index)(1) 17

Page Shopping Textchanged event of Textbox txtID id = txtID.Text.Trim Dim row as Data.DataRow row = DataClass.tblProducts.Rows.Find(id) If row Is Nothing Then ‘ not found Else ‘ Found End If 18

Page Shopping Property AutoPastBack of Textbox Must be True to fire Textchanged event 19

Page Shopping Textchanged event of Textbox txtQuanity 20