|
|
#1 (permalink) |
|
Üyelik Tarihi: 25.10.2007
Yer: istanbul
Mesaj: 3
|
asp.NET if döngüsünde eval kulanımı ???
Kod:
<ASP:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/db_data2007.mdb" SelectCommand="SELECT * FROM [Tree] WHERE [ParentID] = 0"></ASP:AccessDataSource> <ASP:Repeater ID="Repeater1" runat="server" DataSourceID="AccessDataSource1" OnItemCommand="Repeater1_ItemCommand"> <ItemTemplate> <table width="60%"> <tr> <td width="10%"><ASP:CheckBox ID="CheckBox1" runat="server" /></td> <td width="40%"><%# Eval("Ad") %></td> <td width="25%"><%# Eval("Sira") %></td> <td width="25%"> <% if (Eval("Durum") == true) { %> <img src="http://forum.zoque.net/images/active_icon.gif" /> <% } else { %> <img src="http://forum.zoque.net/images/passive_icon.gif" /> <% } %> </td> </tr> <tr> <td colspan="4"> <table width="100%" border="0" align="left" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC"> <tr> <td align="center" style="width: 292px; height: 23px">Ad : <ASP:TextBox ID="TextBox3" runat="server"></ASP:TextBox></td> <td align="center" style="width: 499px">Sıra : <ASP:TextBox ID="TextBox4" runat="server"></ASP:TextBox></td> <td style="height: 23px"> <ASP:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/btn_onayla.jpg" /> <ASP:ImageButton ID="ImageButton4" runat="server" ImageUrl="~/images/btn_iptal.jpg" /></td> </tr> </table> </td> </tr> </table> </ItemTemplate> </ASP:Repeater> |
|
|
|
|
|
#2 (permalink) |
|
Üyelik Tarihi: 28.04.2007
Yer: Ankara
Mesaj: 273
|
Re: asp.NET if döngüsünde eval kulanımı ???
mantıksal operatör yerine string operatör kullanabilirsin. böylece uygulama hard coded olmaz:
Kod:
img src="http://forum.zoque.net/images/" + Eval("Durum").ToString + "_icon.gif" /
Mesaj kuduk tarafından 25.10.2007 (20:31) yeniden düzenlendi.. Açıklama: code syntax error |
|
|
|
Zoque'a hoşgeldiniz!