List Info

Thread: Re: String Formatting for #Eval




Re: String Formatting for #Eval
country flaguser name
United States
2007-09-20 15:37:26

since I just got it working... I agree 100%! thanks

TRAVIS D. FALLS, M.B.A. | THE HARTFORD FINANCIAL SERVICES GROUP |
860.843.4592 | Travis.Falls%40HartfordLife.com">Travis.FallsHartfordLife.com

&quot;Dean Fiala"; < dfiala%40gmail.com">dfialagmail.com>
Sent by: AspNetAnyQuestionIsOk%40yahoogroups.com">AspNetAnyQuestionIsOkyahoogroups.com
09/20/2007 04:26 PM
Please respond to
AspNetAnyQuestionIsOk%40yahoogroups.com">AspNetAnyQuestionIsOkyahoogroups.com

To
AspNetAnyQuestionIsOk%40yahoogroups.com">AspNetAnyQuestionIsOkyahoogroups.com
cc

Subject
Re: [AspNetAnyQuestionIsOk] String Formatting for #Eval

No worries. I just find working with the DataBound event easier to deal
with when formatting gets more complex.

On 9/20/07, travis.falls%40hartfordlife.com">travis.fallshartfordlife.com < travis.falls%40hartfordlife.com">travis.fallshartfordlife.com&gt;
wrote:
>
&gt; Never worked with it before; didn't think of it... until now. I will
>; check it out. (Sorry I have been stuck doing Winforms for the last 18
> months; just trying to get my sanity back) Thanks Dean.
&gt;
> TRAVIS D. FALLS, M.B.A. | THE HARTFORD FINANCIAL SERVICES GROUP |
> 860.843.4592 | Travis.Falls%40HartfordLife.com">Travis.FallsHartfordLife.com
>
>;
>
> "Dean Fiala"; < dfiala%40gmail.com">dfialagmail.com>
>; Sent by: AspNetAnyQuestionIsOk%40yahoogroups.com">AspNetAnyQuestionIsOkyahoogroups.com
&gt; 09/20/2007 04:12 PM
> Please respond to
> AspNetAnyQuestionIsOk%40yahoogroups.com">AspNetAnyQuestionIsOkyahoogroups.com
&gt;
>
> To
> AspNetAnyQuestionIsOk%40yahoogroups.com">AspNetAnyQuestionIsOkyahoogroups.com
&gt; cc
>
> Subject
> Re: [AspNetAnyQuestionIsOk] String Formatting for #Eval
&gt;
>
>
>;
>
>
> If you are going to go through that trouble why not just use the
> ItemDataBound event?
&gt;
> On 9/20/07, travis.falls%40hartfordlife.com">travis.fallshartfordlife.com < travis.falls%40hartfordlife.com">travis.fallshartfordlife.com
>
>; wrote:
&gt; >
>; > Thanks for the thoughts Abdulla, however the first suggestion yields
&gt; > http://localhost/AutoEnrollLogViewer/src=%22images/DONE for an image
&gt; path
>; > instead of http://localhost/AutoEnrollLogViewer/images/DONE.gif
> >
>; > I will try writing a public function, I think that is the best bet.
>; Thanks
&gt; > again
&gt; >
>; > TRAVIS D. FALLS, M.B.A. | THE HARTFORD FINANCIAL SERVICES GROUP |
> > 860.843.4592 | Travis.Falls%40HartfordLife.com">Travis.FallsHartfordLife.com
> >
>; >
>; >
>; > Abdulla Hussein < abdulla_ah2001%40yahoo.com">abdulla_ah2001yahoo.com>
>; > Sent by: AspNetAnyQuestionIsOk%40yahoogroups.com">AspNetAnyQuestionIsOkyahoogroups.com
&gt; > 09/20/2007 03:50 PM
> > Please respond to
> > AspNetAnyQuestionIsOk%40yahoogroups.com">AspNetAnyQuestionIsOkyahoogroups.com
&gt; >
>; >
>; > To
> > AspNetAnyQuestionIsOk%40yahoogroups.com">AspNetAnyQuestionIsOkyahoogroups.com
&gt; > cc
> >
>; > Subject
> > Re: [AspNetAnyQuestionIsOk] String Formatting for #Eval
&gt; >
>; >
>; >
>; >
>; >
>; >
>; > Try this inside the item template
> >
>; > <img border=&quot;0"
> > src="../images/<%# Container.DataItem(&quot;status") %>.gif&quot;
>; > />
&gt; >
>; > or write a public function and called it in the item template if you
> have
>; > a select cases
&gt; >
>; > I hope it help
> >
>; >
>; > travis.falls%40hartfordlife.com">travis.fallshartfordlife.com wrote:
&gt; > I have the following DataList. I need to write out a dynamic string to
> > formulate an image path based on a database value (File Status). Right
&gt; > now I am just setting the "class" attribute on a <td> tag to render an
> > image. Basically if the File status is WAITING I have a class called
&gt; > WAITING... I would rather write out images/WAITING.gif. I can't seem
to
&gt; > figure out how to do this with the statement <%# Eval(";Status&quot;) %> I
> > figured I could do something like <td><asp:Image runat=&quot;Server&quot;
ImageUrl
> > ='images/&lt;%# Eval(";Status&quot;) %>.gif' /></td> Any ideas how I can
> > accomplish this?
&gt; >
>; > <aspataList ID="DataList1&quot; runat=&quot;Server&quot; DataSourceID
> > ="SQLDataSourceFileStatus&quot; Width=&quot;100%";>
&gt; > <HeaderTemplate>;
> > <table class=&quot;FileStatusTable&quot;>
&gt; > <tbody&gt;
> > <tr>
> > <th colspan=&quot;3" class=&quot;Head";>File
> > Status</th>
&gt; > </tr>;
> > <tr>
> > <th class=&quot;SubHead&quot;>Machine Name</
> > th>
&gt; > <th class=&quot;SubHead&quot;>Status</th>
>; > <th class=&quot;SubHead&quot;>File</th&gt;
> > </tr>;
> > </HeaderTemplate&gt;
> > <ItemTemplate>
> > <tr>
> > <td><%# Eval(";MachineName") %></td>
&gt; > <td class='<;%# Eval(";Status&quot;) %>'></td>
> > <td class=&quot;Left";>'<%# Eval(";FileName&quot;) %>'</td>
&gt; > </tr>;
> > </ItemTemplate>
> > <AlternatingItemTemplate>
> > <tr class=&quot;BlueBackground";>
>; > <td><%# Eval(";MachineName") %></td>
&gt; > <td class='<;%# Eval(";Status&quot;) %>'></td>
> > <td class=&quot;Left";>'<%# Eval(";FileName&quot;) %>'</td>
&gt; > </tr>;
> > </AlternatingItemTemplate>;
> > <FooterTemplate>;
> > </tbody>
> > </table>
> > </FooterTemplate&gt;
> > </aspataList>;
> > TRAVIS D. FALLS, M.B.A. | THE HARTFORD FINANCIAL SERVICES GROUP |
> > 860.843.4592 | Travis.Falls%40HartfordLife.com">Travis.FallsHartfordLife.com
> >
>; >
>;
*************************************************************************
&gt; > This communication, including attachments, is
> > for the exclusive use of addressee and may contain proprietary,
> > confidential and/or privileged information. If you are not the
intended
> > recipient, any use, copying, disclosure, dissemination or distribution
> is
> > strictly prohibited. If you are not the intended recipient, please
&gt; notify
&gt; > the sender immediately by return e-mail, delete this communication and
> > destroy all copies.
> >
>;
*************************************************************************
&gt; >
>; > [Non-text portions of this message have been removed]
> >
>; > ---------------------------------
> > Building a website is a piece of cake.
&gt; > Yahoo! Small Business gives you all the tools to get online.
> >
>; > [Non-text portions of this message have been removed]
> >
>; >
>; >
>; >
>; > [Non-text portions of this message have been removed]
> >
>; >
>; >
>; >
>; > Yahoo! Groups Links
&gt; >
>; >
>; >
>; >
>;
> --
> Dean Fiala
&gt; Very Practical Software, Inc
> Now with Blogging...
> http://www.vpsw.com/blogbaby
> Microsoft MVP
>
> [Non-text portions of this message have been removed]
>
>;
>
>
> [Non-text portions of this message have been removed]
>
>;
>
>
> Yahoo! Groups Links
&gt;
>
>
>;

--
Dean Fiala
Very Practical Software, Inc
Now with Blogging...
http://www.vpsw.com/blogbaby
Microsoft MVP

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )