Frågan#1 Hej,
Jag har denna i web.config:
<customErrors mode="On">
<error statusCode="403" redirect="/error/http403"/>
<error statusCode="404" redirect="/error/http404"/>
<error statusCode="500" redirect="/error/general"/>
</customErrors>
Nu skulle jag vilja kunna hämta upp error 500:s url i en sträng.
Nån som har en susning om hur jag kan göra det?
Typ:
string url = Configuration.CustomErrors.GetError("500").Url;
Hitta på:t :)
System.Configuration.Configuration configuration = WebConfigurationManager.OpenWebConfiguration("~");
CustomErrorsSection customErrorsSection = (CustomErrorsSection)configuration.GetSection("system.web/customErrors");
CustomErrorCollection customErrorsCollection = customErrorsSection.Errors;
string url = customErrorsCollection["500"].Redirect;