Last 50 Comments

re: The broken Promise of the Mobile Web
Today @ 7:09am | by Harvey

Sounds like opportunity waiting to happen... take the smartphone desktop icon, why not link to a server that stores your profile and state in each of your web apps? It would add one step by popping up a menu of where you want to go today, not a big price to pay and perhaps there would be other advertising or subscription based benefits. And it would fit into the model you talked about where there might be a clearing house for web apps where user feedback would also be public.

re: The broken Promise of the Mobile Web
Tuesday @ 9:56am | by Steve

Umm, please tell us what you really think!

Yep, unfortunately too much of the conflict is involves App $tores and turf wars.

I like your point about Windows Phone -- what do that have to lose by tacking a new tack?

However, most non-developer types don't really think about native vs. hybrid vs. an icon pointing to a 'pure' website. Either the app exists in the app store for the platform they are running or it doesn't exist at all. Pinning URLs or getting shortcuts is too messy. So there would be some re-aligning of the consumer mindset required in addition to cleaning up the technology.

It is amazing, with all the resources of both people and money and corporate know-how, that some of these obstacles still exist.
re: The broken Promise of the Mobile Web
Monday @ 4:08pm | by Cory House

Superb post Rick. In a world of fast Javascript engines, rich client-side frameworks, and solid network coverage, the list of justifications for building native apps just keeps getting shorter. The technical challenges are minimal and once one platform dives in with rich support, others will likely feel obligated to follow.

This era reminds me a lot of the Flash craze of the late 90s. Once HTML and browsers grew up, Flash's various downsides started to outweigh its benefits. With ES6, and the evergreen browser movement spurring innovation, I see a bright future for mobile Web Apps.
re: The broken Promise of the Mobile Web
Monday @ 1:37pm | by James Monte

Excellent article Rick.. I agree with you on everything.. It's driven by money... For the phone vendors: Native App Store = money for phone vendor.. Web App = no money for phone vendor.. Until they can make money from Web Apps, they will be shooting themselves in the foot if they made it possible to build more robust apps with access to the phones functions...
re: The broken Promise of the Mobile Web
Monday @ 1:35pm | by Rick Strahl

@Al - that hits the nail on the head. We can build the necessary UI for building effective mobile applications, but we're stuck because of the lousy device integration.

It wouldn't be difficult for device platform vendors to make Web based applications first class citizens on mobile devices.

But not there yet unfortunately and it's going to be an uphill to overcome the status quo with this not benefiting the mobile platform vendors.

re: The broken Promise of the Mobile Web
Monday @ 12:03pm | by Al

Great article... It is a shame I can make a great web based mobile app that can do everything it would do if I had the resources to make it native, however so many people will not ever user it b/c it "isn't in the app store".
re: The broken Promise of the Mobile Web
Monday @ 10:08am | by Daniel

Good points, Rick- I also enjoyed your similar discussion on DNR. There is definitely room for improvement in the areas you suggest. I do think mobile web has "arrived" for a whole class of apps - namely enterprise line-of-business apps. In these forms-on-data type apps, you rarely need things like accelerometer or high-end graphics. Plus, you have a captive audience who can generally "deal" with the odd white screen or one-time install process if it means they can do their work from any device.

I've done several with offline and local storage, bootstrap and angularjs or knockout. I am left scratching my head as to why anybody would write an internal application using a native stack like Windows Forms, WPF, or native iOS/Android. I hadn't noticed the white screen issue until you mentioned it here, but none of my users have noticed either ;)

Public-facing apps- sure- discovery and installation are a pain, as are the nuances around advanced sensors, graphics, etc. And you want the UX to be spotless. In one sense, though, thats "just the web". Some desktop websites are hard to find and suck when you get there. Others are easy to find and work well. Frameworks like Bootstrap and Angular are doing a good job to push things forward, but it would help if device OS and browser manufacturers came together a bit more on this.
re: The broken Promise of the Mobile Web
Monday @ 9:10am | by Michael

I'm glad you are trying to push mobile web apps forward, but this all seems to be about money. This dream web app world of yours (which devs would love) seems like it would be a nightmare for the stores. What would prevent people from letting users buy access to their apps outside of a store, or buy some token they can use to active your app, when the app is no longer inside of an app store? I really hope we can one day have apps like you describe though.
re: West Wind WebSurge - an easy way to Load Test Web Applications
Saturday @ 8:39pm | by Bill Tresson

Great little tool. Easy, quick and gets the job done. I ran it on my current Web app and immediately discovered a couple of small performance problems that I was able to pinpoint and fix. Going to be running tests frequently on my sites under development to see issues as they crop up. Thanks for highlighting the need to check performance and creating a tool to make it so easy, Rick...
re: ASP.NET MVC Postbacks and HtmlHelper Controls ignoring Model Changes
August 15, 2014 @ 11:59am | by santosh

Damn, I'm from ASP.NET background slowly transitioning to MVC. I was really caught up with this anomaly(from the perspective of webform developer) until I landed your page. Thanks for this very useful information.
re: Tracing WCF Messages
August 15, 2014 @ 9:01am | by Manjit

Hi Rick, thanks for the article. Saved me incredible amount of time.
re: ASP.NET MVC Postbacks and HtmlHelper Controls ignoring Model Changes
August 14, 2014 @ 2:26pm | by Jason

The real problem for me is Presentation (or re-presentation) of the View. Say for example my user enters their name in the Name field, but decides to put 10 spaces first, or say 5 spaces before First Name and Last Name (assuming 1 field here). Then on validation error and re-presentation of the View, according to the way the Helpers work now, that user would see their name exactly as entered (spaces and all). While this is sure to be a rare instance, it's something I like to "clean-up" on re-presentation (I like that control. It also isn't breaking validation). The other concern is the clearing of a field on validation error, making the user re-enter that data.

This article also makes the argument for updating the View with necessarily corrected information.

I think Microsoft's implementation here should be made more flexible. Thanks Rick, I was struggling with this myself for the past few days. Hard to wrap your head around when coming from other languages such as Java or PHP.
re: Creating ASP.NET MVC Negotiated Content Results
August 14, 2014 @ 11:52am | by adam

Nice work!
Exactly what I needed to extend an existing mvc site to easily extend current controller actionresults to be called for json results.

I'm just looking to use existing ActionResults & Views without having to pass in the view name on each. For example I have a view called "Customers" and thus ideally just change.
public ActionResult Customers()
{
    return View(repo.GetCustomers());
}

To
public ActionResult Customers()
{
    return new NegotiatedResult(repo.GetCustomers());
}


Any advice on how to change the NegotiatedResult to retrieve the ViewName so I don't have to pass it in to each?
re: Caveats with the runAllManagedModulesForAllRequests in IIS 7/8
August 14, 2014 @ 6:11am | by William Gross

Thank you so much for this post, Rick! Your post in combination with http://blogs.msdn.com/b/tmarq/archive/2010/05/26/how-extensionless-urls-are-handled-by-asp-net-v4.aspx was the only documentation I could find on the *true* purpose of ExtensionlessUrlHandler, which is to force all extensionless requests to run in managed mode so that they have the opportunity to be routed by MVC or Web API.
re: AngularJs ng-cloak Problems on large Pages
August 13, 2014 @ 11:53pm | by thanhtruongngoc

hi,

It works well with style.

thanks,
re: IIS Default Documents vs. ASP.NET MVC Routes
August 13, 2014 @ 11:28am | by Chris

Thanks so much. Great article, great help, especially after 1.5 hour of looking through junk then finding your article of gold. Thanks! :)
re: Rendering ASP.NET MVC Views to String
August 11, 2014 @ 1:10pm | by Rich

Just what the doctor ordered! Thanks for sharing!
re: West Wind WebSurge - an easy way to Load Test Web Applications
August 09, 2014 @ 9:00am | by Rick Strahl

@Sabry - yes I played with jMeter and didn't like what I saw there. Yes it would work, but not as straightforward as I'd like it to be. BlazeMeter is a cloud based solution so that's what I needed to avoid and also not free for any sort of realistic load scenario.
re: West Wind WebSurge - an easy way to Load Test Web Applications
August 09, 2014 @ 7:12am | by Bruce

Rick, I was glad to heard you on .Net Rocks. WebSurge looks awesome! Looking forward to trying it out on our next project.
re: West Wind WebSurge - an easy way to Load Test Web Applications
August 08, 2014 @ 9:18am | by Sabry Guen

Hi,

Did you consider using JMeter or BlazeMeter before building your own?
Free and gets the job done :-)
re: Disable User Account Control On Windows 8
August 07, 2014 @ 11:27pm | by Jane

Hallo!
nice atricle. I just wondering if you do it the same way in windows 8 like it mentioned at this site.
http://www.excel-aid.com/sign-out-of-a-user-account-in-windows-8-how-and-why.html
re: ASP.NET MVC Postbacks and HtmlHelper Controls ignoring Model Changes
August 07, 2014 @ 6:42am | by Carlos Cysneiros

