ASP.Net Problem with Linkbutton commandargument
I am trying to send command arguments when a linkbutton is clicked. I am having no problem sending a string as follows:
commandargument="Some String"
and I have no problems sending a bound value scuh as:
commandargument=<%# DataBinder.Eval(Container.DataItem, "SOME_VALUE")%>
Where I have a problem is in my desire to combine the two. I want to concatenate a string with the bound value. I continually get tag not properly formed errors or the binding string itself is returned. I have tried single quotes, double quotes, combinations of the two as follows:
commandargument="Some String" + <%# DataBinder.Eval(Container.DataItem, "SOME_VALUE")%>
commandargument="Some String"<%# DataBinder.Eval(Container.DataItem, 'SOME_VALUE')%>
commandargument='Some String<%# DataBinder.Eval(Container.DataItem, "SOME_VALUE")%>'
commandargument="Some String<%# DataBinder.Eval(Container.DataItem, "SOME_VALUE")%>"
CAN THIS BE DONE??
RESOLVED Commandargument Issue
I found a solution to my problem. I merely had to add the string I wanted to concatenate inside the script tags as follows:
commandargument=<%# "STRING WITH DELIMITERS" & DataBinder.Eval(Container.DataItem, "SOME_VALUE" )%>
This allows me to pass a string with delimters, the last items of which is the value of the binding. I can then parse the string.