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 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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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...
|
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....
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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,...
|
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,...
|
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...
| |