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

get ~/mypage.aspx for use in dynamic javascript

nic
Hi,
I need to get the equivilent of Response.Redirect
(~/mypage.aspx) for a dynamic javascript function.
Essentially I am writing the javascript on the non-code
behind page and need to inject the "~" so I can have a
relative path to my page. So here is the javascript
function:

function showHelp(fieldID)
{
var ahref = "FieldHelp.aspx?FieldID=" + fieldID;
var win = window.open(ahref,"","height=200,width=400");
}

I need the ~/FieldHelp.aspx path but don't know how to get
it. I tried
var ahref = "<%= ~/FieldHelp.aspx%>?FieldID=" + fieldID;

but that doesn't work.

I think injecting serverside code in a dynamic javascript
funtion makes the function more readable than to build it
all server side and inject the whole stream.

Thanks

Nov 17 '05 #1
0 1267

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

Similar topics

10
by: moondaddy | last post by:
I'm writing an ecommerce app in asp.net/vb.net and need to make the pages searchable and crawlable by spiders, particularly Google's. As far as I know, if my pages's contents are mostly populated...
1
by: billy | last post by:
Ok, here's the situation... I have a user control that contains two textboxes (one for a from date/time and one for a to date/time) and two image buttons. The user control itself is supposed to...
6
by: John Rivers | last post by:
hi, here is how to do it and restore sanity to aspx html rendering: (please only reply with sensible architectural discussion - juan) put this at the end of an aspx file (or use an include at...
2
by: Richard Lionheart | last post by:
Hi All, I adapted some sample code from w3schools.com and tried to adapt it to .NET to test dynamic processing in a WebForm. The client page that got generated produced everything that was...
1
by: EagleRed | last post by:
I am developing an ASP.NET 2.0 application using a master page. I have a DataList control on the master page that has a datasource this is an ArrayList of objects that have a CmdURL property. ...
0
by: Jason Kester | last post by:
I've noticed some strange behavior with Atlas, and I'm wondering if anybody else is seeing this. Basically, from the moment I add a ScriptManager tag to one of my pages, any subsequent controls...
6
by: RobGMiller | last post by:
Using ASP.NET 2.0 Need to simply process incoming postback information without sending back a reponse. Client sends HTML from application other than a browser to a page on a web site. Web...
0
by: johnlim20088 | last post by:
Hi, Can someone help me on this? What can I done on code? I able to export csv file in http://mypage.com, but when i change to https://mypage.com, it unable to export, error "cannot display...
9
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
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
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...

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.