Category Archives: Uncategorized

Common ASP.Net Web Virtual and Relative Url helper classes

List of ASP.Net Web/MVC Virtual Paths,Relative and Absolute Paths Utility helper classes Property Input Url Return Value HttpRequest.ApplicationPath http://localhost/testapp/home.aspx /testapp HttpRequest.CurrentExecutionFilePath http://localhost/testapp/home.aspx /testapp/home.aspx HttpRequest.FilePath http://localhost/testapp/home.aspx /testapp/home.aspx HttpRequest.AppRelativeCurrentExecutionFilePath http://localhost/testapp/home.aspx ~/testapp/home.aspx HttpRequest.Path http://localhost/testapp/home.aspx /testapp/home.aspx/PathInfo HttpRequest.PhysicalApplicationPath http://localhost/testapp/home.aspx C:inetpubwwwrootTestApp HttpRequest.RawUrl http://localhost/testapp/home.aspx?user=1 /testapp/home.aspx?user=1 UrlHelper.Content ~/testapp/home.aspx c:inetpubwwwroottestapphome.aspx Property Input Url Return Value HttpContext.Current.Request.Url.Host http://localhost:8080/testapp/home.aspx?user=1&new=2 localhost HttpContext.Current.Request.Url.Authority http://localhost:8080/testapp/home.aspx?user=1&new=2 localhost:8080 HttpContext.Current.Request.Url.AbsolutePath http://localhost:8080/testapp/home.aspx?user=1&new=2 /testapp/home.aspx… Read More »

Common Csharp dotnet Format specifiers or Format Strings for display

Name Format String Example Comments Currency Format C or c or C2 – precision Console.WriteLine(amount.ToString(“C”)) output depends on your current UI culture Percent Format P or p or P2 – precision) Console.WriteLine(number.ToString(“P”)) output depends on your current UI culture Padding with leading zero Format 0 var input = “123”; Console.WriteLine(input.ToString(“0000”)); //result will be 0123 Replaces… Read More »

C# code snippet to Consume Google StreetViewImage API

The Google Street View Image API lets you embed a static(non-interactive) Street View panorama or thumbnail into your web page, without the use of JavaScript. The viewport is defined with URL parameters sent through a standard HTTP request, and is returned as a static image. Following is c# sample to connect with Google StreetViewImage API… Read More »

.Net Interview Question and answers

JSON and AJAX:What is JSON?Once you’ve successfully fired an AJAX request, what sort of response should the server give? An XML document? An HTML snippet? A JSON string which is converted to a JavaScript object? JSON stands for JavaScript Object Notation and is a lightweight data-interchange format. Because it is text-based it is easy for… Read More »

Click Once Deployment

Deployment term can mean an installation of software program on user’s machines. Microsoft Visual Studio 2008 provides several methods for deploying your application. A familiar technology we all know is Microsoft Installer program which offers more detailed and complex deployment scenarios with multiple configuration steps. We’ll see another alternative light weight mechanism called ClickOnce. Click… Read More »

Unity Framework v1.2 – IoC Dependency Injection

Following is the power point presentation related to IoC and Dependency Injection (DI) pattern. This presentation specifically focuses on Unity Framework v1.2 based IoC container. Integration WCF service with IoC container provides finer control over WCF instance management. Unity Framework v1.2 – IoC Dependency Injection View more presentations from guest003bf.

Microsoft MSDN PDC event at chicago on Jan 13th 2009

Good news for the Microsoft developer community in Midwest region. Microsoft is bringing PDC MSDN Live developer conference to chicago on January 13th 2009. Great oppurtunity to know about Windows 7 operating system, Azure cloud computing, Silver light, .Net parallel programming, ASP.Net 4.0 road map, Visual Studio 2010, F# stuff and much more.. Interesting though,… Read More »