Welcome to RP's venture...Here you can find some of the relative topics like ASP.Net, C#.Net,VB.Net, SQL Server, AJAX, Javascripts, Sharepoint, WPF, WCF, Silverlight, MVC, General knowledge, Jokes, Fun, Technical, Non-Technical etc.
0

Method Overriding in C# with Examples

Posted by Rajendra Prasad Panchati on Friday, August 13, 2010
A tutorial on method overriding in C#

Introduction

Method overriding in C# is a feature like the virtual function in C++. Method overriding is a feature that allows you to invoke functions (that have the same signatures) that belong to different classes in the same hierarchy of inheritance using the base class reference. C# makes use of two keywords: virtual and overrides to accomplish Method overriding. Let's understand this through small examples.

Case 1:

class BC
{
  public void Display()
  {
     System.Console.WriteLine("BC::Display");
  }
}

class DC : BC
{
  new public void Display()
  {
     System.Console.WriteLine("DC::Display");
  }
}

class Demo
{
  public static void Main()
  {
     BC b;
     b = new BC();
     b.Display();    
  }
}

Output

BC::Display
 
The above program compiles and runs successfully to give the desired output. It consists of a base class BC and a derived class DC. Class BC consists of function Display(). Class DC hides the function Display() it inherited from the base class BC by providing its on implementatin of Display(). Class Demo consists of entrypoint function Main(). Inside Main() we first create a reference b of type BC. Then we create an object of type BC and assign its reference to reference variable b. Using the reference variable b we invoke the function Display(). As expected, Display() of class BC is executed because the reference variable b refers to the object of class BC.
Now we add a twist of lime to the above program.

Case 2:

class BC
{
  public void Display()
  {
     System.Console.WriteLine("BC::Display");
  }
}

class DC : BC
{
  new public void Display()
  {
     System.Console.WriteLine("DC::Display");
  }
}

class Demo
{
  public static void Main()
  {
     BC b;
     b = new BC();
     b.Display();    

     b = new DC();
     b.Display();    
  }
}

Output

BC::Display
BC::Display
 
Here we are creating an object of Derived class DC and storing its reference in the reference variable b of type BC. This is valid in C#. Next, using the reference variable b we invoke the function Display(). Since b contains a reference to object of type DC one would expect the function Display() of class DC to get executed. But that does not happen. Instead what is executed is the Display() of BC class. That's because the function is invoked based on type of the reference and not to what the reference variable b refers to. Since b is a reference of type BC, the function Display() of class BC will be invoked, no matter whom b refers to. Take one more example.

Case 3:

class BC
{
  public void Display()
  {
     System.Console.WriteLine("BC::Display");
  }
}

class DC : BC
{
  new public void Display()
  {
     System.Console.WriteLine("DC::Display");
  }
}

class TC : BC
{
  new public void Display()
  {
     System.Console.WriteLine("DC::Display");
  }
}

class Demo
{
  public static void Main()
  {
     BC b;
     b = new BC();
     b.Display();    

     b = new DC();
     b.Display();    

     b = new TC();
     b.Display();    
  }
}

Output

BC::Display
BC::Display
BC::Display
 
The output of the above program is a receipt of the fact that no matter to whom base class reference b refers, it invokes the functions of the class that matches its type. But doesn't this sound absurd? If b contains the reference to a perticular derived class object, then its supposed to invoke the function of that class. Well, C# helps us do this by the usage of keywords virtual and override as shown in the following program.

Case 4:

class BC
{
  public virtual void Display()
  {
     System.Console.WriteLine("BC::Display");
  }
}

class DC : BC
{
  public override void Display()
  {
     System.Console.WriteLine("DC::Display");
  }
}

class Demo
{
  public static void Main()
  {
     BC b;
     b = new BC();
     b.Display();    

     b = new DC();
     b.Display();    
  }
}

Output

BC::Display
DC::Display
 
