View Full Version : Please help me define a variable in the HTML of my VB.NET page

11-30-2006, 08:14 AM
Hi everyone,

I am using VB.NET a having a problem sending a datalist value as parameter to my javascript popup window. Here's my code:

This is the line that calls my popup window:

<asp:HyperLink id=Hyperlink1 runat="server" NavigateUrl='JavaScript:openPopup

("largerImage.aspx?name=<%# DataBinder.Eval(Container.DataItem, \"Path\")%>")' ImageUrl='<%# "../images/" + DataBinder.Eval

(Container.DataItem, "ImagePath") %>'></asp:HyperLink>

This is the javascript popup window:

<script language="JavaScript">

var MyWindow=null;

function openPopup(url)


MyWindow=window.open(url,"MyCoolPopup","location", "height=300, width=300");

// -->

The problem is that when I call the popup window, the parameter that shows looks like this : <%# DataBinder.Eval

(Container.DataItem, \"Path\")%>

Instead of the path of the underlying datacontrol image being passed as a parameter, the whole tag is sent.

How can I read just the path of the image control that is in my ItemTemplate area of my datalist control?

Please help!!