Friday, February 03, 2006

Creating Multiple Page in Web Form using IE Web Control

The Microsoft Internet Explorer WebControls are a collection of ASP.NET server controls that facilitate user interface (UI) authoring. The WebControls provide a single-source authoring solution in ASP.NET that delivers HTML content based on a browser's capabilities.

When authoring with the WebControls elements and objects in ASP.NET Web Forms, pages are generated that render and function correctly in all commonly used browsers, providing widespread reach to a diverse browsing audience. The ASP.NET server controls detect the browser type and automatically take advantage of many of the advanced capabilities in Internet Explorer 5.5 and later versions.

The WebControls include a set of Dynamic HTML (DHTML) behaviors, which are downloaded automatically from ASP.NET Web Forms to Internet Explorer 5.5 and later versions. These behaviors implement custom elements that can also be used independently of ASP.NET.

To create multiple page in a webform you must download the IE Web Controls component:
http://www.asp.net/IEWebControls/Download.aspx?tabindex=0&tabid=1

Run the setup file and build to create the .dll file.
Make sure you have \webctrl_client folder in your wwwroot directory. If don't exist, copy the directory to your wwwroot.


Open your Microsoft Visual Studio and add MultiPage and TabStrip component to the Toolbox after successfull installation. You can also add the .dll to \bin directory in your project.

For Visual Studio 2005 installation you must copy \webctrl_client folder into your project folder to enable the Tab Strip.

Then add some lines in your web.config file (after <configuration> tag):

<configSections>
<section name="MicrosoftWebControls"
type="System.Configuration.NameValueSectionHandler, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</configSections>
<MicrosoftWebControls> <add key="CommonFiles"
value="/yourwebsitename/webctrl_client/1_0/"/>
</MicrosoftWebControls>







Both component, MultiPage and TabStrip, are only editable from the html view and can not editable from the designer.


Wednesday, February 01, 2006

Designing Distributed System using VS.Net 2005 Team System

The Distributed System Designers are tools that support the graphical design and validation of distributed systems. This toolset includes tools for application architects, designers, developers and operations architects. The Distributed System Designers are an early deliverable from the Dynamic Systems Initiative (DSI), aimed at improving the development, deployment and management of enterprise-class distributed systems.

The Distributed System Designers provide an integrated design experience with the goal of enabling the visual design and validation of distributed systems. Designers use the System Definition Model (SDM) as the underlying meta-model that describes connectivity, configuration and relationships not only for the application services, but also for the run-time environments. SDM is based on a multi-layered model that includes applications, application hosting environments, network topology, operating systems, and physical devices. This model allows the Distributed System Designers to not only describe designs at each layer, but also to express constraints and policies at each layer that can cut across all layers of a distributed system.

The Distributed System Designers support an integrated model of two domains—development and operations. This allows the designers to address customer problems in the following ways:
  • Provides a common language (based on SDM) for describing the design and configuration of a distributed system.
  • Allows developers to express what the application requires of the run-time environment.
  • Allows operations to express application runtime, security, and connectivity requirements that are the policies of the target deployment environment.
  • Uses abstractions that allow developers and operations to communicate on common ground.
  • Integrates with the existing Visual Studio project system and .NET technologies.
  • Provides full synchronization between visual design elements and code.
  • Includes an extensibility framework to allow new kinds of application and hosting systems to be modeled.

The following section elaborates on the capabilities of the individual designers and editors in the Distributed System Designers toolset.

The Distributed System Designers include the following designers:

  • Application Connection Designer
  • Logical Datacenter Designer
  • System Designer
  • Deployment Designer

We will discuss these designers in the other threads.

Visual Studio 2005 Templates

Visual Studio project and item templates provide reusable and customizable project and item stubs that accelerate the development process, removing the need to create new projects and items from scratch.

A number of predefined project and item templates are installed when you install Visual Studio. For example, the Visual Basic, Visual C#, and Visual J# Windows Appliation and Class Library templates available in the New Project dialog box are all examples project templates. Installed item templates are available from the Add New Item dialog box, and include items such as XML files, HTML pages, and Style Sheets.

