Category Archives: General ASP.Net C#

In-memory Data Caching – few insights.

The content below assumes single Web server hosting the web application. I’m using Framework 4.0, WebForms and System.Runtime.Caching namespace’s MemoryCache class (the in-memory cache provider) meaning cache is stored in web-server’s memory. Any data or complex business object (created with … Continue reading

Posted in General ASP.Net C# | Tagged | Leave a comment

Working with Visual Studio’s Profiler

The in-built Visual Studio’s Profiler can quickly detect performance bottlenecks. To get started with Profiler, you would need Visual Studio Ultimate or Premium version. It’s located under VS top menu -> Analyze->Launch Performance Wizard. In step1, choose “Instrumentation” then follow … Continue reading

Posted in General ASP.Net C# | Leave a comment

Few random development Tips-N-Tricks-8

A simple technique to generate weekly recurring dates in C#. aspx <form id=”form1″ runat=”server”> <div> <h1>Weekly Recurring Date Generation</h1> <b>Choose Date:</b>&nbsp;<asp:Calendar ID=”Calendar1″ runat=”server”></asp:Calendar><br /> Generate Dates For every <asp:TextBox ID=”TextBox1″ runat=”server”></asp:TextBox> weeks. <br /> <asp:CheckBoxList ID=”CheckBoxList1″ runat=”server” RepeatDirection=”Horizontal” RepeatColumns=”4″> <asp:ListItem … Continue reading

Posted in General ASP.Net C# | Leave a comment

Accessing ViewState mutually between PageControl and UserControl.

In my current project, I needed to save a bool variable in UserControl’s ViewState and had to access that in the Parent Container Page. After some thought, here’s a refined approach on this task. To begin with, in asp.net webforms … Continue reading

Posted in General ASP.Net C# | Leave a comment

Revisiting FormsAuthentication.

FormsAuthentication module exists as an in-built HttpModule. For every incoming request, if it finds a valid, non-expired ‘FormsAuthenticationTicket’, it will try to authenticate the user and create a GeneralPrincipal object. The ‘GeneralPrincipal’ object represents the current user. Below are some … Continue reading

Posted in General ASP.Net C# | Leave a comment

Working extensively with Roles in Webforms.

The example below have different scenarios with roles, at various core levels, like –Role based functionalities in a given pageRole based pagesRole based foldersRole based UserControls To begin with, I created a simple forms-based website which uses the in-built membership … Continue reading

Posted in General ASP.Net C# | Tagged , | Leave a comment

ListView with multiple Checkboxes/RadioButtons.

I had a little struggle working with multiple checkboxes/radiobuttons inside a ListView. For Checkboxes inside the ListView, I needed to associate multiple column values from the underlying DataTable, as part of the value attribute. These values again needed to be … Continue reading

Posted in General ASP.Net C# | Tagged , , | Leave a comment