Web User Controls This presentation will cover the basics of defining, creating and using a web user control. Presented to Twin Cities.NET user group By.

Slides:



Advertisements
Similar presentations
Tridion 5.3 Templates.
Advertisements

SharePoint Forms All you ever wanted to know about forms but were afraid to ask.
Master Pages, User Controls, Site Maps, Localization Svetlin Nakov Telerik Corporation
11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
Web Forms and ASP.NET Programming Right from the Start with Visual Basic.NET 1/e 12.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
Programming with Objects: Class Libraries and Reusable Code.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
ASP.NET Programming with C# and SQL Server First Edition
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Building Server Behaviors Tom Muck co-author Building Dreamweaver 4 and Dreamweaver UltraDev 4 Extensions.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Course Textbook: Build Your Own ASP.Net Website: Chapter 2
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 8: WebForms — Web-based.
Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Cascading Style Sheet. What is CSS? CSS stands for Cascading Style Sheets. CSS are a series of instruction that specify how markup elements should appear.
Introduction to.Net and ASP.Net Course Introduction Build Your Own ASP.Net Website: Chapter 1 Microsoft ASP.Net Walkthrough: Creating a Basic Web Forms.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
The Characteristics of CSS
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
INTERNAL CSS Casey Ames Different types of CSS There are three different types of CSS: ◦ External CSS ◦ Internal CSS ◦ Inline CSS In this presentation.
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.
Sustainable SharePoint 2010 Customizations By Bill Keys.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Introduction to ASP.NET 1www.tech.findforinfo.com.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
ASP/ASP.NET: Tricks and Tips How to get Microsoft’s Programming Language to work for you By Wade Tripp Park University
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
CIS 451: ASP.NET Concepts Dr. Ralph D. Westfall January, 2009.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
Things like Textboxes, Lables, ‘n’at. ASPX page is not HTML Controls are rendered into markup that a browser can understand Some controls are rendered.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview How to create a first ASP.NET application.
AUC Technologies Projects Consulting, Development, Mentoring, and Training Company ASP.NET Validation Control Presented By : Muhammad Atif Hussain Deputy.
Christopher M. Pascucci.NET Programming CodeBehind.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
The Problem of State. We will look at… Sometimes web development is just plain weird! Internet / World Wide Web Aspects of their operation The role of.
Introducing ASP+ Scott Mitchell
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
ASP.NET &.NET Environment. Overview Part of Microsoft’s.NET environment Used for Development of  Websites  Internet applications  Web Services & XML.
Compare and Contrast : Blackboard & a Personal Web Page www3.ltu.edu/~s_schneider/howto/faculty.htm You’ll find this presentation (and another) here :
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Building Custom Controls with ASP.NET and the Microsoft ®.NET Framework Rames Gantanant Microsoft Regional Director, Thailand
Learning Aim C.  In this section we will look at how text, tables, forms and frames can be used in web pages.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
Scripting Just Enough SSIS to be Dangerous. 6/13/2015 Visit the Sponsor tables to enter their end of day raffles. Turn in your completed Event Evaluation.
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
Chapter 2 Creating Website with Web Forms. Objectives Understand the different project types and templates when building ASP.NET web sites. The different.
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
ASP.NET Forms.
Dreamweaver MX Lesson 14: Using Find and Replace.
How to Write Web Forms By Mimi Opkins.
Chapter 8 User Controls.
Haritha Dasari Josue Balandrano Coronel -
Web Development in Microsoft Visual Studio 2013
Web Development Using ASP .NET
JavaScript.
Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta
Teaching slides Chapter 6.
Web Development Using ASP .NET
Running C# in the browser
Presentation transcript:

Web User Controls This presentation will cover the basics of defining, creating and using a web user control. Presented to Twin Cities.NET user group By Joseph White Chief Architect, Eden Systems International August 5 th, 2004

About Your Speaker Name: Joseph White - Occupations: – Chief Software Architect for Eden Systems International –.NET mentor and architect (part time contracting available through ILM, your.NET solution provider) –Self Proclaimed “Lazy Programmer” Experience: –Working with.NET for over 3 years, developing software solutions, teaching and mentoring for over a decade.

Web User Controls First, Let’s resolve the name ambiguity –User Controls Could be confused with windows forms controls. –Server Controls Not ambiguous if you know what you are talking about. –Custom Controls Just as confusing as user controls. –Web Controls Used interchangeably to reference either web user controls or server controls.

Web User Controls What they are: –Similar in functionality to ASP include files but much better. –Encapsulate HTML and code into smaller functional units. –Built similar to web forms but hosted on a page as an object. –Reusable within the web project that hosts them.

Web User Controls What they are NOT –They ain’t server controls. –Easily distributed or shared across multiple web projects. –Something you would want to package and sell to the public.

Web User Controls Why not just use an old fashion include? –Include files are not encapsulated objects. Potential variable name conflict with host web page or other instances of the “included” code. Can not be programmatically manipulated by host page. Web user controls contain properties and raise events which provides fluid interaction between the control and the hosting page. Why not create a server control? –Too much work.

Web User Controls Let’s take a peek at what they look like in Visual Studio

Two part entry into the aspx page. Part 1: The declaration. TagPrefix: This is like a namespace in case you want to include other controls with the same name. Usually defaults to uc1. TagName: Again its only significance is to help uniquely identify the control on the page. Usually defaults to the name of the class. Src: Let’s the page know where it can find the ascx file that goes with the control. Web User Controls

Part 2: The actual control tag. TagName TagPrefix Unique instance identifier Required if manipulating on Server

Let’s Make a Simple Control

Web User Controls Things to Note: The control does not declare itself in the code behind. –Use Page.FindControl. –Manually type in the declaration. The properties do not show up in the property sheet. The design view can be drastically different from the runtime view. –In fact, when placed in a repeater control, they become invisible in the designer. A web user control can host another web user control.

ASP.NET Validation Controls Special kind of server controls used for validating input values entered in other server controls. A variety of validation controls allow us to require input, check for formats, compare with other fields, and perform custom operations.

Web User Controls Using Validators in a web user control Encapsulate Complex Validation Logic Validators in the user control will work with the validation summary control on the page. Because the web user control is web project specific it is easy to give validators a consistent look throughout the application.

Web User Controls Complex regular expression: (0?[1-9]|1[0-2])/([0-2]?[0-9]|3[0-1])/((1|2)\d{3}|\d{2}) ([0- 1][0-9]|[2][0-3])[0-5][0-9] Evaluates mm/dd/yy or mm/dd/yyyy with the leading 0 on the month or day being optional. Then it ends with HHMM where leading zero is not optional.

Validation Controls Demo

Web User Controls Working with style sheets. Style Sheet Advantage: –Since the controls are site specific you don’t have to worry about all sorts of properties to handle styles. Style Sheet Disadvantage: –Since the style sheet is declared at the page level, your control (ascx file) may not look quite right in the VS designer.

Web User Controls Working with client side script Best Practice for large script blocks is to use an include file. Since a control may be included more than once on a page, It is important to make sure the script functions are only included once. –Use Page.RegisterClientScriptBlock and Page.IsClientScriptBlockRegistered

Web User Controls Conclusions Pros: Easy to create: –Same programming model as ASP.NET Page Code Behind Page Load event Post Back events Encapsulate complex expressions, functions and html code. OO approach avoids the pitfalls of copy and paste or old fashion includes.

Web User Controls Conclusions Cons: Doesn’t play well with the VS designer. –Renders as a gray box in design view. –Exposed properties not available in property sheet. –Does not declare itself in the code behind. Difficult to share across multiple web projects. Can’t package and sell as a stand alone DLL.

Web User Controls Thank you for your attention.