当前位置: 首页>>代码示例>>C#>>正文


C# ErrorLog.AddErrorToLog方法代码示例

本文整理汇总了C#中ErrorLog.AddErrorToLog方法的典型用法代码示例。如果您正苦于以下问题:C# ErrorLog.AddErrorToLog方法的具体用法?C# ErrorLog.AddErrorToLog怎么用?C# ErrorLog.AddErrorToLog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ErrorLog的用法示例。


在下文中一共展示了ErrorLog.AddErrorToLog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
		try
        {
            ans1 = Session["answer"]!= null ? Session["answer"].ToString() : "";
            if (DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo().UserID != -1)
            {
                //Response.Write(DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo().DisplayName);                
                txtName.Text = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo().DisplayName;                
            }
            else
            {
                txtName.Text = "Anonymous";                
            }
            BindComment();
        }
        catch (Exception ex)
        {
            UserInfo info = UserController.GetCurrentUserInfo();
            ErrorLog objLog = new ErrorLog();
            objLog.ErrorDescription = ex.ToString();
            objLog.ErrorDate = DateTime.Now;
            objLog.ErrorFunctionName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
            objLog.ErrorLoggedInUser = info.Username;
            objLog.AddErrorToLog(objLog);

        }
    }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:29,代码来源:ArticleComment.ascx.cs

示例2: rptDataBound

 protected void rptDataBound(object sender, DataListItemEventArgs e)
 {
     try
     {
         string str = Server.HtmlDecode(ds.Tables[0].Rows[e.Item.ItemIndex]["Article"].ToString());
         Match m = Regex.Match(str, @"<img(.|\n)+?>");
         Image ArticleImage = (Image)e.Item.FindControl("img");
         if (!string.IsNullOrEmpty(ds.Tables[0].Rows[e.Item.ItemIndex]["Thumbnail"].ToString()))
         {
             System.Drawing.Bitmap bmp = customTransactions.RezizeImage(Server.MapPath(ds.Tables[0].Rows[e.Item.ItemIndex]["Thumbnail"].ToString()), 110, 80, ArticleImage);
             ArticleImage.ImageUrl = ds.Tables[0].Rows[e.Item.ItemIndex]["Thumbnail"].ToString();
         }
         else if (m.Success)
         {
             Match inner = Regex.Match(m.Value, "src=[\'|\"](.+?)[\'|\"]");
             if (inner.Success)
             {
                 string imageurl = inner.Value.Substring(5).Substring(0, inner.Value.Substring(5).LastIndexOf("\""));
                 System.Drawing.Bitmap bmp = customTransactions.RezizeImage(Server.MapPath(imageurl), 110, 80, ArticleImage);
                 ArticleImage.ImageUrl = inner.Value.Substring(5).Substring(0, inner.Value.Substring(5).LastIndexOf("\""));
             }
         }
     }
     catch (Exception ex)
     {
         UserInfo info = UserController.GetCurrentUserInfo();
         ErrorLog objLog = new ErrorLog();
         objLog.ErrorDescription = ex.ToString();
         objLog.ErrorDate = DateTime.Now;
         objLog.ErrorFunctionName = "Page Load";
         objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
         objLog.ErrorLoggedInUser = info.Username;
         objLog.AddErrorToLog(objLog);
     }
 }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:35,代码来源:HomeDepartments.ascx.cs

示例3: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         SqlDataAdapter da = new SqlDataAdapter("sp_section",new SqlConnection(customTransactions.connectionString));
         da.SelectCommand.CommandType = CommandType.StoredProcedure;
         da.SelectCommand.Parameters.AddWithValue("@Categoryid", Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["News"]));
         da.SelectCommand.Parameters.AddWithValue("@rows", Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["newsrows"]));
         DataTable dt = new DataTable();
         da.Fill(dt);
         rptnews.DataSource = dt;
         rptnews.DataBind();
     }
     catch (Exception ex)
     {
         UserInfo info = UserController.GetCurrentUserInfo();
         ErrorLog objLog = new ErrorLog();
         objLog.ErrorDescription = ex.ToString();
         objLog.ErrorDate = DateTime.Now;
         objLog.ErrorFunctionName = "Page Load";
         objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
         objLog.ErrorLoggedInUser = info.Username;
         objLog.AddErrorToLog(objLog);
     }
 }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:25,代码来源:HomeNews.ascx.cs

