- 浏览: 44936 次
- 来自: ...
文章分类
最新评论
-
nashwill:
测试了下,好像用不了,什么原因?
利用spring拦截struts(1.x)中的action -
hdf336:
java加密后。net解密 都不一样 别来误导人
java和.net中的des加密和解密 -
cwmwss:
你好,java和.NET加密的结果为什么 不一样呢?能不能做到 ...
java和.net中的des加密和解密
<%@ OutputCache Duration="60" VaryByParam="*" %> <%@ Control Language="C#" AutoEventWireup="true" CodeFile="FormDataChangeA.ascx.cs" Inherits="_controls_FormDataChangeA" %> <table border="0" cellpadding="0" cellspacing="0" style="width: 100%"> <tr style="display:none;"> <td colspan="2" style="background-image: url(_images/cate.gif); height: 24px; font-weight: bold; color: #cc0000; font-size: 9pt;" align="left"> ┣ <asp:Label ID="lblFormName" runat="server"></asp:Label></td> </tr> </table> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BorderColor="#E0E0E0" BorderStyle="None" BorderWidth="1px" CellPadding="4" GridLines="None" ShowHeader="False" Width="100%" OnRowDataBound="GridView1_RowDataBound"> <Columns> <asp:BoundField DataField="FormDataId" Visible="False" /> <asp:TemplateField> <ItemTemplate> <img src="../_images/small.gif" width=5px height=5px ></img> <asp:HyperLink ID="linkCaption" runat="server" NavigateUrl='<%# FormatLink()+"?id=" + Eval("FormDataId") %>' Text='<%# Convert.ToString(Eval("Caption")) %>' ToolTip='<%# Eval("Caption") %>' Target="_blank"></asp:HyperLink> <asp:Label ID="lbl" runat="server" Text='<%# Eval("PostedDate") %>' Visible="false"></asp:Label> <asp:Image ID="imageNew" runat="server" Visible="False" /> </ItemTemplate> <ItemStyle Font-Size="9pt" HorizontalAlign="Left" Width="80%" /> </asp:TemplateField> <asp:BoundField DataField="PostedDate" DataFormatString="{0:yyyy-MM-dd}" HtmlEncode="False" Visible="False"> <ItemStyle Font-Size="9pt" HorizontalAlign="Right" /> </asp:BoundField> </Columns> <RowStyle BorderColor="#404040" BorderStyle="Dotted" BorderWidth="1px" /> </asp:GridView> <asp:Label ID="Label1" runat="server" Font-Size="9pt" ForeColor="Silver" Height="160px" Text="暂无内容" Width="100%"></asp:Label> <table border="0" cellpadding="0" cellspacing="0" style="width: 100%"> <tr> <td align="right"> <asp:HyperLink ID="linkMore" runat="server" Font-Size="9pt" Visible="False">更多</asp:HyperLink></td> </tr> </table>
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class _controls_FormDataChangeA : System.Web.UI.UserControl { public int FormId { set { ViewState["FormDataListControl_FormId"] = value; } get { return Convert.ToInt32(ViewState["FormDataListControl_FormId"]); } } public int Count { set { ViewState["FormDataListControl_Count"] = value; } get { return Convert.ToInt32(ViewState["FormDataListControl_Count"]); } } public int FontLength { set { ViewState["FormDataListControl_FontLength"] = value; } get { return Convert.ToInt32(ViewState["FormDataListControl_FontLength"]); } } public string LinkName { set { ViewState["FormDataListControl_linkName"] = value; } get { return Convert.ToString(ViewState["FormDataListControl_linkName"]); } } public int FormClass { set { ViewState["FormDataListControl_FormClass"] = value; } get { return Convert.ToInt32(ViewState["FormDataListControl_FormClass"]); } } protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) BindData(); } catch (Exception exp) { Response.Redirect("Error.aspx"); } } private void BindData() { int formId = Convert.ToInt32(ViewState["FormDataListControl_FormId"]); int count = Convert.ToInt32(ViewState["FormDataListControl_Count"]); int formClass = Convert.ToInt16(ViewState["FormDataListControl_FormClass"]); linkMore.NavigateUrl = "../ArticleList.aspx?id=" + formId; Junking.Publication.Form form = new Junking.Publication.Form(); DataSet ds = form.Load(formId); if (ds.Tables[0].Rows.Count > 0) { lblFormName.Text = Convert.ToString(ds.Tables[0].Rows[0]["FormName"]); } Junking.Publication.FormData formData = new Junking.Publication.FormData(); DataSet dsList = new DataSet(); switch (formClass) { case 1: dsList = formData.LoadSub(formId, count); //选择formid,时间排列 break; case 2: dsList = formData.LoadTop(formId, count);//选择parentid,时间排列 break; case 3: dsList = formData.LoadListCount(formId, count); //选择parentid 和formid break; case 4: dsList = formData.LoadSub1(formId, count); //选择parentid,formdataid排列 break; case 5: dsList = formData.LoadTop1(formId, count); //选择formid,formdataid排列 break; case 6: dsList = formData.LoadListCount1(formId, count); //选择parentid 和formid,formdataid排列 break; default: dsList = formData.LoadSub(formId, count); break; } if (dsList.Tables[0].Rows.Count > 0) { GridView1.DataSource = dsList.Tables[0]; GridView1.DataBind(); Label1.Visible = false; } else { GridView1.Visible = false; Label1.Visible = true; } } public string FormatLink() { return Convert.ToString(ViewState["FormDataListControl_linkName"]); } public string FormatString(string value, int length) { string r = String.Empty; if (value.Length > length) r = value.Substring(0, length) + "..."; else r = value; return r; } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { int fontlength = Convert.ToInt32(ViewState["FormDataListControl_FontLength"]); if (e.Row.RowType == DataControlRowType.DataRow) { HyperLink hy = (HyperLink)e.Row.Cells[1].FindControl("linkCaption"); Label lbl = (Label)e.Row.FindControl("lbl"); Image image = (Image)e.Row.FindControl("imageNew"); TimeSpan ts = new TimeSpan(); ts = DateTime.Now - Convert.ToDateTime(lbl.Text); int daysCount = Convert.ToInt32(ts.Days.ToString()); if (daysCount < 1) { image.Visible = true; image.ImageUrl = "../_images/n.gif"; hy.Text = FormatString(hy.Text, fontlength-3); } else { hy.Text = FormatString(hy.Text, fontlength); } } } }
发表评论
-
用c#读取excel中的数据插入到数据库中
2008-11-03 17:35 6712上传选择的xls文件,根据得到路径,读取文件信息,插 ... -
解决.net中使用prototype产生乱码
2008-10-21 15:36 784prototype默认用utf-8的字符编码,而.net中用g ... -
抓取网站信息
2008-07-19 11:31 924接触正则表达式的时间不长,感觉挺有意思,所以试着抓取了一下某网 ... -
通过web.config文件连接access
2007-06-07 13:31 18151.新建立website,数据库放在app_code下,数据库 ... -
Gridview中用checkbox来改变选种行的背景色
2007-06-07 13:22 2012通过把checkbox加入到模板列 添加 checkbox的o ... -
gridview中实现选种行变色
2007-06-07 13:19 1725对gridview增加RowDataBound事件 : p ... -
.net资源汇总
2007-06-07 13:18 957名称:快速入门 地址:http://chs.gotdotnet ...
相关推荐
非常漂亮的控件! 非常漂亮的控件! 非常漂亮的控件! 非常漂亮的控件! 非常漂亮的控件!
asp.net控件笔记 asp.net控件笔记
WinCC V7.0 支持.NET控件的编程入门 。net开发的控件可以直接用到WinCC 7 里面
.NET 菜单控件,.net控件,菜单控件,工具栏控件,vs.net控件
asp.net 控件随着窗口大小按比例变化源码! 很值得下载看看!资源免费,大家分享!!
vb.net控件应用编程实例教程vb.net控件应用编程实例教程vb.net控件应用编程实例教程
vb.net 的各种常用空间使用实例 让你快速掌握vb.net的window 编程
ASP.NET14ADO.NET控件控件使用大全
VB.Net控件应用编程实例教程 VB.Net控件应用编程实例教程
ASP.Net控件开发基础资料 , ASP.Net控件设计时支持资料
Asp.net 控件大全
.net 控件拖放,PictureBox控件, Treeview控件, textbox控件
asp.net控件命名规范.docasp.net控件命名规范.doc
.net 图表控件,.net控件,图形控件,统计图控件,.net导出图形报表控件.
标准ASP.NET控件开发实例代码 可以快速入手控件开发知识 供参考
lablview 网页抓取天气预报。利用前面板的.net容器,插入.net控件(WebBrowser),调用Navigate2方法,输入URL,然后从其属性Dcument获得数据。。。。
ASP.NET控件综合实例
asp.net控件.ppt