Ferry Meidianto | /* Living in .NET World */

TAG | asp.net

Today I was debugging ASP.NET website and got very annoying issue. The website has file download feature and anytime I download the file IE9 couldn’t open it – the file was missing before the PDF application could open it. It did work on FF and Chrome.

I have cleaned-up Temporary Files directory and also ASP.NET temporary files (C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files) but no luck.

Later I realized that by changing the debugging port for ASP.NET Development Server to any new number solved the problem. But I didn’t believe that it’s the real solution. Then after playing with IE settings a bit I found that this setting caused the problem.

It was set to Automatically by default.

You can set it to Every time I start Internet Explorer but I prefer Every time I visit the Webpage for my need, both will work.

Hopefully this will help anyone having the same issue as I faced.

·

I recently upgrading ASP.NET MVC 2 solution from Visual Studio 2008 to Visual Studio 2010 (Ultimate Edition). I found that debugging was very slow. Depending on project size, it took around 30 seconds to initialize and another 5 seconds on each page request in my experience.

I tried disabling IntelliTrace (what is IntelliTrace?)

image

and…. voila! it got its awesome performance back!

· · · ·

UPDATE (2010-09-29): Microsoft has release the fix. It should be available through Windows Update.
More Info: http://weblogs.asp.net/scottgu/archive/2010/09/28/asp-net-security-update-now-available.aspx

Microsoft Security Advisory just announced a vulnerability in ASP.NET that can lead to information disclosure. You can read the complete announcement at http://www.microsoft.com/technet/security/advisory/2416728.mspx

Important: Please make sure you read the Workaround section and do appropriate action based on your websites’ config.

Additional information can also be found at Scott Gu’s blog post http://weblogs.asp.net/scottgu/archive/2010/09/18/important-asp-net-security-vulnerability.aspx

·

I shocked when I found that I couldn’t access Umbraco control panel of one of the most important websites that my client has. It threw “Object reference not set to an instance of an object” error once I successfully logged in to the control panel.

image

After making backup and small research I found a way to recover from that annoying thing. The workaround was recycling the Application Pool that the website use.

·

Aug/10

29

How to get Table Cell or Text Box value in SSRS

To get the Table Cell or Text Box value in SSRS you can do like this:

ReportItems![Text Box name].Value

Note: replace the [Text Box name] with the name of Text Box you want to access.

· ·

Aug/10

24

Umbraco: How to get Media in code-behind

To get a media (i.e.: image)  in code-behind you can do it like this.

var currentPage = umbraco.presentation.nodeFactory.Node.GetCurrent();
var media = new umbraco.cms.businesslogic.media.Media(
            Convert.ToInt32(currentPage.GetProperty("[property]").Value)
    );
string imageUrl = media.getProperty("umbracoFile").Value.ToString();

· ·

Changing default browser used in debugging ASP.NET MVC 2 is a bit tricky in Visual Studio 2010. To use ScottGu’s steps, you will need to add new ASPX page first. But unfortunately if you delete the page then close the application, anytime you rerun the application then the change you did will lost (it backs to use the default browser set in OS).

In my case I have Firefox set as my default browser but I need to use Internet Explorer as default browser for debugging. The trick I do is by doing these:

  1. Open the project properties
  2. Go to Web tab
  3. Set the Start Action to use Start external program and then pass the Internet Explorer executable path and the url as Command line arguments.
  4. Set the Servers’ specific port to the same port set in the url in step 3.

image

(click to view the image in original size)

Make donation to this article:


· · · ·

Jul/10

30

ASP.NET MVC 3 Preview 1 released

I must admit that the ASP.NET MVC team is so consistent in developing ASP.NET MVC framework to be better and better. Just few months after the release of ASP.NET MVC 2, now the Preview 1 of ASP.NET MVC 3 has been released.

Yes, Preview 1 maybe not interesting for some of you but it’s a good time to evaluate the framework and provides feedbacks. Tell them what you like and don’t like, this is a good time for it.

To download ASP.NET MVC 3 Preview 1 release please visit:
http://go.microsoft.com/fwlink/?LinkID=157073

New features delivered in this Preview 1 are:

  • Razor View Engine – a new http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx.
  • Multiple View Engine Support – Add View dialog now supports choosing a view engine and adding custom view engines.
  • Validation Improvements – Support for more validation attributes such as the new ones introduced in ASP.NET 4.
  • Dependency Injection at all levels – Opened up seams for applying the dependency injection when instantiating components of the framework. This allows developers to hook into the creation of models during model binding, action filters, etc.
  • Dynamic View and ViewModel Properties – These dynamic properties provide syntactic sugar to setting and accessing ViewData values making controller and view
  • Global Action Filters – allows registering action filters that apply to all ASP.NET MVC requests. This removes the need to apply a filter attribute on every controller.
  • Support for Permanent Redirects – Added new overloads for permanent redirects which issue a 301 HTTP status code instead of a 302.

The following Scott Guthrie’s blog post will guide you to get an overview of those features:

http://weblogs.asp.net/scottgu/archive/2010/07/27/introducing-asp-net-mvc-3-preview-1.aspx

And… yup I said feedback to them. You can use ASP.NET MVC forum to post any feedback you have.

· ·

Theme Design by devolux.nh2.me

Disclaimer

All postings/content on this blog are provided "AS IS" with no warranties, and confer no rights. All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer or sponsors. The content on this site is licensed under a Creative Commons Attribution By license.
To top