473,656 Members | 2,793 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is this ??!

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 ?
Nov 18 '05 #1
1 901
I would recommend downloading the free Microsoft .Net SDK (Software
Developer Kit), from the following URL:

http://www.microsoft.com/downloads/d...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.

"JezB" <je***********@ blueyonder.co.u k> wrote in message
news:OE******** *****@TK2MSFTNG P10.phx.gbl...
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 ?

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3882
by: Randell D. | last post by:
I have just recompiled, upgraded to PHP 4.3.4. As an exercise (and curiosity) I've decided to test out PDF functions and got the test in the PHP online manual working. I had one problem whereby the example refered to Times New Roman - I didn't have this, but I did have Times-Roman which worked. My question - How do I know what fonts I *do* have available? I've run phpinfo() and gd_info() which I hope is enough to tell some wise person...
2
3077
by: thecrow | last post by:
Alright, what the hell is going on here? In the following code, I expect the printed result to be: DEBUG: frank's last name is burns. Instead, what I get is: DEBUG: frank's last name is burns. Here is the code: $frank = "burns";
220
18997
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have any preconceived ideas about it. I have noticed, however, that every programmer I talk to who's aware of Python is also talking about Ruby. So it seems that Ruby has the potential to compete with and displace Python. I'm curious on what basis it...
699
33863
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it could be possible to add Pythonistic syntax to Lisp or Scheme, while keeping all of the...
9
2671
by: Martin Maney | last post by:
In my copious spare time I've been dabbling at getting a computerized version of a board game working. After deciding that tk just made me want to vomit, and wx was like swimming through concrete slurry, and others I have mercifully forgotten about, I stumbled across pygame. (maybe not for the first time; I think I set it aside earlier because it was described as being aimed at a different sort of game, and besides, I had hoped wx might...
92
6441
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption? cheers, reed
3
2421
by: Ron_Adam | last post by:
Ok... it's works! :) So what do you think? Look at the last stacked example, it process the preprocess's first in forward order, then does the postprocess's in reverse order. Which might be usefull. Interesting in any case. Making decorators with this class is a snap!
12
11146
by: Dario | last post by:
The following simple program behaves differently in Windows and Linux . #include <stdexcept> #include <iostream> #include <string> using namespace std; class LogicError : public logic_error { public: string desc;
30
15429
by: James Conrad StJohn Foreman | last post by:
After 3 years of using DB2 on Linux, I'm leaving my current employers to go work for a SQL Server shop instead. In order to find my replacement, they're trying to put together a set of questions to get both some understanding of how wide candidates knowledge is, and how much DB2 specifics they know. Of the questions below, how many do you think are useful in determining if you've got somebody capable of keeping a DB2 instance up,...
2
1631
by: yogesh | last post by:
char TCGI::x2c(char *what) { register char digit; digit = (char) ((what >= 'A' ? ((what & 0xdf) - 'A')+10 : (what - '0'))); digit *= (char) 16; digit += (char) ((what >= 'A' ? ((what & 0xdf) - 'A')+10 : (what - '0'))); return(digit); }
0
8382
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8498
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8600
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5629
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.