Page_Load Problem

G

Gary Coutts

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
 
C

Chris R. Timmons

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);
 
G

Gary Coutts

Hi Chris,


Great idea, I didn't even think of query strings. It also gives a much
neater solution.


Thanks a lot.

Cheers


Gary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top