The above program compiles and runs successfully to give the expected desired output. The function Display() of Base class BC is declared as virtual, while the Derived class's implementation of Display() is decorated with the modifier override. Doing so enables C# to invoke functions like Display() based on objects the reference variable refers to and not the type of reference that is invoking the function. Hence in the above program when b refers to the object of class BC it invokes Display() of BC and then when b refers to the object of class DC it invokes Display() of class DC. Let's see if this holds true for the third generation of derived classes. Take the following program.

Case 5:

class BC
{
  public virtual void Display()
  {
     System.Console.WriteLine("BC::Display");
  }
}

class DC : BC
{
  public override void Display()
  {
     System.Console.WriteLine("DC::Display");
  }
}

class TC : DC
{
  public override void Display()
  {
     System.Console.WriteLine("TC::Display");
  }
}

class Demo
{
  public static void Main()
  {
     BC b;
     b = new BC();
     b.Display();    

     b = new DC();
     b.Display();    

     b = new TC();
     b.Display();    
  }
}

Output

BC::Display
DC::Display
TC::Display
 
The above program compiles and runs successfully to give the expected desired output. The function Display() of Base class BC is declared as virtual, while the implementation of Display() in successive Derived classes is decorated with the modifier override. Next, we succesively create objects of each class and store their reference in base class reference variable b and invoke Display(). The rite versions of Display get invoked based on the object the reference variable refers to. Time for a tiny teaser! Guess what the output would be in the following program?

Case 6:

class BC
{
  public virtual void Display()
  {
     System.Console.WriteLine("BC::Display");
  }
}

class DC : BC
{
  public override void Display()
  {
     System.Console.WriteLine("DC::Display");
  }
}

class TC : DC
{

}

class Demo
{
  public static void Main()
  {
     BC b;

     b = new TC();
     b.Display();    
  }
}

Output

DC::Display
 
Since TC has no implementation of Display(), it inherits Display() from DC as TC is derived from DC. Hence Display() from Derived class DC gets executed. It's as if the derived class TC looked like this:
Collapse
class TC 
{
  public override void Display()
  {
     System.Console.WriteLine("DC::Display");
  }
}
to the compiler. Take one more example. Guess what its output will be.

Work to the viewer:


class BC
{
  public virtual void Display()
  {
     System.Console.WriteLine("BC::Display");
  }
}

class DC : BC
{
  public override void Display()
  {
     System.Console.WriteLine("DC::Display");
  }
}

class TC : DC
{
  public new void Display()
  {
     System.Console.WriteLine("TC::Display");
  }
}

class Demo
{
  public static void Main()
  {
     BC b;

     b = new TC();
     b.Display();    
  }
}

Output

DC::Display
 
Agreed that TC defines its own new version of Display(). But its version of display is not invoked as Display() of TC does not override the Display() of the base class. With this understood we are done with Method overriding in C#.

|
0

Validator server Controls

Posted by Rajendra Prasad Panchati on Thursday, August 12, 2010
Validation Server Control Description
CompareValidator Compares the value of one input control to the value of another input control or to a fixed value
CustomValidator Allows you to write a method to handle the validation of the value entered
RangeValidator Checks that the user enters a value that falls between two values
RegularExpressionValidator Ensures that the value of an input control matches a specified pattern
RequiredFieldValidator Makes an input control a required field
ValidationSummary Displays a report of all validation errors occurred in a Web page

|
0

Cookies and Session State

Posted by Rajendra Prasad Panchati on Thursday, August 12, 2010
When a user navigates to your site, the server establishes a unique session for that user that lasts for the duration of the user's visit. For each session, ASP.NET maintains session state information where applications can store user-specific information. For more information, see ASP.NET Session State Overview topic.
ASP.NET must track a session ID for each user so that it can map the user to session state information on the server. By default, ASP.NET uses a non-persistent cookie to store the session state. However, if a user has disabled cookies on the browser, session state information cannot be stored in a cookie.
ASP.NET offers an alternative in the form of cookieless sessions. You can configure your application to store session IDs not in a cookie, but in the URLs of pages in your site. If your application relies on session state, you might consider configuring it to use cookieless sessions. However, under some limited circumstances, if the user shares the URL with someone else—perhaps to send the URL to a colleague while the user's session is still active—then both users can end up sharing the same session, with unpredictable results. For more information on configuring your application to use cookieless sessions, see the ASP.NET State Management Overview topic.

|
0

Comparing the GridView and DataGrid Web Server Controls

Posted by Rajendra Prasad Panchati on Thursday, August 12, 2010
The GridView control is the successor to the DataGrid control. Like the DataGrid control, the GridView control was designed to display data in an HTML table. When bound to a data source, the DataGrid and GridView controls each display a row from a DataSource as a row in an output table.
Both the DataGrid and GridView controls are derived from the WebControl class. Although it has a similar object model to that of the DataGrid control, the GridView control also has a number of new features and advantages over the DataGrid control, which include:
  • Richer design-time capabilities.
  • Improved data source binding capabilities.
  • Automatic handling of sorting, paging, updates, and deletes.
  • Additional column types and design-time column operations.
  • A Customized pager user interface (UI) with the PagerTemplate property.
Differences between the GridView control and the DataGrid control include:
  • Different custom-paging support.
  • Different event models.
Improved Design-Time Capabilities

Sorting, paging, and in-place editing of data requires additional coding when using the DataGrid control. The GridView control enables you to add sorting, paging, and editing capabilities without writing any code. Instead, you can automate these tasks, along with other common tasks such as data binding to a data source, by setting properties on the control.
If you are working in a designer, such as Microsoft Visual Studio, you can take advantage of designer features built into the GridView control. The GridView control includes support for a smart tag panel that provides a convenient interface for performing common tasks, such as setting properties and launching template editing.

Improved Data Source Binding Capabilities

Typically a DataSet control, a DbDataReader control, or a collection, such as an Array, an ArrayList, or some other class in the System.Collections namespace, is assigned to the DataSource property of either the DataGrid control or the GridView control. The DataGrid control and the GridView control can bind any object that implements the IEnumerable or IListSource interface.
While the DataGrid control can declaratively bind a DataSourceControl control, it can do so only for data selection. Sorting, paging, updates, and deletions must be coded manually. The GridView control supports a DataSourceID property that takes any object that implements the IDataSource interface and can, therefore, take advantage of the data source control's sorting, paging, updating, and deleting capabilities, for example, the SqlDataSource control.

Additional Column Types

The GridView control supports the following column types: BoundField, HyperLinkField, ButtonField, CommandFieldImageField, and CheckBoxField

Built-In and Custom Paging Support

The DataGrid control requires additional coding for paging. The GridView control automatically supports paging by setting the PagerSettings property. The PagerSettings property supports four modes: Numeric(default), NextPrevious, NumericFirstLast, and NextPreviousFirstLast. The Numeric mode displays numbered page links instead of "next/prev" links, and the NumericFirstLast option adds first and last page links. The GridView control's PagerStyle property can be used to set styles and the position of the pager.
Additionally, you can customize the pager buttons for the GridView control using a PagerTemplate.
Custom paging support in the GridView is supplied by the bound data source control as opposed to the AllowCustomPaging mechanism supplied by the DataGrid control.

Expanded Event Model

The DataGrid and the GridView controls have different event models.
The DataGrid control raises single events for operations, while the GridView control is capable of both pre-operation and post-operation events. The GridView control supports the Sorting event that occurs when a field is sorted. Note that this sorting event occurs before the GridView control automatically handles the sort operation, giving you the opportunity to examine or change the SortExpression property, or cancel this operation by setting the Cancel property to true on the passed event arguments.
The GridView control supports the Sorted event that occurs after the GridView control completes the sort operation, giving you the opportunity to change or format the result of the sort operation. In comparison, the DataGrid control supports the SortCommand event that occurs when a column is sorted. Similarly, the GridView control supports RowUpdating and RowUpdated events that occur before and after the GridView control has automatically handled the update operation. In comparison, the DataGrid control supports the UpdateCommand event that occurs when the Update button is clicked for an item in the grid.

For more information on GridView events, see GridView Web Server Control Events.

|
0

ASP.NET Page Life Cycle Overview

Posted by Rajendra Prasad Panchati on Thursday, August 12, 2010
General Page Life-Cycle Stages


Stage
Description
Page requestThe page request occurs before the page life cycle begins. When the page is requested by a user, ASP.NET determines whether the page needs to be parsed and compiled (therefore beginning the life of a page), or whether a cached version of the page can be sent in response without running the page.
StartIn the start stage, page properties such as Request and Response are set. At this stage, the page also determines whether the request is a postback or a new request and sets the IsPostBack property. The page also sets the UICulture property.
InitializationDuring page initialization, controls on the page are available and each control's UniqueID property is set. A master page and themes are also applied to the page if applicable. If the current request is a postback, the postback data has not yet been loaded and control property values have not been restored to the values from view state.
LoadDuring load, if the current request is a postback, control properties are loaded with information recovered from view state and control state.
Postback event handlingIf the request is a postback, control event handlers are called. After that, the Validate method of all validator controls is called, which sets the IsValid property of individual validator controls and of the page.
RenderingBefore rendering, view state is saved for the page and all controls. During the rendering stage, the page calls the Render method for each control, providing a text writer that writes its output to the OutputStream object of the page's Response property.
UnloadThe Unload event is raised after the page has been fully rendered, sent to the client, and is ready to be discarded. At this point, page properties such as Response and Request are unloaded and cleanup is performed.


  Life-Cycle Events     

Page EventTypical Use
PreInitRaised after the start stage is complete and before the initialization stage begins.
Use this event for the following:
  • Check the IsPostBack property to determine whether this is the first time the page is being processed. The IsCallback and IsCrossPagePostBack properties have also been set at this time.
  • Create or re-create dynamic controls.
  • Set a master page dynamically.
  • Set the Theme property dynamically.
  • Read or set profile property values.
    NoteNote
    If the request is a postback, the values of the controls have not yet been restored from view state. If you set a control property at this stage, its value might be overwritten in the next event.
InitRaised after all controls have been initialized and any skin settings have been applied. The Init event of individual controls occurs before the Init event of the page.
Use this event to read or initialize control properties.
InitCompleteRaised at the end of the page's initialization stage. Only one operation takes place between the Init and InitComplete events: tracking of view state changes is turned on. View state tracking enables controls to persist any values that are programmatically added to the ViewState collection. Until view state tracking is turned on, any values added to view state are lost across postbacks. Controls typically turn on view state tracking immediately after they raise their Init event.
Use this event to make changes to view state that you want to make sure are persisted after the next postback.
PreLoadRaised after the page loads view state for itself and all controls, and after it processes postback data that is included with the Request instance.
LoadThe Page object calls the OnLoad method on the Page object, and then recursively does the same for each child control until the page and all controls are loaded. The Load event of individual controls occurs after the Load event of the page.
Use the OnLoad event method to set properties in controls and to establish database connections.
Control eventsUse these events to handle specific control events, such as a Button control's Click event or a TextBox control's TextChanged event.
NoteNote
In a postback request, if the page contains validator controls, check the IsValid property of the Page and of individual validation controls before performing any processing.
LoadCompleteRaised at the end of the event-handling stage.
Use this event for tasks that require that all other controls on the page be loaded.
PreRenderRaised after the Page object has created all controls that are required in order to render the page, including child controls of composite controls. (To do this, the Page object calls EnsureChildControls for each control and for the page.)
The Page object raises the PreRender event on the Page object, and then recursively does the same for each child control. The PreRender event of individual controls occurs after the PreRender event of the page.
Use the event to make final changes to the contents of the page or its controls before the rendering stage begins.
PreRenderCompleteRaised after each data bound control whose DataSourceID property is set calls its DataBind method. For more information, see Data Binding Events for Data-Bound Controls later in this topic.
SaveStateCompleteRaised after view state and control state have been saved for the page and for all controls. Any changes to the page or controls at this point affect rendering, but the changes will not be retrieved on the next postback.
RenderThis is not an event; instead, at this stage of processing, the Page object calls this method on each control. All ASP.NET Web server controls have a Render method that writes out the control's markup to send to the browser.
If you create a custom control, you typically override this method to output the control's markup. However, if your custom control incorporates only standard ASP.NET Web server controls and no custom markup, you do not need to override the Render method. For more information, see Developing Custom ASP.NET Server Controls.
A user control (an .ascx file) automatically incorporates rendering, so you do not need to explicitly render the control in code.
UnloadRaised for each control and then for the page.
In controls, use this event to do final cleanup for specific controls, such as closing control-specific database connections.
For the page itself, use this event to do final cleanup work, such as closing open files and database connections, or finishing up logging or other request-specific tasks.
NoteNote
During the unload stage, the page and its controls have been rendered, so you cannot make further changes to the response stream. If you attempt to call a method such as the Response.Write method, the page will throw an exception.


                       


|
0

Give Anonymous access to a .Net website on IIS5.1

Posted by Rajendra Prasad Panchati on Wednesday, August 11, 2010

|
0

Display ‘Please Wait’ popup

Posted by Rajendra Prasad Panchati on Tuesday, August 10, 2010

This procedure explains how to add a ‘Please wait’ screen to an ASP.net application.


By default at server process (e.g. saving a request) you only see a progress bar in the status bar.statusBar . If it’s a long running process you might not see any update for a longer time, and users might think that the application stopped, is already finished or did not even start because they did not press the correct button. This might result in double clicks on the Save button or closure of the browser window without completion.
Therefore it is better to display message in the middle of the screen so the user is aware that there is something going on. Current procedure describes how to disable all existing web controls (buttons etc.), coloring all areas in dark gray (fade out) and display an animated circle next to a “Please wait” text.
clip_image002
The procedure has been created based on ASP.net 2005 (2.0) and Microsoft’s Ajax Control Toolkit Release 11119.

CSS

Add the following lines to your CSS file:
/*Modal Popup*/ 
.modalBackground {
    background-color:Gray;
    filter:alpha(opacity=70);
    opacity:0.7;
} 

.modalPopup {
    background-color:#ffffdd;
    border-width:3px;
    border-style:solid;
    border-color:Gray;
    padding:3px;
    text-align:center;
}

.hidden {display:none}

JavaScript

Add the following JavaScript Code to your aspx page:
<script type="text/javascript" language="javascript">

         function pageLoad(sender, args) {
            var sm = Sys.WebForms.PageRequestManager.getInstance();
            if (!sm.get_isInAsyncPostBack()) {
                sm.add_beginRequest(onBeginRequest);
                sm.add_endRequest(onRequestDone);
            }
        }

        function onBeginRequest(sender, args) {
            var send = args.get_postBackElement().value;
            if (displayWait(send) == "yes") {
                $find('PleaseWaitPopup').show();
            }
        }

        function onRequestDone() {
             $find('PleaseWaitPopup').hide();
        }

        function displayWait(send) {
            switch (send) {
                case "Save":
                    return ("yes");
                    break;
                case "Save and Close":
                    return ("yes");
                    break;
                default:
                    return ("no");
                    break;
            }
        }
    </script>
Taking a closer look at the script you see the last function “displayWait”. There you could define on which buttons the ‘Please wait’ screen should be displayed. In current example the button has to have the text “Save” or “Save and Close”. On all other buttons the “Please wait” screen will not be displayed. Of course you should modify this function according to your needs.

Buttons in Ajax Update Panel

Add an Update Panel to your aspx page. Place your buttons in the Update-Panel. At least the buttons which should display the ‘Please wait’ screen need to be in the UpdatePanel, but you could of course also add other buttons etc. there.
<asp:UpdatePanel ID="PleaseWaitPanel" runat="server" RenderMode="Inline">
    <ContentTemplate>
       <asp:Button ID="Save" runat="server" Text="Save" OnClick="Save_Click" />
       <asp:Button ID="SaveClose" runat="server" Text="Save and Close" OnClick="SaveClose_Click" />
    </ContentTemplate>
</asp:UpdatePanel>

Aspx Controls

Add a Panel, Button and a ModalPopupExtender to your aspx page. The Panel will be displayed in the middle of the screen. The hidden button is necessary for the ModalPopupExtender as it needs a TargetControl.
<asp:Panel ID="PleaseWaitMessagePanel" runat="server" CssClass="modalPopup" Height="50px" Width="125px">
    Please wait<br />
    <img src="ajax-loader.gif" alt="Please wait" />

Image

Add an animated gif to your project. Check Ajaxload.info to create your own if you like, otherwise you might use this one: ajax-loader

Build

That’s it. Now build your application. Or maybe you want to download the example.

|
0

Play a Video from asp.Net application

Posted by Rajendra Prasad Panchati on Tuesday, August 10, 2010
Here is a code sample.
  1. Create a .aspx file in your site and delete the code-behind file . We need only a single .aspx file.
  2. Put the code below into the page.
  3. Run the site and load the page.
  4. Address the video URL in the TextBox and press the Play button.


 <%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
 protected void btnPlay_Click(object sender, EventArgs e)
 {
  try
  {
   string mySourceUrl = this.TextBox1.Text;
   bool isFullSize = false;
   this.Literal1.Text = this.GetWmaObject(mySourceUrl, isFullSize);
  }
  catch (Exception ex)
  {
   this.Response.Write(ex.ToString());
  }
 }
 private string GetWmaObject(string sourceUrl, bool isFullSize)
 {
  string myObjectTag = "";
  sourceUrl = sourceUrl + "";
  sourceUrl = sourceUrl.Trim();
  if (sourceUrl.Length > 0)
  {
   //Continue.
  }
  else
  {
   throw new System.ArgumentNullException("sourceUrl");
  }
  
  string myWidthAndHeight = "";
  if (isFullSize)
  {
   myWidthAndHeight = "";
  }
  else
  {
   myWidthAndHeight = "width='640' height='480'";
  }
  myObjectTag = myObjectTag + "<object classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' id='player' " + myWidthAndHeight + " standby='Please wait while the object is loaded...'>";
  myObjectTag = myObjectTag + "<param name='url' value='" + sourceUrl + "' />";
  myObjectTag = myObjectTag + "<param name='src' value='" + sourceUrl + "' />";
  myObjectTag = myObjectTag + "<param name='AutoStart' value='true' />";
  myObjectTag = myObjectTag + "<param name='Balance' value='0' />"; //-100 is fully left, 100 is fully right.
  myObjectTag = myObjectTag + "<param name='CurrentPosition' value='0' />"; //Position in seconds when starting.
  myObjectTag = myObjectTag + "<param name='showcontrols' value='true' />"; //Show play/stop/pause controls.
  myObjectTag = myObjectTag + "<param name='enablecontextmenu' value='true' />"; //Allow right-click.
  myObjectTag = myObjectTag + "<param name='fullscreen' value='" + isFullSize.ToString() + "' />"; //Start in full screen or not.
  myObjectTag = myObjectTag + "<param name='mute' value='false' />";
  myObjectTag = myObjectTag + "<param name='PlayCount' value='1' />"; //Number of times the content will play.
  myObjectTag = myObjectTag + "<param name='rate' value='1.0' />"; //0.5=Slow, 1.0=Normal, 2.0=Fast
  myObjectTag = myObjectTag + "<param name='uimode' value='full' />"; // full, mini, custom, none, invisible
  myObjectTag = myObjectTag + "<param name='showdisplay' value='true' />"; //Show or hide the name of the file.
  myObjectTag = myObjectTag + "<param name='volume' value='50' />"; // 0=lowest, 100=highest
  myObjectTag = myObjectTag + "</object>";
  return myObjectTag;
 }
 
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
  <br />
  <br />
  <asp:literal id="Literal1" runat="server"></asp:literal>
  <br />
  <br />
  <asp:textbox id="TextBox1" runat="server" width="500px" height="50px" wrap="true" textmode="multiLine" 
