What is this ??!

  • Thread starter Thread starter JezB
  • Start date Start date
J

JezB

I am a beginner in ASP.NET and web programming in general.

I have seen some examples on the internet in which some text set by
server-side code is "embedded" as a placeholder directly into client-side
html text (in the .aspx file). The syntax in the html text is, for example
:-

<p>Some client-side text and <%=ServerText%></p>

Now in the code-behind module (eg. c#) you can declare a public string
variable named ServerText and assign it to anything you like in Page_Load
and it seems to substitute it into the html stream, eg.

public string ServerText;

private void Page_Load(...)
{
if (!IsPostBack)
{
ServerText = "some server text";
}
}

Lo and behold when the page is rendered my paragraph reads :
Some client-side text and some server text

My questions are :
- what is the proper name for this mechanism ?
- what actually happens at run-time ?
- can anyone point me to some documentation on it (msdn or otherwise) ?
- does the string variable in the code-behind module have to be public ?
 
I would recommend downloading the free Microsoft .Net SDK (Software
Developer Kit), from the following URL:

http://www.microsoft.com/downloads/...A6-3647-4070-9F41-A333C6B9181D&displaylang=en

It has many atricles, tutorials, sample code, and a complete reference to
the .Net Common Language Runtime. You need to familiarize yourself with all
of the concepts involved, and this is one of the best free resources you can
get!

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top