Myname is string and MyId is Int16
in my asp.net page, if I use
%26lt;asp:Label ID=';Lblmylabel1'; Text='%26lt;%# Eval(';Myname';) %%26gt;' runat=';server';%26gt;%26lt;/asp:Label%26gt;
%26lt;asp:Label ID=';Lblmylabel2'; Text='%26lt;%# Eval(';MyId';) %%26gt;' runat=';server';%26gt;%26lt;/asp:Label%26gt;
They're working fine, I want to put them together, so I use following:
%26lt;asp:Label ID=';Lblmylabel'; Text='%26lt;%# Eval(';Myname';) + Eval(';MyId';) %%26gt;' runat=';server';%26gt;%26lt;/asp:Label%26gt;
I get error: Operator '+' cannot be applied to operands of type 'object' and 'object'
Anyone knows how can I put them together or have ',' between those 2 properties?
Thanks,Use repeater control in asp.net?
You should try using String.Format.
text='String.Format(';{0} {1}';,Eval(';Myname';),Eval(';MyID';)) 'Use repeater control in asp.net?
Try changing your Eval() to Eval().ToString()
Eval( ';Myname'; ).ToString() + Eval( ';MyId'; ).ToString()
Don't use asp.net personally, but I'd have thought is was
%26lt;asp:Label ID=';Lblmylabel'; Text='%26lt;%# Eval(';Myname';) %26amp; Eval(';MyId';) %%26gt;' runat=';server';%26gt;%26lt;/asp:Label%26gt;
If VB6 is anything alike.
No comments:
Post a Comment