473,398 Members | 2,393 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,398 software developers and data experts.

Page_Load Problem

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 1073
"Gary Coutts" <Ga********@algorel.com> wrote in
news:eY**************@TK2MSFTNGP14.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...


Gary,

Would using a querystring parameter meet your needs?

window.open('ViewItem.aspx?ItemIndex=' + Index, Index, WindowSetUp);

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Mar 19 '06 #2
Hi Chris,
Great idea, I didn't even think of query strings. It also gives a much
neater solution.
Thanks a lot.

Cheers
Gary

"Chris R. Timmons" <crtimmons@X_NOSPAM_Xcrtimmonsinc.com> wrote in message
news:Xn**********************************@207.46.2 48.16...
"Gary Coutts" <Ga********@algorel.com> wrote in
news:eY**************@TK2MSFTNGP14.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...


Gary,

Would using a querystring parameter meet your needs?

window.open('ViewItem.aspx?ItemIndex=' + Index, Index, WindowSetUp);

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/

Mar 19 '06 #3

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

Similar topics

7
by: Jibey | last post by:
Hello: I'm facing a very strange problem. When I run my Web application in Visual Studio.NET the Page_Load event is not executing. Other events like a Button_Click are executing. It doesn't...
0
by: Itai | last post by:
Background: I have four Web Form pages with respective C# code behind files, all in the same project: localhost/vpath1 Page1.aspx Page2.aspx
2
by: Mark Rae | last post by:
I've inherited an ASP.NET app and have been asked to fix the following problem with a page which is used to display and/or delete records from a database. When the page loads, it displays a list of...
14
by: V. Jenks | last post by:
I'm a little rusty having not touched .NET for 6 months and I can't remember why Page_Load is happening twice in this code: private void Page_Load(object sender, System.EventArgs e) {...
3
by: doobdave | last post by:
Hi all, I'm experiencing a rather strange problem: I am coding a web application using VB.net ASP.net and Visual Studio 2003. It's quite a large application, but the problem only occurs on...
4
by: tshad | last post by:
Is there a way to do put Page_loads on a page? I am trying to setup a Page_Load that just puts a persons name that is logged on at the top of a page the first time a page is loaded. In my...
0
by: jonelling | last post by:
I am having a problem where the page load event is not being fired for certain user controls that I load dynamically in placeholders. Here is what I'm doing in brief, with full test code supplied...
5
by: Andy | last post by:
Hi all, I have a site with the following architecture: Common.Web.dll - Contains a CommonPageBase class which inherits System.Web.UI.Page myadd.dll - Contains PageBase which inherits...
1
by: choukrou | last post by:
Hello everybody! Got a nice problem on 1 of my aspx (and only one): It was working "perfectly" for 1year and a half. Last week I had to fix a lil bug. I do that and test my app. And on the fixed...
11
by: fiefie.niles | last post by:
I am using ASP.NET 2005 and I have a simple form. Page_Load calls a sub mySub that does not do anything (for testing purposes). But, Page_Load gets called twice. On every single ASPX page in my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.