asp.net 前台 对列进行加工(用DataBinder.Eval 不要用Bind)

 <asp:TemplateField HeaderText="稿件">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("[sServerVirtualityPathHttpRemote,sOppositePath,sSmallPhotoFileName]") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemStyle Font-Size="9pt" Width="8%" HorizontalAlign="Center" VerticalAlign="Middle" />
                                                <HeaderStyle Font-Size="9pt" Width="8%" HorizontalAlign="Center" VerticalAlign="Middle" />
                                                <ItemTemplate>
                                                    <table style="margin-top: 0px; margin-left: 0px">
                                                        <tr>
                                                            <td style="height: 58px">
                                                                <a href='<%# string.Format( "PhotoInformation.aspx?ImageID={0}&sType={1}&sImage=1", DataBinder.Eval(Container.DataItem, "sGuidID"),DataBinder.Eval(Container.DataItem, "sGuidIDtBaseDraftType")) %>'
                                                                    target="_blank">
                                                                    <asp:Image ID="Image1" runat="server" ImageUrl='<%# string.Format("{0}/{1}/small/{2}",DataBinder.Eval(Container.DataItem, "sServerVirtualityPathHttpRemote"),DataBinder.Eval(Container.DataItem, "sOppositePath"),DataBinder.Eval(Container.DataItem, "sSmallPhotoFileName")) %>'
                                                                        Height="53px" Width="60px" /><asp:HyperLink ID="HyperLink_txt" runat="server" Visible="False"
                                                                            Target="_blank">HyperLink</asp:HyperLink></td>
                                                        </tr>
                                                    </table>
                                                </ItemTemplate>
                                            </asp:TemplateField>

posted @ 2012-04-06 12:29  郑文亮  阅读(533)  评论(1编辑  收藏  举报