Life Saver! I spent an entire day...thinking I was crazy...whenever I updated a property in the model on a POST, the new value would not be editable (It would be okay for DisplayTextFor). Thank You
re: IntelliSense for Razor Hosting in non-Web Applications
August 06, 2014 @ 6:22pm | by Rick Strahl

@Iaacov - I think in order for that to work you need to add the LINQ namespace to the page or the web.config. In ASP.NET that happens automatically but not here. I'll add it as a default to the latest version of RazorHosting as it's .NET 4.0 - the old version started with .NET 2 and LINQ support wasn't guaranteed.
re: IntelliSense for Razor Hosting in non-Web Applications
August 06, 2014 @ 5:07pm | by Iaacov

I'm using the first approach (templates included in project) and IntelliSense works great, except for extension methods, e.g. Linq extensions.
Is there a solution?
re: A WebAPI Basic Authentication MessageHandler
August 06, 2014 @ 12:00am | by FH

Just stumpled upon these posts and - thumbs up.

Also took a look at the source and discovered your toolbox.

I grabbed a copy and will have a look at it later but the least I can do shout out loud:

THANKS! (caps intended)

Though through a lot of confusing a finally have made my way through ASP.NET Identity and I have my with it - but you can never get enough of good code samples to feed your codemonkey when he is grumbling over stubborn code.

Have a very good day.

By the way - forgive me - I recently found that http://jw.org can feed your minds hunger for answers to big questions of life.
re: West Wind WebSurge - an easy way to Load Test Web Applications
August 05, 2014 @ 8:51am | by Rick Strahl

@Jamie - Currently you can override Cookies and Authorization for every request. There's no query string or POST parsing at this point, but I could see adding that as an option to provide key value pairs for each that get added or replaced.

I also plan to add a plug-in interface so you can use code to look at every request as it goes into processing and then comes out on the other end so you can modify and capture the code.
re: A WebAPI Basic Authentication Authorization Filter
August 03, 2014 @ 11:51am | by EB

This is great, thanks! The only thing I did different is to implement the IAuthorizationFilter so that I didn't need the MyBasicAuthenticationFilter class. My actual authentication occurs in OnAuthorizeUser().

So, this:
public class BasicAuthenticationFilter : AuthorizationFilterAttribute, IAuthorizationFilter


Instead of:
public class BasicAuthenticationFilter : AuthorizationFilterAttribute


And my attribute looks like this:
[BasicAuthenticationFilter]
public IEnumerable<string> Get() { return new string[] { "value1", "value2" }; }


Thanks again for this post! Great stuff, exactly what I was looking for!!!
re: Using FiddlerCore to capture HTTP Requests with .NET
August 01, 2014 @ 6:18am | by Jamy Ryals

Beware, you need a lawyer to understand the license for FiddlerCore. I have no idea if I'm able to use it or not.
re: Basic Spatial Data with SQL Server and Entity Framework 5.0
August 01, 2014 @ 5:04am | by Martin

Thank you. One of the best articles i read in this year. Keep up the good work.
re: Article: A low-level look at the ASP.NET Architecture
July 31, 2014 @ 4:47pm | by Richard

An excellent article and still highly informative here and now in July 2014. Obviously some of the end bits have changed with new MVC Handlers etc but still I was able to follow along using referencesource.microsoft.com and much of the core methods still spot on which says something about the stability of the framework I guess.

I will be reading a couple of "top up" articles next on codeproject etc to bring into line with IIS 7.5 -8 but I'm still struggling to find articles of this quality and depth when it comes to how security and identity are handled/injected throughout the request pipeline.

Something similar to this article discussing security from http.sys all the way to NTFS and back would be ideal. Any thoughts?

Thanks again either way. I know these articles take quite a bit of time to mangle together.... specially so waay waay back in '05 I bet.
re: Accepting Raw Request Body Content with ASP.NET Web API
July 31, 2014 @ 1:06pm | by Isaac

Small adjustment to fix issues where the current thread values (Principal, etc.) are being lost before it gets to the controller.

Instead of:

return actionContext.Request.Content
                    .ReadAsStringAsync()
                    .ContinueWith((task) =>
                    {
                        var stringResult = task.Result;
                        SetValue(actionContext, stringResult);
                    });


Do this:

var rawData = actionContext.Request.Content.ReadAsStringAsync().Result;
SetValue(actionContext, rawData);
return EmptyTask.Start();

re: IIS Default Documents vs. ASP.NET MVC Routes
July 30, 2014 @ 10:20am | by Rick Strahl

