Latest posts on tagged on "CSharp"

Assign values to enum and how to get value from enum?

11 July 2016

You can assign any values to the element of enumeration List. In this example, I will show to how to assign values and datatype and get integer value from enum.

Get you domain name from URL

9 July 2016

It can be achieved by two methods, getting the domain hosted name using URL request Request.Url.Host and another by Uri.

Xml dropdownlist bind in asp.net?

22 June 2016

In this example, I will show you to bind dropdownlist with an xml file using ReadXml() method. In order to read data from cities.xml file into a dataset from the specified path using Server.MapPath.

C sharp partial class

20 June 2016

When working with large projects, partial class splits the class for multiple programmers to work on it at the same time.

Passing string to view mvc

5 June 2016

In this example I will show you how to pass string to view mvc in application. The appropriate way to you must cast in to an object and return as view. In view model you must define the object type and write the string in required place.

Passing IEnumerable string to view mvc

5 June 2016

In this example I will show you how to pass IEnumerable string to view mvc in application. I used string array with array elements contains list of names. I filtered names having length >=5 and assigned to IEnumerable string varable. The appropriate way to pass data from controller to view, is to pass the filterednames to the view

How to create xml file using linq in C#?

2 June 2016

In this example I will show you how to create xml document using Linq .In order to extract data from a database and create an xml document we need to include the namespace using System.Xml.Linq.