PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WEBDEV 2024 → WebDev 22 Page Initialisation Code runs twice
WebDev 22 Page Initialisation Code runs twice
Iniciado por Anthony, out., 12 2017 8:47 PM - Sem resposta
Membro registado
4 mensagems
Publicado em outubro, 12 2017 - 8:47 PM
Hi,

I have initialisation code running twice which in effect runs SQL functions within procedures twice so I thought I would test it in a new WB 22 app 1 page no other code and to me it runs twice.

1 page the only code in the init of the page is:-

sMySessionTest is string = GetGUID()
x is int = 0

Trace(sMySessionTest + CR)

LOOP(5)
x=x+1
Trace(x)
END


Which results in:-

{e3272487-8fcc-4c6a-acff-b4b8cadbdba4}<\r><\n>
1
2
3
4
5
{aecc108f-7d97-4498-be8d-31dde25662ab}<\r><\n>
1
2
3
4
5

I load the page once in the browser and to me its running the init code twice.

I noticed it on a web app that uses MS SQL in procedures which are called in the init code of the page, I can see on the MS SQL profiler its running the select statement twice.

So ignore the SQL version which I am not showing here why in this example would it run the page init code twice?

Is it expected that the init code runs twice? if so I have to remove my code from the init but how can I call it once on page load?

Thanks

Tony