Tag Archives: C#

Microsoft Visual C# is simple, modern, general-purpose, object-oriented programming language, included in the Microsoft Visual Studio. Visual C# is also mostly used in ASP.NET web sites and Windows applications.

Adding Dynamic Meta Tags with Master Pages in ASP.NET using C #

Today each and every website is getting dynamic, every website for example have just on page and is being used to display the contents for various categories, hence the need for the dynamic meta title, meta description and meta keywords arises especially for implementing Search Engine Optimization(SEO) properly on your website having dynamic pages.

In a website what people do is create a Master Page and then this Master Page further contains a number of content or child pages, now what we want to have is having separate meta title, meta description and meta keywords for every child page, but here is the problem as once you run you run your website – preference is given to the meta title, meta description and meta keywords you have given in you Master Page and hence all the child pages will have same meta title, description and keywords.

Basically In ASP.NET you do not have any direct function to re write the title,description and keywords when you are working with Master Pages. To solve this problem I have written some sample code:

Continue reading Adding Dynamic Meta Tags with Master Pages in ASP.NET using C #

C# keywords

There are some reserved keywords in C# which can not be used as names for variables ,class and methods so we can say these Keywords are predefined, reserved identifiers that have special meanings to the compiler. They cannot be used as identifiers. But we can use these keywords as identifier with prefix @ . suppose @abstract can be used but only abstract cannot be used because this is a keyword.

Continue reading C# keywords

ASP:NET Reading XML Data into a DataSet object To GridView in C#

In ASP.NET you have a number of options by which you can easily read an XML Document and display an XML document in DataGrid, GridView, Repeater Control, DropDown List etc or any other control according to your requirements.
Here i will import an xml document using an inbuilt function of dataset and display the data in a GridView Control.

 

Here is the sample XML file named “country.xml” that i am using Continue reading ASP:NET Reading XML Data into a DataSet object To GridView in C#

How to use Regular expression for validating Phone Numbers in .net

Regular expressions are a good way to validate text fields such as names, addresses, phone numbers, and other user information. You can use them to constrain input, apply formatting rules, and check lengths.
You can use the System.Text.RegularExpressions.Regex class for validate any input string for any specific format.
A regular expression can easily check whether a user entered something that looks like a valid phone number. By using capturing groups to remember each set of digits, the same regular expression can be used to replace the subject text with precisely the format you want.

The following example will allow you to Input Phone Number only.

In this example we can determine whether a user entered phone number in a common format that includes 0123456789, 012-345-6789, (012)-345-6789, (012)3456789 012 3456789, 012 345 6789, 012 345-6789, (012) 345-6789, 012.345.6789 and all related combinations

Continue reading How to use Regular expression for validating Phone Numbers in .net

Regular expression for validating integer value

Regular expressions are a good way to validate text fields such as names, addresses, phone numbers, and other user information. You can use them to constrain input, apply formatting rules, and check lengths.
You can use the System.Text.RegularExpressions.Regex class for validate any input string for any specific format.
The following example will allow you to Input Integer Number only.
Continue reading Regular expression for validating integer value

Regular expression for validating email in .net

Regular expressions are a good way to validate text fields such as names, Email address, phone numbers, and other user information. You can use them to constrain input, apply formatting rules, and check lengths.

You can use the System.Text.RegularExpressions.Regex class for validate any input string for any specific format.

Following example shows that how to validate email address

Continue reading Regular expression for validating email in .net