Last 24 Comments

re: Problems with opening CHM Help files from Network or Internet
Today @ 1:32 pm | by Rick Strahl

@Ulf - yes it's been reposted and updated with current screen shots and a few extra notes - yesterday actually. Moved the date up to make it visible in the feed for a bit but not at current date.
re: Creating a dynamic, extensible C# Expando Object
Today @ 1:03 pm | by Rick Strahl

@Mark - I don't agree that dynamics are more than a niche. I think with a static language you tend to make yourself think about problems in a rigid non-changing fashion with things like ORMs and other auto-mapping tools. While it's possible to extend these (with dictionaries for example), the syntax is often undesirable and requires special code to manage the extra data. Dynamics can make that code more natural and take away some of the tedium like type casting that you otherwise have to do. The downside is that dynamic data has a bit of overhead although for things like dictionaries it's not too bad.
re: Creating a dynamic, extensible C# Expando Object
Today @ 12:56 pm | by Rick Strahl

@Bertrand - I started to but didn't get around to playing with it yet - this post was already written up :-). Did see your post on it though and will definitely take a closer look when I get a chance.
re: Creating a dynamic, extensible C# Expando Object
Today @ 11:20 am | by Bertrand Le Roy

Rick, did you check out Clay? http://clay.codeplex.com/ That's what we use in Orchard for all our dynamic object needs (and we have a lot). It's very extensible and has fantastic object initialization syntax.
re: Creating a dynamic, extensible C# Expando Object
Today @ 7:30 am | by Mark

Great article Rick, IMHO dynamics are convenient, but not much more than that. I sometimes dynamically add when using Javascript, but I don't see the trade off of the convenience versus power (losing LINQ like stuff).

A similar case can be made for the recent trend of NoSQL, yes it has it's place, but I believe it is more niche cases when considering the need "dynamically" add properties on certain objects. A good model done from the get-go is a better approach.

Convenient - yes, practical - no. I'd be interested to hear other use-cases, maybe I'm missing some good functionality that can be done with dynamics.
re: Application that won’t Pin to Taskbar in Windows 7
Today @ 5:30 am | by Michael Wallace

Thank you very much! I was spinning my wheels trying to figure out why I couldn't get two shortcuts to pin. They have "help" in the name Stupid Windows!
re: Creating a dynamic, extensible C# Expando Object
Today @ 4:48 am | by John Atten

Fantastic post! Thanks.

I am having to learn all this on my own, and this is exactly the kin thing I find most helpful. Helps me understand what happens "inside the black box" so to speak.

What would I use this for? I'll get back to you after I have mastered it a little.

#Subscribed. :-)
re: Animated GIF images in hidden page elements
Today @ 3:18 am | by Pedrobotella

Hello! I've read all of the solutions posted by now, and the only one I got to work was the one posted by Richard Marr on April 04, 2005

Just added his code after setting the visibility of the element to true.

showWaitPage =function
{
blehbleh your code
bone.elem.style.visibility = "visible";//the function ended here
document.getElementById("YourElement").innerHTML = "<img src='yourGif.gif'>";


Thanks all and hope this works for most people!
re: Problems with opening CHM Help files from Network or Internet
Today @ 1:22 am | by Ulf Elfving

Hi!
This tip really helped out.

I also think that you have to save your chm file to a local storage (C:)

I didn't seem to get this working when I saved the chm file to a network share.

PS
Is this a repost since it popped up in my Google Reader today?
DS
re: DataGrid Paging Events not firing
Monday @ 11:21 pm | by Dee

Thanks to Rick's blog (hats off) and everyone here who posted their solutions as well (tried but still didnt work), along with a few more hrs of googling I was able to locate and experiment with the info found in this article: http://msdn.microsoft.com/en-us/library/ms972814.aspx

My issue was both events (row selection and the page selection) were working its just that any selected row from any page would also show as selected throughout any subsequent pages until another row was selected and the same would repeat. Therefore, it would appear that the user had already selected the row on the new page. I hope I made some sort of sense and that the following sequence of steps will also be your resolve.

Step 1:
Sub GridView1_PageIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
GridView1.SelectedIndex = -1
End Sub

Step 2:
In the HTML code make sure you add: OnPageIndexChanged="GridView1_PageIndexChanged" else I can guarantee it will not work. Note: you may or may not need to EnableViewState="true" mine worked with as well as without it.

<form id="form1" runat="server">
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" CellPadding="4"
DataSourceID="drinks" ForeColor="#333333"
GridLines="None" PageSize="5"
OnPageIndexChanged="GridView1_PageIndexChanged"
onselectedindexchanged="GridView1_SelectedIndexChanged">
<PagerSettings PageButtonCount="5" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<Columns>
re: Capturing Output from ASP.Net Pages
Monday @ 8:38 am | by Jon

I just wanted to say thanks Rick. There have been a number of times that I've been trying to do this or that (usually obscure) and did a web search and came across one of your posts that have been very helpful. It's uncanny your posts always come up.
re: Rendering individual controls for AJAX Callbacks
Monday @ 8:37 am | by DaniB

The postback works alright but is there any way to wire up a button click in the code behind of the control? Those event handler are no longer getting fired after injecting a control with this method. Does anyone know a workaround for this?
re: JavaScript window.SetTimeout to a JavaScript Class method or function with parameters?
Monday @ 3:25 am | by js

Finally got it ;)
Took some time to understand Jos Vissers comment, but finally, it's as easy as
    var ref = this;
    setInterval(function(){
            ref.loop();
        }, 200);

Thank you all!
re: Creating a Dynamic DataRow for easier DataRow Syntax
Sunday @ 9:31 pm | by Rick Strahl

@Dennis, I don't agree. Here are what I think are the main benefits:

* Cleaner, more natural looking code and quicker typing
* Automatic type casting - no need to cast in most cases
* Automatic support for null conversion

The latter is actually quite a pain if you're dealing with nullable types because you have to explicitly convert.
re: Chaining the C# ?? Operator
Sunday @ 10:25 am | by Darren.R

Alternative

s + "" != ""

nice way to do it.
re: Dynamic Types and DynamicObject References in C#
Friday @ 8:48 pm | by Rick Strahl

@Duncan - Performance is decent but still significantly slower than direct access. When I wrote up the DynamicDataReader post a while back I did a bunch of performance testing comparing direct data access using the Reader and the dynamic reader instance and even with warm up (initialization) removed from the call the performance difference was nearly than 2:1. There's definitely a tradeoff for using dynamic even if it does provide some really nice functionality and cleaner code.
re: jQuery CSS Property Monitoring Plug-in updated
Friday @ 7:22 am | by kadın

Maaaan. You repeatedly keep coming up with cool shit! Keep it up!..
re: Dynamic Types and DynamicObject References in C#
Friday @ 6:10 am | by Duncan Smart

> dynamic object access has quite a bit of overhead and is definitely slower

Only the first time you hit a dynamic member, at this point it compiles the call site so that subsequent accesses should be very fast. Hence Rob Conery's dynamic-based Massive "ORM" performs very well compared to Dapper, etc.
re: Making Sense of ASP.NET Paths
Friday @ 5:26 am | by Serguei

When I use synonyms for may base domain - how can I get correct URL?

For example...

base domain: site.de
synonym: site.com

I open "site.com" and I see in my browser "site.com".

But!

AbsolutePath @(HttpContext.Current.Request.Url.AbsolutePath)<br />
Authority @(HttpContext.Current.Request.Url.Authority)<br />
DnsSafeHost @(HttpContext.Current.Request.Url.DnsSafeHost)<br />
Host @(HttpContext.Current.Request.Url.Host)<br />
OriginalString @(HttpContext.Current.Request.Url.OriginalString)<br />

All are "site.de"
re: Dynamic Types and DynamicObject References in C#
February 02, 2012 @ 8:17 pm | by Rick Strahl

@Steven - Clay looks interesting. I have to investigate a little further. Not sure how useful it is to cast dynamic to an interface. That still means that you have to know up front what you're working with - if you know then you might as well be using a static type, no? I can't think of a use case where that would matter (unless you can also construct the interface on the fly).
re: Web Browser Control – Specifying the IE Version
February 02, 2012 @ 8:03 am | by Phillip

I found this:
<h1>Opt-In to High DPI Behavior for Web Browser Controls (WebOCs)</h1>
<span>In order to preserve compatibility with previously developed WebOCs, by default Internet Explorer 8 does not render the web content of WebOCs using the Internet Explorer 8 High DPI behavior, but rather uses the Internet Explorer 7 behavior, which scales up fonts specified in absolute values, such as points. To take advantage of the Internet Explorer 8 High DPI behavior in your programs, you need to use a DOCHOSTUIFLAG called DOCHOSTUIFLAG_DPI_AWARE. You use this flag by using the method GetHostInfo, which has a DOCHOSTUIINFO structure as one of its parameters. In turn, DOCHOSTUIINFO has a operator DWORD called dwFlags as one of its members, that can consist of one or more DOCHOSTUIFLAG values. You must include DOCHOSTUIFLAG_DPI_AWARE in dwFlags in order to take advantage of the Internet Explorer 8 High DPI behavior in your WebOC.</span><br /><br />
 
<span>The quick and easy way to simulate how the HTML content of your WebOCs will appear once opted -in to the High -DPI behavior is to open the equivalent HTML content (composed in an HTML file) in Internet Explorer 8, and simply check out the rendering at the equivalent zoom settings (120 DPI to 125% zoom, 144 DPI to 150% zoom). We do recommend that you test out the WebOC in actual High DPI scenarios to be completely sure the HTML content renders as you hoped.</span><br /><br />


here: http://msdn.microsoft.com/en-us/library/ie/cc849094(v=vs.85).aspx
Is there one of those flags to switch co IE8 as well?
re: Dynamic Types and DynamicObject References in C#
February 01, 2012 @ 1:23 pm | by Rick Strahl

@Nadav, thanks for the feedback. I was thinking about that last night and ended up not changing it at the last minute. Went through this morning and replaced most of the static references with strongly typed.

@John, you're totally right that shouldn't compile - my fat fingers. It was supposed to be the strongly typed foo.Bar property instead foo.Name. Fixed in the article.

I really should abstain from posting really late at night :-)
re: Dynamic Types and DynamicObject References in C#
February 01, 2012 @ 6:30 am | by Steven Berkovitz

Have you had a chance to check out Clay (http://clay.codeplex.com/)? It has some neat features like being able to cast any dynamic object to an interface and then access properties with type-checking, etc.


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