readonly="false" >http://download.microsoft.com/download/8/3/6/836dd5f8-fa92-499f-8219-0d326f13bf18/hilo_data_final.wmv</asp:textbox>
  <br />
  <br />
  <asp:button id="btnPlay" runat="server" text="Play" onclick="btnPlay_Click" />
    </div>
    </form>
</body>
</html>

|
0

Menu Control

Posted by Rajendra Prasad Panchati on Tuesday, August 10, 2010
For Menu Controls U'll be needed UI Code & Style sheet given below.

UI Code:
    Place this piece of code in aspx/ascx file.
 
<ul class="cssMenu cssMenum" style="display: table; width: 150px;">
        <li class=" cssMenui" style="width: 150px;"><a class=" cssMenui" href="#" >
            <h2 style="text-align:center;">    Menu
                </h2>
            <![if gt IE 6]></a> <![endif]>
            <!--[if lte IE 6]><table><tr><td><![endif]-->
            <ul class=" cssMenum" style="margin-left: 148px !important; margin-left: 144px; margin-top: -20px;">
                <li class=" cssMenui">   <a class=" cssMenui" href="#"> Sub Menu1<![if
                    gt IE 6]> </a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]-->
                    <!--[if lte IE 6]></td></tr></table></a><![endif]-->
                </li>
                <li class=" cssMenui"><a class=" cssMenui" href="#"> Sub Menu2<![if
                    gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]-->
                    <!--[if lte IE 6]></td></tr></table></a><![endif]-->
                </li>
                <li class=" cssMenui"><a class=" cssMenui" href="#"> Sub Menu3
                <![if gt IE 6]></a><![endif]><!--[if lte IE 6]><table><tr><td><![endif]-->
                    <!--[if lte IE 6]></td></tr></table></a><![endif]-->
                </li>
            </ul>
            <!--[if lte IE 6]></td></tr></table></a><![endif]-->
        </li>
</ul>
Style Sheet:
     Place this styles in a style sheet from your application.

/* CSS Document @charset "utf-8"; */
ul.cssMenu ul{display:none}
ul.cssMenu li:hover>ul{display:block}
ul.cssMenu ul{position: absolute;left:-1px;top:98%;}
ul.cssMenu ul ul{position: absolute;left:98%;top:-2px;}
ul.cssMenu,ul.cssMenu ul {
    margin:0px;
    list-style:none;
    padding:0px ;
    /*background-color:#000000;
    background-repeat:repeat;*/
    border-style:none;
}
ul.cssMenu table {border-collapse:collapse;}ul.cssMenu {
    display:block;
    zoom:1;
    position:absolute;
    z-index: 1000;
   
}
* HTML ul.cssMenu {position:absolute;}
ul.cssMenu ul{
    width:192px;
}
ul.cssMenu li {
    display:block;
    margin:0px 12px 0px 0px;
    font-size:0px;
}
ul.cssMenu a:active, ul.cssMenu a:focus {
outline-style:none;
}