示例4: Register

    protected void Register(object sender, EventArgs e)
    {
        try
        {
            if (lnkRegister.Text == "Profile")
            {
                Response.Redirect("/profile", false);
            }
            else
            {
                Response.Redirect("/register", false);
            }
        }
        catch (Exception ex)
        {
            UserInfo info = UserController.GetCurrentUserInfo();
            ErrorLog objLog = new ErrorLog();
            objLog.ErrorDescription = ex.ToString();
            objLog.ErrorDate = DateTime.Now;
            objLog.ErrorFunctionName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
            objLog.ErrorLoggedInUser = info.Username;
            objLog.AddErrorToLog(objLog);

        }
    }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:26,代码来源:Header.ascx.cs

示例5: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            SqlDataAdapter da = new SqlDataAdapter("sp_HomeTopRightArticle", new SqlConnection(customTransactions.connectionString));
            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            da.SelectCommand.Parameters.AddWithValue("@Categoryid", Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["ProductReview"]));
           
            DataTable dt = new DataTable();
            da.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                title = dt.Rows[0]["Title"].ToString();
                thumbnail = "../ImageHandler.ashx?imgpath=" + dt.Rows[0]["Thumbnail"].ToString() + "&w=270&h=130";
                url = customTransactions.GenerateFriendlyURL("article", title, "0-" + dt.Rows[0]["Id"].ToString(), 0);
				teaser = dt.Rows[0]["Teaser"].ToString();
            }
        }
        catch (Exception ex)
        {
            UserInfo info = UserController.GetCurrentUserInfo();
            ErrorLog objLog = new ErrorLog();
            objLog.ErrorDescription = ex.ToString();
            objLog.ErrorDate = DateTime.Now;
            objLog.ErrorFunctionName = "Page Load";
            objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
            objLog.ErrorLoggedInUser = info.Username;
            objLog.AddErrorToLog(objLog);
        }
    }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:30,代码来源:HomeTopRightArticle.ascx.cs

示例6: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            SqlDataAdapter da = new SqlDataAdapter("sp_HomeDepartment_Articles", new SqlConnection(customTransactions.connectionString));
            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            da.SelectCommand.Parameters.AddWithValue("@Id1", Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["AVSystems"]));
            da.SelectCommand.Parameters.AddWithValue("@Id2", Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["LawEnforcement"]));
            da.SelectCommand.Parameters.AddWithValue("@Id3", Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["Production"]));            
            da.Fill(ds);
            dldepartments.DataSource = ds;
            dldepartments.DataBind();
        }
        catch (Exception ex)
        {

            UserInfo info = UserController.GetCurrentUserInfo();
            ErrorLog objLog = new ErrorLog();
            objLog.ErrorDescription = ex.ToString();
            objLog.ErrorDate = DateTime.Now;
            objLog.ErrorFunctionName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
            objLog.ErrorLoggedInUser = info.Username;
            objLog.AddErrorToLog(objLog);

        }
    }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:27,代码来源:HomeDepartments.ascx.cs

示例7: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             string ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["SiteSqlServer"].ToString();                
             SqlDataAdapter da = new SqlDataAdapter("sp_HomeCoverStory", new SqlConnection(customTransactions.connectionString));
             da.SelectCommand.CommandType = CommandType.StoredProcedure;
             da.SelectCommand.Parameters.AddWithValue("@PortalId", customTransactions.PortalId);
             da.Fill(ds);
             JSON_DataTable_DataHolder.Value = customTransactions.DataTableToJSON(customTransactions.TrimDataTableJSON(ds), "HomeCoverStory");
         }
     }
     catch (Exception ex)
     {
         UserInfo info = UserController.GetCurrentUserInfo();
         ErrorLog objLog = new ErrorLog();
         objLog.ErrorDescription = ex.ToString();
         objLog.ErrorDate = DateTime.Now;
         objLog.ErrorFunctionName = System.Reflection.MethodBase.GetCurrentMethod().Name;
         objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
         objLog.ErrorLoggedInUser = info.Username;
         objLog.AddErrorToLog(objLog);
     }
 }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:26,代码来源:HomeCoverStory.ascx.cs

