Вы находитесь на странице: 1из 6

ASP .

Net User controls Competency Building Asset

CONSULTANCY SERVICES LIMITED

1. Part A: ASP .Net User controls Requirements..............................................................................3 1.1 Functional Requirements.......................................................................................................3 1.2 Critical Quality Requirements.................................................................................................3 1.2.1 Maintainability (Criticality: High)....................................................................................3 1.2.2 Portability (Criticality: Low)...........................................................................................3 2. Part B: Navigation Control Process Steps....................................................................................4 2.1 ASP .Net Common Design and Development Details............................................................4 2.2 Process Steps for Development ............................................................................................4 2.3 Mapping of Other Quality Characteristics...............................................................................5 2.3.1 Maintainability (Criticality: High)........................................................................................5 2.3.2 Portability (Criticality: Low)...............................................................................................5 3. Part C: Acceptance Criteria.........................................................................................................6

1. Part A: ASP .Net User controls Requirements


1.1 Functional Requirements (Suitability) Requirements Statement Create a user control in an ASP.net application and render it in web pages. This functionality is based on ASP.Net 2.0 using C# language. User control: Create the user control which takes input as first name and last name and on click of the button it concatenates and displays the name to the user.

Context Where does the requirement fit in the system? In a web application, we need to have some common functionality such as search, navigation menu etc, which need to be present in more than one page. These can be achieved in the form of user control. User controls can be kept centrally at one place can be inherited in multiple pages. Hence, when we need to modify the user control, changes need to be done only at one place

1.2

Critical Quality Requirements CTQ- Critical to Quality, Criticality: High/ Medium/ Low Maintainability (Criticality: High) Changeability Easily build a web application with certain user controls. Easily change the functionality of all pages just by modifying only one user control file Portability (Criticality: Low)

1.2.1

1.2.2

Insatiability

User and custom controls behave same for all the browsers. They should be supported across different platforms seamlessly. User controls can be installed in GAC and used across multiple applications.

2. Part B: Navigation Control Process Steps


ASP .Net Common Design and Development Details Refer to the document ASP.Net Common Design and Development Details for all common design and development details related to environment details, reusable framework, reusable routines etc. 2.2 Process Steps for Development Functional Requirements (Suitability) Creating and using User controls in ASP.Net.
User control could be used when you need to repeat same code on many pages. Good examples are page footer, header or some kind of site navigation.

Creating user controls


1. Create a ASP.net Web Application 2. In Solution Explorer, right-click the name of the Web site, and then click Add New Item -> Web User Control -> name it WebUserControl1.ascx. 3. In the design view, add 2 labels and 2 textboxes and 1 button. 4. Name the 2 labels as Enter First Name and Enter Second Name respectively and button as click as shown in the above figure. 5. On the button click write code for concatenating the string from the 2 textboxes.

Consuming user control in ASPX page 1. Drag and drop the user control to the ASPX pages (page1.apx), or add the code manually in
the ASPX page using @register . Ex: <% @Register Src= TagName= TagPrefix=>

The @Register directive associates aliases with namespaces and class names for notation in custom server control syntax. When you drag and drop a user control onto your .aspx pages, the Visual Studio automatically creates an @Register directive at the top of the page. This register the user control on the page so that the control can be accessed on the .aspx page by a specific name.
Src The location (relative or absolute) of the declarative ASP.NET User Controls file to associate with the tagprefix:tagname pair. TagName An arbitrary alias to associate with a class. This attribute is only used for user controls. TagPrefix An arbitrary alias that provides a shorthand reference to the namespace of the markup being used in the file that contains the directive. In our case Src = ~/WebUserControl1.ascx TagName = concatenate TagPrefix = Name

2. This piece of code references the user Control so we can use it in our page. Then use the user control where we want the Control to appear on aspx page. Code to use user control will be: <Name:concatenate runat = server />

2.3

Mapping of Other Quality Characteristics

2.3.1

Maintainability (Criticality: High) Requirement: Controls can be changed easily in one place without having to edit the individual pages in your site. Process Steps:

Place all the controls under one single folder. E.g. Controls folder.

2.3.2

Portability (Criticality: Low) Requirement: Custom controls can be installed in GAC and used across multiple applications. Process Steps:

Start-> Settings->control panel -> Administrative Tools -> .Net Framework configuration 2.0. A new .net configuration page will open. Open My Computer -> manage the assembly cache -> Add an assembly to the GAC -> Browse and open the DLL that needs to be installed -> click open -> Ok. DLL will be installed in GAC and all the other .Net application can use the custom control

3. Part C: Acceptance Criteria


Criteria a) b) Ability to build quality Execute the CBA correctly Time to build quality Productivity Benchmark productivity (experts) Minimum acceptable productivity Time to build competence in associate range UOM % hours Hours Hours Days Target Value 100

c)

Вам также может понравиться