Technology Guruu

  • Home
  • Site Info
    • About Us
    • Disclaimer
    • Privacy Polacy
  • Home
  • Digital Marketing
    • SEO
    • SMM
    • SEM
  • Quotes
  • Technical
  • Java
  • .Net
    • C#.Net
    • ASP.Net
  • Keychains

Monday, 4 April 2016

Web User Control in asp.net

 Akansha     17:30:00     TechnicalQuestions     No comments   

Web User Control in .net

Web User Control

  • Whenever we want to consume a user control in single web application then we will go for "Web User Control". That means at a time web user control will provide services to single web application. Web User Control is a user defined control.
  • To develop a web user control Microsoft will provide a predefined template is called web user control which we will add to the solution explorer.
How to add web user control to solution explorer
Step 1: Open solution explorer window
Step 2: Select application name
Step 3: Right click add new item it will open add new item window. Here we have to select predefined template called web user control. With this process a new web user control will added to the solution explorer window
Every web user control will be representing with mainly 2 files
a) .ascx file
b) .ascx.cs file
Implementation of web user control will be divided into following steps
Step 1: Adding web user control to the solution explorer window 
Step 2: Designing the web user control
Step 3: Defining the web user control business logic or functionality
Step 4: Registering web user control or adding web user controlto the concern web page.
.ascx File:
                 This file will support two modes
1. Design Mode:  In this mode it will display the designer window of the .aspx file. In this we can design the web user control according to the requirement.
2. Source Mode: In this mode it will display the source code of the web user control
Structure of .ascx code window:-
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="WebUserControlExample.WebUserControl1" %>

// Here it will display the source code of design

.ascx.cs File:
                   It is a c#.Net class file. Every web user control is a user defined class i.e.,webuser control1,webusercontrol2,....webusercontroln are user defined classes.
* For all these web user control classes Microsoft is providing a predefined class called user control as super class.
* user control is a predefined class which is part of System.Web.UI Base class library
Structure of .ascx.cs File:-
public partial class WebUserControl1 : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
                // Here we will write the business logic or functionality of the webusercontrol
        }
    }  
Friends You Like My Post Please Share to Your Friends Through Facebook,Twitter,Google+ etc
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Popular Posts

  • Brief description about Delegates
    Introduction about delegates and why delegates are came the main purpose of delegates how to useful and what are the advantages and disadv...
  • How do I increase organic traffic within One Month
    There’s plenty you can do boost organic site traffic at no cost except your time: Optimize for your personas, not search engines.  ...
  • Top Most Differences between windows,web and console applications
    You want to get clarity on any topic the differences very helpful at that time and in these we are having top 5 differences between conso...
  • Brief Description about Multicast Delegate
    Multicast delegate is an extension of normal delegate. It helps you to point more than one method at a single moment of time. Multicast ...
  • How to Remove Audio From Any Video Using VLC Media Player?
    Step by Step Procedure for  Remove(Mute) Audio in a Video Using VLC  Player A picture is worth a thousand words and a video is worth a t...
  • Best Methods To Get A Cheap Home Insurance Deal!
    Cheap Home Insurance Home Insurance is seen as a luxury but in all honesty it is a necessity especially in the case of natural disast...
  • Connected and Disconnected Data Access Architecture
    The Ado.Net Frame Work Supports Two Models of Data Access Architectures one is Connected Oriented architecture and second One is Disconnec...
  • Best Good Afternoon wishes greetings and quotes
    Top Most Good Afternoon Wishes Good Afternoon wishes are gives a relaxation in afternoon time.This wishing can be done between 12 to 3 p...
  • Missing My Friend Quotes : Friendship Day Quotes 2017
    Friends today my article about missing friends and moments with them. Here you are seen the best friendship quotes and some  feelings when...
  • INTERESTING PSYCHOLOGICAL FACTS ABOUT GIRLS Love In Valentines Day
    Girls Love And Caring Love feelings are very interesting to every one and moreover girls feelings are very interesting and amazing a...

Categories

  • Entertainment (67)
  • TechnicalQuestions (58)
  • Quotes (11)
  • C#.Net (8)
  • Java (8)
  • ValentinesDay (4)
  • SEO (3)
  • Home
  • About Us
  • Disclaimer
  • Privacy Policy
  • Sitemap

Copyright © 2015-2017 Good Friends 5.All Rights Reserved• And Our Sitemap • All Logos and Trademark Belongs To Their Respective Owners•