示例8: FillArticle

    public void FillArticle(int SiteId, string keyword, int MatchType)
    {
        try
        {

            //articleCount = "Your Query <b><i>" + keyword + "</i></b> returned " + customTransactions.GetSearchResults(1, keyword, SortMethod,MatchType).Rows.Count.ToString() + " record(s) ";
			dtSearchResults = null;
            dtSearchResults = customTransactions.GetSearchResults(1, keyword, SortMethod, MatchType);
			articleCount = (MatchType == 1) ? "Your Query <b><i>&#8220;" + keyword + "&#8221;</i></b> returned " + dtSearchResults.Rows.Count.ToString() + " record(s) " : "Your Query <b><i>" + keyword + "</i></b> returned " + dtSearchResults.Rows.Count.ToString() + " record(s)";
            if (customTransactions.GetSearchResults(1, keyword, SortMethod,MatchType).Rows.Count != 0)
            {
                gridArticle.DataSource = customTransactions.GetSearchResults(1, keyword, SortMethod, MatchType);
                gridArticle.DataBind();
            }
            else
            {
                // dvArticleCount.InnerHtml  = "Your Query <b><i>" + keyword + "</i></b> returned no record(s) for ARTICLE";
                gridArticle.DataSource = null;
                gridArticle.DataBind();
                dvArticleCount.InnerText = "No Records Found";
            }
        }
        catch (Exception ex)
        {
            UserInfo info = UserController.GetCurrentUserInfo();
            ErrorLog objLog = new ErrorLog();
            objLog.ErrorDescription = ex.ToString();
            objLog.ErrorDate = DateTime.Now;
            objLog.ErrorFunctionName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
            objLog.ErrorLoggedInUser = info.Username;
            objLog.AddErrorToLog(objLog);
        }
    }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:34,代码来源:SearchResult.ascx.cs

示例9: register_click

    protected void register_click(object sender, EventArgs e)
    {
        try
        {
            UserInfo objUser = new UserInfo();

            objUser.PortalID = customTransactions.GetPortalID(Request.ServerVariables["SERVER_NAME"].ToString());
            objUser.IsSuperUser = false;
            objUser.FirstName = txtFirstName.Text;
            objUser.LastName = txtLastName.Text;
            objUser.DisplayName = txtFirstName.Text + " " + txtLastName.Text;
            objUser.Email = txtEmailAddress.Text;
            objUser.Username = txtUserName.Text;

            UserMembership objMembership = new UserMembership(objUser);
            objMembership.Approved = true;
            objMembership.CreatedDate = DateTime.Now;
            objMembership.Email = txtEmailAddress.Text;
            objMembership.Username = txtUserName.Text;
            objMembership.Password = txtPassword.Text;

            //DotNetNuke.Security.Roles.RoleController role = new DotNetNuke.Security.Roles.RoleController();
            //role.AddUserRole(PortalAliasController.GetPortalAliasInfo(Request.ServerVariables["SERVER_NAMES"]).PortalID, objUser.UserID, 1, DateTime.Now);

            objUser.Membership = objMembership;
            UserCreateStatus result = UserController.CreateUser(ref objUser);

            //Check status
            if (result == UserCreateStatus.Success)
            {
                lblMessage.Text = "User registered successfully";
            }
            UserController.UserLogin(0, objUser, Request.ServerVariables["SERVER_NAME"], this.Request.UserHostAddress, true);
            Response.Redirect("/index.aspx", false);

        }

        catch (Exception ex)
        {
            UserInfo info = UserController.GetCurrentUserInfo();
            ErrorLog objLog = new ErrorLog();
            objLog.ErrorDescription = ex.ToString();
            objLog.ErrorDate = DateTime.Now;
            objLog.ErrorFunctionName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
            objLog.ErrorLoggedInUser = info.Username;
            objLog.AddErrorToLog(objLog);

        }
    }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:50,代码来源:Register.ascx.cs

示例10: FillGrid

    private void FillGrid()
    {
		int gIndex = 0;
		string strPrev, strNext;
        try
        {
			if (Request.QueryString.Count > 0)
			{
				gIndex = Convert.ToInt32(Request.QueryString["paging"].ToString());
			}
			string ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["SiteSqlServer"].ToString();
			SqlConnection con = new SqlConnection(ConnectionString);
			SqlCommand cmd = new SqlCommand("sp_FetchTitles", con);
			cmd.Parameters.AddWithValue("@PortalId", customTransactions.PortalId);
			SqlDataAdapter da = new SqlDataAdapter(cmd);
			cmd.CommandType = CommandType.StoredProcedure;
			DataSet ds = new DataSet();
			da.Fill(ds);
			gridArticle.DataSource = ds.Tables[0];
			gridArticle.PageIndex = gIndex;
			gridArticle.DataBind();
			if (gIndex == 0)
				strPrev = "";
			else
				strPrev = "<a href='/GoogleJump.aspx?paging=" + (gIndex - 1) + "'>Prev</a>";
			if (gIndex >= gridArticle.PageCount - 1)
			{
				strNext = "";
				strPrev = "<a href='/GoogleJump.aspx?paging=" + (gridArticle.PageCount - 2) + "'>Prev</a>";
			}
			else
			{
				strNext = "<a href='/GoogleJump.aspx?paging=" + (gIndex + 1) + "'>Next</a>";
				if (strPrev != "")
					strNext = "&nbsp; &nbsp; &nbsp; &nbsp; " + strNext;
			}
			lblPaging.Text = "<br /><br />" + strPrev + strNext;
        }
        catch (Exception ex)
        {
            UserInfo info = UserController.GetCurrentUserInfo();
            ErrorLog objLog = new ErrorLog();
            objLog.ErrorDescription = ex.ToString();
            objLog.ErrorDate = DateTime.Now;
            objLog.ErrorFunctionName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
            objLog.ErrorLoggedInUser = info.Username;
            objLog.AddErrorToLog(objLog);
        }
    }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:50,代码来源:GoogleJump.aspx.cs

