This action might not be possible to undo. Are you sure you want to continue?
ASP.NET is a unified Web development model that includes the services necessary for you to build enterprise -class Web applications with a minimum of coding. ASP.NET is part of the .NET Framework, and when coding ASP.NET applications you have access to classes in the .NET Framework. You can code your applications in any language compatible with the common language runtime (CLR), including Microsoft Visual Basic and C#. These languages enable you to develop ASP.NET applications that benefit from the common language runtime, type safety, inheritance, and so on. ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language. The ASP.NET SOAP extension framework allows ASP.NET components to process SOAP messages.
After the release of Internet Information Services 4.0 in 1997, Microsoft began researching possibilities for a new web application model that would solve common complaints about ASP, especially with regard to separation of presentation and content and being able to write "clean" code. Mark Anders, a manager on the IIS team, and Scott Guthrie, who had joined Microsoft in 1997 after graduating from Duke University, were tasked with determining what that model would look like. The initial design was developed over the course of two months by Anders and Guthrie, and Guthrie coded the initial prototypes during the Christmas holidays in 1997.
The initial prototype was called "XSP"; Guthrie explained in a 2007 interview that, "People would always ask what the X stood for. At the time it really didn't stand for anything. XML started with that; XSLT started with that. Everything cool seemed to start with an X, so that's
what we originally named it." The initial prototype of XSP was done using Java, but it was soon decided to build the new platform on top of the Common Language Runtime (CLR), as it offered an objectoriented programming environment, garbage collection and other features that were seen as desirable features that Microsoft's Component Object Model platform didn't support. Guthrie described this decision as a "huge risk", as the success of their new web development platform would be tied to the success of the CLR, which, like XSP, was still in the early stages of development, so much so that the XSP team was the first team at Microsoft to target the CLR.
With the move to the Common Language Runtime, XSP was reimplemented in C# (known internally as "Project Cool" but kept secret from the public), and the name changed to ASP+, as by this point the new platform was seen as being the successor to Active Server Pages, and the intention was to provide an easy migration path for ASP developers. Mark Anders first demonstrated ASP+ at the ASP Connections conference in Phoenix, Arizona on May 2, 2000. Demonstrations to the wide public and initial beta release of ASP+ (and the rest of the .NET Framework) came at the 2000 Professional Developers Conference on July 11, 2000 in Orlando, Florida. During Bill Gates' keynote presentation, Fujitsu demonstrated ASP+ being used in conjunction with COBOL, and support for a variety of other languages was announced, including Microsoft's new Visual Basic .NET and C# languages, as well as Python and Perl support by way of interoperability tools created by Active State. Once the ".NET" branding was decided on in the second half of 2000, it was decided to rename ASP+ to ASP.NET. Mark Anders explained on an appearance on The MSDN Show that year that, "The .NET initiative is really about a number of factors, it's about delivering software as a service, it's about XML and web services and really enhancing the Internet in terms of what it can do ... we really wanted to bring its name more in line with the rest of the platform pieces that make up the .NET framework." After four years of development, and a series of beta releases in 2000 and 2001, ASP.NET 1.0 was released on January 5, 2002 as part of version 1.0 of the .NET Framework. Even prior to the release, dozens
NET.of books had been written about ASP. * Testing and Debugging A local Web server for testing and a debugger that helps you find errors in your programs. and development continued apace. This release focused on improving ASP. such as buttons and text boxes.NET's support for mobile devices Visual Web Developer Visual Web Developer is a full-featured development environment for creating ASP. * Page design features Consistent site layout with master pages and consistent page appearance with themes and skins. and Microsoft promoted it heavily as part of their platform for web services. * Deployment Tools to automate typical tasks for deploying a Web application to a hosting server or a hosting provider. The topics in this section describe what ASP. The code editor includes syntax coloration and IntelliSense. . ASP.NET Web applications.NET Web controls are and how to work with them. Guthrie became the product unit manager for ASP. Other controls encompass complex behavior. Many Web server controls resemble familiar HTML elements.NET. with version 1.NET Web pages that run when the page is requested and that render markup to a browser.1 being released on April 24.NET Controls ASP. 2003 as a part of Windows Server 2003. Visual Web Developer offers you the following features: * Web page design A powerful Web page editor that includes WYSIWYG editing and an HTML editing mode with IntelliSense and validation. such as a calendar controls. * Code editing A code editor that enables you to write code for your dynamic Web pages in Visual Basic or C#. and controls that manage data connections.NET Web server controls are objects on ASP.
NET Web server controls. reusable controls using the same techniques you use for creating ASP.NET Web Server Controls ASP. You can then embed them in ASP. A user control is a kind of composite control that works much like an ASP.NET page and then add the markup and child controls that you need.NET Web pages. you can create your own custom.NET Web page³you can add existing Web server controls and markup to a user control. User controls are containers into which you can put markup and Web server controls. where they act as a unit. These controls are called user controls. In those cases.NET User Controls In addition to using Web server controls in your ASP.NET Web pages. and define properties and methods for the control. They make it particularly easy to create controls with complex user interface elements. User Control Structure An ASP. You create the user control in much the same way you create an ASP. * Custom controls. A custom control is a class that you write that derives from Control or WebControl. you can create your own controls. User controls are substantially easier to create than custom controls.NET User Controls ASP.NET Web user control is similar to a complete ASP. A user . You can then treat the user control as a unit and define properties and methods for it.NET Web page (. You can create: * User controls. At times. with both a user interface page and code.NET Web pages.aspx file).NET Web Parts Controls ASP. because you can reuse existing controls. You have two options.y y y ASP. you might need functionality in a control that is not provided by the built-in ASP.
Other controls encompass complex behavior. such as a calendar controls.NET Web page in these ways: * The file name extension for the user control is .NET Web server controls are objects on ASP. You can use the same HTML elements (except the html. ASP. Many Web server controls are similar to familiar HTML elements. and controls that you can use to connect to data sources and display data. the page automatically sends supporting client script to the browser for AJAX functionality. or form elements) and Web controls on a user control that you do on an ASP. if you are creating a user control to use as a toolbar. When you add an AJAX control to an ASP. body. For example.NET Web pages that run when the page is requested and that render markup to the browser. These elements must be in the hosting page. Instead. These consist of server and client code that integrate to produce rich client behavior.NET Web Server Controls ASP. but this is not required. as you would any control.control can include code to manipulate its contents like a page can.NET Web page. the user control contains an @ Control directive that defines configuration and other properties. or form elements in it. A user controls differs from an ASP.NET also provides AJAX-enabled server controls. you can put a series of Button Web server controls onto the control and create event handlers for the buttons. The following are the controls which comes under web server controls: y y y Login Toolbox Controls Validation Toolbox Controls Data Toolbox Controls . * User controls cannot run as stand -alone files. You can also provide additional client code to customize the functionality of a control.ascx. including performing tasks such as data binding. ASP.NET Web page.NET pages. such as buttons and text boxes. body. you must add them to ASP. * Instead of an @ Page directive. * The user control does not have html.
NET Login Controls ASP. you create a Web pages and then add the login controls to them from the Toolbox.NET forms authentication to help automate user authentication for a Web site. Typically. By default. The default Visual Studio project templates for Web applications and for Web sites include prebuilt pages that let users register a new account. login controls integrate with ASP. you can assign users to roles and then authorize users to access specific Web pages by role. the ASP. The control displays one of two templates: the AnonymousTemplate or the LoggedInTemplate.NET membership and ASP.) Optionally.NET login controls work in plain text over HTTP. You can also create your own pages that you can add ASP. use HTTPS with SSL encryption. you restrict access to ASP. (The default project template for Web projects includes a folder named Accounts that is already configured to allow access only to logged-in users.NET pages by putting them into a protected folder. By default. The LoginView Control The LoginView control allows you to display different information to anonymous and logged-in users. In the .NET Web applications without requiring programming. If you are concerned about security.NET login control This topic contains the following sections: y y y y y y The The The The The The LoginView Control LoginStatus Control LoginName Control PasswordRecovery Control CreateUserWizard Control ChangePassword Control 1. To use the login controls.ASP. You then configure the folder to deny access to anonymous users (users who are not logged in) and to grant access to authenticated (logged-in) users.NET provides robust login (authentication) functionality for ASP. and change their passwords.NET login controls to in order to add login functionality. This topic describes each ASP. log in.
The login link takes the user to a login page. the control displays the user's Windows account name. Alternatively. . The LoginView control also includes events for ViewChanging and ViewChanged . you can add markup and controls that display information appropriate for anonymous users and authenticated users.NET membership to store passwords using non-reversible encryption. You can configure ASP. the PasswordRecovery control asks the question and checks the answer before recovering the password. 3. The PasswordRecovery control sends an e-mail message containing a password to the user. the PasswordRecovery control generates a new password instead of sending the original password to the user. respectively. You can customize the appearance of the LoginStatus control by setting the LoginText and LoginImageUrl properties.NET membership. The LoginStatus Control The LoginStatus control displays a login link for users who are no t authenticated and a logout link for users who are authenticated. 2. The PasswordRecovery Control The PasswordRecovery control allows user passwords to be retrieved based on the e-mail address that was used when the account was created. You can also configure membership to include a security question that the user must answer to recover a password. which allow you to write handlers for when the user logs in and changes status.templates. if your site uses integrated Windows authentication. The LoginName Control The LoginName control displays a user's login name if the user has logged in using ASP. In that case. The logout link resets the current user's identity to be an anonymous user. If you do. 4.
NET membership system. the CreateUserWizard control adds the new user to the ASP. The following example shows a PasswordRecovery control declared in an ASP.The CreateUserWizard control gathers the following user information: y y y y y y User name Password Confirmation of password E-mail address Security question Security answer The following example shows a typical ASP.The PasswordRecovery control requires that your application can forward e-mail message to a Simple Mail Transfer Protocol (SMTP) server. By default. <asp:PasswordRecovery ID="PasswordRecovery1" Runat="server" SubmitButtonText="Get Password" SubmitButtonType="Link"> <MailDefinition From="administrator@Contoso.aspx"> <WizardSteps> <asp:CreateUserWizardStep Runat="server" Title="Sign Up for Your New Account"> </asp:CreateUserWizardStep> <asp:CompleteWizardStep Runat="server" Title="Complete"> </asp:CompleteWizardStep> </WizardSteps> </asp:CreateUserWizard> .com" Subject="Your new password" BodyFileName="PasswordMail.NET declaration for the CreateUserWizard control: <asp:CreateUserWizard ID="CreateUserWizard1" Runat="server" ContinueDestinationPageUrl="~/Default.txt" /> </asp:PasswordRecovery> 5.NET page with MailDefinition property settings to customize the e-mail message. You can customize the text and format of the e-mail message sent to the user by setting the MailDefinition property. The CreateUserWizard Control The CreateUserWizard control collects information from potential users.
The ChangePassword control includes two templated views that are displayed to the user. which displays the user interface used to gather the data required to change the user password.NET Validation Controls The The The The The The RequiredFieldValidator Control CompareValidator Control RangeValidator Control RegularExpressionValidator Control CustomValidator Control ValidationSummary Control Validation Server Control RequiredFieldValidator CompareValidator Description Ensures that the user does not skip a form entry field Allows for comparisons between the user's input and another item using a comparison operator (equals. the control populates the text box with the user's login name. greater than. The ChangePassword Control The ChangePassword control allows users to change their password. and so on) Checks the user's input based upon a RangeValidator . If the user is authenticated. ASP. less than. which defines the user interface that is displayed after a user password has been successfully changed.6. The user must first supply the original password and then create and confirm the new password. The second template is the SuccessTemplate. If a user has not been authenticated. the user password is changed to the new password. the control prompts the user for a login name. If the original password is correct. The ChangePassword control works with authenticated and nonauthenticated users. The control also includes support for sending an e-mail message about the new password. The first is the ChangePasswordTemplate .
lowerand upper-level numbers or characters range of RegularExpressionValidator Checks that the user's entry matches a pattern defined by a regular expression. you have to set the CausesValidation property for the control to False. To prevent this.NET page to initiate validation. This is a good control to use to check e-mail addresses and phone numbers CustomValidator ValidationSummary Checks the user's entry using customcoded validation logic Displays all the error messages from the validators in one specific spot on the page Not all button clicks are equal Normally. You may not want each and every button on the ASP. you don't want that button click to validate the contents contained in the Web form. or LinkButton control on the page that submits the form and causes the validation to initiate. ImageButton. If the user clicks one of these buttons. The RequiredFieldValidator Control The RequiredFieldValidator server control makes sure that the user enters something into the field that it is associated with in the form. This might not be the functionality that you are always looking for in your Web forms. there is some sort of Button. For instance. <asp:Button id="Button1" runat="server" Text="Button" CausesValidation="False"></asp:Button> 1. you might have a Cancel or Reset button on the Web page. You need to tie the RequiredFieldValidator to each control that is a required field in the form. Although this is the simplest of the . in a series of HTML form elements.
you use the RangeValidator server control.validation server controls. To see an example of using the RequiredFieldValidator server control. you just set the Operator³DataTypeCheck. or Currency in the CompareValidator control to make sure that the user's input into the field is the specified type. a database value. Date. <asp:RangeValidator id="RangeValidator1" runat="server" ControlToValidate="TextBox1" Type="Integer" ErrorMessage="You must be between 30 and 40" . create a Web form that contains a TextBox server control and a Button server control. 2. as illustrated in Listing 9. Instead of being greater than or less than a specific constant. For instance. When comparing against data types. Integer. Next to the button. but the RangeValidator server control compares what is entered into the form field with two values and makes sure that what was entered by the user is between these two specified values. you want the values entered to be between a specific range of numbers. imagine that you have a text box where you want end users to enter their ages. The CompareValidator Control The CompareValidator server control compares the value entered into the form field to another field. Using the RangeValidator server control to work with a range of numbers Age: <asp:TextBox id="TextBox1" runat="server"></asp:TextBox>  . place a RequiredFieldValidator server control. you can set the Type attribute to String. After that is done. you must understand certain things about it. For this. Double. 3. The RangeValidator Control The RangeValidator server control is similar to the CompareValidator server control. or other value that you specify.
You can also use the Date value for the Type property to make sure that the entry is between specific date ranges. it is considered to have the value of String. the RangeValidator server control fires an error message and considers the form submission invalid. For example. the value is being checked against a range that is specified by using the MaximumValue and MinimumValue properties.MaximumValue="40" MinimumValue="30"></asp:RangeValidator> In this case. such as String. you can use the String data type with the RangeValidator server control to make sure that the value entered falls within a specific range of characters. as illustrated in Listing 10. in this example. you can easily do this by using the RangeValidator server control. The RegularExpressionValidator Control The RegularExpressionValidator server control is a validation control that enables you to check the user's input based on a pattern defined by a regular expression. 4. Notice. Date. This is a great control to check whether the user has entered a valid e -mail address or telephone number. and Currency. If not specified. that the Type property is not specified. These choices enable you to do a number of range comparisons. In the . Double. <asp:RangeValidator id="RangeValidator1" runat="server" ControlToValidate="TextBox1" ErrorMessage="Your last name needs to be between M and P" MaximumValue="Q" MinimumValue="M"></asp:RangeValidator> In the example in Listing 10. it doesn't need to be specifie d because the default value of the Type property is String. In this case. The Type property enables you to make comparisons against many different . the user should enter a value between 30 and 40 in the text box. if the user is entering her last name. If some number is entered that is outside of this range. For instance.NET Framework types. and you want only people with last names starting with M and P to proceed. Comparing an entry to a range of characters Last name: <asp:TextBox id="TextBox1" runat="server"></asp:TextBox>  . just as you can use the String data type in the CompareValidator server control. Integer. Also. you can use the Currency value in the Type property to retrieve monetary -value entries that are within a certain range.
Understanding the Difference Between the ErrorMessage and Text Properties In the examples shown so far using the ValidationSummary server control. when the validation server control is triggered. <asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ErrorMessage="You must enter your first name" ControlToValidate="TextBox1"></asp:RequiredFieldValidator> </p> <p>Last name <asp:TextBox id="TextBox2" runat="server"></asp:TextBox>  . One ideal way of presenting this validation-error information is to have an asterisk (*) appear next to the HTML form fields in question. . <asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server" ErrorMessage="You must enter your last name" ControlToValidate="TextBox2"></asp:RequiredFieldValidator> </p> <p> <asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Submit"></asp:Button> </p> <p> <asp:ValidationSummary id="ValidationSummary1" runat="server" HeaderText="You received the following errors:"> </asp:ValidationSummary> </p> <p> <asp:Label id="Label1" runat="server"></asp:Label> </p> Using this kind of construct. while the error messages stating what is wrong with the input appear in the list of errors shown within the ValidationSummary control. the error messages were next to the ite ms that were being validated (the RequiredFieldValidator server controls) and were displayed within the ValidationSummary server control. . error messages similar to the ones shown in Figure 9 appear on the screen.
NET Data Controls 1. Data Binding with the GridView Control The GridView control provides you with two options for binding to data: y y Data binding using the DataSourceID property. Data binding using the DataSource property. edit. and delete data from many different kinds of data sources. you can display. including the GridView control.NET provides a number of tools for showing tabular data in a grid. You can use the GridView control to do the following: y y Automatically bind to and display data from a data source control. and updating. XML files. and updating. ASP.ASP.NET datasets and data readers. Additionally. This approach requires you to write code for any additional functionality such as sorting. paging. which allows you to bind to various objects. including ADO. paging. and business objects that expose data. Grid view list A recurring task in software development is to display tabular data. edit. This is the recommended approach because it allows the GridView control to take advantage of the capabilities of the data source control and provide built-in functionality for sorting. Utilizing templates to create custom user interface (UI) elements. you can customize the appearance and behavior of the GridView control by doing the following: y y y Specifying custom columns and styles. which allows you to bind the GridView control to a data source control. sort. including databases. page through. Adding your own code to the functionality of the GridView control by handling events. and delete data from a data source control. With the GridView control. Select. .
alternating items. ListView ListViewItem ListViewDataItem . edit. or edit-mode items. The GridView control also allows you to specify the format of the columns. Additionally. and alignment of the GridView control's rows. you can enable the control to automatically support update and delete operations on the bound data. similar to the DataList and Repeater controls. ListView Control The ASP. In addition to the control displaying returned data. selected items. 2. The ListView control displays data in a format that you define by using templates and styles.When you bind to a data source using the DataSourceID property. insert. You can display items individually. You can configure the control to enable users to select. sort. and delete data. Formatting Data Display in the GridView Control You can specify the layout. It is useful for data in any repeating structure. You can display data in pages. and to sort and page data. or you can group them. An object that represents a data item in the ListView control. unlike those controls. Class Description A server control that displays the values of a data source by using user-defined templates. all without code. However. You can specify the display of text and data contained in the rows. font. An object that represents an item in the ListView control. The following table lists the key classes that are related to the ListView control. color. delete. with the ListView control you can enable users to edit. the GridView control supports two-way data binding.NET ListView control enables you to bind to data items that are returned from a data source and display them. you can specify whether the data rows are displayed as items. and insert records.
For more information and an example. . similar to the DetailsView control. The FormView control is typically used for updating and inserting new records. or to jump to the first or last page of data. A server control that provides paging functionality for controls that implement the IPageableItemContainer interface. The difference between the FormView and the DetailsView controls is that the DetailsView control uses a tabular layout where each field of the record is displayed as a row of its own. the FormView control does not specify a pre-defined layout for displaying the record. FormView Control The FormView control is used to display a single record at a time from a data source. The FormView control is often used in combination with a GridView control for master/detail scenarios. you create templates to display and edit data-bound values. 3.ListViewItemType An enumeration that identifies the function of items in a ListView] control. and binding expressions used to create the form. The templates contain controls. TemplatePagerField A DataPager field that enables users to create a custom paging UI. When you use the FormView control. Instead. The FormView control lets you work with a single record from a data source. see Modifying Data Using a FormView Web Server Control. DataPager NumericPagerField A DataPager field that enables users to move through pages of data one page at a NextPreviousPagerField time. such as the ListView A DataPager field that enables users to select a page of data by page number. In contrast. you create a template that contains controls to display individual fields from the record. It is often used in master/detail scenarios where the selected record of the master control determines the record to display in the FormView control. and formatting that define the look and functionality of the form. binding expressions. The template contains the formatting. controls.
set the AllowPaging property to true and specify a PagerTemplate value. update. insert. inserting. and delete operations of the associated data source control. where each data row represents a field in the record. The FormView control can automatically page over the data in its associated data source one record at a time. the DetailsView control displays each field of a record on its own line. edit. The DetailsView control is typically used for updating and inserting new records. This requires that the data is represented by an object that implements the ICollection interface. or that the underlying data source supports paging. even if its data source exposes multiple records. The DetailsView control relies on the capabilities of the data source control to perform tasks such as updating. 4. By default. inserting. The FormView control exposes several events that you can handle to execute your own code. It is often used in combination with a GridView control for master/detail scenarios. often in a master/detail scenario where the selected record of the master control determines the record to display in the DetailsView control. even if its data source exposes multiple records. You can also write handlers for the ItemCreated and ItemCommand events. The FormView control displays only a single data record at a time. and deleting records. The DetailsView control does not support sorting. and deleting records. DetailsView Control The DetailsView control displays a single record from a data source. provided that the data is represented by an . The events are raised before and after insert. The DetailsView control can automatically page over the data in its associated data source. To enable paging behavior. The DetailsView control displays only a single data record at a time.The FormView control relies on the capabilities of the data source control to perform tasks such as updating. or delete a single record at a time from its associated data source. The FormView control provides the user interface (UI) for navigating between records. The DetailsView control gives you the ability to display.
The DataList Web server control displays data in a format that you can define using templates and styles. such as ordering them in columns or rows. The format for displaying the data is defined in templates that you create. Header. You can also customize the control to support other functionality. you can configure the DataList control to allow users to edit or delete information. DataList Control The DataList Web server control displays rows of database information in a customizable format. set the AllowPaging property to true. You can create templates for items.object supporting the ICollection interface or that the underlying data source supports paging. Optionally. footer. and editing modes. The DataList control is useful for data in any repeating structure. 5. selection. The record displayed by the DetailsView control is the current selected record. alternating items. such as a table. . By including Button Web server controls in the templates. To enable paging behavior. The DetailsView control provides the user interface (UI) for navigating between data records. you can connect the list items to code that allows users to switch between display. and edit items. and separator templates are also available to let you customize the overall appearance of the DataList. The DataList control can display rows in different layouts. You select a particular record from the associated data source by paging to that record. selected items. such as selecting rows.
NET Web Parts Control The ASP. This overview covers the fundamental aspects of the Web Parts control set. it is helpful to be familiar with the essential Web Parts controls described in the following table. but some controls are essential either because they are required for Web Parts to work. As you begin using Web Parts and creating basic Web Parts pages. WebPartManager CatalogZone EditorZone . including a description of the most frequently used and essential Web Parts components needed to create a Web Parts page.NET Web Parts control set is a group of components that work together to enable you to create Web pages on which end users can modify the appearance and behavior of the user interface (UI) directly from a browser. Contains EditorPart controls. Categories of Web Parts Components The Web Parts control set consists of three fundamental building blocks: personalization capabilities. Web Parts Essential Controls The Web Parts control set is extensive. or because they are the controls most frequently used on Web Parts pages. Contains CatalogPart controls. Use this zone to create a catalog of Web Parts controls from which users can select controls to add to a page. The following diagram illustrates the relationships among these building blocks in the Web Parts control set.ASP. Use this zone to enable users to edit and personalize Web Parts controls on a page. One (and only one) WebPartManager control is required for every Web Parts page. Web Parts control Description Manages all Web Parts controls on a page. UI structural components required for using Web Parts UI controls on a page. and the Web Parts UI controls themselves.
Pages can contain one or more zones. Contains WebPartConnection controls. Whenever any of these controls are placed in a zone. The connection defines one of the Web Parts controls as a provider (of data). or custom controls as Web Parts controls. Contains a list of available Web Parts controls that users can add to the page. Renders the primary UI. For maximum programmatic control.WebPartZone Contains and provides overall layout for the WebPart controls that compose the main UI of a page. Serves as the base class specialized editor controls. and provides a UI for managing connections. Use this zone whenever you create pages with Web Parts controls. user controls.. the control WebPartManager automatically wraps them with GenericWebPart controls at run time so that you can use them with Web Parts functionality. Creates a connection between two Web Parts controls on a page. ConnectionsZone WebPart (GenericWebPart ) You can also use existing server controls. for the CatalogPart WebPartConnection EditorPart . and the other as a consumer. most Web Parts UI controls fall into this category. you can create custom Web Parts controls that derive from the base WebPart control.
Set the height and units. BehaviorEditorPart. WebPart Control Property Title ChromeType Select the direction that content flows on the Direction page. For a code example. Select the title and border option type. Appearance Editor Part Web Server Control The AppearanceEditorPart Web server control provides an editor control that enables end users to edit several user interface (UI) properties on an associated WebPart control.WebControls. LayoutEditorPart.. you can use the other EditorPart controls supplied with the Web Parts control set. The following table lists user customizable features and corresponding WebPart control property values that are editable by using the AppearanceEditorPart control. see System.WebParts.UI. and the PropertyGridEditorPart controls. the LayoutEditorPart. You can also create a custom editor control by inheriting from the EditorPart class. User Customizable Feature Set the text for the title.Web. The built-in EditorPart controls provide commonly used editing features for WebPart controls. These controls include the BehaviorEditorPart.EditorPart controls (AppearanceEditorPart. and PropertyGridEditorPart) Allow users to personalize various aspects of Web Parts UI controls on a page.::.EditorPart . Height Width Hidden To enable editing of other properties and of the behavior of WebPart controls. The AppearanceEditorPart control enables end users to edit several UI properties of a WebPart control. Hide or show the control. Set the width and units.
Set the Title icon image link. Specify whether a Web part can be minimized. Set the Catalog icon image link. Set the authorization filter. WebPart Control Property y Description TitleUrl TitleIconImageUrl CatalogIconImageUrl HelpUrl Hidden HelpMode ExportMode AuthorizationFilter AllowClose AllowEdit AllowHide AllowMinimize y y y y y y y y y y y y . Set the Title link. User Customizable Feature Set the description text of the Web Part. Specify whether a Web part's properties can be edited. The BehaviorEditorPart Web server control is an editor part control that enables end users to change several user interface (UI) properties on an associated WebPart control at run time. Specify whether a Web part can be removed from the page.BehaviorEditorPart Web Server Control The BehaviorEditorPart control provides an editor control that enables end users to change properties that affect the behavior of an associated WebPart or GenericWebPart control. The following table lists user customizable features and the corresponding WebPart control property values that users can edit by using the BehaviorEditorPart control. Hide or show the control. Specify whether a Web part can be hidden. Set the Help link. Specify the Help mode. Select the export mode.
The two controls can be WebPart controls or any other type of server control. you must still connect the controls. Using Web Parts controls. To learn more about Web Parts connections. . see Web Parts Connections Overview and the WebPartConnection and ConnectionPoint class overviews. and the other control acts as the consumer. ConnectionsZone Web Server Control The ConnectionsZone Web server control provides a user interface (UI) that enables users to form connections between WebPart and other server controls that reside in WebPartZoneBase zones. After you have configured the controls to form a Web Parts connection. You can connect controls in these ways: y Declare a connection in a Web page. A key feature of Web Parts controls such as the CatalogZone control is that they enable end users to personalize Web pages and save their personalized settings. you can enable users to create connections at run time between two server controls to form a connection and share data. The CatalogZone control serves as the primary control in the Web Parts control set for hosting CatalogPart controls on a Web page. They must be designed to handle connections and they must be in a WebPartZoneBase zone. The control enables end users to add WebPart controls or other server controls to a Web Parts page at run time.Specify whether a Web part can be moved between zones. or only within its own zone. y AllowZoneChange CatalogZone Web Server Control The CatalogZone control serves as the primary control in the Web Parts control set for hosting CatalogPart controls on a Web page. One control acts as the provider of data.
BehaviorEditorPart Lets users customize behavior properties of a WebPart control at run time. One aspect of modifying Web Parts pages includes editing the appearance. It is an optional control that is not necessary to form connections. and edit buttons. and other properties of the visible WebPart controls. height. The ConnectionsZone control generates a UI that enables users to connect or disconnect any eligible controls. Several controls in the Web Parts control set provide the editing features. behavior. such as the AppearanceEditorPart width. Add a ConnectionsZone control to the page so that users can connect the controls on demand. The following table provides a list of EditorPart controls that the EditorZone can host and a description of each. it is useful when you want to give users control over which server controls are connected or disconnected. and title. EditorPart Control Description Lets users customize the visual properties of a WebPart control at run time. EditorZone Web Server Control The EditorZone Web Server control serves as the primary control in the Web Parts control set for hosting EditorPart controls on a Web page. layout.y y Create a connection in code. . A key feature of Web Parts is the ability of end users to personalize Web pages and save their personalized settings. which is the primary control in the Web Parts control set for hosting EditorPart controls on a Web page. However. close. This includes the EditorZone control. such as displaying minimize.
This includes WebPart controls. Toggling between page views Switches between page views. and displays the modes in which users can edit the Personalizing appearance. and behavior of controls. deleting. Task Managing Web Parts controls Adding and removing Web Parts controls Administering connections tasks that are performed by the Control Functionality Manages the controls on a page that provide Web Parts features. It manages all the Web Parts controls. properties.LayoutEditorPart Lets users customize layout properties of a WebPart control at run time. such as selecting a minimized or normal state. Monitors the connections for problems. controls and pages Maintains user-specific personalization settings on each page. and Web Parts events. and closing WebPart controls on a page. You must add one (but only one) WebPartManager control to every page that uses Web Parts controls. connections. Provides the methods for adding. Lets users edit custom properties at run time that are declared as part of a WebPart PropertyGridEditorPart control. Enables users to move controls on a page. or setting the index at which the control will appear within the target zone. and enables users to carry out tasks such as changing page layout or . Adds and removes connections between controls. and zones. WebPartManager Web Server Control The WebPartManager control is the central control of the Web Parts control set. Web Parts functionality. The WebPartManager control works only with authenticated users. The following table lists WebPartManager control.
see the WebZone class documentation. The WebPartZone control inherits user interface elements from the WebZone base class and provides a common UI for the controls that it contains. These common UI elements are known collectively as chrome. . header and footer. and lets users import the files to personalize controls in other pages or sites. Defines and raises life-cycle events for Web Parts Raising Web Parts controls. title. moved. Enabling import and export of controls Exports XML streams that contain the state of the properties of WebPart controls. For more information about the UI elements that the WebPartZone control inherits from the WebZone base class. such as the border. includes events for when controls are life-cycle events added. style characteristics. They consist of the peripheral UI elements on all the controls. or deleted.editing controls. and provides a common UI for the controls it contains. such as close or minimize). WebPartZone Web Server Control The WebPartZone control serves as the primary control in the Web Parts control set for hosting WebPart controls on a Web page. and verbs (UI actions that a user can carry out on a control. connected.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.