数据绑定后细节处理

 <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>

posted @ 2015-05-06 15:06  Pavilion  阅读(171)  评论(0编辑  收藏  举报