473,327 Members | 1,979 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,327 software developers and data experts.

best way to open a popup with vars

Hi

I want to be able to click an item in a list, and a new window popup.
Obviously i would use window.open in javascript within a RegisterClientScript
thingy.

However, i want to pass the id of the selected list item to the new popup
window. SO presumably i cant use RegisterClientScript?

How would I go about this, so I can call

private void ListBox_Click
{
window.open(popup.aspx?id=listbox_selected
}

Any help aprpeciated!

Cheers
Dan
Nov 18 '05 #1
3 1515
you make a javascript

function open(listBoxName) {
list = document.getElementByName(ListBoxName);
i = list.selectedIndex;
val = list.options[i].value;
window.open('blabla?id='+val);
}

try to put this script on your button which open the pop-up .

"Dan Nash" wrote:
Hi

I want to be able to click an item in a list, and a new window popup.
Obviously i would use window.open in javascript within a RegisterClientScript
thingy.

However, i want to pass the id of the selected list item to the new popup
window. SO presumably i cant use RegisterClientScript?

How would I go about this, so I can call

private void ListBox_Click
{
window.open(popup.aspx?id=listbox_selected
}

Any help aprpeciated!

Cheers
Dan

Nov 18 '05 #2
Thanks,

But how do I make that Javascript execute from the
ListBox_SelectedIndexChanged event?

Cheers
Dan

"Psycho" wrote:
you make a javascript

function open(listBoxName) {
list = document.getElementByName(ListBoxName);
i = list.selectedIndex;
val = list.options[i].value;
window.open('blabla?id='+val);
}

try to put this script on your button which open the pop-up .

"Dan Nash" wrote:
Hi

I want to be able to click an item in a list, and a new window popup.
Obviously i would use window.open in javascript within a RegisterClientScript
thingy.

However, i want to pass the id of the selected list item to the new popup
window. SO presumably i cant use RegisterClientScript?

How would I go about this, so I can call

private void ListBox_Click
{
window.open(popup.aspx?id=listbox_selected
}

Any help aprpeciated!

Cheers
Dan

Nov 18 '05 #3
Hi DAN,

write a javascript method which build the URL and then pass the same in the
window,.open method it will look something like below.
<script>
function PopUpWindow()
{
var sVal = ListBox1.options[ListBox1.Selectedindex].value;
var sURL = 'popup.aspx?id=' + sVal ;
window.open(sURL);
}
</script>

and in the Code behind page_load event for the ListBox add the below code

ListBox1.Attribuites.Add("onchange","PopUpWindow() ");

thats all everything works fine later
---------------------
Praveen K
---
"Dan Nash" wrote:
Hi

I want to be able to click an item in a list, and a new window popup.
Obviously i would use window.open in javascript within a RegisterClientScript
thingy.

However, i want to pass the id of the selected list item to the new popup
window. SO presumably i cant use RegisterClientScript?

How would I go about this, so I can call

private void ListBox_Click
{
window.open(popup.aspx?id=listbox_selected
}

Any help aprpeciated!

Cheers
Dan

Nov 18 '05 #4

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

Similar topics

2
by: venkatesh | last post by:
Hi Members, I have used the below mentioned code to open a html page in a new browser. The window size is 200 x 300. In that browser, I've given code to open another browser of the same size....
4
by: Phillip Parr | last post by:
Hello, I have a nice system where someone clicks on a picture to show the full version. This pops up in a window.open box. It works great, the only problem is that if the user clicks a second...
2
by: Mike Button | last post by:
Hello all, I am really really desperate on what I should do, and I am asking for help from anyone in this newsgroup, here's the situation: I am creating a form that is being run on a server...
23
by: Markus | last post by:
Hi, i have this problem: Sometimes, i can't reproduce, if i click on an small image on the website, the popup _AND_ an other Tab in firefox open. Here are the linkcode: <div...
13
by: ldan | last post by:
Hi everybody, I would not consider myself an expert in javascript - but so far whatever I know, helped me reaching my goals. Recently I started to experience a lot of javascript errors related...
2
by: David Hearn | last post by:
I have a need to open a popup window from one of my forms if a particular session variable is empty. What is the best way to do this? Once the popup opens, the user will make a selection from the...
2
by: aaa | last post by:
I am bringing up a popup which has a couple of fields that the user enters. I fill the hidden fields then submit and close the popup which then reverts back to my main form, which retrieves the...
7
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses...
2
by: TH | last post by:
Hi there What's the best way for a popup to cause an event to fire in the opener? I've got a popup which currently returns a value to the opener by setting a hidden input in the opener: ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.