asp.net-4.0

Problem with <system.web.extensions> config group when upgrading to .NET 4.0

风流意气都作罢 提交于 2020-01-02 02:14:09
问题 So we've upgraded our site from 3.5 SP1 -> .NET 4. When we ran the site, we got an Internal Server Error (500), stating the following configuration group could not be read: <system.web.extensions> <scripting> <scriptResourceHandler enableCompression="true" enableCaching="true" /> <webServices> <jsonSerialization maxJsonLength="999999" /> </webServices> </scripting> </system.web.extensions> We commented out this section and the website ran fine (but now we are getting problems with JSON -

Caching ASHX Image Response

女生的网名这么多〃 提交于 2019-12-30 07:05:35
问题 I have created an ashx file to generate image thumbnails on the fly. I would like to cache these images client side after they are called the first time. URL: ~/image.ashx?dir=user&w=25&h=25&force=yes&img=matt.jpg Code Behind: public void ProcessRequest (HttpContext context) { TimeSpan refresh = new TimeSpan(0, 15, 0); context.Response.Cache.SetExpires(DateTime.Now.Add(refresh)); context.Response.Cache.SetMaxAge(refresh); context.Response.Cache.SetCacheability(HttpCacheability.Server);

ASP.NET MVC - Uploading an image to Amazon S3

99封情书 提交于 2019-12-30 02:08:33
问题 I have my image from Request.Files[0]. Now, how do I upload this image to S3? I see that in the AWS .NET API you have to specify ContentBody when putting an object which is a string. How would I get the content body of my file? 回答1: var file = Request.Files[0]; PutObjectRequest request = new PutObjectRequest(); request.BucketName = "mybucket" request.ContentType = contentType; request.Key = key; request.InputStream = file.InputStream; s3Client.PutObject(request); 回答2: Slightly more detail

The best browser detection solution in ASP.NET 4.0

冷暖自知 提交于 2019-12-30 00:53:35
问题 I googled this topic and I came across with three different ways to configure browser capabilities: browscap.ini, browserCaps element in web.config and .browser files in App_Browsers. I thought .browser files is the latest way, but I don't seem to find up-to-date files. But I found quite fresh browscap.ini from http://browsers.garykeith.com/downloads.asp. My first priority is to exclude common crawlers from the visitor stats. The second priority is to detect browser and os with correct

The best browser detection solution in ASP.NET 4.0

风格不统一 提交于 2019-12-30 00:53:04
问题 I googled this topic and I came across with three different ways to configure browser capabilities: browscap.ini, browserCaps element in web.config and .browser files in App_Browsers. I thought .browser files is the latest way, but I don't seem to find up-to-date files. But I found quite fresh browscap.ini from http://browsers.garykeith.com/downloads.asp. My first priority is to exclude common crawlers from the visitor stats. The second priority is to detect browser and os with correct

How to implement Socket.IO with ASP.Net, IISNode, Node.JS, and SQL Server for event-based push notifications?

喜欢而已 提交于 2019-12-30 00:32:23
问题 For a notification project, would like to push event notifications out. These are things like login, change in profile, etc., and to be displayed to the appropriate client. I would like to discuss some ideas on putting it together, and get some advice on the best approach. I noticed here that changes made to a CouchDB can be detected with a _changes stream, picked up by Node, and a process kicks off. I would like to implement something like this (I'm using SQL Server, but an entry point at

Preventing a deadlock when calling an async method without using await

久未见 提交于 2019-12-28 16:51:53
问题 I need to call a method returning a Task from within public override void OnActionExecuting(ActionExecutingContext filterContext) It wont let me make this method async it throws the following An asynchronous module or handler completed while an asynchronous operation was still pending. and when calling entityStorage.GetCurrentUser().Result I get a deadlock. How can I avoid this? I have been playing around with it coming up with stuff like entityStorage.GetCurrentUser().Result.ConfigureAwait

development enivroment of 3.5 and hosting 4.x conflicts issues

笑着哭i 提交于 2019-12-25 07:39:27
问题 I am trying to deploy a website developed in the 3.5 and deploying it on 4.x .. now the series of conflicts has risen with the web.config. it promted me to delete most of the sectionGroup elements. Which I duely deleted and the problem further reached to delete the system.web.extension version=3.5.0 element. Which I deleted . Now I am getting another error but don't know what to do whith that. the website is www.spiralsnet.com 来源: https://stackoverflow.com/questions/17382489/development

hosting the application in iis cascading dropdown with ajax is display the method 500 error?

二次信任 提交于 2019-12-24 16:24:27
问题 I am using cascading dropdownExtender in my application it is working on local system but i am hosting IIS not working display the method 500 error what is the problem pls give me suggestion. Thanku hemanth 回答1: I could findout my answer , first debugging the asmx page i could findout the duplication dlls in my application, i deleted that one it is working fine . 回答2: In above question problem is first i hosted in iis that time the folder cascading drop down extender code dll is adding

ASP.Net Application Warmup - Exposing Collections

会有一股神秘感。 提交于 2019-12-24 15:26:34
问题 My MVC application currently uses the Global.asax , Application_Start method to load tons of data, and then exposes it as collections. For example: Current Usage Example: // Global.asax public static DataRepository Repository { get; set; } protected void Application_Start() { // All the normal stuff... // Preload this repository. DataRepository = new DataRepository(); } // HomeController.cs Example public ActionResult Index(){ return Json(MyApplication.Repository.GetSomeCollection(),