Vous êtes sur la page 1sur 5

Question 1 Can I show an image and text in a data grid column header at the same time?

Answer

Descript ion UI UI

You can encode the html for the <img> tag within the HeaderText string, and combine it with text. For example: <asp:BoundColumn HeaderText="<img src=some.gif><br>He re is some text" DataField="SomeFiel d"/>

I want to use a style sheet class directly on a control instead of using inline or page-level formatting, is it possible?

Every WebControl derived control has a CssClass property which allows you to set it's format to a style sheet.

Control

The calendar control always shows the current month, even if the selected date (SelectedDate=) is in a different month. How do I see the correct month?

You'll need to set the VisibleDate property on the Calendar as well, which is used to control the currently displayed month in the Calendar.

Control

Is it true that COM objects no longer need to be registered on the server?

Yes and No. Legacy COM objects still need to be registered on the

Deployme nt

server before they can be used. COM developed using the new .NET Framework will not need to be registered. Developers will be able to autoregister these objects just by placing them in the 'bin' folder of the application. 4 Where should the config.web file be located? The main config.web file for the site should be in the web root. You can also over-side the main config file by placing a copy into a sub web and modifying certain settings. Yes, you can use: <%@ Page Language="VB" Explicit="True" Strict="True" %> Configur ation

Is there a way to set Option Explicit and Option Strict in an ASP.Net page without using a code-behind file?

Asp.net

Is it possible to protect my sourcecode so clients can't see it?

ASP.NET supports a mode of development called "codebehind". This enables you to partition your code into a separate file from an .ASPX page

Asp.net

file (which contains your static html and server control declarations). This provides two benefits: 1) Better code/content separation/organiza tion (enabling more tool support, multideveloper support, localization support, etc). 2) Enabling you to optionally "precompile" the codebehind file before deployment on a server. This step provides (among other things) the ability to protect your source code from direct access by your customers.

How can I dynamically add user controls to a page?

User Controls can be dynamically loaded. One of the great advantages over include files here is that the code still compiles and runs

as if the user control were in the page to begin with. Public Sub Page_Load(Source As Object, E As EventArgs) UserControl myUserControl = LoadControl("myCont rol.ascx") ' Page.Controls(2) is the Form ' Controls.AddAt is used to "insert" the control ' Controls.Add can also be used to append the user control to the end of the collection Page.Controls(2 ).Controls.AddAt(0, myUserControl) End Sub

How can I place multiple forms on a single ASP.Net page?

You can have multiple HTML forms on an ASP.Net page, but you can only have one form designated as runat="server". In ASP.Net you can create the appearance of two

forms by putting all of your fields in a single server-side form and using multiple submit buttons. You can then write seperate code for the click event of each button and only deal with the appropriate fields. If you choose to use standard HTML forms, you can just use Request.Form to access the fields.

Vous aimerez peut-être aussi