示例11: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (HttpContext.Current.User.Identity.Name != "")
            {
                //Response.Write(customTransactions.GetUserRoles(HttpContext.Current.User.Identity.Name, 0));
                if (customTransactions.GetUserRoles(HttpContext.Current.User.Identity.Name, 0).ToLower().Contains("blogger"))
                {
                    //For Bloggers
                    Response.Redirect("/blogs", false);
                }
                else if (customTransactions.GetUserRoles(HttpContext.Current.User.Identity.Name, 0).ToLower().Contains("editor"))
                {
                    //For rest of the users
                    Response.Redirect("/articleadmin", false);

                }
                else
                {
                    //For Editors and Host
                    Response.Redirect("/index", false);
                }
            }
        }

        catch (Exception ex)
        {


            UserInfo info = UserController.GetCurrentUserInfo();
            ErrorLog objLog = new ErrorLog();
            objLog.ErrorDescription = ex.ToString();
            objLog.ErrorDate = DateTime.Now;
            objLog.ErrorFunctionName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
            objLog.ErrorLoggedInUser = info.Username;
            objLog.AddErrorToLog(objLog);

        }
    }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:41,代码来源:Login.ascx.cs

示例12: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            UserInfo user = UserController.GetCurrentUserInfo();
            if (user.UserID == -1)
            {
                lnkSignIn.Text = "Sign-In";
                lnkRegister.Text = "Register";
            }
            else
            {
                lnkSignIn.Text = "Logout";
                lnkRegister.Text = "Profile";
            }
            if (isHostOrEditor == 1)
                lnkArticle.Style.Add("display", "inline");// = true;
            else
                lnkArticle.Style.Add("display", "none");
            if (Request.QueryString["categoryid"] != null)
                _Page = Convert.ToInt32(Request.QueryString["categoryid"]);
            else if (Request.QueryString["articleid"] != null)
                _Page = Convert.ToInt32(customTransactions.Get_CategoryByArticleId(Request.QueryString["articleid"].ToString()));
            //Response.Write(_Page);
        }
        catch (Exception ex)
        {
            UserInfo info = UserController.GetCurrentUserInfo();
            ErrorLog objLog = new ErrorLog();
            objLog.ErrorDescription = ex.ToString();
            objLog.ErrorDate = DateTime.Now;
            objLog.ErrorFunctionName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
            objLog.ErrorLoggedInUser = info.Username;
            objLog.AddErrorToLog(objLog);

        }
    }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:38,代码来源:Header.ascx.cs

示例13: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            SqlConnection conn = new SqlConnection(connectionString);
            SqlDataAdapter adap = new SqlDataAdapter("Select * from Users where IsFirstLogin=1 and username= '" + user.Username + "'", conn);
            dt.Clear();
            adap.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "nKey", "DisplayMsg()", true);
            }
            Session["FirstGrid"] = null;
            Session["SecondGrids"] = null;
            if (!IsPostBack)
            {
                txtLogName.Text = user.Username;
                txtFirstName.Text = user.Profile.FirstName;
                txtLastName.Text = user.Profile.LastName;
                txtEmailAdd.Text = user.Email;
            }
        }
        catch (Exception ex)
        {


            UserInfo info = UserController.GetCurrentUserInfo();
            ErrorLog objLog = new ErrorLog();
            objLog.ErrorDescription = ex.ToString();
            objLog.ErrorDate = DateTime.Now;
            objLog.ErrorFunctionName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
            objLog.ErrorLoggedInUser = info.Username;
            objLog.AddErrorToLog(objLog);

        }
    }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:37,代码来源:Profile.ascx.cs