ul.cssMenu a, ul.cssMenu li.dis a:hover, ul.cssMenu li.sep a:hover, ul.cssMenu li.sep a:visited {
    display:block;
    vertical-align:middle;
    /*background-color:#000000;*/
    border-width:0px;
    border-color:#000000;
    border-style:none;
    text-align:left;
    text-decoration:none;
    padding:0px;
    _padding-left:0;
    font:bold 12px ;
    color: #FFFFFF;
    text-decoration:none;
    cursor:pointer;
}
ul.cssMenu span{
    overflow:hidden;
}
ul.cssMenu li {
    float:left;
}
ul.cssMenu ul li {
    float:none;
}
ul.cssMenu ul a {
    text-align:left;
    /*white-space:nowrap;*/
}
ul.cssMenu li.sep{
    text-align:left;
    padding:0px;
    line-height:0;
    height:100%;
}
ul.cssMenu li.sep span{
    float:none;    padding-right:0;
    width:3px;
    height:100%;
    display:inline-block;
    background-color:#C0AF62;    background-image:none;}
ul.cssMenu ul li.sep span{
    width:100%;
    height:3px;
}
ul.cssMenu li:hover{
    position:relative;
}
ul.cssMenu li:hover>a{
    background-color:#EFEFEF;
    border-color:#4C99AB;
    border-style:none;
    font:normal 12px Verdana, Arial, Helvetica, sans-serif;
    color: #000000;
    text-decoration:none;
}
ul.cssMenu li a:hover{
    position:relative;
    background-color:#EFEFEF;
    border-color:#4C99AB;
    border-style:none;
    font:bold 12px Verdana, Arial, Helvetica, sans-serif;
    color: #000000;
    text-decoration:none;
}
ul.cssMenu li.dis a {
    color: #AAAAAA !important;
}
ul.cssMenu img {border: none;float:left;_float:none;margin-right:3px;width:16px;
height:16px;
}
ul.cssMenu ul img {width:16px;
height:16px;
}
ul.cssMenu img.over{display:none}
ul.cssMenu li.dis a:hover img.over{display:none !important}
ul.cssMenu li.dis a:hover img.def {display:inline !important}
ul.cssMenu li:hover > a img.def  {display:none}
ul.cssMenu li:hover > a img.over {display:inline}
ul.cssMenu a:hover img.over,ul.cssMenu a:hover ul img.def,ul.cssMenu a:hover a:hover ul img.def,ul.cssMenu a:hover a:hover img.over,ul.cssMenu a:hover a:hover a:hover img.over{display:inline}
ul.cssMenu a:hover img.def,ul.cssMenu a:hover ul img.over,ul.cssMenu a:hover a:hover ul img.over,ul.cssMenu a:hover a:hover img.def,ul.cssMenu a:hover a:hover a:hover img.def{display:none}
ul.cssMenu a:hover ul,ul.cssMenu a:hover a:hover ul{display:block}
ul.cssMenu a:hover ul ul{display:none}
ul.cssMenu span{
    display:block;
    background-image:url(default.files/arrowmain.gif);
    background-position:right center;
    background-repeat: no-repeat;
   padding-right:11px;}
ul.cssMenu li:hover>a>span{    background-image:url(default.files/arrowmaino.gif);
}
ul.cssMenu a:hover span{    _background-image:url(default.files/arrowmaino.gif)}
ul.cssMenu ul span,ul.cssMenu a:hover table span{background-image:url(default.files/arrowsub.gif)}
ul.cssMenu ul li:hover > a span{    background-image:url(default.files/arrowsubo.gif);}
ul.cssMenu table a:hover span,ul.cssMenu table a:hover a:hover span{background-image:url(default.files/arrowsubo.gif)}
ul.cssMenu table a:hover table span{background-image:url(default.files/arrowsub.gif)}
/*a:link {color:#FFFFFF}       unvisited link */
/*a:visited {color:#FFFFFF}   visited link */
/*a:hover {color:#FFFFFF}   mouse over link */
/*a:active {color:#FFFFFF}   selected link */
ul.cssMenu a, ul.cssMenu li.dis a:hover, ul.cssMenu li.sep a:hover, ul.cssMenu li.sep a:visited{color:#FFFFFF;}
ul.cssMenu a, ul.cssMenu li a:hover, ul.cssMenu li a:hover, ul.cssMenu li a:visited{color:#FFFFFF;font-size:12px; font-weight:bold;font-family: Verdana, Arial, Helvetica, sans-serif;}
ul.cssMenu li a:hover {color:#000000;font-size:12px;font-weight:bold;font-family: Verdana, Arial, Helvetica, sans-serif;}

|

About Me