PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WEBDEV 2024
→
Multiple calling of Page Initialisation when load a page
Multiple calling of Page Initialisation when load a page
Started by Simon PHILLIPS, Jan., 09 2021 1:57 PM - 3 replies
Connect yourself…
Simon PHILLIPS
#1
Registered member
32 messages
Popularité : +1 (1 vote)
Posted on January, 09 2021 - 1:57 PM
Hi all
I'm not sure if this should be happening, but I have found that when a page is loaded into the browser, the Initializing of page_??? server event is called 5 times.
This happens on every page, so what I am finding is if I put any calls to the server to read/update files in this code, then it means that it calls it 5 times when really it should be just the once.
Is this normal? I am using AWP mode for the pages and find that it happens if I open a page from another page in the site, or I call the page directly from WinDev (i.e. not from the main menu.
The browser load event happens only once.
In short, should I simply move all the code in the Initializing of Page_???? into an Ajax enabled local procedure and then call it via AjaxExecute from the Browser Load event?
--
Simon Phillips
OtterReg Software
Report
0
0
Simon PHILLIPS
#2
Registered member
32 messages
Popularité : +1 (1 vote)
Posted on January, 09 2021 - 2:08 PM
Just to add a footnote to this, the Global declarations (server) is also called 5 times.
--
Simon Phillips
OtterReg Software
Report
0
0
Simon PHILLIPS
#3
Registered member
32 messages
Popularité : +1 (1 vote)
Posted on January, 09 2021 - 2:50 PM
After more investigation, I have found that all the pages on my site are based on a page template. When I have tested the calls when the pages are using the template, then it does multiple Initializations. If I just create a blank page and run that, it just does the one which is what I would have expected. I then created a new template based page with nothing on it except the template controls and it again did five refreshes.
The template has 2 loopers on it, but I have copied those onto the blank non-template page, and it works fine. I have check all the code in the template and there is nothing which would cause a page initialization.
Any ideas what could be causing this would be gratefully received.
--
Simon Phillips
OtterReg Software
Report
0
0
Simon PHILLIPS
#4
Registered member
32 messages
Popularité : +1 (1 vote)
Posted on January, 11 2021 - 8:44 PM
Ok found out what it is. Any call to the server will cause this, even if a button with no code or action is clicked, then the Page_initializing and Page Global declarations are run. This also happens if AjaxExecute is called from browser code regardless of the options that are applied.
--
Simon Phillips
OtterReg Software
Report
0
0
→ Go back to WEBDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text