开发者

Concatenation of Static Text with DataBinding Value

Anyone can help me with how to concatenate static text with databinding value like for example:

<asp:Label ID="lblSurveyUrl" runat="server" text='<%#DataBinder.Eval(Container.DataItem, "SurveyID")%>'></asp:Label>

now the text of this label becomes 1,2 or 3 (whatever SurveyID we're getting from table) but I would like it to become.

somepage.aspx?id=1

where "somepage.aspx?id=" is the fixed text and 1 is value that w开发者_运维技巧e got from expression. How can I achieve this ?

Thanks.


Try giving the static text in a format string:

<asp:Label ID="lblSurveyUrl" runat="server" text='<%#DataBinder.Eval(Container.DataItem, "SurveyID", "somepage.aspx?id={0}")%>'></asp:Label>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