473,414 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Page Load Phasing

Hi,

I am generating a popup window for data entry using the javascript
window.open function:

window.open('ViewItem.aspx', Index, WindowSetUp) ;

I need to generate some controls dynamically in ViewItem.aspx, the type of
controls generated are dependant on Index.

I need to pass the Index value to ViewItem.aspx and I am using a hidden
control (hCatIndex) and small java function to store the info:
function PassData()
{
var CatIndex ;

CatIndex = document.getElementById("hCatIndex") ;
CatIndex.value = window.dialogArguments ;
}

PassData() is run when the page is loaded, the problem is that the script is
run after the Page_Load() of ViewItem and I need the info before this.

Can I get the script (PassData) to run before Page_Load ?

Is this a valid way to pass data between Client and Server or is there a
better way.
I am using Visual Studio .Net 2003.
Any ideas or comments would be most appreciated.
Best Regards

Gary Coutts

Mar 18 '06 #1
2 1100
Hi Gary,

Normally, Session or Cookie is used to transfer (share) data between pages.

And it’s impossible to run javascript code before Page_Load. javascript
runs on client-side. Page_Load event is on server-side. Only after all
server–side event, page is rendered on client-side, then there are chances to
run javascript code.
HTH

Elton Wang

"Gary Coutts" wrote:
Hi,

I am generating a popup window for data entry using the javascript
window.open function:

window.open('ViewItem.aspx', Index, WindowSetUp) ;

I need to generate some controls dynamically in ViewItem.aspx, the type of
controls generated are dependant on Index.

I need to pass the Index value to ViewItem.aspx and I am using a hidden
control (hCatIndex) and small java function to store the info:
function PassData()
{
var CatIndex ;

CatIndex = document.getElementById("hCatIndex") ;
CatIndex.value = window.dialogArguments ;
}

PassData() is run when the page is loaded, the problem is that the script is
run after the Page_Load() of ViewItem and I need the info before this.

Can I get the script (PassData) to run before Page_Load ?

Is this a valid way to pass data between Client and Server or is there a
better way.
I am using Visual Studio .Net 2003.
Any ideas or comments would be most appreciated.
Best Regards

Gary Coutts

Mar 19 '06 #2
How about just passing the variable as a querystring parameters.

window.open('ViewItem.aspx?'+Index, Index, WindowSetup);

Or something like the above.

"Gary Coutts" <Ga********@algorel.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

I am generating a popup window for data entry using the javascript
window.open function:

window.open('ViewItem.aspx', Index, WindowSetUp) ;

I need to generate some controls dynamically in ViewItem.aspx, the type of
controls generated are dependant on Index.

I need to pass the Index value to ViewItem.aspx and I am using a hidden
control (hCatIndex) and small java function to store the info:
function PassData()
{
var CatIndex ;

CatIndex = document.getElementById("hCatIndex") ;
CatIndex.value = window.dialogArguments ;
}

PassData() is run when the page is loaded, the problem is that the script
is
run after the Page_Load() of ViewItem and I need the info before this.

Can I get the script (PassData) to run before Page_Load ?

Is this a valid way to pass data between Client and Server or is there a
better way.
I am using Visual Studio .Net 2003.
Any ideas or comments would be most appreciated.
Best Regards

Gary Coutts

Mar 20 '06 #3

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

Similar topics

6
by: user | last post by:
when i first load index.php with arguments ie: "index.php?page=x", the $_SERVERvalue is null. I then get the session id appended to each link. If i refresh the page, I get the $_SERVER I want, but...
1
by: WFB | last post by:
Hi, I have a base class from which all of my pages derive (ABCBasePage). For example, ABCCustomerSelect Inherits ABCPasePage. I would now like to have ABCPocketSelect which should inherit from...
0
by: Frank 'Olorin' Rizzi | last post by:
Hello everyone. This is quite convoluted, but I'll try to make it simple. I have a couple of bottom-line questions (I guess): 1~ what happens between the Page_Load routine in the code behind...
2
by: Sam | last post by:
I have a custom control (MyTextBox - taken from Microsoft website) that implements the IPostBackDataHandler interface. It is added to the controls collection of a placeholder control during the...
7
by: Goober | last post by:
I have a page that receives a session variable from the default.aspx. On Page load, the code in Page load gets executed twice. So far, no problem. It sets the session variable each time,...
7
by: UJ | last post by:
I've got a page with a user control on it. While the page is loading, it needs to check certain conditions of the user object to enable/disable things on the screen. Currently in the page_load of...
5
by: venky | last post by:
Hi, I have a question, i have a web control in my web page. Let say i have page pag1.aspx and control.ascx and page1 contains control. I have written code on the page load of page and also the...
3
by: GauravGupta | last post by:
i want to know that is it posible to call button click event before page load event on post back.... please help me....
1
by: hemantkamb | last post by:
Hi…. I have created one website with Master and content page . I have taken TreeView Control on master page. And I wants that when I click to tree node the value of tree node is added to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.