asp:imagebutton problem passing though multiple databound fields to the command argument

D

Darren Clark

I need to be able to send through 2 peices of infomraiton in the
commandArgument property of a image button...

<asp:imagebutton
CommandArgument='<%# DataBinder.Eval(Container,"DataItem."+
JR.Core.Data.JobseekerData.FLD_SEARCH_ID) %>_<%#
DataBinder.Eval(Container,"DataItem."+JR.Core.Data.JobseekerData.FLD_SEARCH_
PROFILE_ID ) %>'
CommandName='ProfileMatch'
id="match" onmouseover="this.src ='../Images/magnifyover.gif'"
onmouseout="this.src ='../Images/magnifynorm.gif'" Runat="server"
ImageUrl="../Images/editnorm.gif"
name="match">
</asp:imagebutton>

the code i am using below wont work... i get the following error message
"CS1040: Preprocessor directives must appear as the first non-whitespace
character on a line"

however when i change the line from
CommandArgument='<%# DataBinder.Eval(Container,"DataItem."+
JR.Core.Data.JobseekerData.FLD_SEARCH_ID) %>_<%#
DataBinder.Eval(Container,"DataItem."+JR.Core.Data.JobseekerData.FLD_SEARCH_
PROFILE_ID ) %>'
TO

CommandArgument='<%# DataBinder.Eval(Container,"DataItem."+
JR.Core.Data.JobseekerData.FLD_SEARCH_ID) %>'

and only pass thorugh one agrument it works..... how can i fix this?

regards
Darrne
 
D

Darren Clark

I found the problem..

instead of CommandArgument='<%# DataBinder.Eval(Container,"DataItem."+
JR.Core.Data.JobseekerData.FLD_SEARCH_ID) %>,<%#
DataBinder.Eval(Container,"DataItem."+ JR.Core.Data.JobseekerData.FLD_ID)
%>'

change to

<%# DataBinder.Eval(Container,"DataItem."+
JR.Core.Data.JobseekerData.FLD_SEARCH_ID) +","+
DataBinder.Eval(Container,"DataItem."+ JR.Core.Data.JobseekerData.FLD_ID)
%>,
 
Top