Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > HyperLink + Javascript + DataItem=Problems

Reply
Thread Tools

HyperLink + Javascript + DataItem=Problems

 
 
Elmo Watson
Guest
Posts: n/a
 
      11-19-2005
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?


 
Reply With Quote
 
 
 
 
Patrick.O.Ige
Guest
Posts: n/a
 
      11-19-2005
Elmo try looking at this sample by Scott at:-
http://datawebcontrols.com/faqs/Hype...leQuerystringV
alues.shtml
or
http://datawebcontrols.com/faqs/Hype...nANewWindow.sh
tml
It should guide you
Hope that helps
Patrick


"Elmo Watson" <> wrote in message
news:...
> 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)elps


>
> 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?
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink davetichenor ASP .Net 1 10-30-2006 02:57 PM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink Dave ASP .Net Datagrid Control 0 10-21-2006 07:48 PM
Can't create fragment/JavaScript hyperlink Axel Dahmen ASP .Net 1 02-04-2005 07:44 AM
open a new window without javascript and without hyperlink Dan ASP .Net 8 11-24-2004 08:10 AM
Dynamically Hyperlink and Event Handler for the Hyperlink ? Ken ASP .Net Datagrid Control 1 08-15-2003 11:38 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57