Why and how to create RSS feeds in C#

Every user visits hundreds of websites every day. Now such user doesn’t have the time to visit the site they like every day. Such users are interested in visiting your site only when your website is updated with new articles. RSS comes as a rescue for all such visitors as it allow them to stay informed about the latest content in the sites they are interested in. Newsletter and site email also achieves this purpose but most of the visitors expect privacy and are not interested in sharing their email for weekly or daily newsletters.

Posted on: 4 May 2013 | 10:49 pm

Loop through all records in Sql server with while statement

Foreach is the common functionality in all programming language. Foreach is used for traversing items in a collection. Unlike for loop constructs which maintains a counter to loop defined number of times, foreach will essentially loop through all the items in the collection. Hence strictly speaking, there is no such foreach loop in SQL. Cursor does offer similar kind of functionality but using cursor is not the recommended approach. In this article, we will see how to implement foreach kind of functionality in SQL using While loop

Posted on: 3 May 2013 | 10:24 pm

Hide or unhide data using Visibility ValueConverter class

Data from database comes in many different ways and most of the times; you need to format the data before it is bound to the control. In silver light, we use value converter to format the data before it is bounded to the control. Simplest example of using value converter would be to format the date to be displayed in “date of birth” column.

Posted on: 2 May 2013 | 9:56 pm

Delete duplicate records from table in SQL

Redundancy is the most common issue in all databases. Very often, your database is filled up with redundant data and then you are burdened with the task of removing redundant data from your database. One of the most important tasks in this regard is deleting out the duplicate records. Writing a query to delete duplicate records is not an easy task but writing an efficient one is very important especially when your database has huge volumes of records. Let us go through some of the scenarios applicable when deleting records from a database.

Posted on: 23 April 2013 | 12:03 am

Call Codebehind method from GridView ItemTemplate Eval function

Gridview is the most common control used in an ASP.Net application. Almost, every websites make use of gridview to display tabular data. Usually, this data comes from the database or xml file, which is then bounded to gridview control. Each column of the data retrieved from the database is bound to fields (columns) of the GridView. This binding of database column with gridview column is done using Eval function. Normally, we directly bind the retrieved data from the database onto the gridview. But sometimes, it is desirable to tweak or modify the data before it is bounded to the grid column. For Ex: Instead of binding FirstName and Lastname in two separate columns, I would like to bind it in a single column as FullName, which will display FirstName followed by lastName separated by space in between. Plus I would like to append Mr. or Mrs. depending upon the gender of the person.

Posted on: 16 April 2013 | 10:21 pm

Working with AJAX ColorPickerExtender control

There is no decent inbuilt color picker in ASP.NET. You may find dozens of pure JavaScript color pickers but none of them are proficient or looks attractive in the ASP.NET page. To ease out the efforts of the coder, developer community has released a very flexible ASP.NET Ajax control that gives you select colors from the color box. Color picker is an ASP.NET Ajax control that let you pick a color from a list of all possible colors displayed in a color palette.

Posted on: 10 April 2013 | 11:42 pm

Find range of elements in HTML with jquery

Many times, there is a need to find an element in your HTML/aspx page and then do some action on that element. For EX: You may want to apply some action on elements having the same class name. JQuery is very handy in such situations since it has an inbuilt function of finding elements and then executing some action on that element in the same JQuery statement. Using JQuery, We can change the appearance of filtered elements in a HTML page very easily. In this article, we will see how to find a range of JQuery elements and then execute some action on this filtered HTML elements.

Posted on: 9 April 2013 | 11:44 pm

SQL-Removing numbers in a string

Recently, I got the requirement of removing the trailing integers in a string. This was not difficult as I had the readymade SQL function to achieve the same (Which I have used in my previous company). But the problem was I had to query the server where I did not have permissions to create functions. In this case, my readymade function was not going to help. So, I decided to write a query instead of SP or function to achieve the same.

Posted on: 4 April 2013 | 11:10 pm

Trigger custom or manual postback in ASP.NET

One of the most important features of ASP.net is the ability of manually triggering the postback event onto the server. Post back is a process by which the request is posted onto the server based on the event generated by user action. For Ex: when the user selects a dropdown, a post back event is triggered.For all the server control except Button and ImageButton, postback is generated by the JavaScript function __doPostBack(). Button and imagebutton uses the client browser functionality to submit the content onto the server. For all other controls, Asp.net runtime automatically insert the definition of __doPostBack() function in the HTML output to initiate a postback onto the page.

Posted on: 2 April 2013 | 11:26 pm

Add, remove or toggle class of HTML control using jquery.

Many times, there is a need to add, remove or modify class of an element on some user action. For EX: when a user click on a button then the button should be disabled or should become of a different color etc. JQuery is very handy in such situations. JQuery has some inbuilt functions that allow you to add, remove or toggle class of any HTML or any ASP.Net server control. In this article, we will see how to use such JQuery function to change the appearance of HTML control.

Posted on: 1 April 2013 | 11:09 pm