SlideShare a Scribd company logo
1 of 29
1
A Programme Under the compumitra Series
WEB SERVER CONTROLS SET – 2
LAB WORK GUIDE
2
OUTLINE
ControlGroup1VB (in VB) Using Following
Web Server Controls.
 TextBox, Button, Label
3
ControlGroup1VB
Using VB in asp.net
 ASP:TEXTBOX Supports Autocomplete, Autopostback, Single or Multiline Mode
in addition to standard properties related to colors, size, style etc.
 ASP:BUTTON Supports Use of OnClientClick, UseSubmitBehaviour, PostBackUrl
type of activity in addition to usual properties.
 ASP:LABEL Supports programmatically placed content on desired location.
This session will explain you about three asp controls namely Textbox, Button and
Label used simultaneously in the same website page. This helps you to understand
passing of values between controls.
InheritanceVB -Web Site Creation-1
From Start Page Click New Website and reach this screen
2. Select 'ASP.NET Empty Web Site'
3. Select Location=File System
4. Click 'Browse..' tab to
select the location where
you want to save your Web
Site
5. click 'OK'
1. Select Language=Visual Basic
 By default Your Web Site shall be saved in the Location- "C:Documents and
SettingsMy DocumentsVisual Studio 2010WebSites." Change it to
"C:Learner<student-id>WebControlsControlGroup1VB" folder
ControlGroup1VB -Web Site Creation-2
In the Solution Explorer Window
Select the path -> Right click ->
Add New Item…
InheritanceVB -Web Site Creation-3 'Add New Item' dialog box will open
1. Select 'Web Form'
2. Simply Click on
'Add' button
77
ControlGroup1VB -TextBox tool-1
1. Toolbox will appear here. If not
already open, open this using the 'View'
Menu. You may have to right click on
title bar of tool-bar to make it dockable
Your default.aspx template will open
2. Make Sure that the default.aspx is
opened in design view mode.
88
Drag and Drop TEXTBOX
2. Drag and Drop 'TextBox' in the
div area seen in the design view.
ControlGroup1VB -TextBox tool - 2
1. Select the 'TextBox' from
'Standard' Toolbox
Optional Technique is to place the cursor at
appropriate place in design view and then double
click the control from the tool box.
99
ControlGroup1VB – BUTTON Placement
After selection Drag and
Drop 'Button' in div
1010
ControlGroup1VB -LABEL Placement-1
2. Select the 'Label' from
'Standard' Toolbox
1. Press 'Enter' key to bring the
cursor one line below.
1111
ControlGroup1VB -LABEL Placement-2
After selection Drag and
Drop 'Label' here.
1212
ControlGroup1VB -LABEL Properties setting-1
2. Select the Label
1. Then open the
Properties window by
Selecting 'Properties
Window' in 'View' menu
Or By pressing 'F4' Key.
1313
ControlGroup1VB -LABEL Properties setting-2
Set the 'Text' Property equal to Null
(Remove predefined text).
1414
ControlGroup1VB -Go to Default.aspx.vb
Double click on 'Button'
15
ControlGroup1VB -Type Code and Run
Type the "Label1.Text=TextBox1.Text" Between Sub Button1_Click and
End Sub.
And Run Code By pressing 'F5'
Your double click action on previous page has
actually created this code at the back end.
16
ControlGroup1VB -Output
Type any text here, press button to see that text
transferred to label control placed below.
Output on browser
Just Now You completed an exercise where you created a 3
control form that had both client side and server side codes.
This is the power of ASP.NET where client side code and server
side code can be kept in separate files.
1717
ControlGroup1VB -Stop Debugging
Stop Debugging by Selecting
'Stop Debugging' option in
'Debug' menu.
18
ControlGroup1VB Modification Trials –TextBox Property-1
1- Set
'BackColor' = 'Aqua'
'BorderColor' = '#0033cc'
'BorderStyle' = 'Double'
'BorderWidth' = '4px'
2- And see effects
On 'TextBox'.
19
ControlGroup1VB Modification Trials –TextBox Property-2
1- Set 'AutoCompleteType'
= 'DisplayName'
2- And 'TextMode' =
'MultiLine'
3- Then see effects
On 'TextBox'.
20
ControlGroup1VB Modification Trials –Button Property-1
1- Set 'BackColor' = 'Pink'
2- And 'Text' = 'Press Me'
3- Then see effects
On 'Button'.
21
ControlGroup1VB Modification Trials –Button Property-2
1- Set 'Height' = '30px'
And 'Width' = '100px'
2- Then see effects
On 'Button'.
22
ControlGroup1VB Modification Trials –Label Property-1
1- Set 'Font Name' = 'Arial'
2- And 'ToolTip' = 'This
is Output value'
23
ControlGroup1VB Modification Trials –Source view
Press 'Source' tab to see source view
Source code of 'Default.aspx'
24
ControlGroup1VB Modification Trials –Label2
Drag and Drop
another 'Label'
And set 'Text' property = Blank
25
ControlGroup1VB Modification Trials –Default.aspx.vb-2
Then run code and see
Type
'Label1.Text = TextBox1.Text
Label2.Text = " Font of Label1 = " & Label1.Font.ToString()'
in 'Sub Button1_Click' method
Go to 'Default.aspx.vb' page
26
ControlGroup1VB Modification Trials – OnClientClick
 Go to asp:button control and add
