Good morning David,
Yes there is. You just need to expose strpath as page class property (or
simply as protected variable)
-- aspx page code --
<asp:ImageButton ID="ImgBtn1" runat="server"
CausesValidation="false" CommandName="Select"
AlternateText='<%# Eval("Name") %>'
ImageUrl='<%# Eval("FullName") %>'
CommandArgument='<%# ImageDirPath + Bind("FullName") %>'
OnClientClick="return showpic(this);"
OnCommand="ImgBtn1_Command" Height="100" Width="150" />
-- end aspx page code --
-- code behind/beside
protected string ImageDirPath
{
get
{
return "~/Images/";
}
}
-- end code behind/beside
Note I used Eval() instead of Bind() because (in this case) you're not
getting the value back from the control.
hope this helps
--
Milosz
"David C" wrote:
I have a DataList that displays photos and is bound to a list of files. Is
there a way to combine the value of a variable (strpath) with the #
Bind(...) in the ImageURL field. Below is what I have now.
<asp:ImageButton ID="ImgBtn1" runat="server"
CausesValidation="false" CommandName="Select"
AlternateText='<%# Bind("Name") %>'
ImageUrl='<%# Bind("FullName") %>'
CommandArgument='<%# Bind("FullName") %>'
OnClientClick="return showpic(this);"
OnCommand="ImgBtn1_Command" Height="100" Width="150" />
I would like to add the value of strpath to the # Bind("FullName").
Thanks.
David