@Karl - that's kind of an odd setup. But I think you can do that by creating a custom route or web.config RewriteUrl rule that reroutes any link to another. With configurations and .config transformations rewriteurls can be different on your dev setup and production.
re: IIS Default Documents vs. ASP.NET MVC Routes
July 30, 2014 @ 10:00am | by Karl

That is great!

I like to drop a default.aspx during development, or downtime and then just remove it and it would find the /index.aspx page which would be the normal run-time home page.

So now I can drop the default.aspx in my MVC site and it will show a "under dev" logo or whatever.

The only problem is since there is no index.aspx file on MVC sites I can't navigate to mydomain/index.aspx and see the content that would be displayed e.g. for client previews etc.

Any idea?
re: Using FiddlerCore to capture HTTP Requests with .NET
July 29, 2014 @ 10:20am | by Rick Strahl

@Eric - Thanks. I've updated the post with GetRequestBodyAsString() - also my code :-). I also added a blurp about licensing.
re: West Wind WebSurge - an easy way to Load Test Web Applications
July 29, 2014 @ 7:50am | by Jamie

I've been playing around with this a bit. Love the simplicity. I'm curious if you plan to provide a way to parameterize certain values in the request URL and body? I have a correlation id (Guid) that needs to be sent with a group of requests. It should be unique to each thread and to each group of requests (e.g. four) within a thread. I can make it unique within a thread by generating a session file with unique values. That's tedious, but doable. I don't see a way to make it unique across threads.

Granted, adding in parameterization might remove some of the simplicity you are trying to achieve.
re: Using FiddlerCore to capture HTTP Requests with .NET
July 29, 2014 @ 7:00am | by Eric Lawrence

Hey, Rick-- Thanks for an awesome post!

If you're trying to get the request or response body as a string, you should use the oSession.GetRequestBodyAsString() and oSession.GetResponseBodyAsString() methods respectively. It's not safe to assume that all textual bodies are UTF-8 encoded; these methods will examine the charset declaration in the headers and/or the body when decoding the bytes to a string.

You can get the Fiddler book as a PDF; see http://fiddlerbook.com

One final caveat: While Fiddler is free for all and Telerik has committed to it remaining so indefinitely, FiddlerCore is provided under a different license with open source and commercial terms. FiddlerCore's license can be found in the installation package.

Thanks again!
re: jQuery Form Serialization without ASP.NET ViewState
July 27, 2014 @ 12:56am | by Mike Gledhill

Wow.
Excellent tip, great time saver.

Donation sent. Go and have a beer !
re: WebAPI: Getting Headers, QueryString and Cookie Values
July 25, 2014 @ 12:34pm | by me

Thanks for posting this! It is definitely a time-saver and I agree, the API syntax is much more annoying than it used to be for these common requests.
re: ASP.NET Frameworks and Raw Throughput Performance
July 24, 2014 @ 1:22am | by Nikolai

Thanks for doing this bechmark and amazing results and summary. It was really good to see that ASPX doesn't perform much worse than ASHX.

There's a chance that performance drop over time may be attributed to turbo-boost which is on your 2720QM CPU unless you disable it in BIOS.

The way it works is, once CPU is loaded, it will speed up to 3.3GHz instead of 2.2GHz. However as the CPU potentially gets hotter during the test, there's a chance that it starts to automatically clock down to produce less heat.

Quad-core mobile CPUs are the worst in that aspect as they are in a bucket of design power 45W as opposed to 35W for dual-cores.

What you can do is install a free utility CPUz that will show you CPU speed while you run bechmarks. Or, considering it is Dell, you can actually disable turbo-boost in BIOS just as it seems you already disable Hyper-Threading (which is good to do for consistency of your test). There's also another free tool SpeedFan that can show you core temperatures while you run the test. What you may notice is that just few seconds after you stop the test to IISRESET, core temperatures may drop from ~ 70-80 degrees to ~ 50-60 degrees, thus bumping turbo boost back to max.
re: Nuget Dependencies and latest Versions
July 23, 2014 @ 1:13am | by Pete

Currently experiencing pain because the SignalR package and it's dependencies (specifically OWIN) don't seem to be setup correctly (we had a similar problem a while ago with ODATA). Very very annoying!
re: Allowing Access to HttpContext in WCF REST Services
July 21, 2014 @ 4:30am | by James

What would be nice is a way to access the query string dictionary in the same way you use the params keyword.

However, I guess that then doesn't map well to SOAP?
Does SOAP not have a concept of optional parameters?
re: Hosting SignalR under SSL/https
July 17, 2014 @ 10:39am | by lrpham

Hi Rick, I've been running this HTTPS configuration for a few months without issues but now, messages sent to any specific client does not reach the client. I'm using hubs and is using this method to send the message:

Clients.client(connectionID).publishMessage()

However, when sending a message back to a client caller it works fine using this method:

Clients.Caller.publishMessage()

The only thing that changed recently was the connection string to the database server.
Have you run into this problem with HTTPS ? Thanks.
re: Web Browser Control – Specifying the IE Version
July 15, 2014 @ 2:34am | by Marc

Two of the values for IE10 and IE11 are incorrect in your table (you had 11999, 11000, 10999 and 10000). According to the MS documentation you link to:

11001 (0x2AF9) Internet Explorer 11. Webpages are displayed in IE11 edge mode, regardless of the !DOCTYPE directive.

11000 (0x2AF8) IE11. Webpages containing standards-based !DOCTYPE directives are displayed in IE11 edge mode. Default value for IE11.

10001 (0x2711) Internet Explorer 10. Webpages are displayed in IE10 Standards mode, regardless of the !DOCTYPE directive.

10000 (0x02710) Internet Explorer 10. Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode. Default value for Internet Explorer 10.

Furthermore, you can do this at runtime by writing to HKCU\Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION, so long as you write your executable name in before instantiating any web browser controls. When writing to HKCU, you (a) don't need elevated privileges, and (b) don't have to worry about 32 vs 64 bit -- the wow6432node key is not used in HKCU.
re: ASP.NET MVC Postbacks and HtmlHelper Controls ignoring Model Changes
July 12, 2014 @ 11:54pm | by om

very nicely explained and helped me figure out actual problem.
Thanks
re: ASP.NET Routing not working on IIS 7.0
July 09, 2014 @ 12:18pm | by Todd

This is a great thread going!

@txcraig and others let us to a working solution.

Adding the specific module needed worked for us. We had the "evil" runAllManagedModulesForAllRequests="true" attribute, but didn't want to use it because of the performance concerns (and should you just run all really?). Simply adding the correct module, and removing that evil attribute solved the problem.

We didn't install the patch for Windows 2008 SP2, IIS 7.0 we wanted to try to work around that.

<modules>
<remove name="BundleModule" />
<add name="BundleModule" type="System.Web.Optimization.BundleModule" />
</modules>
re: Project Navigation and File Nesting in ASP.NET MVC Projects
July 08, 2014 @ 7:33pm | by Adrian

Good stuff Rick. Especially like the nesting. Jimmy Bogard and his buddy Tim Thomas have written about the same issue and come up with the concept of 'feature folders':

http://timgthomas.com/2013/10/feature-folders-in-asp-net-mvc/
re: Expanding Urls with RegEx in .NET
July 08, 2014 @ 1:10pm | by Josh

In order for the options to work, the last line of the ExpandURLS function would need to be modified as following:

    Public Function ExpandUrls(Text As String) As String
 
        Dim pattern As String = "([""'=])?(http://|ftp://|https://|www\.|ftp\.[\w]+)([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])"
 
        ' *** Expand embedded hyperlinks
        Dim options As System.Text.RegularExpressions.RegexOptions = RegexOptions.IgnorePatternWhitespace Or RegexOptions.Multiline Or RegexOptions.IgnoreCase
 
        Dim reg As New System.Text.RegularExpressions.Regex(pattern, options)
 
        Dim MatchEval As New MatchEvaluator(AddressOf Me.ExpandUrlsRegExEvaluator)
        Return Regex.Replace(Text, pattern, MatchEval, options)
    End Function

re: Dynamic Types and DynamicObject References in C#
July 07, 2014 @ 9:03am | by Joy

Good stuff, just what I was looking for :D
Thanks!
re: Dell XPS 15 review
July 07, 2014 @ 1:25am | by krystan honour

I saw this review and it cermented my decision to buy. I echo your sentiments about keyboard and after I'd read the reviews about the Lenovo X1 2nd gen I couldn't in all conscience buy the lenovo purely because of the keyboard.

however the xps15 looked like a great bit of kit and its being delivered tomorrow. Thanks for the great review and the driver pages.
re: WCF WS-Security and WSE Nonce Authentication
July 06, 2014 @ 11:22am | by John Herron

Hi Rick - I'm getting an h:Security section before the o:Security section. The web service I'm calling fails because of this with a "user could not be authenticated" error. If I capture the message with fiddler then remove the section or change the h:Security spelling it works. Did you remove the section from your post or does it include it? I need a way to remove the h:Security section.

Thanks
John


West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2014