您目前尚未登陆,请选择【登陆】或【注册
首页->影音视频->Asp.net2.0的电影在线点播系统片段源码>>userfavor.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:Asp.net2.0的电影在线点播系统片段源码
当前文件:文件类型 MovieShowSample/userfavor.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11using System.Reflection; 12public partial class userfavor : System.Web.UI.Page,ICallbackEventHandler 13{ 14 protected void Page_Load(object sender, EventArgs e) 15 { 16 ImageButton1.Attributes.Add("onclick","select1();return false;"); 17 ImageButton2.Attributes.Add("onclick", "select2();return false;"); 18 Button1.Attributes.Add("onclick","safe();return false;"); 19 20 //从cookie中获取身份验证票信息 21 string cookieName = FormsAuthentication.FormsCookieName; 22 HttpCookie authCookie = Context.Request.Cookies[cookieName]; 23 24 if(authCookie!=null) 25 { 26 //解密 27 FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value); 28 string name = authTicket.Name.ToString(); 29 30 DataVisit mydv = new DataVisit(); 31 DataSet myds=mydv.getfavor(name); 32 GridView1.DataSource = myds; 33 GridView1.DataBind(); 34 } 35 36 } 37 38 39 public string result; 40 public string GetCallbackResult() 41 { 42 //为便于查看加载效果,添加延时 43 System.Threading.Thread.Sleep(1000); 44 45 string[] parts = result.Split('|'); 46 //搜索名为MethodName的方法 47 MethodInfo method = this.GetType().GetMethod(parts[0]); 48 49 //定义一个object数组用来保存参数 50 object[] args = new object[parts.Length - 1]; 51 Array.Copy(parts, 1, args, 0, args.Length); 52 53 return (string)method.Invoke(this, args); 54 } 55 56 public void RaiseCallbackEvent(string eventArgument) 57 { 58 result = eventArgument; 59 } 60 public string safe(string pwd,string email,string phone,string qq) 61 { 62 //从cookie中获取身份验证票信息 63 string cookieName = FormsAuthentication.FormsCookieName; 64 HttpCookie authCookie = Context.Request.Cookies[cookieName]; 65 66 67 if (authCookie != null) 68 { 69 70 //解密 71 FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value); 72 string name = authTicket.Name.ToString(); 73 74 DataVisit mydv = new DataVisit(); 75 mydv.change(name, pwd, email, phone, qq); 76 return "修改成功了!"; 77 78 } 79 else 80 { return "修改失败了!";} 81 82 83 } 84 85 protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) 86 { 87 if (e.Row.RowType == DataControlRowType.DataRow) 88 { 89 e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#e4f5d1';"); 90 //当鼠标移走时还原该行的背景色 91 e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor"); 92 } 93 } 94 95 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) 96 { 97 if (e.Row.RowType == DataControlRowType.DataRow) 98 { 99 LinkButton lb = (LinkButton)e.Row.FindControl("LinkButton1"); 100 lb.Attributes.Add("onclick","javascript:return confirm('是否删除该影片?')"); 101 } 102 } 103 104 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) 105 { 106 if (e.CommandName == "Delete") 107 { 108 //从cookie中获取身份验证票信息 109 string cookieName = FormsAuthentication.FormsCookieName; 110 HttpCookie authCookie = Context.Request.Cookies[cookieName]; 111 112 if (authCookie != null) 113 { 114 //解密 115 FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value); 116 string name = authTicket.Name.ToString(); 117 118 DataVisit mydv = new DataVisit(); 119 string filmid = e.CommandArgument.ToString(); 120 mydv.deletefilm(Convert.ToInt32(filmid), name); 121 DataSet myds = mydv.getfavor(name); 122 GridView1.DataSource = myds; 123 GridView1.DataBind(); 124 } 125 } 126 } 127 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) 128 { 129 130 } 131} 132
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:Asp.net2.0的电影在线点播系统片段源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号