示例14: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Request.QueryString["categoryid"] != null)
            {
                categoryId = Convert.ToInt32(Request.QueryString["categoryid"]);
                dlmultiSection.DataSource = customTransactions.Get_Child_Category(categoryId.ToString());
                dlmultiSection.DataBind();

                FillInnerGrid();

                if (!IsPostBack)
                {

                    CDefault tp = (CDefault)this.Page;
                    tp.Title =  customTransactions.GetCategoryName(categoryId);
                    tp.KeyWords = "GovernmentVideo " + customTransactions.GetCategoryDetails(categoryId) + ", techlearning " + customTransactions.GetCategoryDetails(categoryId);

                }
            }
        }
        catch (Exception ex)
        {
            Response.Write(ex.ToString());
            UserInfo info = UserController.GetCurrentUserInfo();
            ErrorLog objLog = new ErrorLog();
            objLog.ErrorDescription = ex.ToString();
            objLog.ErrorDate = DateTime.Now;
            objLog.ErrorFunctionName = "Page Load";
            objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
            objLog.ErrorLoggedInUser = info.Username;
            objLog.AddErrorToLog(objLog);

        }
    }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:36,代码来源:multisection.ascx.cs

示例15: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
		title = "";
        try
        {
			span1.Visible = isHostOrEditor;
            ArticleInfo info;
			if ((Request.QueryString["id"] != null) || (Request.QueryString["articleid"] != null))
			{
				if (Request.QueryString["id"] != null)
				{
					SqlDataAdapter adap = new SqlDataAdapter("sp_GetArticleIdfromEktron", new SqlConnection(ConfigurationManager.AppSettings["SiteSqlServer"]));
					adap.SelectCommand.CommandType = CommandType.StoredProcedure;
					adap.SelectCommand.Parameters.AddWithValue("ektid", Request.QueryString["id"] );
					DataTable dt=new DataTable();
					dt.Clear();
					adap.Fill(dt);
					articleid=Convert.ToInt32(dt.Rows[0][0].ToString());
				}
				else if (Request.QueryString["articleid"] != null)
				{                
					articleid = Convert.ToInt32(Request.QueryString["articleid"]);                
				}
				
				info = ArticleController.Get(articleid);
				ArticleController.UpdateViews(articleid);
				Session["ArticleId"] = articleid;
				//art = customTransactions.Get_Article_Details("Article", Convert.ToInt32(articleid));
				art = info.Article;				
				publishdate = info.PublishDate.ToString("MMM dd, yyyy");
				title = info.Title;
				author = info.Author;
				if (author.Trim() != "")
					author = "by " + author;				
				if (art.Length != null && art.Length > 0 )
				{
					BusinessLogic paging = new BusinessLogic(Convert.ToInt32(articleid));
					//Response.Redirect("http://www.google.co.in",false);
					JavaScriptSerializer serialize = new JavaScriptSerializer();
					articles = (paging.IsPagingEnable) ? serialize.Serialize(SplitText(Server.HtmlDecode(art), 370)) : serialize.Serialize(Server.HtmlDecode(art));
					
					CDefault tp = (CDefault)this.Page;

					tp.Title = "GovernmentVideo: " + info.Title;
					if (info.Keywords.ToString() == "")
					{						
						tp.KeyWords="GovernmentVideo: " + info.Title + " governmentvideo: " + info.Title.ToLower();
					}
					else
					{
						tp.KeyWords = info.Keywords.ToString();
					}
				}
				else
				{
					string path="http://www.governmentvideo.com/index";
					HttpContext.Current.Response.Status = "301 Moved Permanently";
					HttpContext.Current.Response.AddHeader("Location", path);
					HttpContext.Current.Response.Redirect(path, false);
				}
			}
			
        }
        catch (Exception ex)
        {			
            UserInfo info = UserController.GetCurrentUserInfo();
            ErrorLog objLog = new ErrorLog();
            objLog.ErrorDescription = ex.ToString();
            objLog.ErrorDate = DateTime.Now;
            objLog.ErrorFunctionName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            objLog.ErrorControlName = (GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").Remove(0, GetType().ToString().Replace("ASP.", "").Replace("_ascx", ".ascx").LastIndexOf("_") + 1));
            objLog.ErrorLoggedInUser = info.Username;
            objLog.AddErrorToLog(objLog);

        }
		if (title == "")
		{
			Response.Redirect("http://www.governmentvideo.com/index");
		}
    }
开发者ID:smartabbas,项目名称:governmentvideo.com,代码行数:80,代码来源:Article.ascx.cs


注:本文中的ErrorLog.AddErrorToLog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。