Sponsored Ad

Monday, February 18, 2013

C# Class Protected Method Accessibility

A protected method of a class will be accessible in any inherited class. But it is not accessible outside of class, even by using same class name.

using System;

public partial class _Default : System.Web.UI.Page
{
    class aaa
    {
        protected void abc()
        {
            int i = 1;
        }
    }

    class bbb: aaa
    {
        public void g()
        {
            abc();
        }
    }

    class ccc : bbb
    {
        public void h()
        {
            abc();
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        ccc c = new ccc();
        c.g();

        //not working
        //c.abc();

    }
}

Saturday, August 18, 2012

How to Configure the HTML5 Intellisense for Visual Studio 2008/2010

So HTML5 is getting popular and visual studio 2008/2010 is not supporting it. Lets add the intellisense for HTML5. Follow the following steps and your visual studio will support it.

Step 1: Go to the HTML 5 Intellisense for VS 2008/2010 and Download it.

Step 2: Close Visual Studio and install it. Now Open Visual Studio and go to Tools > Options > Text Editor HTML > Validation and select HTML5 from target option.

VS HTML 5 Setting

In case you don't find HTML5 in Target then follow the following steps:

Step 1: Download this zip file and extract in  folder.

HTML 5 Extracted files

Step 2: Now copy html_5.xsd file to your Visual studio installation directory, in my case it is C:\Program Files\Microsoft Visual Studio 10.0\Common7\Packages\schemas\html. You can find corresponding directory in you system depend on visual studio and OS version.

VS Installation location - HTML 5 file

Step 3: Now go to extracted version and install VS-2010-x86 registry file in your system.

Step 4: Open visual studio and go to Tools > Options > Text Editor HTML > Validation and select HTML5 from target option.

VS HTML 5 Setting

Step 5: Go to VS editor and write HTML 5 code. it is supporting now.

HTML 5 Article tag in VS editor

Sponsored Ad

Website Update

Followers