• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
我要飞的更高!
一步一个脚印!
博客园    首页    新随笔    联系   管理    订阅  订阅

VS2003基础知识一

实际开发过程中,常常一个数据显示控件(如repeater)显示数据时,常要把(repeater)其中的某个字段的值传到cs文件中去进行数据处理返回想要的结果.......

实际开发过程中,常常一个数据显示控件(如repeater)显示数据时,常要把(repeater)其中的某个字段的值传到cs文件中去进行数据处理返回想要的结果.

1.aspx文件代码

<asp:repeater id="Repeater1" runat="server">
          <ItemTemplate>
           <table width="100%" border="0" cellspacing="0" cellpadding="2">
            <tr>
             <td width="28%" height="25"><%# DataBinder.Eval(Container.DataItem, "Name") %></td>
             <td width="72%">
             </td>
            </tr>
           </table>
           <%# BindList((string)DataBinder.Eval(Container.DataItem, "ID"),(string)DataBinder.Eval(Container.DataItem, "Display")) %>
          </ItemTemplate>
   </asp:repeater>

 

2. cs文件代码

protected string BindList(string SupportProductID,string Display)//
  {    

         //数据处理       
        return "数据处理结果";
  }

这样就可以在aspx文件直接调用cs文件的方法,返回一些处理后的数据显示在前台.

 

posted @ 2008-08-20 15:29  "鸟巢"  阅读(338)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3