Web Controls Making a WebRequest using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.IO;

Slides:



Advertisements
Similar presentations
Web Development & Design Foundations with HTML5
Advertisements

Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
ASP.NET and ADO.NET. ASP.NET Server Controls Intrinsic Controls: These controls correspond to their HTML counterparts. –Ex. Textbox, listbox, button,
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
Copyright © 2012 Pearson Education, Inc. Chapter 2 Introduction to Visual C#
GTECH 731 Lab Session 4 Lab 3 Review, Lab 4 Intro 9/28/10 Lab 3 Review Lab 4 Overview.
ASP.NET Programming with C# and SQL Server First Edition
Overview This presentation covers the initial overview of the different server controls. 2.
Internet Protocols & Client Server Programming
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
Lecture 17: Spanning Trees Minimum Spanning Trees.
Telerik Software Academy ASP.NET Web Forms Data Validation, Data Validators, Validation Groups Telerik Software Academy
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.
Beginning Web Site Development Module 1 – Dynamic Web Site Development Fundamentals of building dynamic Web sites with ASP.NET 2.0 and C# Version.
ASP Hello, world. ServerClient Response Request A form.
INSPIRING CREATIVE AND INNOVATIVE MINDS Module 4: Adding Code to a Microsoft ASP.NET Web Form Implementing Code-Behind Pages Adding Event Procedures to.
Lesson №12 Telecommunication network software design for HTTP and Internet Lector: Aliev H.U. TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES THE DEPARTMENT.
© Minder Chen, ASP.NET 2.0: Introduction - 1 ASP.NET 2.0 Minder Chen, Ph.D. Framework Base Class Library ADO.NET: Data & XML.
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 14, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.
Chapter 4 – Working with ASP.NET Controls Dr. Stephanos Mavromoustakos.
Microsoft Visual Basic 2008 CHAPTER SEVEN Creating Web Applications.
Database Programming Dr. John Abraham. Data Sources Data source specifies the source of the data for an application. Click on Data from Menu Choose show.
Internet Technologies and Web Application Web Services With ASP.NET Tutorial: Introduction to.
Cross-Language Demo Demonstrates mixing C# and VB.NET code C# Class CSDemoClass.cs VB.NET Class VBDemoClass.vb “Main” class (C#) Demo.cs.
Features of Object Oriented Programming:  A class is a collection of things which posses common similarities.  In C#.NET a class is a user defined.
Fonts The following CSS properties will be described: 1.Font-family 2.Font-style 3.Font-variant 4.Font-weight 5.Font-size 6.Font.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Unit 3: Adding Code to a Microsoft ASP.NET Web Form.
Global.asax file. Agenda What is Global.asax file How to add the Global.asax file What are the default events available Explanation to Application_Level.
Dynamic Dropdown Lists 1. Objectives You will be able to Use Dropdown Lists to solicit multiple choice user input in an ASPX web page. Populate a Dropdown.
CS590VC – Tutorial 6 Client-side connection through external application.
ASP.NET More on searching databases 1ASP.NET, More on searching databases.
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.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. SharePoint API and Development in ASP.NET Creating “Hello World” application Working with.
More exercises with C# Fateme Rajabi #W6. Add an image to your project Right click on your project name in solution explorer Add -> Existing item -> browse.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
XHTML Formatting font with a style declaration. Formatting Font HTML uses the font tag to change size and family of font But… the font tag is being deprecated.
CPSC 481 Fateme Rajabiyazdi #W4. Visual Studio Download Visual Studio 2013 (Ultimate) from – MSDN Academic Alliance Software Center – IT account.
Microsoft SharePoint Server 2007 Technical Overview Romeo Pruno nonaka.eu.
Introduction to Windows Forms Application By N Hanumantha Rao MCA By N Hanumantha Rao MCA.
MIS 3200 – Unit 5.1 Iteration (looping) – while loops – for loops Working with List Items.
ASP + JavaScript Client and Server scripts. Link 1 function MyClick(){ document.write("MyClick"); } function MyFunction1(){ alert("My Function 1"); }
1111 Creating ASPX Controls Programatically Objectives You will be able to Dynamically add controls to a page. Dynamically alter properties of controls.
Lecture Set 7 Procedures and Event Handlers Part B - The Structure of an Application Event Handlers.
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 22, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.
Lecture 11: Generics. The Generic List loading data from a file using System.IO; : namespace EmpListDemo { static class Program { static void Main(string[]
Strings in C++/CLI us/library/system.string.aspxhttp://msdn.microsoft.com/en- us/library/system.string.aspx public: static.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Advanced.NET Programming I 14 th Lecture Pavel Ježek
ASP.NET Part 2 Instructor: Charles Moen CSCI/CINF 4230.
A little PHP. Enter the simple HTML code seen below.
Chapter 9 Programming Based on Events
התוכנית: using System; using System.Collections.Generic;
using System; namespace Demo01 { class Program
Building Your Own Class
How to Create a Simple Web Service and Use it in ASP.Net
Service-Oriented Computing -- Service Provider and Application Builder
برمجه صفحات الانترنتASP
MUTENESS ASSİSTMENT 1)WHY CHOICE ? 2)ABOUT DESİGN 3)WHICH CODES USING
عرض اجمالي المهام الشرطية في سي شارب (الأمر if)
Static and Dynamic Web Pages
Lecture 13: Tree Traversals Algorithms on Trees.
class PrintOnetoTen { public static void main(String args[]) {
ASP.NET.
Module 05: Building ASP .NET Applications
Web Development Using ASP .NET
E-commerce Applications Development
5/6/2019 Session 8.2 Postback, ViewState
MIS 3200 – Unit 5.1 Iteration (looping) Working with List Items
Button Web Server Controls
Advanced .NET Programming I 15th Lecture
Presentation transcript:

Web Controls

Making a WebRequest using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.IO;

Creating a WebRequest namespace WebRequestorApp { class Program { static void Main(string[] args) { WebRequest req = WebRequest.Create(" WebResponse resp = req.GetResponse(); StreamReader reader = new StreamReader(resp.GetResponseStream(), Encoding.ASCII); Console.WriteLine(reader.ReadToEnd()); }

Mixing Code With HTML Hello World!!! <% // This block will execute in the Render_Control method Response.Write("Check out the family tree: "); Response.Write(this.GetType().ToString()); Response.Write(" which derives from: "); Response.Write(this.GetType().BaseType.ToString()); Response.Write(" which derives from: "); Response.Write(this.GetType().BaseType.BaseType.ToString()); Response.Write(" which derives from: "); Response.Write( this.GetType().BaseType.BaseType.BaseType.ToString()); Response.Write(" which derives from: "); Response.Write( this.GetType().BaseType.BaseType.BaseType.BaseType.ToString ()); %>

Mixing Code With HTML :Server Side void ShowLineage() { Response.Write("Check out the family tree: "); Response.Write(this.GetType().ToString()); Response.Write(" which derives from: "); Response.Write(this.GetType().BaseType.ToString()); Response.Write(" which derives from: "); Response.Write(this.GetType().BaseType.BaseType.ToString()); Response.Write(" which derives from: "); Response.Write( this.GetType().BaseType.BaseType.BaseType.ToString()); Response.Write(" which derives from: "); Response.Write( this.GetType().BaseType.BaseType.BaseType.BaseType.ToString()); } Hello World!!! <% ShowLineage(); %>

Dropdown List <div style= "font-family: 'Times New Roman', Times, serif; font-size: 14pt; font-weight: bold"> Page in Visual Studio Item 1 Item 2 Item 3 Item 4 Item 5 Item 6

DropDownList Code protected void Button1_Click(object sender, EventArgs e) { Response.Write("Hello. Here's what you typed into the text box: "); Response.Write(this.TextBox1.Text); Response.Write(" "); Response.Write("And the selected item is: "); Response.Write(this.DropDownList1.SelectedItem.Text); }

CheckBoxList protected void Button1_Click(object sender,System.EventArgs e) { Label1.Text = "You Selected: "; foreach (ListItem li in CheckBoxList1.Items){ if (li.Selected == true){ Label1.Text += li.Text + " "; }

RadioButtonList My level of education is:<asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" onselectedindexchanged="RadioButtonList1_SelectedIndexChanged"> Primary school Middle school High School Vocational college Bachelors degree Masters degree PhD or other doctorate

The Code protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { Label1.Text = "Your level of education is " + RadioButtonList1.Text; }

The ListBox Assuming that you created a ListBox lstEmployees: Protected void btnAdd_Click(object sender, EventArgs e) { if (lstEmployees.SelectedIndex > -1) { string _value = lstEmployees.SelectedItem.Value;//Gets the value of items in list. string _text = lstEmployees.SelectedItem.Text;//Gets the Text of items in the list. ListItem item = new ListItem (); //create a list item item.Text = _text; //Assign the values to list item item.Value = _value; lstSelectedEmployees.Items.Add(item); //Add the list item to the selected list of employees lstEmployees.Items.Remove(item); //Remove the details from employee list }