A major part of any SOA implementation is the ability to return multiple data formats and while SOAP still plays a major role in SOA, the need for RSS syndication, JSON and plain XML may require you to add new functionality and steer away from traditional WCF RPC calls. With OData enabled services you...
PageRouteHandler resides in System.Web.Routing and implements IRouteHandler. It is designed to be a basic handler for Routes defined in an application, eliminating the need to implement custom IRouteHandlers when there are no business rules to validate. It can also check for access to physical files...
The ListView control is a natural progression of the GridView. It displays data by using user-defined templates instead of row fields, allowing for layout flexibility. Paging, sorting, inserting and editing records are all built into a ListView, and, can be greatly manipulated both in the layout and...
What is output caching? Output caching is a way of caching the generated HTML created from your ASP.NET pages. Output caching can cache an entire page or fragments of a page. The first request to a page is served dynamically, and then any subsequent requests are served from the output cache until the...
If you have a mobile version of your site, you probably need to detect and redirect users on mobile devices that navigate into the main site. It’s easy in ASP.NET you can just call Request.Browser.IsMobileDevice Or Request.Browser["IsMobileDevice"] Or even System.Web.HttpBrowserCapabilities myBrowserCaps...
Application.StaticObjects holds all of the objects that have been defined using <object runat="server" scope="Application"> </object> tags in Global.asax. I defined my own object and used it in the Application_OnStart() event. It worked inside visual studio; however, it...
You can easily change any AppSettings value in web.config during runtime from your C# code by using WebConfigurationManager. Configuration configuration = WebConfigurationManager .OpenWebConfiguration( "~" ); AppSettingsSection appSettings = ( AppSettingsSection )configuration.GetSection( "appSettings"...
In order to get the remote port of an http request we need to work with HttpWorkerRequest. HttpWorkerRequest is a low level class used by HttpContext. Its main function is to define the base worker methods used by ASP.NET managed code in order to process HTTP requests. Now let’s leverage it In...
Twicher is a little lunch order program I wrote using the entity framework and ASP.NET AJAX. It’s designed to run on your local office intranet and help manage lunch orders. It has a choice of menus and users can register and order for an admin to organize a delivery or a pickup. If you ever had...