ASP.NET Substring

  • Thread starter Thread starter Tahir
  • Start date Start date
T

Tahir

hi,
i am programming a website using ASP.NET 2.0 and SQL 2005 and serving the
last five members via DataList containing a HyperLink like this code:
<asp:HyperLink ID="firmaHyperLink" runat="server" NavigateUrl='<%#
Eval("firmId", "~/Firma.aspx?firmId={0}") %>' Text='<%# Eval("name", "{0}")
%>' ></asp:HyperLink>
i have a problem that "name" variable may be too long so how can i substring
it? very glad if a sample code :)
 
You can always do the binding of this field in code behind using the Row
Data Binding event. This allows you to evaluate the value and do whatever
you want before binding it.

If that is not acceptable, you can bind back to a routine that does the work
for you. Just pass the entire Eval back to the routine.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
 
Back
Top