onclientclick="MsgBox('Hello')" in 'Default.aspx'. Now type
following script in the Head Section.
<script type="text/javascript">
function MsgBox (textstring) { alert (textstring) }
</script>
Now run and see that a local alert box comes
even when the server side button code is run.
You just learned a client side code in javascript.
Remember that Javascript is not JAVA. Always treat these two languages as entirely
different things.
Javascript is run by a web browser on the computer running the web browser. Java is
a full fledged programming language to develop web applications or to develop
application on any operating system.
27
ControlGroup1VB Modification Trials – UseSubmitBehaviour
 Go to asp:button control source and add UseSubmitBehavior="True"
in 'Default.aspx'.
Now run and see the effect on Chrome/Firefox browser. You will see that the
button will run on pressing ENTER key too. When this is set to "False" the button
will not run on ENTER key. This is because browser's submit behaviour is not getting
activated when it is made false. The behaviour of other browsers may depend on
its settings.
Please note that when you press enter key, the cursor of browser should not be
placed on the corresponding button, else browser will execute the button handler
directly.
We shall discuss submit behaviour in detail at a later point.
28
ControlGroup1VB Modification Trials – PostBackURL
 Go to asp:button control source and add
PostBackUrl="Hyperlink.aspx" in 'Default.aspx'. Also copy your
previous website file default.aspx in webcontrolshyperlink
folder and rename it to hyperlink.aspx in your current website
directory.
Now run and see the effect in browser. You will see that when the button is pressed
it targets you to another URL hyperlink.aspx.
What's so great about reaching another URL with button.
This is actually a ASP.NET way to take data from previous pages. When a link is
reached through PostbackURL, one can read the values of control in the previous
page using the PreviousPage Property. This we shall see in another lab with sample
codes.
29
Ask and guide me at
sunmitraeducation@gmail.com
Share this information with as
many people as possible.
Keep visiting www.sunmitra.com
for programme updates.

More Related Content

Similar to Web Server Controls VB Set 1

Similar to Web Server Controls VB Set 1 (20)

Project1 VB
Project1 VBProject1 VB
Project1 VB
 
ASP.NET UNIT 3.ppt
ASP.NET UNIT 3.pptASP.NET UNIT 3.ppt
ASP.NET UNIT 3.ppt
 
Vbtutorial
VbtutorialVbtutorial
Vbtutorial
 
Button controls and using methods to make a simple web browser
Button controls and using methods to make a simple web browserButton controls and using methods to make a simple web browser
Button controls and using methods to make a simple web browser
 
Practicalfileofvb workshop
Practicalfileofvb workshopPracticalfileofvb workshop
Practicalfileofvb workshop
 
Vb%20 tutorial
Vb%20 tutorialVb%20 tutorial
Vb%20 tutorial
 
Ma3696 Lecture 2
Ma3696 Lecture 2Ma3696 Lecture 2
Ma3696 Lecture 2
 
Software engineering modeling lab lectures
Software engineering modeling lab lecturesSoftware engineering modeling lab lectures
Software engineering modeling lab lectures
 
Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6
 
Mca 504 dotnet_unit5
Mca 504 dotnet_unit5Mca 504 dotnet_unit5
Mca 504 dotnet_unit5
 
AcroButtonsTutorial
AcroButtonsTutorialAcroButtonsTutorial
AcroButtonsTutorial
 
AcroButtonsTutorial
AcroButtonsTutorialAcroButtonsTutorial
AcroButtonsTutorial
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
 
Unit f adobe dreamweaver cs6
Unit f adobe dreamweaver cs6Unit f adobe dreamweaver cs6
Unit f adobe dreamweaver cs6
 
dr_4
dr_4dr_4
dr_4
 
dr_4
dr_4dr_4
dr_4
 
CheckBox In C#.pptx
CheckBox In C#.pptxCheckBox In C#.pptx
CheckBox In C#.pptx
 
GigaSpaces CCF Quick Tour - 2.3.6
GigaSpaces CCF Quick Tour - 2.3.6GigaSpaces CCF Quick Tour - 2.3.6
GigaSpaces CCF Quick Tour - 2.3.6
 
Tutorials v10
Tutorials v10Tutorials v10
Tutorials v10
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
 

More from sunmitraeducation

Installing JDK and first java program
Installing JDK and first java programInstalling JDK and first java program
Installing JDK and first java programsunmitraeducation
 
Visual Web Developer and Web Controls VB set 3
Visual Web Developer and Web Controls VB set 3Visual Web Developer and Web Controls VB set 3
Visual Web Developer and Web Controls VB set 3sunmitraeducation
 
Visual Web Developer and Web Controls CS set 3
Visual Web Developer and Web Controls CS set 3Visual Web Developer and Web Controls CS set 3
Visual Web Developer and Web Controls CS set 3sunmitraeducation
 
Progamming Primer Polymorphism (Method Overloading) VB
Progamming Primer Polymorphism (Method Overloading) VBProgamming Primer Polymorphism (Method Overloading) VB
Progamming Primer Polymorphism (Method Overloading) VBsunmitraeducation
 
Programming Primer EncapsulationVB
Programming Primer EncapsulationVBProgramming Primer EncapsulationVB
Programming Primer EncapsulationVBsunmitraeducation
 
Programming Primer Encapsulation CS
Programming Primer Encapsulation CSProgramming Primer Encapsulation CS
Programming Primer Encapsulation CSsunmitraeducation
 
Programming Primer Inheritance VB
Programming Primer Inheritance VBProgramming Primer Inheritance VB
Programming Primer Inheritance VBsunmitraeducation
 
Programming Primer Inheritance CS
Programming Primer Inheritance CSProgramming Primer Inheritance CS
Programming Primer Inheritance CSsunmitraeducation
 
Html Server Image Control VB
Html Server Image Control VBHtml Server Image Control VB
Html Server Image Control VBsunmitraeducation
 
Html Server Image Control CS
Html Server Image Control CSHtml Server Image Control CS
Html Server Image Control CSsunmitraeducation
 
Html Server Anchor Control VB
Html Server Anchor Control VBHtml Server Anchor Control VB
Html Server Anchor Control VBsunmitraeducation
 
Html Server Anchor Control CS
Html Server Anchor Control CSHtml Server Anchor Control CS
Html Server Anchor Control CSsunmitraeducation
 

More from sunmitraeducation (20)

Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
Installing JDK and first java program
Installing JDK and first java programInstalling JDK and first java program
Installing JDK and first java program
 
Grid Vew Control VB
Grid Vew Control VBGrid Vew Control VB
Grid Vew Control VB
 
Grid View Control CS
Grid View Control CSGrid View Control CS
Grid View Control CS
 
Ms Access
Ms AccessMs Access
Ms Access
 
Database Basics Theory
Database Basics TheoryDatabase Basics Theory
Database Basics Theory
 
Visual Web Developer and Web Controls VB set 3
Visual Web Developer and Web Controls VB set 3Visual Web Developer and Web Controls VB set 3
Visual Web Developer and Web Controls VB set 3
 
Visual Web Developer and Web Controls CS set 3
Visual Web Developer and Web Controls CS set 3Visual Web Developer and Web Controls CS set 3
Visual Web Developer and Web Controls CS set 3
 
Progamming Primer Polymorphism (Method Overloading) VB
Progamming Primer Polymorphism (Method Overloading) VBProgamming Primer Polymorphism (Method Overloading) VB
Progamming Primer Polymorphism (Method Overloading) VB
 
Programming Primer EncapsulationVB
Programming Primer EncapsulationVBProgramming Primer EncapsulationVB
Programming Primer EncapsulationVB
 
