码迷,mamicode.com
首页 > 其他好文 > 详细

数据绑定后细节处理

时间:2015-05-06 17:10:46      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

 <script type ="text/javascript">
        function getmouth(dt) {
            var mouth = "";
            switch (dt) {
                case 1:
                    {
                        mouth = "Jan.";
                        break;
                    }
                case 2:
                    {
                        mouth = "Feb.";
                        break;
                    };
                case 3:
                    {
                        mouth = " Mar.";
                        break;
                    }
                case 4:
                    {
                        mouth = "Apr.";
                        break;
                    }
                case 5:
                    {
                        mouth = " May.";
                        break;
                    }
                case 6:
                    {
                        mouth = "Jun.";
                        break;
                    }
                case 7:
                    {
                        mouth = "Jul.";
                        break;
                    }
                case 8:
                    {
                        mouth = "Aug.";
                        break;
                    }
                case 9:
                    {
                        mouth = "Sept.";
                        break;
                    }
                case 10:
                    {
                        mouth = " Oct. ";
                        break;
                    }
                case 11:
                    {
                        mouth = " Nov.";
                        break;
                    }
                case 12:
                    {
                        mouth = "Dec.";
                        break;
                    }
            }
            return mouth;
        }
    </script>

 

 <asp:Repeater runat="server" ID="rptnewsthree">         

                    <ItemTemplate>                      

           <li id="datatime" class="znew02" value="<%#string.Format("{0:MM}", Eval("UpdateTime"))%>">

                                    <script type="text/javascript">document.write(getmouth(<%#string.Format("{0:MM}", Eval("UpdateTime"))%>));</script>      

    <%# Eval("UpdateTime", "{0:dd}"+","+"{0:yyyy}")%>                           

      </li>                 

                <li class="znew03"><a href="/news/newsinfo.aspx?nid=<%#Eval("ID") %>">         

                            <%# WebUtil.Substring(Eval("Title").ToString(), 60)%></a></li>     

                            <li class="znew04">               

                      <%#WebUtil.Substring(WebUtil.DelHTML(Eval("Content").ToString ()).ToString(), 100)%></li>   

                              <li class="znew01"><a href="/news/newsinfo.aspx?nid=<%#Eval("ID") %>">阅读新闻</a></li>                             </ItemTemplate>         

                </asp:Repeater>

数据绑定后细节处理

标签:

原文地址:http://www.cnblogs.com/ft-Pavilion/p/4482084.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!