HyperLink + Javascript + DataItem=Problems

E

Elmo Watson

Ok - I've got a datalist - in the template, there is a hyperlink, in which,
I need to dynamically use the record's ID inside a Javascript function (a
popup window function, which works perfectly with implicit ID)

The problem I think, is where to put the single and double quotes - I get a
The server tag is not well formed
error.

Here's the last one that didn't work:
<asp:Hyperlink id="hyLink"
NavigateURL="Javascript:OpenIt('comments.aspx?id=<%#
Container.DataItem("id")' %>)" Text="Comments" Runat="server" />

as I said, the OpenIt function works fine, as long as there's no dynamically
generated id...
I've tried removing the Outer double quotes from the NavigateURL property,
along with several other combinations - but I still get the error.

Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top