Programming Primer Encapsulation CS
Programming Primer Encapsulation CSProgramming Primer Encapsulation CS
Programming Primer Encapsulation CS
 
Programming Primer Inheritance VB
Programming Primer Inheritance VBProgramming Primer Inheritance VB
Programming Primer Inheritance VB
 
Programming Primer Inheritance CS
Programming Primer Inheritance CSProgramming Primer Inheritance CS
Programming Primer Inheritance CS
 
ProgrammingPrimerAndOOPS
ProgrammingPrimerAndOOPSProgrammingPrimerAndOOPS
ProgrammingPrimerAndOOPS
 
Web Controls Set-1
Web Controls Set-1Web Controls Set-1
Web Controls Set-1
 
Understanding IDEs
Understanding IDEsUnderstanding IDEs
Understanding IDEs
 
Html Server Image Control VB
Html Server Image Control VBHtml Server Image Control VB
Html Server Image Control VB
 
Html Server Image Control CS
Html Server Image Control CSHtml Server Image Control CS
Html Server Image Control CS
 
Html Server Anchor Control VB
Html Server Anchor Control VBHtml Server Anchor Control VB
Html Server Anchor Control VB
 
Html Server Anchor Control CS
Html Server Anchor Control CSHtml Server Anchor Control CS
Html Server Anchor Control CS
 

Recently uploaded

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Web Server Controls VB Set 1

  • 1. 1 A Programme Under the compumitra Series WEB SERVER CONTROLS SET – 2 LAB WORK GUIDE
  • 2. 2 OUTLINE ControlGroup1VB (in VB) Using Following Web Server Controls.  TextBox, Button, Label
  • 3. 3 ControlGroup1VB Using VB in asp.net  ASP:TEXTBOX Supports Autocomplete, Autopostback, Single or Multiline Mode in addition to standard properties related to colors, size, style etc.  ASP:BUTTON Supports Use of OnClientClick, UseSubmitBehaviour, PostBackUrl type of activity in addition to usual properties.  ASP:LABEL Supports programmatically placed content on desired location. This session will explain you about three asp controls namely Textbox, Button and Label used simultaneously in the same website page. This helps you to understand passing of values between controls.
  • 4. InheritanceVB -Web Site Creation-1 From Start Page Click New Website and reach this screen 2. Select 'ASP.NET Empty Web Site' 3. Select Location=File System 4. Click 'Browse..' tab to select the location where you want to save your Web Site 5. click 'OK' 1. Select Language=Visual Basic  By default Your Web Site shall be saved in the Location- "C:Documents and SettingsMy DocumentsVisual Studio 2010WebSites." Change it to "C:Learner<student-id>WebControlsControlGroup1VB" folder
  • 5. ControlGroup1VB -Web Site Creation-2 In the Solution Explorer Window Select the path -> Right click -> Add New Item…
  • 6. InheritanceVB -Web Site Creation-3 'Add New Item' dialog box will open 1. Select 'Web Form' 2. Simply Click on 'Add' button
  • 7. 77 ControlGroup1VB -TextBox tool-1 1. Toolbox will appear here. If not already open, open this using the 'View' Menu. You may have to right click on title bar of tool-bar to make it dockable Your default.aspx template will open 2. Make Sure that the default.aspx is opened in design view mode.
  • 8. 88 Drag and Drop TEXTBOX 2. Drag and Drop 'TextBox' in the div area seen in the design view. ControlGroup1VB -TextBox tool - 2 1. Select the 'TextBox' from 'Standard' Toolbox Optional Technique is to place the cursor at appropriate place in design view and then double click the control from the tool box.
  • 9. 99 ControlGroup1VB – BUTTON Placement After selection Drag and Drop 'Button' in div
  • 10. 1010 ControlGroup1VB -LABEL Placement-1 2. Select the 'Label' from 'Standard' Toolbox 1. Press 'Enter' key to bring the cursor one line below.
  • 11. 1111 ControlGroup1VB -LABEL Placement-2 After selection Drag and Drop 'Label' here.
  • 12. 1212 ControlGroup1VB -LABEL Properties setting-1 2. Select the Label 1. Then open the Properties window by Selecting 'Properties Window' in 'View' menu Or By pressing 'F4' Key.
  • 13. 1313 ControlGroup1VB -LABEL Properties setting-2 Set the 'Text' Property equal to Null (Remove predefined text).
  • 14. 1414 ControlGroup1VB -Go to Default.aspx.vb Double click on 'Button'
  • 15. 15 ControlGroup1VB -Type Code and Run Type the "Label1.Text=TextBox1.Text" Between Sub Button1_Click and End Sub. And Run Code By pressing 'F5' Your double click action on previous page has actually created this code at the back end.
  • 16. 16 ControlGroup1VB -Output Type any text here, press button to see that text transferred to label control placed below. Output on browser Just Now You completed an exercise where you created a 3 control form that had both client side and server side codes. This is the power of ASP.NET where client side code and server side code can be kept in separate files.
  • 17. 1717 ControlGroup1VB -Stop Debugging Stop Debugging by Selecting 'Stop Debugging' option in 'Debug' menu.
  • 18. 18 ControlGroup1VB Modification Trials –TextBox Property-1 1- Set 'BackColor' = 'Aqua' 'BorderColor' = '#0033cc' 'BorderStyle' = 'Double' 'BorderWidth' = '4px' 2- And see effects On 'TextBox'.
  • 19. 19 ControlGroup1VB Modification Trials –TextBox Property-2 1- Set 'AutoCompleteType' = 'DisplayName' 2- And 'TextMode' = 'MultiLine' 3- Then see effects On 'TextBox'.
  • 20. 20 ControlGroup1VB Modification Trials –Button Property-1 1- Set 'BackColor' = 'Pink' 2- And 'Text' = 'Press Me' 3- Then see effects On 'Button'.
  • 21. 21 ControlGroup1VB Modification Trials –Button Property-2 1- Set 'Height' = '30px' And 'Width' = '100px' 2- Then see effects On 'Button'.
  • 22. 22 ControlGroup1VB Modification Trials –Label Property-1 1- Set 'Font Name' = 'Arial' 2- And 'ToolTip' = 'This is Output value'
  • 23. 23 ControlGroup1VB Modification Trials –Source view Press 'Source' tab to see source view Source code of 'Default.aspx'
  • 24. 24 ControlGroup1VB Modification Trials –Label2 Drag and Drop another 'Label' And set 'Text' property = Blank
  • 25. 25 ControlGroup1VB Modification Trials –Default.aspx.vb-2 Then run code and see Type 'Label1.Text = TextBox1.Text Label2.Text = " Font of Label1 = " & Label1.Font.ToString()' in 'Sub Button1_Click' method Go to 'Default.aspx.vb' page
  • 26. 26 ControlGroup1VB Modification Trials – OnClientClick  Go to asp:button control and add onclientclick="MsgBox('Hello')" in 'Default.aspx'. Now type following script in the Head Section. <script type="text/javascript"> function MsgBox (textstring) { alert (textstring) } </script> Now run and see that a local alert box comes even when the server side button code is run. You just learned a client side code in javascript. Remember that Javascript is not JAVA. Always treat these two languages as entirely different things. Javascript is run by a web browser on the computer running the web browser. Java is a full fledged programming language to develop web applications or to develop application on any operating system.
  • 27. 27 ControlGroup1VB Modification Trials – UseSubmitBehaviour  Go to asp:button control source and add UseSubmitBehavior="True" in 'Default.aspx'. Now run and see the effect on Chrome/Firefox browser. You will see that the button will run on pressing ENTER key too. When this is set to "False" the button will not run on ENTER key. This is because browser's submit behaviour is not getting activated when it is made false. The behaviour of other browsers may depend on its settings. Please note that when you press enter key, the cursor of browser should not be placed on the corresponding button, else browser will execute the button handler directly. We shall discuss submit behaviour in detail at a later point.
  • 28. 28 ControlGroup1VB Modification Trials – PostBackURL  Go to asp:button control source and add PostBackUrl="Hyperlink.aspx" in 'Default.aspx'. Also copy your previous website file default.aspx in webcontrolshyperlink folder and rename it to hyperlink.aspx in your current website directory. Now run and see the effect in browser. You will see that when the button is pressed it targets you to another URL hyperlink.aspx. What's so great about reaching another URL with button. This is actually a ASP.NET way to take data from previous pages. When a link is reached through PostbackURL, one can read the values of control in the previous page using the PreviousPage Property. This we shall see in another lab with sample codes.
  • 29. 29 Ask and guide me at sunmitraeducation@gmail.com Share this information with as many people as possible. Keep visiting www.sunmitra.com for programme updates.