Beginning ASP.NET 1.1 with Visual C# .NET 1002003 [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Beginning ASP.NET 1.1 with Visual C# .NET 1002003 [Electronic resources] - نسخه متنی

Chris Ullman

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید











Class Browser

In Visual Studio .NET you automatically get a display of various options as you type (IntelliSense). But in Web Matrix you have to find the names of those properties and their values on your own. The process is somewhat cumbersome and non-intuitive. After a few months of writing pages, the lack of intellisense may be the number one reason you pay the money for Visual Studio .NET.

The names of properties and their values are held in the class browser. It shares screen space with the properties window in the lower right of the Web Matrix screen. Click on the Classes tab, and then you will probably want to make the window wider and higher while you use it. F2 toggles the Toolbox on and off to make more room. In the class browser, you will see a list of the names of classes, many of which will be completely foreign to your experience. Let's run through an example that shows how to use the tool.

Some of these examples use vocabulary and theory covered in the book, so if you've just started reading, you may have to follow the steps without a complete understanding of the terminology.

The technique to use the class browser consists of five steps:



In the Properties window, switch to the Class tab



Expand a class until you see the object of interest, and then double-click on the object to open its description in the central screen



In the central screen, expand the members of the object until you see the item of interest



Double-click on that item to see a description



Click on the hyperlink to read further documentation



Note that when you open a class browser page, it is a sister to your ASP.NET pages in the center of the screen. You can switch between the windows with Ctrl+F6 or by going to Windows and then selecting your page. You can also tile the ASP.NET page and the class browser page.

In this exercise, we will use the class browser to see if we can set the Text property of a checkbox to a certain alignment.

Try It Out - Class Browser Property Look-Up




Create a page named ExerciseClassBrowser1.aspx in your MatrixPractice folder. Add an asp:CheckBox (from the Toolbox Web Controls). Be sure you use CheckBox, and not CheckBoxList. Now you need to find out if you can align the text.



Open the class browser by selecting the Class tab at the lower right. Recall that all <asp: > controls are part of the ASP.NET Web Controls class. Find that class in the list (near the top) and expand it by clicking on the + sign. In the list you see your <asp:CheckBox>. Double-click on it to open information on the control in the central part of the screen. On the left is a tree that gives you options to view the properties, methods, and other members of the CheckBox control. If you expand Properties, you see a TextAlign property available (see Figure B-11):


Figure B-11



To know the syntax and possible values, double-click on the TextAlign property in the left side of the page (Figure B-11) and you get some details in the center panel. These details are not of much use so click on the link to read MSDN documentation on the Web.



The Web page gives many details that are of little use to you. However, if you scroll down you can see an example that shows the proper syntax. Near the top of the page is a section on property values with a link that takes you to a table of values, including Left and Right.



Now that you know that the asp:CheckBox control supports alignment of text and have learnt the acceptable values, add the following to your page. Remember to use Ctrl+F6 to switch between the ASPX page and the class browser information page. Take a look at the Design view or Preview view in the tab at the bottom of the page space. Change the TextAlign value to

right to see the difference:

<form runat="server">
<asp:CheckBox id="CheckBox1"
runat="server"

textalign="right">
</asp:CheckBox>
</form>




/ 220