I've got a gridview with a template column calling a javascript
"win.open" routine (see below).
asp code:
<asp:TemplateFi eld
HeaderText="Let ter code"
ItemStyle-HorizontalAlign =Center>
<ItemTemplate >
<asp:hyperlin k
ID=letter_code
runat=server
NavigateUrl=<
%#String.Format ("javascript:vo id(OpenPopupWin dow('letter_res ponse_detail.as px?
letter_code={0} ','width=900,he ight=450,top=47 5,left=300,scro llbars=yes,resi zable=yes'));", Eval("letter_co de"))
%>>
<%#Container.Da taItem("letter_ code")%>
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateFie ld>
/asp code
Code for the routine is :
<script language="javas cript">
function OpenPopupWindow (target_url,win _options)
{
Window.open(tar get_url,null,wi n_options)retur n false
}
</script>
This works fine. The problem that I have, is that I now need to call
the popup with two extra parameters which are taken from 2
dropdownlists elsewhere on the form.
Suggestions as to how I do this?
Cheers 1 5443
DaveyP wrote:
I've got a gridview with a template column calling a javascript
"win.open" routine (see below).
asp code:
<asp:TemplateFi eld
HeaderText="Let ter code"
ItemStyle-HorizontalAlign =Center>
<ItemTemplate >
<asp:hyperlin k
ID=letter_code
runat=server
NavigateUrl=<
%#String.Format ("javascript:vo id(OpenPopupWin dow('letter_res ponse_detail.as px?
letter_code={0} ','width=900,he ight=450,top=47 5,left=300,scro llbars=yes,resi zable=yes'));", Eval("letter_co de"))
%>>
<%#Container.Da taItem("letter_ code")%>
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateFie ld>
/asp code
Code for the routine is :
<script language="javas cript">
function OpenPopupWindow (target_url,win _options)
{
Window.open(tar get_url,null,wi n_options)retur n false
There is no Window object in Javascript, it's named window. Javascript
is case sensetive.
Don't use null as window name. Use '_blank' if you want to open a new
window.
You have forgotten the semicolon between the statemenets.
}
</script>
This works fine. The problem that I have, is that I now need to call
the popup with two extra parameters which are taken from 2
dropdownlists elsewhere on the form.
Suggestions as to how I do this?
Do you want to take the values at the time of creating the page, or when
the user clicks the link?
For the first, you would add parameters in the String.Format, and append
the url in the format string with "&{1}&{2}".
For the second, you would add the values in the javascript. Perhaps
creating a new function if you don't want to change the OpenPopupWindow
function.
--
Göran Andersson
_____ http://www.guffa.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Jeannie |
last post by:
I have a popup window which is a slideshow of about 7 images. When the
popup window loads, the first image is present and then the viewer can
select next or previous to scroll through the rest of the images.
I'd like to use the same popup window at different points throughout
the website and have the Virtual Tour (slideshow) open up at the
appropriate photos. Meaning I'd like to control which picture the
popup window opens up to,...
|
by: tshad |
last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an
asp.net problem or a javascript problem.
I have a page that was originally created from a program I found on the net
that works well as an html page.
It brings up a modal popup window that I have been trying to work out for
days now and this was the closest I have been able to come.
I added a little asp.net code and an asp.net button and cannot get it to
|
by: Mark Fox |
last post by:
Hello,
I am attempting to do something very simple. I have
a page MainPage.aspx and a popup window Popup.aspx. When
users click on the linkbutton in the popup window I am
looking to do some server side processing in Popup.aspx,
then have the popup window close, and have the
MainPage.aspx do a postback to the server. But I am
having trouble determining what client side javascript
Popup.aspx should render after it does its server side
|
by: Paul Krasucki |
last post by:
This is for a search page that takes parameters on one page, processes the
query, and displays them on another page.
I've got a javascript popup window on a button click event. When the user
clicks the button, the popup window opens, and the parent page goes on with
the query. No problem there. The problems comes in when one of my
validator's throws an error, then naturally the page does not post back
waiting for the page to valid. ...
|
by: tshad |
last post by:
This is from my previous post, but a different issue.
I have the following Javascript routine that opens a popup page, but doesn't
seem to work if called from an asp.net button. It seems to work fine from a
link.
The button does bring up the popup window, but when I press the links on the
page, it doesn't return or close the window.
****************************************************************************
| |
by: E |
last post by:
I am having trouble with setTimeout working on a second call to the
setTimeout function from a second page which is an html page.
Here is the scenario.
I have a web page and onload it calls a javascript function which calls
setTimeout and will process a second javascript function "Warn" just before
the session expires. The Warn function displays an html page with a
button. A second timer is started to cause the html page to close...
|
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 pageA.html
2. User clicks on menu link to open popup.html
3. pageA.html checks if popup.html is already open. It is not, open
|
by: Eric |
last post by:
I have a user of a web application written in Java/JSP that is unable
to login to the site simply because certain links on the page do not
run when they are clicked. Other popups using Javascript on the same
page work correctly.
It appears to be isolated to 1-2 machines in a particular network. I
cannot verify whether these machines have had virus/spyware scans, but
I do know the user is running Firefox 2.1 and IE 7 with the same...
|
by: pavanip |
last post by:
Hi,
I have written the code for display popup window using javascript in button onclient click event.
<asp:Button ID="Button1" runat="server" Style="position: static" OnClientClick="openwindow()"
Text="Execute"/>
<script type="text/javascript">
function openwindow()
{
window.open("AssignedTickets.aspx",'window','width=630,height=620,background=silver,menubar=no, resizable=no')
}
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |