Bunch's Blog

  Home  |   Contact  |   Syndication    |   Login
  48 Posts | 0 Stories | 36 Comments | 0 Trackbacks

News

Tag Cloud


Archives

Green

This is somewhat related to my previous post. I needed to strip out a leading character from an EVAL when I appended that value to a URL. Luckily the character was always the same, in this example an X. The solution was to simply use Replace on the EVAL and replace the X with “”.

 <asp:HyperLink ID="hlID" runat="server" Text='<%# EVAL("ID") %>' NavigateUrl='<%#"Default.aspx?ID=" + Replace(EVAL("ID"),"X", "") %>'/>

Technorati Tags:
posted on Wednesday, July 30, 2008 2:51 PM

Feedback

# re: EVAL and replace 9/10/2009 2:57 AM Oscar Casagrande
EVAL("ID").ToString().Replace("X", "")
or
EVAL("ID").ToString().Replace("X", String.Empty)

[]'s

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: