ASP.NET

125K

Solutions

28K

Contributors

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

Share tech news, updates, or what's on your mind.

Sign up to Post

How to create/Configure Error page in asp.net web application
When any error was occurred into our asp.net web application it is require that client doesn't know about this error. At that time we need to implement error page redirection and the error details are directly sent to Website administrator vie email.

Error Page Creation Steps

Step 1 – Create Global.asax file into your project and write following code into “Application_Error”

void Application_Error(object sender, EventArgs e)

{

HttpUnhandledException httpUnhandledException = new HttpUnhandledException(Server.GetLastError().Message, Server.GetLastError());

Application["Exception"] = HttpContext.Current.Server.GetLastError();

Application["actualerrorpage"] = httpUnhandledException.GetHtmlErrorMessage();

Application["errortime"] = DateTime.Now.ToLocalTime().ToString();

Application["errorurl"] = Request.Url.AbsoluteUri.ToString();

Application["browser"] = Request.Browser.Browser.ToString() + " ( " + Request.Browser.Type.ToString() + " )";

Application["clientip"] = Request.UserHostAddress.ToString();

if (Request.UrlReferrer != null)

{

Application["referurl"] = Request.UrlReferrer.AbsoluteUri.ToString();

}

else

{

Application["referurl"] = "None";

}

}

Step 2 – Create error.aspx page into your website / Project and write following code into your error.aspx.cs file Page_Load event and “MailToSendSite” function outside of the Page_Load event

0
Bootstrap 4: Exploring New Features
LVL 19
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

how can i rename the header text in grid view dynamically in ASP.NET
0
LVL 10

Expert Comment

by:Dorababu M
Any particular columns you are trying to change? If so you can use RowDataBound event

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
    if (e.Row.RowType == DataControlRowType.Header)
    {
        e.Row.Cells[0].Text = "Your text";
    }
}

Open in new window

0
LVL 29

Expert Comment

by:Brian B
You have entered this as a post, but it looks like you are asking for help. To get the best response from the Experts, you should probably re-submit this as a question using the "ask a question" button at the top of the page, or this link: https://www.experts-exchange.com/askQuestion.jsp

If you do ask a question, please post the link to it back here so others can find your question and help you more quickly.

Please see here for further details: http://support.experts-exchange.com/customer/portal/articles/756544-how-to-succeed-at-ee-as-an-asker
0

ASP.NET

125K

Solutions

28K

Contributors

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications