June 16, 2009

ASP.NET Variables

The one of the most important parts of any coding language is variables and how to set them.

For our example we are going to use a ‘String’, please see below our code:

<% String Title = “My Title”; %>

As you can see we are setting a string named ‘Title’ with the string of “My Title”.

Now we want to display (echo / print / output) this to the page:

<%= Title %>

If you wanted to just write some text to the browser, most of the outputs in ASP.NET you will be using the ‘Response.Write()’ command instead:

Response.Write(“My Title”);

Hope you find this helpful.

Leave a Reply

Your email address will not be published. Required fields are marked *

About Host Media

We have been hosting websites since 2002 and are always moving forward. All articles written under the Host Media author are created by the team who support our customers.

Category

ASP.NET using C#

Tags

, , , ,