c#

Class

In .NET languages, classes are templates used for defining new types. With classes we can describe both the properties and behaviors (or functionality) of objects. Properties contain the data that are exposed by the class. Behaviors are defined by the public methods (also called member functions) and events of the class. Collectively, the public properties and methods of …

Learn more

Casting

Conversion of a value from one type to another. Implicit casting is performed silently by the compiler when the casting would not cause any information to be lost (e.g., converting a 16-bit integer to a 32-bit integer value). Explicit casting is coded by the programmer using the particular language’s cast operator. This is necessary when the use of …

Learn more

C# ( C-Sharp)

An object-oriented and type-safe programming language supported by Microsoft for use with the .NET Framework defined by the standard ECMA-334. The language was created by by Anders Hejlsberg (author of Turbo Pascal and architect of Delphi), Scot Wiltamuth, and Peter Golde, specifically for building enterprise-scale applications. Its syntax is similar  to both C++ and Java and is considered …

Learn more

Base class

Classes may be used to create other classes. A class that is used to create (or derive) another class is called the Base class or Super class.

Related TutorialsRemoting
Strongly-typed
Pre-defined …

Learn more

How to convert string to int in C#

1. You could call the ToInt32 method to convert an input string to an int:

int numberVar = Convert.ToInt32(“37”);

2.You could also convert a string to an int through the Parse method of the System.Int32 struct:

int numberVar = Int32.Parse(“-37”);

Related TutorialsHow to use ViewState in C#
How to transfer information between pages in ASP.NET using cross-page posting in C#
How to preserve member …

Learn more

How to call JavaScript from ASP.NET code behind

To call JavaScript from C# code behind you should:

1. Set the Body tag in your page/master page to runat=”server” and an id=”MyBody”.
2. Code the script tag in your page:

<script src=”MyFunction.js” type=”text/javascript”></script>

3. In the code behind attach the onload attribute to the body tag:

protected void Page_Load(object sender, EventArgs e)
{
MasterPageBodyTag = (HtmlGenericControl)Page.Master.FindControl(“MyBody”);
MasterPageBodyTag.Attributes.Add(“Onload”, “MyFunction()”);
}

Related TutorialsHow to use the Calendar control in ASP.NET …

Learn more