quoting a javascript link w argument

Results 1 to 2 of 2

Thread: quoting a javascript link w argument

  1. #1
    Join Date
    Dec 1969

    Default quoting a javascript link w argument

    Trying to use this javascript to open a details window that is passed a Request.Params["id"]<BR><BR>&#060;a href="Javascript:PopDetail(&#039;EventDetailByID.a spx?id=&#060;%# DataBinder.Eval(Container.DataItem,"eventid") %&#062; &#039;, 600, 500)" &#062;<BR><BR>This works - opens the details popup window as it should. However, in development, if I try to switch from HTML to Design view, it gives ma an error "Quote values differently inside a &#060;%..."value"...&#062; block. Anyone know how to nest quotes inside this sort of call to preven this error? When it errors it also messes up the code - so I need to fix it.

  2. #2
    Join Date
    Dec 1969

    Default RE: quoting a javascript link w argument

    This is one of the weaknesses of the VS.NET IDE. I know of no way around it - doesn&#039;t mean there isn&#039;t a way around it, though.<BR><BR>What I do, is use the following hack. I replace the entire string with something like:<BR><BR>&#060;%# DisplayJavaScriptWindow(DataBinder.Eval(Container. DataItem,"eventid")) %&#062;<BR><BR>Then, in my code-behind class, I add a method that returns a string called DisplayJavaScriptWindow, like:<BR>[code language="VB.NET"]<BR>Public Function DisplayJavaScriptWindow(eventID as Integer) as String<BR> Return "&#060;a href=""JavaScript:PopDetail(..." & eventID & "..."<BR>End Function<BR>[/code]<BR><BR>Does this make sense?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts