Archive for April 3rd, 2008

Creating a Layout Using Master Pages in ASP.NET?

Thursday, April 3rd, 2008

Master Pages can contain markup, controls, or code, or any combination of these elements.
a Master Page can contain a special type of control, called a ContentPlaceHolder control. A ContentPlaceHolder defines a region of the master page rendering that can be substituted with content from a page associated to the master. A ContentPlaceHolder can also contain default content, just in case the derive page does not need to override this content. The syntax of a ContentPlaceHolder control is given below:

<%– ContentPlaceHolder control –%>
<asp:contentplaceholder id=”FlowerText” runat=”server”/>

<%– ContentPlaceHolder with default content –%>
<asp:contentplaceholder id=”FlowerText” runat=”server”>
<h3>Welcome to my florist website!</h3>
</asp:contentplaceholder>

To differentiate a Master Page from a normal page, a Master Page is saved under the .master file extension. A page can derive from a Master Page by defining a MasterPageFile attribute on its Page directive, as demonstrated below. A page that is associated to a Master Page is called a Content Page.

<%@ Page MasterPageFile=”Site.master” %>

A Content Page can declare Content controls that specifically override content placeholder sections in the Master Page. A Content control is associated to a particular ContentPlaceHolder control through its ContentPlaceHolderID property.

<%@ Page MasterPageFile=”Site.master” %>

<asp:content id=”Content1″ contentplaceholderid=”FlowerText” runat=”server”>
With sunshine, water, and careful tending, roses will bloom several times in a season.
</asp:content>
<asp:content id=”Content2″ contentplaceholderid=”FlowerPicture” runat=”server”>
<asp:Image id=”image1″ imageurl=”~/images/rose.jpg” runat=”server”/>
</asp:content>

Posted by Mahesh ( Tryangled )

How do you create shared assemblies in .NET?.

Thursday, April 3rd, 2008

Following steps are involved in creating shared assemblies :
* Create your DLL/EXE source code
* Generate unique assembly name using SN utility
* Sign your DLL/EXE with the private key by modifying AssemblyInfo file
* Compile your DLL/EXE
* Place the resultant DLL/EXE in global assembly cache using AL utility

Posted by Mahesh ( Tryangled )

What is the trace utility used for?

Thursday, April 3rd, 2008

Using the SOAP Trace Utility
The Microsoft Simple Object Access Protocol (SOAP) includes a TCP/IP trace utility, MSSOAPT.EXE. You use this trace utility to view the SOAP messages sent by HTTP between a SOAP client and a service on a server. In order to use the Trace Utility, perform the following steps on the server. Open the Web Services Description Language (WSDL) file.

1) In the WSDL file, locate the <soap:address> element that corresponds to the service and change the location attribute for this element to port 8080.
For example, change

<http://MyServer/VDir/Service.wsdl>
to
<http://MyServer:8080/VDir/Service.wsdl>
2) Run MSSOAPT.exe.
3) File menu, New, Click “Formatted Trace” (if you don’t want to see HTTP headers) or click Unformatted Trace (if you want to see HTTP headers). 4) In the Trace Setup dialog box, click OK to accept the default values.

Using the Trace Utility on Client
To see all send/receive messages from a service, do the following steps on the client.
1) Copy the WSDL file from the server to the client.
2) Modify location attribute of the <soap:address> element in the local copy of the WSDL document to direct the client to
localhost:8080

Make a note of the current host and port.

For example, Change
<http://MyServer/VDir/Service.wsdl>
to
<http://localhost:8080/VDir/Service.wsdl>
and make note of “MyServer”.

3) On the client, run MSSOPT.exe.
4) File menu, New, and either click Formatted Trace (if you don’t want to see HTTP headers) or click Unformatted Trace (if you do want to see HTTP headers).
5) In the Destination host box, enter the host specified in Step 2.
6) In the Destination port box, enter the port specified in Step 2.
7) Click OK.

Posted by Mahesh ( Tryangled )