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

Attributes.add problem

I'm trying to assign the results of a variable in ASP.Net to a button's
onclick event (a Javascript function) - -

The Javascript function is:
function OpenIt(NewWindow) {

flyout=window.open(NewWindow,"flyout","resizable=n o,scrollbars=no,width=755,
height=550,scrollbars=1,top=100,left=100")
}

Then, I add this to the the routine that returns the URL
btnvideo.attributes("onclick")="OpenIt('<%#sURL %>');"

If I don't include the single quotes, it just tells me it's a syntax
error - - which doesn't really help -

the generated html is:
<input type="submit" name="btnvideo" value="Get Video" id="btnvideo"
onclick="OpenIt('<%# sURL %>');" />

Any ideas on how to get this working?

Nov 19 '05 #1
1 1556
Is this part:
btnvideo.attributes("onclick")="OpenIt('<%#sURL %>');"

happening on the server side, say in Page load?

If so, you don't need the <% %> rather just your sURL

Like this:
btnvideo.attributes("onclick")="OpenIt(" + sURL + ");"

Is that it? More of the code would help.
--
Clint Hill MCAD
H3O Software
http://www.h3osoftware.com
"David Wier" wrote:
I'm trying to assign the results of a variable in ASP.Net to a button's
onclick event (a Javascript function) - -

The Javascript function is:
function OpenIt(NewWindow) {

flyout=window.open(NewWindow,"flyout","resizable=n o,scrollbars=no,width=755,
height=550,scrollbars=1,top=100,left=100")
}

Then, I add this to the the routine that returns the URL
btnvideo.attributes("onclick")="OpenIt('<%#sURL %>');"

If I don't include the single quotes, it just tells me it's a syntax
error - - which doesn't really help -

the generated html is:
<input type="submit" name="btnvideo" value="Get Video" id="btnvideo"
onclick="OpenIt('<%# sURL %>');" />

Any ideas on how to get this working?

Nov 19 '05 #2

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

Similar topics

7
by: Info 3000 | last post by:
Hello, I'm beginner in XML. I have just a little question : I understand that I can write : <Book> <Title> A nice day </Title> <Author> James Nicepen </Author> </Book>
4
by: louissan | last post by:
Hi all, I'm coming across a problem, and really do not get where it comes from. The goal: to loop over attributes read from "object" nodes in an imported XML file/flow (via XMLHTTP) and...
8
by: nicolas.sanguinetti | last post by:
Hi, I want to add custom attributes to my xhtml documents to use with my DOM scripts. For example, I want to have some tags -say, the <h1>- have an attribute and a . The thing is that I also...
3
by: Stephan Brunner | last post by:
Hi I have created two flavors of an XSLT stylesheet to transform all attributes of an XML document to elements: They both work as expected with MSXML and XMLSPY but throw an exception ...
2
by: Zach Mortensen | last post by:
I can't seem to get dynamically-compiled JScript code to use C#-defined custom attributes. I have a simple attribute and a class defined in a C# assembly: namespace MyNamespace { public...
3
by: J'son | last post by:
Guys, I have created a custom class that derives from DataList so that I can add some custom client side functionality into each new item row (<td>). Heres the class in its simplest form: ...
11
by: Nathan Sokalski | last post by:
I add several JavaScript events (onchange, onkeypress, etc.) to Controls using the Add method of the Attributes collection. However, if the JavaScript code contains certain characters, such as & or...
23
by: Frank Millman | last post by:
Hi all I have a small problem. I have come up with a solution, but I don't know if it is a) safe, and b) optimal. I have a class with a number of attributes, but for various reasons I cannot...
2
by: cloftis | last post by:
Using VS2003, VB and MSHTML, Using an HTMLSpanElement I want to enumerate the attributes of a SPAN tag. 1 'For testing sake 2 Dim strMarkup as String = "<span attr1='somevalue'...
11
by: Rafe | last post by:
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.