Passing a Global Variable from Server Code to Browser Code

Startbeitrag von Clarion Ghost am 11.05.2012 18:59

Reading the tutorial, Page 54. I understand that an int Variable declared in Server Code is available to use with Browser Code..

I am declaring a variable in a Server Browser embed

Information is int
Information = 20

But when I try to pass the contents of information in a Browser Server the compiler complains when I include the variable 'Information' with the Browser Code..

Am I doing something wrong or have I just misunderstood page 54. (The note about this is in the Caution Box)

Many Thanks



What Webdev page type are you using? (What project type?)

If you use a Webdev Standard project type, then Webdev manage the variables in each page for you and you can access them in browser code.

If you use a AWP pages project type then each page is independent of the others. Then you can define the variables you want pass to pages with the Context and the functions associated.

Rubén Sánchez Peña (exClarioner)

von Ruben Sanchez Peña - am 11.05.2012 20:17
Hi Ruben

FileNew/Page/Page. I am using a plain page.

What I am trying to do is move information from the server code to use in the browser code area on the same page.

Many Thanks

von Clarion Ghost - am 11.05.2012 20:33

The reason why the compiler complained was that the Global Variable I was trying to read in the Browser Code was declared in the Page opening code. This cannot be used in the Browser Code. Passing the cursor over the error (in red) thrown up by the compiler, the tool tip explains this.

As I have said before, I will get on much better if I only learn to read!

Many Thanks

von Clarion Ghost - am 11.05.2012 22:40
Zur Information: hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.