B
Buddy Ackerman
I'm trying to modify an ASCX written in C#. There is code embedded with the HTML and some lines start with <%#, what is
the # for (is it like <%= in VB.NET)?
So, I have a line that looks like this:
<td><%# Server.HtmlEncode(((DesktopAlert.Web.User)Container.DataItem).Username) %></td>
However, I want to do a string replace on the Username so I tried to do this:
<%
string username = Server.HtmlEncode(((DesktopAlert.Web.User)Container.DataItem).Username);
username.Replace("Str2Replace", "ReplaceWith");
%>
<td><%# username %></td>
This little bit of code is inside an asp:repeater tag. When I make this modifcation tha page nolonger displays anything
it is completely empty (even when I do a view source on the page there is nothing in it no HTML tag, nothing).
What am I doing wrong?
the # for (is it like <%= in VB.NET)?
So, I have a line that looks like this:
<td><%# Server.HtmlEncode(((DesktopAlert.Web.User)Container.DataItem).Username) %></td>
However, I want to do a string replace on the Username so I tried to do this:
<%
string username = Server.HtmlEncode(((DesktopAlert.Web.User)Container.DataItem).Username);
username.Replace("Str2Replace", "ReplaceWith");
%>
<td><%# username %></td>
This little bit of code is inside an asp:repeater tag. When I make this modifcation tha page nolonger displays anything
it is completely empty (even when I do a view source on the page there is nothing in it no HTML tag, nothing).
What am I doing wrong?