These templates provide a starting point for users to begin creating new projects or expanding current projects. Project templates provide the basic files needed for a particular project type, include standard assembly references, and set default project properties and compiler options. Item templates can range in complexity from a single empty file with the correct file extension to a multi-file item containing items such as source code files with stub code, designer information files, and embedded resources.

In addition to the installed templates available in the New Project and Add New Item dialog boxes, you can author your own templates or download and use templates created by the community.

All project and item templates, whether installed with Visual Studio or created by you, function with the same principles and consist of the same contents. All templates contain the following items:

  • The files to create when the template is used. This includes all source code files, embedded resources, project files, etc.
  • One .vstemplate file. This file contains the metadata that provides Visual Studio with the information it needs to display the template in the New Project and Add New Item dialog boxes and create a project or item from the template.
When these files are compressed into a .zip file and placed in the proper folder, Visual Studio automatically displays them in the My Templates section of the New Project and Add New Item dialog boxes.

Tuesday, January 31, 2006

Display a Windows Form without Recreate the Object

This is a simple code to check whether a form is already created or not.
First, if the Form is nothing then we always create the object.
Second, if the form is ever created but already disposed. The objForm contains a reference but the objForm.Created is false. We also create the object.
Otherwise, we only show and activate the form without recreate the object if the form is already created.

Private objForm as myFormName

Private Sub DisplayForm()
   If IsNothing(objForm) OrElse Not (objForm.Created) Then
      objForm= New myFormName

   End If
   objForm.Show()
   objForm.Activate()

End Sub

Create ASP.Net Page Title in Web Browser

I want to introduce you how to create page Title in your web browser. I create the title first time using Visual Studio .Net 2003.

The steps are described below:
1. Add id and runat server at your asp page.
    <title id="PageTitle" runat="server"></title>
2. Add a HtmlGenericControl object in your code-behind.
    Protected PageTitle As HtmlGenericControl
3. Set the innertext for the PageTitle object in your code-behind.
    PageTitle.InnerText = "This is a new title"

These three steps will set your web browser title to a new title.

Now I migrate my application to Microsoft .Net 2.0.
Using Microsoft .Net 2.0, the steps can be written in one line:
Page.Title = "This is a new title"

The line above is a new feature in Microsoft .Net 2.0. I create my application using Visual Studio .Net 2005. This is only one enhancement in this version.

Saturday, January 28, 2006

New Visual Studio.Net 2005 Application Folders

ASP.NET recognizes certain folder names that you can use for specific types of content. The table below lists the reserved folder names and the type of files that the folders typically contain.

The content of application folders, except for the App_Themes folder, is not served in response to Web requests, but it can be accessed from application code.

1. App_Browsers : Contains browser definitions (.browser files) that ASP.NET uses to identify individual browsers and determine their capabilities.
2. App_Code : Contains source code for utility classes and business objects (for example, .cs, .vb, and .jsl files) that you want to compile as part of your application. In a dynamically compiled application, ASP.NET compiles the code in the App_Code folder on the initial request to your application. Items in this folder are then recompiled when any changes are detected.
3. App_Data : Contains application data files including MDF files, XML files, as well as other data store files. The App_Data folder is used by ASP.NET 2.0 to store an application's local database, which can be used for maintaining membership and role information.
4. App_GlobalResources : Contains resources (.resx and .resources files) that are compiled into assemblies with global scope. Resources in the App_GlobalResources folder are strongly typed and can be accessed programmatically.
5. App_LocalResources : Contains resources (.resx and .resources files) that are associated with a specific page, user control, or master page in an application.
6. App_Themes : Contains a collection of files (.skin and .css files, as well as image files and generic resources) that define the appearance of ASP.NET Web pages and controls.
7. App_WebReferences : Contains reference contract files (.wsdl files), schemas (.xsd files), and discovery document files (.disco and .discomap files) defining a Web reference for use in an application.
8. Bin : Contains compiled assemblies (.dll files) for controls, components, or other code that you want to reference in your application. Any classes represented by code in the Bin folder are automatically referenced in your application.

Configuration settings for your site are managed in a Web.config file that is located in the site's root folder. If you have files in subfolders, you can maintain separate configuration settings for those files by creating a Web.config file in that folder.