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

Cleaner way to write this?

I have a repeater control. Within it, I have a quoted HTML attribute that
contains a quotes javascript variable stsring which contains my asp.net tag.
To prevent nested quote issues, I have to write it like this:

<a href="javascript:;" onclick=<% response.write("""")
%>window.opener.document.getElementById('src').val ue='/slides/SM/<%#
DataBinder.Eval(Container.DataItem, "filename")
%>';javascript:window.close();<% response.write("""") %>><b>[sm]</b></a>

Is there a more elegant solution?

-Darrel
Mar 20 '07 #1
1 1125
You can bind back a pointer to a method in the code behind and assemble the
JavaScript string there. The code behind will get a bit more extensive, but
it will be easy enough to feed the file name parameter and create the code
there. Your other option is to create a control that takes the file name and
outputs the proper JavaScript. you can then embed that control in the
Repeater.

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

*********************************************
Think outside the box!
*********************************************
"Darrel" <no*****@nospam.comwrote in message
news:uz**************@TK2MSFTNGP04.phx.gbl...
>I have a repeater control. Within it, I have a quoted HTML attribute that
contains a quotes javascript variable stsring which contains my asp.net
tag. To prevent nested quote issues, I have to write it like this:

<a href="javascript:;" onclick=<% response.write("""")
%>window.opener.document.getElementById('src').val ue='/slides/SM/<%#
DataBinder.Eval(Container.DataItem, "filename")
%>';javascript:window.close();<% response.write("""") %>><b>[sm]</b></a>

Is there a more elegant solution?

-Darrel
Mar 20 '07 #2

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

Similar topics

9
by: Alex Martelli | last post by:
All my mailboxes have been filling up with files of about 130k to 150k, no doubt copies of some immensely popular virus. So, I've no doubt lost lots of real mail because of "mailbox full"...
13
by: Steven Scaife | last post by:
I have decided to re-write the intranet site i created over a year ago. The coding is pretty awful and hard to read cos I made the mistake of not putting comments in or putting crappy comments in...
20
by: Al Moritz | last post by:
Hi all, I was always told that the conversion of Word files to HTML as done by Word itself sucks - you get a lot of unnecessary code that can influence the design on web browsers other than...
19
by: Matthew Wieder | last post by:
I was hoping that someone could point me in the right direction. I'm looking to develop a tool that will run an XML file against an XSD schema and if a node doesn't conform to the schema, remove...
1
by: heren | last post by:
http://www.htmlcodecleaner.com-http.com/
13
by: John Salerno | last post by:
The code to look at is the try statement in the NumbersValidator class, just a few lines down. Is this a clean way to write it? i.e. is it okay to have all those return statements? Is this a good...
29
by: John Salerno | last post by:
Hi guys. I'm looking for a nicer, more compact way of writing this code. It doesn't have to be anything fancy, just something without the duplication and preferably only one return statement. ...
2
Chrisjc
by: Chrisjc | last post by:
Hey guys I am in need of a registry cleaner.. my sister got a nasty Virus... and I cant seem to get it out of the ADD/REMOVE PRO prompt... let alone I am not 100% sure I got it... I put a scanner...
0
by: myprotein | last post by:
if "all applications disconnection" is anathor tigger of page cleaner? hi all I discovered that when all application disconnect from the database, db2 will "truncate" current active log file...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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
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
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...
0
agi2029
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,...

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.