Category Archives: C#

generate hyphen key

In this example i am trying to do some string manipulation. Depending on the value of this string different sorts of new hyphenated string will be generated. Such as Input String is “data”, output will be “data-1” Input String is … Continue reading

Posted in C# | Leave a comment

C# : new and virtual keywords

Example demonstrate how we can access derived class method without overridng the base class method. Fiddle public class Base { public virtual void Run() { Console.WriteLine(“Base running”); } } public class Derieved : Base { public new void Run() { … Continue reading

Posted in C# | Tagged , | Leave a comment

Use and Advantage :private set

Basically, I want to create an instanceof a class, and once the instance is created, the properties of that object should not be allowed to be modified. Bit tricky, when you hear this for the first time. It can be … Continue reading

Posted in C# | Leave a comment

Populate days dropdownlist for selected month and year using javascript

In this article, i have described how we can populate number of days in day dropdownlist using javascript for the selected month and year. When we change the the month and year, the values in the days drop down will … Continue reading

Posted in ASP.NET, C#, Javascript and Jquery | Tagged , , , , , , , | Leave a comment

validate email id, input only numbers, alphabets or alphanumeric characters

Refer to jquery code below to validate numeric, alphabets, alphanumeric and validate email id fields. Function below allows users to enter only numeric values in textbox. Regular expression is used to check if the input character is numeric or not. … Continue reading

Posted in C#, Javascript and Jquery | Tagged , , , , , , , , , , , | Leave a comment

Split DataTable into multiple tables

Consider a DataTable with a column name salary, following code splits the DataTable on the basis of values in salary column, i.e all the rows in DataTable with same salary will come into one DataTable. DataTable dt= new DataTable(); dt … Continue reading

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

Events and ASP.Net

ASP.Net is an event-driven programming and responds to events through its predefined event handlers. When events are raised it must be handled. In ASP.NET, objects may raise events and may have assigned event handlers. For example, a button may raise … Continue reading

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

Implement ICallbackEventHandler Example

In this article, I have tried to explain an alternate way of achieving the AJAX functionality using ICallBackEventHandler. Many of the times we must have used core AJAX to partially update the page content. Using UpdatePanel can be another approach … Continue reading

Posted in ASP.NET, C# | Tagged , , , , | 1 Comment