Thursday, February 7, 2013

HttpHandler in Asp .Net

An ASP.NET HTTP handler is basically a process that runs in response to a request made to an ASP.NET Web application. The most common handler is the ASP.NET page handler that processes .aspx files. When users request an .aspx file, the request is processed by the page through the page handler. (Wikipedia)

I am going to create an Http Handler which will serve an image in response to a request like Shalvin.img.



public class MyHandler : IHttpHandler
{
        public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "image/jpeg";
        context.Response.WriteFile("Session.jpg");
    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }
}

For directing the application to use this handler when i request Shalvin.img I have to add a few sections in web.config.


<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.5"/>
    <httpRuntime targetFramework="4.5"/>

    <httpHandlers>
      <add verb="*" path="Shalvin.img" type="MyHandler, App_Code"/>
    </httpHandlers>
    
  </system.web>
  
  <system.webServer>
  <validation validateIntegratedModeConfiguration="false"/>

  <handlers>
    <add name="ImageHandler" verb="*" path="Shalvin.img" type="MyHandler, App_code" />
  </handlers>
  </system.webServer>
  
</configuration>



Friday, January 25, 2013

SPWeb Class with SharePoint 2013

SPWeb Class represents a web site.

The AllWebs Property of the SPSite Class will return all web sites within the site collection.

SPSite sSiteCollection = new SPSite("http://shalvin");
foreach(SPWeb sw in sSiteCollection.AllWebs)
 {
  listBox1.Items.Add(sw.Url);
  listBox1.Items.Add("Root web ? " + sw.IsRootWeb);
  listBox1.Items.Add(sw.Site);
  listBox1.Items.Add("  ");
}





The Webs property of SPWeb Calss will Return all the immediate child web sites beneath a web site.

SPcontext ctx = SPContext.Current;
SPSite site = ctx.Site;

SPWeb sw = sw.RootWeb; 
listBox1.Items.Add(web.Title);

foreach(SPWeb child in sw.Webs)
{
 listBox1.Items.Add(child.Title);
}

SPSite Class with SharePoint 2013


SPSite Class Represents a collection of sites in a web application. It comprises of the top level site and all its sub sites.
SPSite Class is under Microsoft.SharePoint namespace. Microsoft.SharePoint.dll is placed in Program Files\Common Files\Microsoft Shared\Web Server Extensions\15, also  called 15 hive.

We will start with a SharePoint 2013 Visual Web Part project.

using Microsoft.SharePoint;

SPSite sSiteCollection = new SPSite("http://shalvin");

listBox1.Items.Add(sSiteCollection.ContentDatabase);
listBox1.Items.Add("Conn String: " + sSiteCollection.ContentDatabase.DatabaseConnectionString);
listBox1.Items.Add("Web App: " + sSiteCollection.WebApplication.Name);
listBox1.Items.Add(sSiteCollection.Url);


Sunday, January 13, 2013

Trip to Arthunkal via State Highway 66

Today I took a trip to Arthunkal (Aleppey Disstrict) via State Highway 66 from Marine Drive North End. Though people used to take the NH way because it is the more familiar route, I prefer SH 66. SH 66 is pollution and traffic free. There are a lot of beaches on the way like Andhakaranazhi Beach.

Tuesday, January 8, 2013

Kerala Microsoft User Group Meeting - 19th Jan 2013 (Saturday) - Kochi


Venue: Orion India Systems Pvt Ltd, 103, 2nd floor, Tejomaya, Info park SEZ, Kakkanad, Kochin-682030  

Agenda                                                                             
09:30 - 09:40 Community updates
09:40 - 10:40 Windows Azure Web Sites by Shiju
10:40 - 11:40 TBD by Yanesh

11:40 - 11:50 Tea Break & Networking (10 min)
11:50 - 12:50 WinRT / Windows8 via C#  by Anoop

12.50 - 01:00 Ask the experts

Register

Friday, December 14, 2012

TechDays Kochi - Dec 20

December 20, 2012
09:00 am – 8:00 pm
Athullya Aditorium,
Infopark, Smart Space,
Park Office,
Athulya,
Kakkanad, Kochi – 682030

An exclusively for developers, where you'll get to be a part of Technical and Coding Sessions. It will be a unique opportunity for you to learn the design/technical tenets in building an 'Immersive Windows 8' App. The event will take you through a series of activities to help you complete your very own compelling and immersive Windows 8 App, by offering guidance on creative and technical design.

TimeDetails
09:00 am - 10:00 amRegistration
10:00 am - 10:30 amOpening Keynote
10:30 am - 11:15 amPlatform for Windows Store Apps
11:15 am - 11:30 amTea Break
11:30 am - 12:15 pmDesigning a Windows Store App
12:15 pm - 01:00 pm Windows Store Apps for .NET developers
01:00 pm - 01:30 pmMoving the web forward with Internet Explorer 10
01:30 pm - 02:30 pmLunch
02:30 pm - 08:00 pmCode Jam



Register

Friday, October 19, 2012

TiEcon Kerala 2012 (25-26 Oct)

Date: 
Thursday, October 25, 2012 - 9:30am - Friday, October 26, 2012 - 6:30pm
Location
Le Meridien Resort & Convention Centre Cochin
India

Wednesday, June 20, 2012

Kerala Microsoft User Group Meeting - 23rd June 2011 (Saturday) - Kochi

Venue: Orion India Systems Pvt Ltd, 103, 2nd floor, Tejomaya, Info park SEZ, Kakkanad, Kochin-682030 

Agenda                                                                            
09:30 - 09:40 Community updates
09:40 - 10:40 NodeJS on Windows Azure by Shiju
10:40 - 11:40 C# in Depth and Roslyn CTP by Anoop
11:40 - 11:50 Tea Break & Networking (10 min)11:50 - 12:50 Sharepoint 2010 - Out of the Box features by Shalvin
12.50 - 01:00 Ask the experts


http://k-mug.org/content/UGMeet230612.aspx