iis-7

Display custom error page when file upload exceeds allowed size in ASP.NET MVC

江枫思渺然 提交于 2019-12-17 06:28:30
问题 My main issue is that I want to display an custom error page when an uploaded file exceeds allowed size (maxRequestLength in web.config). When the big file is uploaded an HttpException is thrown before my upload action method in the controller is invoked. This is expected. I have tried to catch the exception in a custom attribute and also to override OnException in the controller. Why isnt it possible to catch the exception in either the attribute or the OnException method? Its possible

Display custom error page when file upload exceeds allowed size in ASP.NET MVC

前提是你 提交于 2019-12-17 06:28:16
问题 My main issue is that I want to display an custom error page when an uploaded file exceeds allowed size (maxRequestLength in web.config). When the big file is uploaded an HttpException is thrown before my upload action method in the controller is invoked. This is expected. I have tried to catch the exception in a custom attribute and also to override OnException in the controller. Why isnt it possible to catch the exception in either the attribute or the OnException method? Its possible

How can I get gzip compression in IIS7 working?

点点圈 提交于 2019-12-17 03:49:21
问题 I have installed Static and dynamic compression for IIS7, as well as setting the two web.config values at my application Virtual Folder level. As I understand it, I don't need to enable compression at the server, or site level anymore, and I can manage it on a per folder basis using my web.config file. I have two settings in my .config file that I have set to customize gzip for my app: <httpCompression dynamicCompressionDisableCpuUsage="90" dynamicCompressionEnableCpuUsage="0"> <scheme name=

How do you debug classic ASP?

回眸只為那壹抹淺笑 提交于 2019-12-17 03:35:38
问题 I have to debug a classic asp site being served by IIS 7 (windows 2008). How can I do this? I have only worked with ASP.NET. 回答1: From an MSDN blog post: http://blogs.msdn.com/mikhailarkhipov/archive/2005/06/24/432308.aspx Here is how to make ASP debugging work: Enable ASP debugging on the server. (I also added DEBUG verb to the asp extension, but I am not sure if it is required). Open classic ASP in VS 2005. Set breakpoint. View page in browser or run without debugging. Debug | Attach to

Request is not available in this context

白昼怎懂夜的黑 提交于 2019-12-17 02:44:15
问题 I'm running IIS 7 Integrated mode and I'm getting Request is not available in this context when I try to access it in a Log4Net related function that is called from Application_Start . This is the line of code I've if (HttpContext.Current != null && HttpContext.Current.Request != null) and an exception is being thrown for second comparison. What else can I check other than checking HttpContext.Current.Request for null?? A similar question is posted @ Request is not available in this context

Classic ASP on IIS7: refusing to send errors to browser on 500 Internal Server Error

感情迁移 提交于 2019-12-17 02:37:37
问题 I have classic ASP running on IIS 7. Even though I configured the ASP "Debugging Properties" to "Send Errors to Browser = True", the web app REFUSES to send errors to the browser and continues to send a 500 internal server error. My browser has "Show Friendly HTTP Error Messages" unchecked. Failed Request Tracing is installed (not sure if that's related) Happens both on web pages loaded locally on the server and remotely The App Pool is integrated (not sure if that matters) Any ideas? 回答1:

IIS7 Permissions Overview - ApplicationPoolIdentity

微笑、不失礼 提交于 2019-12-16 20:05:16
问题 We have recently upgraded to IIS7 as a core web server and I need an overview in terms of the permissions. Previously, when needing to write to the file system I would have give the AppPool user (Network Service) access to the directory or file. In IIS7 I see, as default, the AppPool user is set to ApplicationPoolIdentity . So when I check the task-manager, I see that a user account called 'WebSite.com' is running the IIS Process ('Website.com' being the name of the website in IIS) However

IIS 7 gives me error 500 internal server error when trying to display my XML document

元气小坏坏 提交于 2019-12-14 02:51:50
问题 This is quite strange. I have a piece of code running on my server that emits XML to the browser. When I use my dev box to access the page I get a "500 Internal Server Error" page. After numerous diagnostic attempts, I RDPed into my server and tried to use its internal web browser. I was able to see the xml document fine. In know this has nothing to do with my dev browser because I tried both FF and IE and they were able to view the same XML from a mirror server. This leads me to believe it

IIS 7 - URL Rewrite - do I include the http or https protocol in the regex?

空扰寡人 提交于 2019-12-13 20:38:17
问题 In IIS 7.5 (Win2k8 R2) I'm trying to create a new rule for these requests: http://www.domain.com/userprofile https://www.domain.com/userprofile http://domain.com/userprofile https://domain.com/userprofile rewriting to: http://www.domain.com/users/?username=userprofile (or whatever the protocol/domain is) The regex that I wrote is: ^(http|https)://(www\.domain.com|domain\.com)/([a-zA-Z0-9-]{6,35}) and the rewrite is: {R:1}://{R:2}/users/?username={R:3} But this is not working. Is it because I

Can't get HttpContext.Current.User.Identity to work in my WebMatrix project

本秂侑毒 提交于 2019-12-13 20:29:05
问题 I want to capture the user opening my page in an internal Windows AD network. I think I've tried everything: @{ // other code string user123 = HttpContext.Current.User.Identity; } and also @{ // other code <script> var user123 = HttpContext.Current.User.Identity; </script> } And trying to use that later inside my HTML code. Or passing it as a parameter to a stored procedure inside my razor block. Nothing. Either empty, runtime error, or undefined. Note1: HttpContext is recognized by WebMatrix