views:

62

answers:

1

First i have a getProfileImage.aspx which accepts a CusID and TN as query strings and display n image. So getProfileImage.aspx?CusID=10&TN=Y will show the image fine in the browser :)

But...

Now i am presented with a Form View and i want to bind the src of the image to get the image from the getProfileImage.aspx page...

The following code works fine :) 10 is the customer ID and the image is working fine...

<asp:Image ID="Image1" runat="server" Height="151px" ImageUrl='~/getProfileImage.aspx?CusID=10&TN=N' />

But now i want to Bind the CusID value...

<asp:Image ID="Image1" runat="server" Height="151px" ImageUrl='~/getProfileImage.aspx?CusID=<%# Bind("CusID") %>&TN=N' />

This simply does not work :( The getProfileImage.aspx is called with CusID=<%... where the way i see it the <%# Bind("CusID") %> is not parsed by ASP which would have returned 10...

<%# Bind("CusID") %>

The above tag alone will work... but inserting it to the middle of the tag seems to break it...

Any suggestions ? Thanx a lot in advance :)

+1  A: 

Yeyy! :) I found the answer :)

ImageUrl='<%# Eval("CusID", "getProfileImage.aspx?CusID={0}&TN=N") %>' 

The {0} is replaced by the CusID which is just what i wanted :) Thanx a lot Robin Day for your help too :) :)

Ranhiru Cooray