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

Adding DotNet Variables to Javascript URL

I've got this Javascript HREF:

<a
href="javascript:void(window.open('print_Mileage.a spx?id=<%#sID%>&emp=<%#sEmp%>'))">Printer
Friendly Page</a>

The variables sID and sEmp are populated when the page loads. However when I
hover over the link for this, the variables are not populated in the
querystring.
I tried doing a Page.Databind at page_load, but I had an erroneous error
that only disappeared once I removed the line.

I know I've done this before, but I can't remember how - - - - What am I
missing here?


Dec 18 '07 #1
2 1066
"Elmo Watson" <sm@here.comwrote in message
news:u$**************@TK2MSFTNGP02.phx.gbl...
I know I've done this before, but I can't remember how - - - - What am I
missing here?
# is Databinding shorthand... If you don't want to use that, you need to
use:

<a
href="javascript:void(window.open('print_Mileage.a spx?id=<%=sID%>&emp=<%=sEmp%>'))">Printer
Friendly Page</a>
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Dec 18 '07 #2
One option, that gives you full control, is to bind in code behind. To do
this, use a hyperlink control instead of an anchor <a href>. It will create
the ifno for you.

If this is part of a grid, you can set up the hyperlink control in the grid
and use the designer to add the information to the URL string.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
"Elmo Watson" <sm@here.comwrote in message
news:u$**************@TK2MSFTNGP02.phx.gbl...
I've got this Javascript HREF:

<a
href="javascript:void(window.open('print_Mileage.a spx?id=<%#sID%>&emp=<%#sEmp%>'))">Printer
Friendly Page</a>

The variables sID and sEmp are populated when the page loads. However when
I hover over the link for this, the variables are not populated in the
querystring.
I tried doing a Page.Databind at page_load, but I had an erroneous error
that only disappeared once I removed the line.

I know I've done this before, but I can't remember how - - - - What am I
missing here?


Dec 18 '07 #3

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

Similar topics

5
by: Sue | last post by:
On code-behind page: (attributes set programatically for each of these elements) linkbutton added to tablecell textbox added to tablecell tablecells added to tablerow tablerow added to table...
3
by: Aaron Ackerman | last post by:
I have a bound combobox the appears on a cell within the column of my bound grid when the user clicks on a cell n(In my vb.net WinForm app). I am trying to allow the adding of an item to that bound...
10
by: Melissa Mussitsch | last post by:
I've done this before while creating a brand new table. But the code below is not working and I keep getting the error: "Internet Explorer cannot open the Internet site ..... Operation aborted" ...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
3
by: Ankit Aneja | last post by:
I have a strange situation and I have no idea how to solve this. Its a Recruitment Search Page,in the Admin Page, for every button click event the Admin Person has to create a checkbox on the users...
1
by: trint | last post by:
How can I add javascript to my code view of my default.aspx file and get my meny to show? Here is the code I want to display (it's obviously a menu): <!-- menu script itself. you should not...
17
by: Sven Rutten | last post by:
Hello Actually I want to add some C#-Code to a VB.NET-Project in VS 2005. Normally I creating a DLL and importing that from the VB-Project. But as I am coding something for a Smart Device...
2
by: Jim Andersen | last post by:
I have this piece of code I am trying to convert from c# to vb.net. It's a Windows project. This line gives me trouble ( I have tried to compress the code for readability. Hope I haven't screwed...
1
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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
0
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...
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
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...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.