Tales from the Evil Empire

Bertrand Le Roy's blog

News


Bertrand Le Roy


Add to Technorati Favorites Tales from the Evil Empire - Blogged

Blogs I read

My other stuff

Posted: by

Comments

Tom said:

Thanks Alister and Betrand for this nice thread :).

Well lets me give you my point on this.

I think that most of the arguments presented here are a bit "off road", if I take the SQLDatasource comment, yes its bad to use sql statements inside a page but how many ASP.NET 1.0 books today are already presenting their samples with this bad technic ? ... Let's face the truth ... How many hobbysts or even developpers know or care about ntier, MVC etc ... architectures anyway ...

The real problem does not lies in the tools but how people use them ... I agree .... There is a lot new stuff in Whidbey some on which I am also very sceptical about like the code beside model for example or mixing again code & design on the same page even if its hidden by the IDE ... But still these are just new tools to add to your bag during your development road and you must only choose the right one at the right time.

One of the hardest part now is the richness of the framework which is getting so big that its becoming diffcult to have a big picture or to choose the right tools at the right time until you've gone through almost everything, which (can) takes some (lot) time. But I doubt that it was an easy path when you learned ASP.NET 1.0 for the first time also. New features / products take always some time to get through before you see and get all the benefits, but it seems to take more and more time for each release.

People, in particulary hobbyst, have a strange image of computing. The image of being an easy path that do not require any effort to do something and that everything will come together like magic. It's not and very far from being the case. Do I sit down in a car and drive down the highway without having my driving licence first ? Not until we invented a fully automated car that drive me where I want to go ... Everything needs time to learn ... Yes some things can be easier to learn than others but cluttering down features wont help, lets take a simple example there are tons of vb programmers who struggle learning the object model of .net. Should we go back to quick & dirty model of vb instead ? I don't think so ... So what's the solution ?

Microsoft is trying to address the needs of two kind of totally different people working on totally different projects with totally different technical backgrounds ... The hobbyst and the enterprise developpers ...

Two kind of people for one framework, that must be a big headache for them ... The only "exit" I see could come from two totally different IDE's. Visual Studio has become a great IDE, but it's just too much and too expensive for any hobbyst who wants to use it. So the weak point here is clearly webmatrix, don't get me wrong ... Its nice, its free but I believe it's not matching what hobbyst are waiting for, an easy , cheap and very visual tool with a low learning curve, with many default and easy to modify templates / tools and no code at all. Whidbey has all the inner working to do such a tool .. So where is it ?

Communication is also a huge problem, there are so many different features in products today targeting so many different people that it's almost impossible to communicate correctly. For whidbey in a sense there is too much communication about a product that won't ship till next year. For people who are interested like me in what's comming next its great to see where it goes but that might too much for others ... As a developper I percieve the whidey communication as if MS is already, in a way, cluttering down .net to attract hobbyst and promotes bad design which is exactly the opposite feeling of Alister's one ... Its not my opinion but its just how I perceive the MS communcation at first without hands on the product ...

About PHP ... Is it really because it's so easy to use and to understand that most people use it ? Probably there is some "marketing" truth about this statement but let's look closer, Apache has almost 70% of the hosting market ... That might be another good reason why it's so "popular" ... MS needs to work on an "hobbyst" targeted IDE but if they really want to hit their hobbyst target they will need to increase their web market shares among hosters ... If IIS had 70% of the market share I am quite sure that this, great btw, thread would never have existed.

Anyway many thanks to Alister for startic this interesting topic ...
# June 16, 2004 7:13 PM

Bertrand Le Roy said:

Thanks for the comments, Tom. Right to the point, as always.
Your points on a hobbyist IDE are well taken... You're absolutely right. WebMatrix was a good start, and we must not stop there. Especially with Eclipse on the "other side".
About PHP, you're absolutely right too, and to make ASP.NET as popular in the hobbyist market, we have to increase the number of cheap to free hosters. We also have to make it easy to host from home. We're working on that too.
# June 16, 2004 7:13 PM

Jeff said:

So where is it?
# June 17, 2004 12:21 AM

Bertrand Le Roy said:

Click on the title...
# June 17, 2004 1:10 PM

SomeNewKid said:

This thread has been reproduced in its entirety on Paschal's weblog:
http://weblogs.asp.net/pleloup/articles/155954.aspx

I wasn't too keen on the word "debate" but, other than that, the reproduction was introduced with a complimentary preface.

Thanks again, Bertrand, for the time you invested in answering the concerns I raised.
# June 18, 2004 12:13 AM

TrackBack said:

TheServerSide.NET
# June 18, 2004 7:33 PM

TrackBack said:

# June 23, 2004 3:56 AM

Erebuss said:

C'est pas drole si les VBistes ont notre using maintenant aussi ;)
Bon, bonne nouvelle, je connais un nouveau mot clé de Vb.net 2005 alors :D

/GP
# July 6, 2004 2:23 PM

Jerry Pisk said:

No it doesn't. The rule is "no business logic belongs to the view (an ASPX page in ASP.NET)", not "no code belongs to the view". There can be code in the view, but not business logic code (or anything else business logic). Database connections are business logic, not views, and as such they do not belong to the view, even if you wrap them so you don't actually have to put any code there.

But you're right in one point - ASP.NET is not layered. An ASPX page is all three layers in one, it's the controller, the business logic and the view. No separation there at all, no matter how much you and Microsoft keep repeating that there is.
# July 12, 2004 4:23 PM

masqued vengor said:

Hey Bertrand, move on blogs.dng ;-)
# July 12, 2004 5:40 PM

Bertrand Le Roy said:

Jerry, you just don't get it.
Data sources are NOT business logic.
No matter how you write your applications, your presentation layer will always have to communicate with the other layers. Data sources are just a declarative way of communicating with other layers.
Yes, there can be code in the view, but there should not be code in a declarative surface such as the CodeFront. But you're right in pointing out that it's not a matter of code or no code.
Data sources are NOT database connections, they are a way for the presentation layer to communicate with other layers.
The Page Controller is not business logic either. The only code you should have in there is the code that orchestrates the UI elements and the code that establishes the communication with the other layers.
My whole point is the the communication code has always been in the page (it has to be, there has to be a way for the data to get into the Template View), it just moved from procedural to declarative.

ASP.NET does NOT contain the business layer unless you want it to be there, and we all know this is not good architecture.
But many many people are doing multilayered architecture with ASP.NET and your statement is just a troll.
As many people, you're thinking in J2EE terms. It is not because ASP.NET adopts a different angle that it's wrong. And surprise, JSF adopts almost the same architecture. Why would that be??
# July 12, 2004 5:55 PM

TrackBack said:

# July 12, 2004 6:01 PM

SomeNewKid said:

From my extended mail conversation with you, Bertrand, I took away two concepts that I feel underscore ASP.NET's strength and beauty.

The first is the concept of the Page as an application surface, not a UI surface. It is a powerful concept, and I had already added it as an epilogue to Paschal's archive of our conversation:
http://weblogs.asp.net/pleloup/archive/2004/06/18/159085.aspx

The second is the concept of CodeFront and CodeBehind representing two sides of the same coin ... declarative and procedural programming respectively. The more logic we can represent declaratively, the more powerful and graceful ASP.NET becomes.

Now to see the Page as an application surface, one that does not invalidate n-tier development, requires that developers view their app from a different perspective.

Current literature always shows an application from a "side on" view. Here, we see a data store at the bottom, above that a data layer, above that a business layer, and above that the UI layer. Business and UI processes may represent additional layers.

To best understand the ASP.NET Page, we must swing our view from "side on" to "above". Having done so, we can understand the Page as a topographic map of the entire application. That "pool" of data on our map may be a shallow pool (perhaps drawing directly from an XML file), or it may be a deep pool (with data having risen from a different physical tier, through a data layer and business layer). This analogy illustrates the power of the SqlDataSource and ObjectDataSource respectively. Looking from "above" the application, they may look similar, but their depth is completely different.

Before I took this new "from above" perspective, I found Whidbey troubling. Now, having taken this new perspective, I find Whidbey beautiful. It may be a strange superlative to apply to a development environment, but I truly find ASP.NET's declarative model to be a thing of beauty. Powerful, graceful, beautiful.
# July 12, 2004 6:46 PM

Bertrand Le Roy said:

Thank you so much for this comment, Alister, I really appreciate. So, when are you getting a blog?
# July 12, 2004 6:50 PM

Kevin Dente said:

The data source stuff is very cool, and I'm looking forward to being able to take advantage of it. But why do data source controls appear on the visual portion of the page when they don't generate any visual representation? It sems like the component tray was originally intended to hold non-visual design elements, but ASP.NET never really took advantage of it the way WinForms did.
# July 12, 2004 11:30 PM

Bertrand Le Roy said:

Kevin: I personally am uneasy with the way non-visual elements like DataAdapters used to appear in this component tray whereas it's not part of the markup (ie, the declarative part of the page). Why DataAdapters and not any public property of the page, then? Of course, the answer is that only Components appear there, but for most users, it is not clear what a Component is, so it seems quite arbitrary.
Now, data source controls are part of the markup, so they appear on the design surface like any other control. If you see the design surface as the visual representation of the markup, there is no reason why it should behave any differently than other controls.
Another reason is that it is perfectly possible for example to put a data source control in a DataList template to do hierarchical binding. Of course, doing that with a SqlDataSource would most of the time give catastrophic performance, but doing it with an object data source could make perfect sense. Don't get me wrong, there are better ways to do that, but it is still a reasonable scenario and one that we're allowing. Well, in this case, the data source couldn't be in the component tray because its data container is important in this context, it's not directly under Page, and it is repeated.
ASP.NET is closer in its spirit to Avalon than to Windows Forms anyway (which is not a surprise when you know the people behind Avalon...)
# July 13, 2004 2:45 AM

TrackBack said:

See also http://techno-weenie.net/blog/code/95/net-20-datasource-controls
# July 13, 2004 1:53 PM

Kevin Dente said:

Bertrand: The way I see it, there's actually two separate issues here: 1) does the control persist as markup on the page, and 2) is the control displayed on the visual design surface, along with "visual" controls.

Personally, I think that the notion of a separate area where non-visual elements are displayed (even if they actually "live" as markup on the page) is a useful one. Putting them on the visual design surface strikes me as potentially confusing. Where should they go? Does it matter where they live on a page? Where do you shove them so they don't interfere with your visual layout (especially in a flow layout, where they occupy space in the flow and change the layout of the page)? Fortunately, I see that Whidbey has an option to hide non-Visual controls - but of course then it's not obvious that they exist at all, and if you unhide them, it reflows your page.

I do see your point about the data-source-in-a-template case, although it seems like there could be another solution. I'll have to think about that one... ;)

Side question - how does one flag a control as non-visual in Whidbey?

# July 13, 2004 4:27 PM

Bertrand Le Roy said:

Kevin: It doesn't matter where you put a data source on a page as long as you don't need it inside some container, so I'd put them at the end of the page so that they don't disturb the rest of the visual layout.
To make a control non-visual, just mark it with the [NonVisualControl] attribute...
# July 13, 2004 5:55 PM

Kevin Dente said:

Bertrand: Yes, I realize that. My point was that rendering the non-visual controls inline in the page forces the page designer to be aware of and accomodate those issues. Personally, I would rather just see the non-visual controls down in the tray. But that's just my opinion.

Thanks for the NonVisualControl pointer.
# July 13, 2004 6:30 PM

Laurent Kempé said:

I have to say that I second Kevin. Having the non visual controls in the flow is really annoying.
# July 22, 2004 6:40 PM

Bertrand Le Roy said:

This kind of choice is not made whimsically. It relies on usability studies, which means that while some may find it annoying, most people like it better this way.
As you have an easily discoverable designer option to make non-visual controls appear and disappear at will, I don't think there's much more we can do...
# July 22, 2004 6:44 PM

TrackBack said:

Sami Jaber's contribution to the dabate (french)
# July 23, 2004 9:34 PM

Mike Kozlowski said:

That Oracle article was one of the lamest, most preposterous pieces of cheerleading I've seen since Dave Massy said that he was afraid to use non-IE browsers for security reasons.

I mean, c'mon, PHP? Back in 1996, when I was writing CGI apps in Perl, I would've turned up my nose at PHP. It's a horrid little hack of a platform that nobody in their right mind would ever want to use -- it's as if somebody saw ASP (a horrid little hack in its own right) and made a cheap rip-off without even bothering to develop a proper language in which to embed their page-template stuff. At least when Sun ripped off ASP with the original JSP spec, they had the decency to graft it on top of fundamentally sound technologies.

But not only is PHP bad in comparison to other antiquated techniques, it doesn't even bear comparison with modern development methods. JSP 2.0 with JSTL (and possibly JSF, which I haven't had a chance to really try) is amazingly better than old, hackish JSP. ASP.NET is incredibly advanced over old, hackish ASP. PHP 5 is... a slightly better lousy hack than it used to be. Um, yay.

# July 23, 2004 9:42 PM

Andrew Storrs said:

I know many former PHP programmers (myself included)...

"former"... Nuff said. :)
# July 24, 2004 2:27 AM

Muntedhar "Pzycoman" Alhakim said:

That article is just plain silly.

It lists ASP.NET as Slow, as opposed to PHP which is fast.

I did this tests a long time ago (about a year, maybe more) - http://www.pzycoman.myby.co.uk/lspeed.html

Even with a precompiling doohicky (Zend Accelerator) (Which kind of makes the tests unfair, as there arnt many ASP.NET accelerators), its still as slow as a 3 legged rocking horse.

In the same time (roughly) it took PHP to do 8 million calculations, ASP.NET did 1.6 Billion.

Enough said :)
# July 24, 2004 2:47 AM

Matt said:

That's a very basic test, and I hope the results aren't due to compiler optimisations. The compiler should be able to get rid of the comparison entirely!
I prefer ASP.NET myself, but that test is as bad as Oracle's info.
# July 24, 2004 3:39 AM

Jouni Heikniemi said:

Bleroy: Many good comments, too bad some of them got a bit too biased and personal - they're just eating the credibility of your writings.

There's one point I'd like to comment on: "Open-source opportunity. Sure, if that's important to you. If accountability is more important, then I guess that's a different story." I don't think there's much Microsoft can defend itself with against that claim. For most products, I can't really say MS has been very responsible and accountable. The lack on open information flow and the relatively slow speed of fixing bugs and providing patches is certainly a factor when considering whose products to deploy.

Many open source groups manage to provide much more reliable and useful customer support than Microsoft has traditionally been able to offer. This especially has been true for many of the Internet applications. Add in the possibility to do (no matter how unsupported) custom hacks, and there certainly has been an air of flexibility around LAMP platforms when compared to the stagnation of ASP.

That said, Microsoft has taken significant leaps with ASP.NET, the new developer community (not to ignore this blogging business) and now with Whidbey's relatively open bug tracking. Even though the direction is right, you'll need years more to convince people to trust on Microsoft's accountability. One of the greater things working for you is the developer community that now has sufficient role and publicity to actually make things work. Some people will be very dubious, but time is a good healer.
# July 24, 2004 4:19 AM

TrackBack said:

# July 24, 2004 4:28 AM

Bysza said:

Oracle article sucks...

Since I can't say more than all my predecessors already said, I may pinpoint this: section "Database Coding Examples", "ASP.NET Connecting to Oracle" is... wrong.
It's not ASP.NET connecting to Oracle, but a *console application* connecting to oracle and printing two column contents to the console... :D
# July 24, 2004 8:55 AM

TrackBack said:

ASP.NET vs PHP - Counterclaim to Oracle's FUD
# July 24, 2004 8:58 AM

Bertrand Le Roy said:

Jouni: I won't pretend I'm not biased. I work for Microsoft. I just hope that I'm less biased than the Oracle article author.
But what I mean by accountability (at least for ASP.NET as that's my team) is that if you have any trouble with our software, you know exactly who to turn to, and you can be sure that support or direct contact with one of us through mail, newsgroups or the ASP.NET forums will very quickly find a solution.
I know that when I was a Microsoft customer, every time I had to use the support, I got commitment and I got a solution.
I also know that the last time there was a widespread virus/worm for Windows, there was a company-wide effort from many non-support employees to provide free support to the general public to help get rid of the vermin.
We still have some progress to make, in particular for community support, but I think we're getting there fast, as you seem to have noticed.
# July 24, 2004 10:04 AM

Larry Osterman said:

It's off topic, but, I've got to ask: Bertrand, how did you get real links to show up in your comments section? Every time I've tried to do that, the HTML gets quoted...
# July 24, 2004 12:18 PM

TrackBack said:

Well, I don't agree that PHP is any simpler for beginners, especially with Whidbey. Our usability studies show quite a different situation. It certainly looks more familiar to people who have done some classic ASP or JSP development, but a complete beginner will start faster with VS.NET + ASP.NET than with PHP...
# July 24, 2004 2:36 PM

Jouni Heikniemi said:

All right Bertrand,

Since you almost asked for it ;-), I'll use this opportunity to ask you for an answer to one of my news group postings quite some time ago. Any chance you could tell me what's going on in the following:

http://groups.google.fi/groups?selm=Xns949197CADD5E4jouninews2heikniemin%40194.100.2.89

Unanswered mysteries are the things that make me yearn for a totally open bug reporting system. Let's see if this one actually becomes a non-mystery :-)
# July 25, 2004 1:11 AM

Bertrand Le Roy said:

Jouni: First check this: http://support.microsoft.com/default.aspx?scid=kb;en-us;833268. I don't think this is your problem, though, but it's worth checking.
Your problem is probably a conflict that happens when you hit the second control. Naming conflicts can appear as all pages and controls are automatically compiled into the same _ASP or ASP namespace. In Whidbey, this problem was solved, but in the meantime, the recommended fix is to specify the ClassName explicitly in the @Control directive so that even though the file name is the same, the controls will have different class names.
# July 25, 2004 3:00 PM

Jouni Heikniemi said:

Yep, that much I figured and we've been using ClassName already. It's a bit problematic at times, but it does fix the immediate problem. Looking forward to Whidbey, then. Thanks for confirming my thoughts on the issue. Another score for Microsoft's developer support - keep it up :-)
# July 25, 2004 3:49 PM

DevNull said:


PHP runs on almost every platform ASP.NET does not.
PHP runs on over 60% of the webserver today ASP.NET does not.
PHP is free/open ASP.NET is maintained by one company.

the above things a for me way more important that if its takes 5 or 7 seconds to get a result. ASP.NET may be faster but i guess its a lot more restrictbie and un-flexiable than PHP.

# July 26, 2004 6:43 AM

Toast said:

Personally, I prefer PHP as I'm not restricted to any platform. I've got Apache, PHP and MySQL running on MS and OSX and Linux and for the hobbyist developers without a corporate budget or enough cash around, going for a LAMP setup is a lot more realistic.

Another thing I like about PHP is the extensions that can be got for it. From different databases to graphical libraries to PDF generation to SWF generation, there's a lot that can be done and even though PHP mightn't be as english-like in its syntax, once it's practised, it's no problem to read and write.

That's my two cents anyway.
# July 26, 2004 7:12 AM

Richard Moore said:

The file open example is still wrong in your corrected version - it ignores the possibility that the file exists but is not readable by the user the script is running as. A better solution would be to try to open the file and either handle the resulting exception or rethrow it.
# July 26, 2004 8:14 AM

TrackBack said:

I read this in the comments to a reply to the PHP vs ASP.NET crap Oracle posted. Mike Kozlowski wrote: That Oracle article was one of the lamest, most preposterous pieces of cheerleading I've seen since Dave Massy said that...
# July 26, 2004 9:04 AM

Caruccio said:

"Memory that's not used is useless."

today, 1GB RAM is not enough for a web server... if all your process become memory-eaters, your server will get down soon... at this point, I think ASP.NET fails (like almost Microsoft solution).
# July 26, 2004 10:25 AM

abc said:

hey,

why all think that ASP.NET runs only on MS Windows?
look at http://www.mono-project.com/about/index.html


some fixes for:
1. PHP runs on almost every platform ASP.NET does not.
2. PHP runs on over 60% of the webserver today ASP.NET does not.
3. PHP is free/open ASP.NET is maintained by one company.

solutions:
1. use mono
2. apache + ASP.NET mono module
3. 1, 2 -> ASP.NET is !!!NOT!!! maintained by one company.

# July 26, 2004 10:32 AM

Shike Maffer said:

abc's comments mirror mine...if multiple OS's is the acid test in the argument, why not consider mono?

There is nothing in PHP that you couldn't do in traditional ASP. With ASP.NET, Microsoft addressed many things and turned it into a real web development architecture. If you don't like it because it's Microsoft, that's fine. But as Bertrand points out in his response, the real agenda here is Oracle. You remember Oracle, the company that is in bed with Java? So why pimp PHP? Simple, because Oracle dependence is OK, Microsoft dependence is not. Dead on Bertrand, dead on. Oracle has been whining about Microsoft's dominance for years...they aren't arguing against market dominance/reliance...they're arguing about it not being to their benefit. Oracle and Sun (to throw them in here too..) have always shown that when they are the vendor that you must rely on, that they are as ruthless, gouging and uncaring as they claim Microsoft is.

And lastly the chart in the article is lame, but I've figured out the scale: $$ is better than $$$, but worse than $. So there you have it.

Shaffer
# July 26, 2004 10:53 AM

dick tang said:

>Then, let's look for vulnerabilities: choose Microsoft / IIS / 6.0. >Results:
>1 (One!) x-site scripting vulnerability in a web administration >tool that's not even installed by default
>And three for ASP.NET

>OK, let's do the same for Apache 2. Results:
>25 (Twenty-five!) vulnerabilities, including DOS and Buffer >Overflows
>Wow, that's a lot! Let's look for PHP 4 now... Results:
>19 (Nineteen!) vulnerabilities, including integer overflows, >arbitrary file disclosures, cross-site scripting, etc.

that's not fair,how long did apache and php releaese?
I agree that IIS 6 is securer than before,but you should not list
ps. 25 vulnerabilities is not usually affect all of the platform
# July 26, 2004 11:01 AM

General Protection Fault said:

For Shike Maffer:
"There is nothing in PHP that you couldn't do in traditional ASP. "

That's B.S. In old-school ASP, to rotate an image, you had to buy a third-party COM library like LEADTools. PHP handles this natively with the image* functions. Likewise, for creating PDFs, PHP has built-in support but ASP does not. Add all those COM libraries on your TCO!
# July 26, 2004 11:06 AM

Oscar Leeper said:

So if following the link off VA Systems owned propaganda mouthpiece Slashdot wasn't enough of a clue, I just watched the page load on the Oracle article:

1)Click on link
2)Oracle banner appears at top of page

And there I sit thinking to myself, "Yup, another piece of Oracle FUD. This should be funny."

Thanks Bertrant, for putting into words what every *level-headed adult* programmer was thinking upon reading the article(or the banner at the top of the article).
# July 26, 2004 11:38 AM

Yeehaw said:

"the author tries to convince us that PHP and ASP.NET fall into the same category of web platforms that '[embed] code into HTML pages with special tags that signal to a preprocessor that they contain code, and that it should do something with it'. This is true of PHP, but not of ASP.NET, where the code can, but should not be in the HTML markup."

Code and HTML should be separated (most of the time) in both languages, and it's just as possible to do this in PHP as in ASP.NET. I stopped reading your rant seriously at this point, because it showed that you are at least as dishonest as the Oracle writer.

I also love how you defend that ASP.NET is tied to IIS by defending the *security* of IIS. That's really rich. I stopped reading altogether at that point. Your are obviously on the far-away planet Microsoft at this point.

A bunch of developers are building large, fast, powerful, scalable programs quickly and maintainably using completely free and open tools. They don't need you, and ASP.NET would have to be *far* superior to warrant marrying your company and shelling out a bunch of cash. But I'm sure you'll find a way to shrug this off and still be 'right'.
# July 26, 2004 11:56 AM

Jason Lotito said:

some fixes for:
1. PHP runs on almost every platform ASP.NET does not.
2. PHP runs on over 60% of the webserver today ASP.NET does not.
3. PHP is free/open ASP.NET is maintained by one company.

solutions:
1. use mono
2. apache + ASP.NET mono module
3. 1, 2 -> ASP.NET is !!!NOT!!! maintained by one company.

Unless I am mistaken, ASP.NET is NOT covered by any open standards, therefore making it's legal standing unsure. Indeed, from the MONO page:

"The controversial elements are the ASP.NET, ADO.NET and Windows.Forms subsets. Those are convenient for people who need full compatibility with the Windows platform, but are not required for the open source Mono platform, nor integration with today's Mono's rich support of Linux.
...
The Mono strategy for dealing with these technologies is as follows: (1) work around the patent by using a different implementation technique that retains the API, but changes the mechanism; if that is not possible, we would (2) remove the pieces of code that were covered by those patents, and also (3) find prior art that would render the patent useless."

So in reality, a business decision to use ASP.NET means a business decision to run on Windows.

As far as scaling and all that fun stuff, I just have to point to Yahoo!.

I don't necessarily agree with the Oracle article; after all, it's Oracle trying to make non-Microsoft products sound better.

And finally, as far as the "benchmark test" is concerned: Yes, I too can make PHP code slower than ASP code if I choose to do certain things that any professional PHP coder would know not to do. In posting a benchmark, make sure your code is correct.
# July 26, 2004 12:00 PM

kmcafee said:

I just wanted to say that I work in a development house where there are 3 programmers in one division doing PHP web development, and 5 programmers in my team doing ASP.NET web application (sold to customers to provide business functionality, not hosting web sites) devleopment. We are very happy with the ASP.NET development experience for our needs. But PHP is also working out well for the other teams needs.

And the one MS point I totally and completely disagree with is the Accountability issue. Microsoft has 0 accountability, period. They have never stood up and taken responsibility for a problem, and they have never provided solutions at the same speed as any other business organization I have done business with. There are numerous bugs in Visual Studio 2003, and a handfull we found in the .NET library itself - all of which we discovered in our first 6 months of working with the technology, and reported to our MS Partner contact. Nothing has or will be done about any of them, period. Until they are fixed in whichever future release Microsoft feels like fixing them in.

How bout this one, use "devenv" to build a solution, and then open the solution with devenv visually (visual studio), and you cannot open ANY of the visual designers, you must "touch" these files first, or delete your web cache and or object files.

And if a SQL Server or .NET update ever looses my customers data, Microsoft will not offer me one bit of accountability, nor money to make reparations - they are as accountable to me as my congressman - which is to say, not at all.
# July 26, 2004 2:29 PM

Luis Alberto said:

I work for a small company. We have two servers running, one for ASP.NET (Win2003 and so) devel and the other is a LAMP machine (Debian Woody). Both servers work just fine, have almost the same hardware and run many apps, apart from devel ones.

The win2k+3 machine is maintained by an outsourcing company, that is an official partner of MS (cannot say names, we still work with them and I know that MS boys are going to throw shit on them) and, among other things, did Exchange, firewall and A/V thingies. It was a busy server, running also file and printing jobs for the whole domain on wich we operate, and a powerful one (like the other one): 2xXeon 2 GHz, 1 GB of RAM, some scsi raid storing.

I know that all that tasks are excessive for such a server, having in mind that we do ASP on it. So we purchased another server, a clone of this (they're IBM beasts) and installed Linux Debian on it, to use it as a PHP devel platform. As we work with Exchange, we moved the routing, firewalling, A/V and antispam to the debian machine, so the win server didn't have to maintain the load our internet use demand. This solution worked beautifully, but it was not sufficient. File and printing serving is a heavy task on our office, so we moved to Samba and Cups with excellent results. We noticed also that we could move the two scanners and share them with SANE on the debian machine.

Now, we can develop comfortably on the windows machine but look at this:
-Win2003 services:
-Exchange (~1000 processed emails per day), managing connections only from the debian machine.
-ASP.NET (two simultaneous users testing code, an occasional customer trying its work in progress web).
-DAT nightly backup, so it does not interfere with our normal ASP work). We are going to move this service to the debian server on september, as soon as I end trying a new backup system on an old PC running also debian.
-Domain controller, 16 users and 19 computers.

-Debian:
-Spamassassin + ClamAV + Postfix (as gateway for exchange, processing ~2000 emails a day, half of them are SPAM or virii from the outside and do not pass to Exchange).
-Apache 1.3.x, PHP 4.1.x, Turck MMCache
-MySQL 3.x
-Samba, 9 users doing some heavy tasks as editing large graphics files directly from the server. Four PHP developers, although their disk usage would be like 0.001% of the total being the rest used by designers.
-CUPS, serving a parallel kyocera laser printer and two USB hp deskjet printers.
-SANE, serving one HP flat scanner and a nikon diapo scanner (both USB).

Cannot give you any numbers, since these are production servers and cannot run any tests on them. But I can assure you that we are very surprised with the perfomance of the linux server, but also with the lack of perfomance of the windows server. The Linux server is bigger, so the comparison is not clear (2xXeon 2.2 GHz, the memory is also a bit faster but they have the same amount), but it runs many services on it and it's very secure. Usualy we have Exchange and IIS fighting for RAM, so the system gets very swappy, and I cannot imagine why IIS wants so many memory... it's not our app, we make some finetunning on it from time to time, and before doing anything we make some diagnostics on it, including the measuring of its memory footprint, which usually is what we expect (ok, we have some memory leaks from time to time which are resolved when detected).

I am really curious on a real benchmark, not MS/Oracle FUD or some user doing silly tests. First, because curiosity, and on a more professional side I want to know if the behaviour of the windows server is normal. An mostly idle webserver and a not very busy mail exchanger is not what I would expect to get a good server on its knees.

Anyway, we are moving all services to debian (converting the windows server) slowly, the current debian server is beggining to have too much responsibilities and I want to be able to transfer quickly and efficiently tasks from one server to another in case of hardware failure.
# July 26, 2004 3:51 PM

Bertrand Le Roy said:

DevNull: ASP.NET being maintained by one company is seen by some companies as an advantage in terms of consistency and accountability. If for you, "openness" is more important than anything else, sure, go ahead and use PHP, or... Mono.
As for "i guess its a lot more restrictbie and un-flexiable than PHP", well, guess again, this is just a gratuitous affirmation that would need a little more argumentation...

Toast: do some research. Here's what I could find in two minutes:
http://sourceforge.net/projects/nfop/ one of the open-source PDF libraries for .NET
http://sourceforge.net/projects/ming-sharp/ a .NET wrapper around the Ming SWF library.
And of course, as I was saying in the article, image creation libraries are built-in the .NET class library, as well as database access, etc. The main difference with PHP being that it's consistent, well-organized and object-oriented.

Richard: I'm well aware that other error treatment is necessary in the code you will substitute for "#work with the file". The problem here with the original code was that it throws and catches untyped exceptions, and it throws unecessarily, which is very bad practice.
Another problem that I did not underline in the article is that existing PHP libraries having been written before the support for exceptions appeared in PHP5, chances are that these libraries will not throw exceptions anytime soon and you will have to use different techniques for error treatment whether you use older or newer libraries. More inconsistency...

Nofool: you'll need a little more argumentation than that not to be taken for a common troll.

"Doesn't matter", whatever your name is: you're so clever, but you could also have read the article where I make it very clear that I work for Microsoft.

Caruccio: ASP.NET only takes the /proportion/ of memory that you configure in machine.config. It does not "eat up" memory, it uses what you configure there. There's nothing shocking there: the machine is supposed to be a web server, right? So the web process takes /available/ memory and uses it. So what?
1GB is more than enough, I've run dozens of web sites on 512MB machines without a glitch. Did you see the price of memory chips by the way?
The bottom line is does your web site run smoothly or not? The proportion of memory the web process uses is just irrelevant as long as it does not get in the way of other necessary processes.

Dick: you're right, I should perhaps have compared on the same time frame instead of just on the last version of each product. But you can do so yourself and you will see that it doesn't change much: over the time IIS6 has been on the market, there have been many more security issues with LAMP than with IIS+ASP.NET.

GPF: I did not quote the facts page as "proof", and if you have a better study of TCO for Windows and Linux, let me know.
As for your answer to Shaffer, well, I was personnally not talking about classic ASP. Actually, even I, despite all my pro-MS bias and my general dislike of the PHP syntax, would probably choose PHP over classic ASP. But fortunately, classic ASP has been replaced by ASP.NET. So this is just irrelevant to the current discussion.

Yeehaw: yes, it is perfectly possible to write more or less clean code in PHP (or classic ASP). I've written such code myself. But you really have to get out of your way to do so: linear models such as PHP promote spaghetti intertwined HTML and code, whereas ASP.NET promotes a clean separation from the start as the default model.
I'm glad you continued to read the article despite the fact that you stopped reading it (?!).
You know, your comment about IIS security is just disarming. You're accepting the common preconceived idea that IIS is unsecure despite all evidence to the contrary even when faced with this evidence. All you have to do is follow a single link or do your own research, but I guess you don't want to do even that simple thing because that would endanger your whole system of belief that MS is inherently bad.
And I guess that no, we don't live on the same planet.
Sure, many companies build great and clean things with open-source tools, I've never said or written anything that would indicate otherwise. I sincerely think that ASP.NET IS far superior to PHP, though, and I'm willing to show how.
Who said that you had to "marry" MS, though? Not me, just you. And what "bunch of cash" are you talking about?
You guys are way too irrational and should think more about productivity, maintainability, interoperability, you name it, stuff that really matters, not whether or not the producer of this or that technology is ideologically acceptable.

Jason: I never said that PHP could not scale. You're right in saying that Yahoo did this successfully. ASP.NET scales out of the box. The gratuitous affirmations to the contrary in the Oracle paper would have to be backed by some kind of study. Saying something does not make it true. Proving it does.
I agree that the "benchmark" Pzykoman posted in his comment do not mean much. I'm still waiting for a serious, real-world application based performance study.

Kmcafee: I'm very surprised by what you're saying about support. The experience I've had with them before I joined MS is completely different. Did you go through support for these? How did they close the events? Won't fix??
What are these "numerous bugs"? Were they aknowledged as real bugs?
The repro for the bug you cite is incomplete: I've been doing this kind of very simple manipulation every day for years and never encoutered or heard about having to touch the file. What did support say about this one?
About SQL or ".NET update" (what's that?), /did it/ lose some of your customers data?

Luis: you should contact support: I think there may have been some memory issues with the interaction of Exchange and ASP.NET. It should work, though, even though it's generally not a good idea to put both on the same servers (I can hear the zealots already. Well, in my former company, we had Linux machines and we did not put mail servers and web servers on the same machines on Linux either)
# July 26, 2004 4:20 PM

TrackBack said:

The article on ActiveWin
# July 26, 2004 4:22 PM

TrackBack said:

This promises to bring more comments than I can reasonably handle. Oh well!
# July 26, 2004 4:26 PM

Bruce said:

Nice article, rebutting a laughable original. However I couldn't help noticing that every mention of ASP.NET etc points to the relevant Microsoft sites, but you didn't put a similar link even on the first mention of PHP or Oracle. A nit that spoilt my impression of the article!
# July 26, 2004 4:53 PM

Oscar Leeper said:

Bruce:

Take a look at the comment you just posted. Did you add links to Microsoft and ASP.NET? I sure didn't add them to mine.
# July 26, 2004 5:45 PM

Bertrand Le Roy said:

Bruce: the ASP.NET and Microsoft links are automatically added by the .text engine. I could add the same kind of automatic links for PHP and Oracle, but then I would also have to do it for every other company out there I may mention the name of. I won't as the blog's focus is ASP.NET...
But here are the addresses of PHP and Oracle anyway:
PHP: http://www.php.net/
Oracle: http://www.oracle.com/
# July 26, 2004 5:52 PM

Jason Lotito said:

Bertrand: My comment regarding scalability was in response to another comment I read on here (I believe). As a PHP programmer, obviously my opinions should be taken with a grain of salt.

However, what I have found is that professional PHP programmers are more than willing to admire .NET for it's strengths. ASP.NET unforunately has the tradition of ASP via VB (which, frankly, sucked). ASP.NET is an improvement, and there are efforts in the PHP Community to take what we find nice about ASP.NET and implement it for PHP.

For example, the "Widge Control" functionality of ASP.NET has been done in PHP with different libraries. WACT is a fine example of this. On a side note: PHP has a fine history of taking what is nice in other languages and using it. PHP's support for external libraries is amazing (and frankly, that's it's purpose, to be a glue language). Anyways, off topic...

As far as Oracle's paper: Yeah, for those that know better, it's Oracle's way of biting at MS's ASP.NET. ASP.NET and PHP are competing technologies despite the underlying architecture, as is Java and C#. So if you are Oracle, and you want to diss ASP.NET, which technology are you going to talk up, will it be Java or PHP?

PHP, of course!

Frankly, articles like these serve the readers little, as you have to question the reason for putting out an article like this. Granted, MS's own ASP v.s. PHP article wasn't any better, but any developer worth his salt could see that a mile away.

Frankly, I am happy and successful with what I do, and as long as ASP.NET continues to move forward, it will only force us PHP guys to make sure we compete. Competition is good, after all. It will only make PHP and ASP.NET better in the long haul.
# July 26, 2004 6:36 PM

Bertrand Le Roy said:

Jason: Thanks for the message. Yes, competition is good, and the PHP market shares are a strong motivation for us. I'll have a look at WACT, which I don't know.
# July 26, 2004 6:40 PM

Another matthew said:

Hi from OSNews.com :)

"[embeding code in html] This is true of PHP, but not of ASP.NET, where the code can, but /should/ not be in the HTML markup"

In practice, this means that ASP.NET has a built in templating language whereas PHP doesn't -- and that's all. It's not about which of the many abstraction and templating layers in both languages are best -- an XML/XSLT approach or an OO controls model for example -- it's just defaults. ASP.NET's default templating language has code at the top as a reference to the code behind (and you can't have two of these, I think) so one could argue the binding in ASP.NET is similar too. Similar, unless you choose otherwise and use a templating language that outputs your markup. The supposed mixing of code and content exists in both languages.

The biggest mark against ASP.NET is that it's not cross-platform (Mono doesn't count yet ;), and that for any web standards nazi the HTML it produces favours MSIE over others.

Sure, you can choose controls that produce good html, but ASP.NET doesn't by default ;)

Good response though. I generally agree with you, but just because the Oracle guy isn't a good programmer doesn't mean a thing to PHP itself.

Thanks!
# July 26, 2004 7:10 PM

Bertrand Le Roy said:

Other Matt: It's not just templating. What about the rich page lifecycle? What about events? What about WebControls?
By the way, ASP.NET 2.0 will produce standard XHTML out-of-the box by default.
# July 26, 2004 7:14 PM

TrackBack said:

Nexen reprend la news d'OsNews
# July 26, 2004 7:57 PM

TrackBack said:

Some commentaries on Channel9
# July 26, 2004 8:00 PM

Another matthew said:

"It's not just templating. What about the rich page lifecycle? What about events? What about WebControls?"

Bertrand Le Roy: I've been writing C#/ASP.NET for 2 years now, but I'm coming to prefer a hybrid ASP.NET/placeholder/XML/XSLT approach to page generation. The page lifecycle is... well, it's actually got in my way a lot of the time. It's useful for application start and stop, and I guess it's breaks up the code into their order.

I would have loved for ASP.NET to have a placeholder control that maintains state for it's added controls. There's a 3rd party control that does this, but last time I checked (6 months ago) it was buggy as hell.

As I was kinda hinting, my main complaint with ASP.NET is that it's an abstraction away from http, html, and the vagaries of web browser bugs. The problem is that the browser bugs exist, so you can either ignore them (ASP.NET style) or deal with the underlying tech. When you've got two search forms on a page ASP.NET puts them as a single form tag, so pressing enter submits both. There are hacks that use javascript to hit the right button based on which field you're in but it's a workaround, and it doesn't degrade gracefully for older browsers. I develop government websites so there are requirements around this kind of thing -- we can't rely on Javascript. JoelOnSoftware called this a leaky abstraction or something like that -- when it'd be nice to tell programmers that you can deal with onClick and onChange events on a per field/button basis, but that the nature of the web means otherwise.

PHP has a library called PHP Web Controls (a ripoff of ASP.NET's model).

ASP.NET is pretty good, but I prefer the XML/XSLT approach and capturing the actual form elements as POST/GET rather than an abstraction. Now that I've got my abstraction library (a week to write) ontop of ASP.NET it doesn't take longer than the buggy event model.

XHTML in ASP.NET 2.0 will be great.
# July 26, 2004 11:42 PM

TrackBack said:

It's been a while since I have looked at any PHP so I am unable to offer any lucid commentary regarding the ASP.NET vs. PHP debate (originally sponsored by Oracle and Sean Hull) currently taking place on Bertrand Le Roy's blog ("Some co
# July 27, 2004 12:21 AM

TrackBack said:

iamwill » Oracle’s comparison of PHP and ASP.NET; The comments keep rolling in.
# July 27, 2004 2:44 AM

Warren said:

The author is wrong with his outdated knowledge of PHP.

PHP is still the better tool. It's more flexiable and has more functions.

The author is wrong to assume that PHP ALSO is best used seperated from the HTML, it has a include_once (as well as an include) function, which is usually used to bring in the PHP library code.

PHP is also more portable and follows a C++ style (less typing) format, not some beginners style of basic that ASP follows. every time I use ASP I have to drop my intelligence to MS level.

I too have used both ASP and PHP, on windows and Linux. Overall PHP is better by far!

# July 27, 2004 9:00 AM

Bertrand Le Roy said:

Another Matt: It's true that you need to know the page lifecycle to do things in the right order, otherwise it can get in the way. But when you come to think about it, that's what makes all the magic stuff in ASP.NET possible (automatic state management, events, etc.). I think we've simplified the writing of ASP.NET pages in Whidbey a lot, even though the lifecycle is now even richer.
I assume you mean to maintain the state of dynamically added controls. The WebParts and their zones do that in Whidbey, but a more general purpose control could be interesting. I'll look into it.
We've also made things better in v2 for multiple form problems. You can now have default buttons, and have a button post to a different page, while retaining the strongly typed experience of ASP.NET.
I think the web is getting more mature now, and ASP.NET, especially with the new Adapter infrastructure, is the only web platform that is able to automatically adapt to the peculiarities and bugs of each browser or device. After all, hardware abstraction has been working pretty well in OSs, so why would browser abstraction and HTML abstraction be a bad idea? It certainly works in ASP.NET. There are some cases where you can feel that using the old Request.Form may be easier, but that can be a slippery slope, and you may end up rewriting a part of the framework where you could probably have done the same while maintaining the ASP.NET model intact. I don't know about your special case, it would have to be looked into in details. I know that I've made this mistake in the very beginning of ASP.NET (classic ASP methods were hard to loose) and discovered later that my problem had a much simpler and cleaner solution.
But you know, we shouldn't impose our own idea of how you should develop, and I'm very glad that you found your own method and that it works for you. I even think that PHP is what works for some people just because they like this style of free-form, I control exactly everything, style of programming. I even know some people who love to develop in assembly language (I used to be one of them).
So we have to allow for different styles.
By the way, can you be a little more explicit about the "buggy event model"? What's buggy about it? If you found bugs, I'd like to know about them so that we can correct them. By the way, we opened this site to submit bugs and suggestions for Whidbey:
http://lab.msdn.microsoft.com/productfeedback/

Mattia, Warren, etc.: if you have nothing more constructive to say than "your article suckz, php rulez, MS suckz", please go away.

In particular, Warren, it's amusing that you should tell me my knowledge of PHP is outdated as you yourself are talking about classic ASP, not ASP.NET. Come on, PHP follows a C++ style?? Are you kidding me? A Perl style, ok, but not C++. C# follows a C++ style (C#, you know, one of the languages you can CHOOSE in ASP.NET)
And separation through include_once? Wow, take a look at ASP.NET's Register directive. It's just light years ahead.

Bob: of course, you dropped the main part of the citation, which was that individual cases should not be taken for generalities. I'm only talking about verifiable things, you guys are talking about purely emotional things. I also said that we still had a lot of work to do, but of course, you didn't want to hear that, you only hear what conforts your system of beliefs.
Just compare the number of security issues in IIS 5 and IIS6 and see how much progress we've made in just a few years on this huge code base. We're doing the same kind of work on Windows itself, and this will give XP SP2 and Longhorn.

Anona: please do your homework before you post such preposterous nonsense. Open a web browser, go to Google, type "mac worm", click on the search button with your single-button mouse and click on the first thing that shows in the many answers:
http://securityresponse.symantec.com/avcenter/venc/data/mac.simpsons@mm.html
Oh, it's a worm, and it's for the Mac.
Of course, a worm for MacOS won't get very far as there are so few macs. Like a virus that would target people with Vayron eyes.
Why are there anti-viruses for the Mac by the way?
I also did a search on Apple Mac OSX Server on http://www.securityfocus.com/bid/vendor/ and there are just too many vulnerabilities for me to bother counting. Do the same search on Windows Server 2003: there are 2.
Of course I'm not denying that there have been a lot of problems, but like Bob, you don't want to listen to what I'm saying.
Get me right this time: I'm not denying. What I'm saying is that we've already made a lot of progress (see the numbers for yourself: the record speaks for itself indeed) and that we're still working.
You're saying that we haven't done "much" to solve security problems? How do you explain the numbers on security focus then?
Get real. Get the facts.
And go away.
# July 27, 2004 2:19 PM

TrackBack said:

# July 27, 2004 2:56 PM

Bertrand Le Roy said:

Dear trolls,

This is not your private chat room. This is my blog.
With your uninteresting, unoriginal rants, you're making this page heavier than it needs to be and wasting legitimate reader's bandwidth.

So here's what we're going to do. You're going to open your own blog, and rant all you want there. I'll even trackback to it if it's funny enough.

In the meantime, I'm moving all trollesque comments to this page from now on:
http://weblogs.asp.net/bleroy/articles/199077.aspx
# July 27, 2004 5:51 PM

Bysza said:

Anona: I understand you're a Mac power-user, right?
That is great. :)

How much did you pay for your Mac?
I'm not claiming to be a Mac expert, but I took a time to lookup a Mac like this:
Bundle Power Mac G5 2.0GHz DP 512 160 4x SuperDrive 56K NIC w 1GB Upgrade - lowest price: $2339.00 (without monitor)

Opposed to: Dell Dimension 8400
Pentium® 4 Processor 530 with HT Technology (3GHz, 800 FSB)
Microsoft® Windows® XP Home Edition
512MB Dual Channel DDR2 SDRAM at 400MHz (2x256M) at $989.00 (with monitor).
Correct me if I'm wrong, but AFIK these are at least comparable machines, right?
Unfortunately with uncomparable prices. :(

We have lots of PCs in our company (1000+) and several Macs. Well, I bothered to ask my collegues working on them about problem they had.
Mac is and was advertised as a problem-free computer, which is not entirely true.We had problems with several hardware items, including SCSI drives, scanners, etc.
MacOS has its faults, bugs and also security problems.
Every part is 2 or 3 times more expensive than PC hardware, but at least Mac box looks great. ;)

How many directly Internet connected Macs are there?
Do you have any idea?

First of all, during early stages of Internet era, say late 80' and early 90', how many network connected hosts there were?
Did everyone was thinking about security as much as today?
Look on TCP/IP. It has no security features and ability to easly spoof addresses is causing lots of problems. Same with SMTP, etc.
And of course the idea to build IE as an integral part of the OS... ;)

It is a big problem (or impossible ;) to upgrade every internet connected windows boxes to the newest os or at least install patches on each, especially when there are no features build in the older windows versions that could allow that.
And people are not keen on upgrading, since lots of them doesn't know what is going on with their machines.
They just want to play games, browse internet and read mail. That's where the biggest problem lays.

It is a challenge to change thousands of employees mindset and correct so huge codebase as MS has, especially when you think of the compatibility with vast amounts of applications already written for this platform.
I'm really satisfied with progress MS has done so far in terms of security out of the box and I'm looking forward to WinXP SP2.
But I'm not saying that it shouldn't be done earlier ;)

My point is:
If you are satisfied with your Mac - use it and be happy. :)
Security is a big concern for a few years now, and MS has invested in security a lot of efford and money.
Implicity and explicity admitting security is a major concern.

Please let go the holly war, and give peace a chance... :D
# July 27, 2004 6:57 PM

TrackBack said:

# July 27, 2004 8:51 PM

Another matthew said:

Bertrand, yes I was talking about maintaining the state of added controls. Steping back though, the only reason to add controls to a page and register events with addHandler() -- all that hassle -- is because that's the way the ASP.NET event/page lifecycle/OO model works. Other models wouldn't require this, so I think I'm being fair when I say that ASP.NET still has a way to go (it's good, but it could be a lot better).

Many platforms adapt to the device they're on, so I think it's overstating it to say that ASP.NET is unique in this regard (hundreds of CMSs do browser detection and produce different output based on this; whether it's a simple template change or by using high-level objects that adapt their HTML to the browser).

I agree that a high-level object model expressing abstracts like "treeview" and "tabs" that is then turned into device-specific html is the best -- that's a good approach, however ASP.NET turns asp:panels into div tags for IE and table tags for Moz! Their radiobuttonlists are produced with label tags surrounding the text and not the radio button, which would be better for Konq and NN4 (with no downside). The abstraction that ASP.NET provides is used to produce HTML that works better in IE. This is just talking about defaults again, but it's a little annoying to have to write repeater controls to get the appropriate HTML. Even required fields (as in, the required field validator in ASP.NET) is poorly implemented in non-IE browsers, and it allows non-IE browsers to bypass this step.

I assume you've read the JoelOnSoftware article about leaky abstractions -- my point is that ASP.NET is a leaky abstraction. HTML and HTTP don't have the concept of required form fields, and they don't have a way of distinguishing between hitting enter in a form and which button is affected (if any). ASP.NET and many platforms build ontop of HTML higher concepts such as treeviews and tabs and buttons -- they build abstraction, but if abstraction is done poorly it can be confusing to programmers.

Now, I don't want to end this post on such high concepts, because they tend to blur the different possible approaches within each concept. ASP.NET could have done required form fields transparently for all browsers but it didn't. This isn't a general statement saying that abstractions mean losing control (because of course it means that) but the abstraction must be well done or else it leaks, and ASP.NET (and others) leak.
Thanks :)
# July 27, 2004 10:26 PM

Julien Ellie said:

Haha :) Bertrand you're crazy to have taken down this ridicule article from Oracle and you're now fighting hordes of troll. Luckilly there're still a few interesting comments in there from people who have a little respect for people trying to do their job.
# July 28, 2004 3:08 AM

Bertrand Le Roy said:

A.Matt: I don't really understand what you're saying about dynamic controls. Actually, there are very few good reasons to add controls to a page dynamically, I'd need to know your precise use case to give any advice.
But I'd be curious to see how other models solve this problem. I don't know any other framework that do. But perhaps I didn't understand exactly what you were referring to.
I take your points on non-IE browsers, this is something we should do better, even though we always have a fallback. For example, validators are always enforced server-side (as they should be even for IE to prevent elementary forged posts), so you just get an additional postback on these browsers. But agreed, there is no good reason (except the limited time we have) to not implement client-side validators for DOM-compliant browsers.
On the other hand, there are some third party validators that solve this problem. After all, our job is not to give every possible control out of the box, but to provide a web development framework on which you can build your applications. We try to solve the most common scenarios out of the box, but we can't do everything at once. That's why there is a v2, and that's why there will be a v3. There's always room for improvement and your feedback is valuable.
And if I'm not mistaken, you don't have this issue with validators on PHP because there are no validators, so you actually have to build them from scratch.
I've read the JoelOnSoftware article, and his main point seems to be "the abstractions save us time working, but they don't save us time learning". Fair enough, but you still save time working. And granted, to do ASP.NET well, you probably need to learn a few things like the page lifecycle.
But one of the things he does not mention, though (or perhaps I missed it), is that the learning can be very progressive. I think ASP.NET is good for beginners because you don't have to learn HTML and the other underlying concepts first (like in PHP), you can start with the high-level concepts. In my own experience, it is very common with what Joel calls "leaky abstractions" to only have to learn the underlying complexity along the way (the later the better). For example, after all these years writing C# code intensively, I still know very little IL (and only because I was curious about it, not because I really nedded it).
Thanks for the feedback anyway, it's refreshing after all this reckless trolling.
# July 28, 2004 1:51 PM

PLeX said:

Thought this was quite funny...

Poll results from bottom of Oracle article:

Created :Wed Jul 28 15:56:29 PDT 2004 Please rate this document:
Excellent 1541 Votes 18.8%
Good 1085 Votes 13.2%
Average 292 Votes 3.6%
Below Average 2563 Votes 31.2%
Poor 2721 Votes 33.2%
Total: 8202 votes
# July 28, 2004 6:57 PM

TrackBack said:

Yexley
# July 28, 2004 8:58 PM

TrackBack said:

# July 30, 2004 1:23 PM

TrackBack said:

# August 4, 2004 2:45 AM

Siva Mateti said:

Why not use Server.Transfer instead of Response.Redirect especially if both pages are aspx? How can I avoid ThreadAbortException for Server.Transfer?
# August 4, 2004 9:22 AM

Bertrand Le Roy said:

Excellent question.
Server.Transfer will not get the right URL in the address line of the user's browser. If that's acceptable, you can use Transfer, and you save one client/server roundtrip.
Now, Transfer also has a Response.End (and hence a ThreadAbortException), but the code inside Transfer is really just two lines:
Execute(path, null, preserveForm);
Response.End();

So you see that to avoid the exception for Transfer, you should just use Execute instead.
Of course, if you do that, you still need to suppress the output from the first page because both pages will output to the same response (you don't need to do that with Redirect because you have two separate requests in this case, and thus two different responses, the first one being thrown away). This can be done by clearing the response before calling Execute or doing some funny stuff with the writer parameter of Execute. Many strange scenarios here ;)
# August 4, 2004 1:19 PM

TrackBack said:

# August 5, 2004 3:09 AM

Siva Mateti said:

# August 5, 2004 8:55 AM

TrackBack said:

# August 5, 2004 2:00 PM

Dimitri Glazkov said:

I am not sure that it has to be an ideal world for the clean separation to work. Indeed, the concept needs refinement, but the core of it is good, methinks. Imagine something like this: an adapter pattern with decoratorish tendencies applied to rendering of a control.

This way, a control only represents the data and manipulation with it. It does not emit any markup, but it does know how to retrieve, process, and update information.

Parallel to it is an adapter, which doesn't know how to do any of the above with the data, but it does know how to query control's properties and how to render it using markup.

Yes, this means that for each control there has to be an adapter, but it is a compromise that we ought to be willing to make in order to escape hard-coding HTML into control's functionality.

We are essentially continuing the Page Controller paradigm into the controls, rather than stopping at the level of the page.

As a possible implementation scenario, an adapter could simply spit out control's properties as XML and allow developers write XSLT to transform it into HTML.

You could also easily imagine an adaptive control, which attempts to render properties of any control -- this is not necessarily a production environment-type trick, but something that could be useful to render orphan controls -- those without a corresponding adapter.

This is why my third role is for advanced developers -- creating adapters would not be something that a designer would do. Following requirements of a designer, yes, but probably not a designer him/herself.
# August 5, 2004 5:00 PM

TrackBack said:

# August 5, 2004 5:13 PM

TrackBack said:

# August 5, 2004 5:13 PM

Bertrand Le Roy said:

I understand your points, but one of the places where the whole thing falls apart is performance. This is what I mean when I say it's an ideal world, something we should tend to, but that we should not place above everything else, despite having to solve the real-world problem in all its complexity.
Believe me, this approach where adapters are completely separated from the control has been considered, but unfortunately, adapters are expensive. As would be to have an additional XML/XSLT level.
The choice that was made is to make is as efficient as possible for the main scenario (which is HTML) and fall back to adapters only when we need to.
If you look at the present state of things, the rendering is already pretty much separated from the rest of the control: you output HTML only in Render.
Where I don't agree with you, even from an idealistic point of vue, is in your core analysis that controls should be some kind of local page controller only, leaving the rendering to some other entity. While I agree that there is a benefit in having ways to override this part of the control's behavior (as well as others), most controls are UI elements first, not data manipulating entities (exceptions are non-visual controls like DataSources and these do not render anything). The purpose of a control as I understand it is to transform some part of your data into markup AND to manage the interaction of the user back with this data (which is what XSLTs don't do).
So I think if your control does too much data manipulation, that's a sure sign that part of this code should be in a different layer and not in your control.
Don't forget also that a control's interaction with the user is dependant on the actual markup. It's a two-way thing.
So what would be left in a control if it doesn't do the rendering (and thus can't do some of the interaction either) and doesn't do stuff that belongs in other layers? Almost nothing, it's then just a structure. You've just added a useless abstraction, transferring all of the logic into the adapter.
# August 5, 2004 6:29 PM

Bertrand Le Roy said:

Brant, can you elaborate? Millions of developers successfully build UIs with HTML and ASP.NET or some other server platform. How are they "failing at some point"?
I agree that XAML solves many of the problems we have to face with HTML, but HTML is very far from being the dead-end you're talking about.
# August 5, 2004 9:20 PM

Dimitri Glazkov said:

Bertrand, I think your assertion that most controls are UI elements is correct and valid. There are a couple of "buts" though:

1. There is definitely a trend into making controls more than that -- look at the "login" control in Whidbey, for example. For all I can see, it's a little self-contained application.

2. Being a UI element doesn't mean that controls have to emit the actual markup. That is why I am advocating a layer of abstraction -- to provide capability to translate UI into whatever flavor of markup (even XAML, perhaps?) is required.

3. The mentioned above layer of abstraction has to work both ways -- in fact, it should be the purpose of translating results back and forth. The control doesn't need to worry about whether this was a POST request, a GET request, or an asynchronous WS callback of some sort. The control doesn't need to worry about how it would be rendered. All it has to do is to advertise to the rendering layer that it will take a one-line input of plain text titled "Login", a one-line masked input of plain text titled "Password", and a "Login" button. The control performs validation and reaction to the input. The rendering layer makes it look "pretty". I am simplifying, of course.

I realize that what I am proposing is veering off from the current concept of a Web control, but hey, that's what this communication thing is for -- thought generation :)

As far as performance is concerned, I understand your point. Balancing functionality and performance is a tough act. I do believe, however, that there are ways to minimize impact of an abstraction layer on overall application performance. You guys wrote a book on this stuff :)
# August 6, 2004 9:18 AM

Bertrand Le Roy said:

Brant:

HTML is much more than RTF because of two things: Javascript and the posting mechanism. Yes, its semantics are those of a document markup language (it comes from SGML after all), because the people who conceived it couldn't foresee the importance the web would have today. But it has been improved and is today something you just can't avoid.

Of course, Windows Forms, XUL and XAML (and others) are more suited to interactive applications than HTML is. And if you have a choice, most applications should be written using a smart client technology. But you rarely have this option, even though the deployment problems are more or less solved. So there is a strong need for technologies like ASP.NET and there will still be for some more time. Of course you won't develop Excel in ASP.NET, but you can and you have to develop applications such as Outlook Web Access, which is very close to the desktop application. If only because when I'm away from my office, I still need a way to consult my mail from any computer I may find. And the only reasonable way you can develop this kind of rich application for the web is by adding a level of abstraction like what ASP.NET provides with WebControls.

I wish we all lived in a world where you don't need to develop for HTML but can always use something richer, but this is not the world we're living in. It's great to develop better rich client technologies. I see you contributed to Mozilla and XUL, this is great, but don't fall into this trap: you don't have a universal answer that applies to everything (by the way, the subtitle of my blog is highly sarcastic: ASP.NET is no universal answer).

By the way, which ASP.NET Tree control are you talking about? There are many such controls. The one we're shipping with Whidbey (and the only one we're supporting) DOES support Gecko browsers. It even does out-of-band node population without posting the whole page thanks to the excellent implementation of XmlHttp that Gecko has.

I'm a little confused also when you talk about "pixel perfect" layout. In my mind, pixel-perfect is more needed in printable document formats such as PDF, but certainly not in applications. Accessibility constraints, for example, are one reason why your UI framework should be able to gracefully adapt to very big fonts. There goes pixel-perfect layout.
Actually, all recent UI frameworks allow for dynamic resizing and positioning of the elements according to some general and relative layout.
And of course, HTML has always allowed for this by default, which makes it notoriously unprintable, but highly adaptable.

Dimitri:
I think I agree with you on the whole principle, and I think we're trying to get there, but we have to integrate our own constraints (which are huge because of our enormous developer audience). We make tradeoffs every day, we have to.
But if you read this recent article: http://www.theserverside.net/articles/showarticle.tss?id=AssemblyVersioning you can probably spot a few hints about what transformations there will be in the structure of ASP.NET in v.Next.

About the login example, yes, there is some functionality in the control, but it's still just managing the interaction of the user with the underlying authentication layer. I see what you mean, though, and it's an interesting idea.
I think we're already addressing most of this concern, though.
For example, templating is one way you can take the relevant part of the rendering to the page (or user control).
Adapters are also another way you can do that.
Themes are also very powerful (though not many people realised how much).

The main thing is that the additional layer is completely optional. The default basic scenario stays performant because it does not have these additional layers. We're trying to make the optional scenarios performant too, but there's no way they can ever be as fast as the default behavior. And believe me, we spend a lot of time on the optimization of this stuff (adapters were tough for that matter).
# August 6, 2004 2:35 PM

Bertrand Le Roy said:

By the way, I love it when the comments become larger than the original message. It proves that the subject was well chosen :)
# August 6, 2004 2:36 PM

TrackBack said:

I'm a fan of Nikhil's blog and this one is a great post. Read it!
# August 7, 2004 1:45 AM

Bertrand Le Roy said:

From Nikhil's post: "A key problem with adapters is exposing internal state of the control to the adapter. It is possible to expose some state, but the moment an external developer decides to write a new adapter, it is likely they will find they need some piece of internal state information that has not been exposed to them. The adapter model essentially creates a parallel inheritance hierarchy, which doesn't work all that great for extensibility in the long run."
# August 9, 2004 3:31 PM

Eric said:

I have several business layer components I have created that I don't want in the flow design but would like to have in the tray where the SQL Connection object and others go. The only way I have been able to accomplish this is to inherit from System.ComponentModel.Component - BUT, being that I am not inheriting from System.Web.UI.WebControl all my state management, etc is gone. I need to inherit from System.Web.UI.WebControl but still have the control be put in the tray or not be visible. I tried "marking" the control with the [NonVisualControl] attribute but it just says "The type or namespace name 'NonVisualControl' could not be found (are you missing a using directive or an assembly reference?)
"

Any suggestions? In case anyone is wondering...the control manages the routing of documents for approval.

Here is the start of one of my control declarations:

[NonVisualControl, DefaultProperty("Department"), ToolboxData("<{0}:ApprovalFlow runat=server></{0}:ApprovalFlow>"),]

public class ApprovalFlow: System.Web.UI.WebControls.WebControl
# August 10, 2004 2:16 PM

Bertrand Le Roy said:

NonVisualControlAttribute is new in ASP.NET v2.
The tray is gone too in v2. In v1, the designer would mess a lot more with your code, and would represent on the design surface objects that are really declared in the codebehind (in the infamous "do not touch" sections).
In v2, the designer only changes what is in the declarative part of the page (that is the markup), leaving what's in the codebehind entirely your business.
So in v2, your code will still run, but I don't think you'll see your components on the design surface. Except if you make them non-visual controls and put them in the markup. They will still be in the design flow, but you can hide them using "hide non visual controls".
# August 10, 2004 2:33 PM

Greg Holmes said:

MS seems to have a problem with this "hey, we're hip, we're listening; we have blogs!" thing. The individual developers seem to have pretty thin skin ;)

If you have a blog, a real blog, then discussion is going to ensue. In public. Much of it rough and tumble. That's kind of the point of tech blogs.

# August 17, 2004 2:41 PM

Bertrand Le Roy said:

Greg: not at all, the troll comments are very public, and I did not delete a single message. You just have to follow the link if you really want to read all that nonsense.
I just think that the immense majority of readers has other things to do than read troll posts. The trolling on this article was drowning the few relevant comments, and making the page unnecessarily heavy. I just took the irrelevant comments out of the page, but did NOT delete them. So it's still public, and you can very well post your comments there.
# August 17, 2004 2:46 PM

Jeff said:

I cranked this out in old fashioned ASCII text last month:

http://weblogs.asp.net/jeff/archive/2004/07/04/172683.aspx
# August 17, 2004 3:47 PM

mike said:

Here's a link to an entry that describes the effect of ValidateRequest:

http://www.mikepope.com/blog/DisplayBlog.aspx?permalink=441
# August 18, 2004 10:10 PM

Jerry Pisk said:

Well, it would all be lot easier if Microsoft would stop bowing to beginners and actually encourage secure coding. For example, Struts' form input or message server tags HTML encode their output by default and you have to turn it off if you want to, while ASP.NET's input, literal and other tags do not provide HTML encoding at all. If you want it you have to add server side code to call Server.HtmlEncode().
# August 18, 2004 11:42 PM

shartzog said:

trackback
# August 19, 2004 12:14 AM

TrackBack said:

learn about injection attacks!
# August 19, 2004 12:49 AM

TrackBack said:

# August 19, 2004 1:07 AM

George V. Reilly said:

"Writing Secure Code" has a lot to say about all of this, and should be a must-read book for all developers.
# August 19, 2004 2:54 AM

Mike Griggs said:

Great article, thanks.
# August 19, 2004 6:21 AM

TrackBack said:

# August 19, 2004 6:43 AM

Kyle Heon said:

There is a way that you can pass a string of comma-seperated values (numeric in the case of "Rule #4: Use parametrized queries whenever possible."). I have been using a user-defined functions (SQL2000) that I found from www.sqlteam.com years ago.

It can now be found here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsqlmag01/html/TreatYourself.asp

This is a very powerful function because it has allowed me to continue disabling read/write access the user and only granting execute rights to the stored procedures.
# August 19, 2004 7:21 AM

Brant Gurganus said:

I was at a job last year as an intern and I seemed to be the only one that cared about these things. My coworkers claimed that average joe user wouldn't do these things. I tried to argue that it isn't average joe user you need to worry about.

Besides the obvious means of input such as input controls, make sure URL parameters are cleaned as well as cookie data and hidden form fields. Average joe wouldn't change those things, but somebody with knowhow and malicious intent would. In the case of URL parameters, some browsers such as Mozilla allow you to create keyword-invoked bookmarks that replace the a '%s' in the bookmark URL with the text after the keyword when typed in the URL bar.
# August 19, 2004 9:18 AM

g said:

I tried to used the

Response.Redirect("~/default.aspx", false);

on a normal ASP page and get "Wrong number of arguments or invalid property assignment"

Is there a solution for the same problem in a non- .net environment?
# August 19, 2004 10:53 AM

John S. said:

Excellent write up.
# August 19, 2004 10:57 AM

Ron Buckton said:

I have some pointers for avoiding injection attacks in two common instances, 1) Passing arrays to SQL Server and 2) advanced search queries (e.g. avoiding WHERE clause concatenation) at:

http://blogs.chroniclesdesign.com/rbuckton/archive/2004/08/19/145.aspx
# August 19, 2004 11:48 AM

Bertrand Le Roy said:

Jerry, this is simply wrong. If you had just tried this: <asp:textbox runat=server Text="<script>alert('blah');</script>"/>, this is the rendered html you would have got: <input name="ctl00" type="text" value="&lt;script>alert('blah');&lt;/script>" />
We do not encode literal controls because they are... literal.
# August 19, 2004 2:03 PM

Bertrand Le Roy said:

g: This version of Redirect only exists in ASP.NET, not in classic ASP. There is no such thing as an exception in classic ASP, so you actually don't have this problem at all as far as I know, so no need to solve it ;) But I may be wrong. It's been such a long time since I've done any classic ASP at all.
# August 19, 2004 2:13 PM

TrackBack said:

# August 19, 2004 2:46 PM

TrackBack said:

# August 19, 2004 2:48 PM

TrackBack said:

blog.jasonnussbaum.com :: Flash, Programming, and Everything
# August 19, 2004 2:53 PM

TrackBack said:

Bertrand Le Roy has an excellent introduction to injection attacks. If you're doing web development and don't know what an injection attack is or how to prevent them, you have got to read this....
# August 19, 2004 6:24 PM

mike said:

Jerry Pisk, you seem to be contradicting yourself, if I understand correctly. On the one hand you say "stop bowing to beginners and encourage secure coding" and on the other hand you say "Struts ... encode their output." I interpret this to mean that Struts doesn't encourage secure coding either -- it's all just done automatically. (?) As Bertrand notes later, asp:textbox does encode, although the more secure option (on by default) is to reject potentially bad input in the first place. Precisely because so few people understand the need (or techniques) for encoding -- see other comments -- the default behavior of ASP.NET is to enforce security for you.

FWIW, auto encoding for controls like asp:label breaks the otherwise legitimate ability to included formatted markup as the Text property for that control. Ditto Literal, of course.
# August 19, 2004 10:26 PM

John D said:

Wow, some of us don't have the luxury of arguing all day long about an internet article. I will take whatever someone gives me in the way of business. I do PHP at work, I do ASP.NET at home, the new job I'm applying for *might* go to JSP, and I use Classic ASP for the Portland Access User's Group (www.PAUG.com). Am I going to convince someone to change? I doubt it. I'm a lowsy salesman. And I can't hold my own when it comes to was/wasnot rattatattat. What I got out of this whole blog (and it is a lot, mind you) was the need to go back and study typing so I too can type fast.
# August 20, 2004 12:58 PM

TrackBack said:

# August 20, 2004 11:10 PM

TrackBack said:

# August 22, 2004 1:17 PM

TrackBack said:

Matt Berther
# August 23, 2004 3:31 PM

JP.Boomtown | spIder said:

Thanks for the article!
# August 26, 2004 2:30 AM

Mike Griggs said:

C# starts to look more and more like C++/STL with every passing day...
# August 31, 2004 5:29 PM

Wesner Moise said:

For more concisely is to use the following iterator method

IEnumerable<T> FilteredEnumerable<T>(IEnumerable<T> en, Predicate<T> pred)
{
foreach(T t in en)
if ( pred(t) )
yield return t;
}

# August 31, 2004 5:36 PM

TrackBack said:

# September 1, 2004 1:35 AM

TrackBack said:

# September 1, 2004 1:36 AM

TrackBack said:

# September 1, 2004 2:52 AM

TrackBack said:

# September 1, 2004 2:54 AM

TrackBack said:

Great post about iterators.
# September 1, 2004 8:07 PM

Accessibility said:

I don't know if this will ever be read, but...

Bertrand, I don't think you, or anyone at Microsoft, for that matter, understands that HTML is just a structural markup, and does not - in fact, *MUST* not have ANYTHING to do with how the data is displayed.

In general, HTML must be written such that Netscape 1.0 (the one from 1994. or so) displays it properly, fully and completely, as well as IE6 (which should be dead) and Opera 7.x, Safari, something based on the Gecko engine, _plus_ Lynx and Links.

There are people who have disabled JavaScript. They can't do much on ASP.NET pages. There are also vision-impaired and blind people, and the story is the same because ASP.NET are mostly random tag soup, instead of a structured and valid HTML document...

The purpose of adapters should not be to fall-back functionally to older and different browsers, but to ENHANCE the *APPEARANCE* for newer ones.

There's no excuse AT ALL to do XMLHTTP requests to populate tree nodes in a tree control. None whatsoever! Someone who loads a page for offline use will get screwed by this, and will get screwed royally. The ONLY proper thing is to create a good old structure of nested unnumbered lists COMPLETELY and have JavaScript-enabled visual browsers take care of node expanding/collapsing.
# September 2, 2004 5:18 AM

Bertrand Le Roy said:

Dear anonymous strict guy,

Thank you for assuming everyone at Microsoft is an idiot. What you say is more or less true of HTML + CSS, which not all browsers understand, but absolutely false for pure HTML. Take the <b> tag, for example. Why is it in every version of HTML including XHTML? It's not structural, it just means bold text, which is pure form. And it's not as if you couldn't do a span with a class that has bold font-weight. So why is it still there? Just because there are the extremists who think everyone should work the way they have decided is the right way, and there are the pragmatic people who think some freedom is better than any dogma, however "perfect" it may be.

It is absolutely correct to assume that a web site should be browsable with Lynx and when Javascript is disabled, as well as by people with disabilities. You can build such pages with ASP.NET 1.1 (which does not mean that everyone does it, most people don't bother). Now, with ASP.NET 2.0, out of the box, you'll get XHTML compliant code and accessibility by default.
And when you build a web site, having ways to achieve everything without javascript does not mean you have to force this on everyone and not have quicker ways to achieve the same things when javascript is enabled.

The purpose of adapters is to adapt the markup for _marginal_ situations. The default behavior should go to the most common situations. This is so obvious I'm appalled by your statement.

Now about XMLHTTP. First, you seem to forget that the web is not just a collection of documents. There are applications out there, for which offline use is simply meaningless. By the way, offline browsing is a very very marginal thing and will become even more so.
Now, take a site like MSDN. Hundreds of thousands of articles. Would you really like the treeview to preload all the nodes so that you can browse it offline or with a text browser? This is completely unrealistic as your page would take forever to download. The right approach is of course to adapt to a link list that can take you to the next level and that enables you to navigate back up one level (à la Mac Finder as opposed to the Windows explorer tree).
And there are of course all kinds of applications that need treeviews that are filled as nodes are open. Posting back the whole page is a waste of bandwidth, that's why the XMLHTTP mechanism is there. By the way, this is not the default behavior of our TreeView.
Actually, this is quite funny as this is one of the features that gets the most positive feedback from the community.

You know, I also get feedback all the time from people who have decided there is one and only one way to write a web page. They will tell you for example that menus should only be written using CSS and no javascript. CSS menus are great technical achievements, but they can't be keyboard accessible, for example. Ours is.
Accessibility is an absolute requirement for ASP.NET 2.0 and you can rest assured that all of our controls will be accessible by default, including TreeView and Menu.
# September 2, 2004 2:09 PM

Robin Debreuil said:

Hey Bertrand,

Thanks for the 'way too kind' review. I must say that I wasn't able to accurately describe my feelings toward the whole exercise, but "impressively time consuming" is exactly perfect. In fact that is the one phrase that describes pretty much everything I've been passionate about in my life -- and I always thought these things were unrealted. That would certainly have to be the major text in any bioctal proficiency diploma. Oh, and it would make a hell of a blog sub title!

That is a great idea on the balanced ternary bioctal numbers, it really opens up a lot of possibilities. I've been experimenting with a system where bits are like charges (+/-). There are two digits, making four states +1, -1, 0 (neither), and an impossible set of both (which always destroys itself leaving 0). In certain ways Zero makes more sense not being a digit, at least it always seems a bit awkward the way its used now. With 'charges', negative and positive numbers are written the same, just they use different 'digits' (eg Int32 and Int64 represent negatives the same way, no confusion between -1 and 0xFFFF, etc..). Adding a positive to a negative can result in a 'mixed' number after the cancellations (a number with both +1 and -1 digits), but the normalizing is pleasantly simple. It also gives bool states of (something like) True (1), False (-1), NotTested (0), and Impossible(+-). Hmm, I can never describe these things in words, esp when having my end of day wine. I'm doing some animations I'll post...

Anyway, after reading your idea about ternary bioctal numbers, I've been trying tonight to get the above system into positive and negative larger numbers. It becomes pretty interesting, this really makes you ask a lot of totally basic questions about the nature of the numbers. Using two colors works for writing, but obviously there would need to be a logical way to represent positives vs negatives without color, and also zero and (+-)... What do you think would be a the right base for a system that goes naturally above and below zero (like ternary also does)? Would it be -8 to +8, or -16 to +16? I really like the symmetry of 4^4 (and 3^3 in ternary), just not sure if that should be half on each side of zero, or a full negative mirrored copy..

Anyway, I think that last glass of wine has rinsed out the day's caffeine, so time to sleep. Btw, your blog has been the first good and deep overview of Whidbey I've read -- looks like it really will be something else, cool even : ). Thanks for that too...

Salut,
Robin

PS Do you really think the solar system would be that much more boring without my anus? Creepy.
# September 4, 2004 6:02 AM

Bertrand Le Roy said:

Well, Robin, not my idea, it came from a comment on your blog. After that, it was just adding nevi and minus nevi.
Actually, I might give you a few hints that you may find useful or not, dating back from my thesis work, which was about graded algebras, with a focus on ternary algebras. Perhaps you know of Grassmann algebras, which are non-commutitive Z2-graded algebras, for example. Here, it looks like you're building a graded algebra but can't find the right grading group. See the sign as the grade, and the grading group is then Z2. Now, zero does not belong in the grading group, but in the algebra (otherwise, your grading group is no longer a group because it has no neutral element). What's the grade/sign of zero? You decide (the folks who designed the way signed integers are coded in binary decided it was positive).
Seems like you have some more useless thinking to do.
By the way, did you consider publishing your stuff in a scientific paper, something not too academic like Scientific American? It would be great fun to see this in a mainstream journal.

Do you realize that thanks to you, when you type "Microsoft butthole anus" in Google, chances are you'll end up on my blog? Thanks a lot, really.
# September 7, 2004 2:53 PM

Robin Debreuil said:

Hey Bertrand,

Thanks for the pointers to Grassmann algebras, that looks like totally fascinating stuff. Yes huge amounts of useless reading ahead, happy to say. Still it will pale in comparison to the massive amounts of time you must have consumed doing a thesis on the subject. I can only stand in awe.

I would love to publish something in a magazine like Scientific American, even a letter, but it's always seemed so out of reach. Recently though, I've become more hopeful... I'm not trying to brag here, but I've been offered pretty generous funding for my next article. It titled, "New Numeric Writing System Disproves Global Warming". Of course the required travel and research will soak up most of that, but it is still a small step towards the dream...

Btw, sounds like you could make some serious coin with google ads ; ).

Cheers,
Robin

PS - Completely unrelated, but with ASP.NET I've recently found a few servers I admin have backups of config files, called web.config.old or something. Being that these were generally artifacts left over from early testing, they sometimes contained unencrypted passwords, or db access stuff. The problem of course is they could be downloaded from the net. Obviously that is a user error, but maybe it would be a good idea to block files with the pattern ".config" (appearing anywhere) by default? Just a thought..

# September 8, 2004 2:14 AM

Bertrand Le Roy said:

Just try it. If you've got good material like your stuff, it's probably easier than it seems.

About the old config file, use the web.old.config name instead of web.config.old. That will take care of it as the .config extension is never served.

I'll think about the Google ads, thanks for the tip.
# September 8, 2004 1:27 PM

www.atomic9.net said:

It would be nice if a standards group (or Microsoft-based equivalent) created a standard regex library of whitelist/blacklist patterns to handle input. That would make a great first-layer of defense against SQL injection attacks.
# September 9, 2004 10:57 AM

Bertrand Le Roy said:

Not sure why you think this should be a standard, but you can find a lot of such regular expressions on sites such as regexplib.com.
The problem is that there would be about as many expressions as there are use cases. If you try to do something too universal, there is a serious risk to have too many false positives and to block legitimate data. The white list is often very context sensitive. I've showed an example on integer fields, which is one of the simplest cases, but it can get a lot more complicated than that.
The point is that to fight against SQL injections, the best you can do is always use parametrized queries. This way, you never even need white lists.
The cases where you can't use parametrized queries are very few.
# September 9, 2004 2:16 PM

mike said:

We still need the opposite, the late, lamented DataSetDataSource that turns XML data into relational data. :-( Bind a GridView to an XML file? No problem!
# September 11, 2004 5:36 PM

TrackBack said:

Bernard discusses a new Whidbey data source control that he's developed that allows you to use relational data hierarchically. This is pretty cool; it allows you to use the logically hierarchical structure of a relational database in hierarchical contr ...
# September 12, 2004 2:24 AM

Jack said:

Because it is usefull
# September 16, 2004 2:11 PM

Keith said:

Well said! Well said! I particularly HATE the F Lock key!
# September 16, 2004 2:11 PM

Kevin said:

WOW I am having the exact same problem with 'PrintScrn'

WHY MS WHY
# September 16, 2004 2:12 PM

Bertrand Le Roy said:

Jack: I'm really genuinely interested. What is the Num Lock key useful for?
# September 16, 2004 2:17 PM

Matt Hawley said:

I hate it too, but its useful for users who don't know the shortcut keys Ctrl + P is print.
# September 16, 2004 2:18 PM

Eric Newton said:

my issue is why doesnt Print Screen actually PRINT THE SCREEN...

I dont see a key on my keyboard that says COPY SCREEN TO CLIPBOARD SO YOU HAVE TO PASTE IN PAINT THEN YOU CAN PRINT SCREEN key...

I dont even think they could fit all that onto a half inch square key...

Die, F Lock!
# September 16, 2004 2:54 PM

Matthew W. Jackson said:

What's with the new delete key, too? Why can't you get a normal keyboard anymore?
# September 16, 2004 2:57 PM

Shane Courtrille said:

Death to the F key. My keyboard has this and I hate it with a passion. If it wasn't off by default I would hate it a little less but the hate would still be there... Anyone know of a good non-MS natural keyboard?
# September 16, 2004 3:05 PM

James said:

I strongly dislike the way that many keyboards do not have the same placement of important keys, such as the backslash, which can either be placed above or below the return key, or the delete and insert keys which can either be placed above the cursor keys or at the top-right-hand corner of the keyboard on many laptops... At least use the same general layout!

On laptops, the NumLock key is important because they don't have number pads, so it allows you to use certain keys on the main keyboard as a number pad... but because of the way many laptop keyboards are laid out, this is not always useful either.

James.
# September 16, 2004 3:16 PM

John Drake said:

Keys I have never seen any use for are the Scroll Lock key and the Pause / Break key.

Has anyone ever had anything useful happen by pressing those keys?

Anyhow, this is about the NumLock key. I use it. Most times it is turned off, because I tend to use the keypad for navigation. I will occaisonaly turn it on if I need to do extended number entry.

John
# September 16, 2004 3:19 PM

Bertrand Le Roy said:

James: of course it's useful on laptops, and should be kept on these devices, but on ordinary large keyboards that have a real numeric pad, it's totally useless. By the way, Num Lock on a laptop does not have the exact same meaning as the numeric pad is not separated and thus the keys it replaces are not the same.
In other words, Num Lock on desktop duplicates keys that we already have (and is off by default, although Windows now retains its state on reboots) whereas on laptops, it replaces other unique keys.
# September 16, 2004 3:20 PM

Bertrand Le Roy said:

John: I think this is really interesting. I'd like to understand why you use the numeric pad for navigation instead of the dedicated arrow keys just next to it?
# September 16, 2004 3:23 PM

Frans Bouma said:

The only key I really hated (that's past tense indeed) was the caps lock key. I used a keyboard remapper tool to map it to cntrl :) I'm not sure but perhaps you can remap numlock as well :)
# September 16, 2004 3:31 PM

petal said:

you think that's annoying? try working regularly with a keyboard that doesn't have a keypad (instead uses the mjkluio789 keys for 0123456789 respectively), and which supports multiple servers - switching between screens using a KVM switch can often leave you wondering why the hell your account is getting locked out when you *know* you've got the password right - all because the numlock status varies from server to server! I fail to see why this needs to happen when there is a perfectly serviceable numeric row at the top of the keyboard. Thank god for registry settings.
# September 16, 2004 3:32 PM

anonymous said:

Scroll Lock can be used in Excel. Try it and arrow around on the spreadsheet :)
# September 16, 2004 3:36 PM

Anonymous Coward said:

I use the numeric keypad for number entry and for navigation, frobbing NumLock as required.

I do this because I've been doing it for the last twenty years, because it works for me, and because I have better things to do with my time than retrain my brain to use this week's arrow-key-location fad.
# September 16, 2004 3:37 PM

Bertrand Le Roy said:

Anonymous coward: that kind of makes sense, but you must be really as pissed as I am about F Lock, then. And about the new layout of keyboards as a whole.
At the same time, I've used computers for about 25 years and I've seen so many different keyboard layouts during that time that I really don't think the old IBM keyboard layout is deeply imprinted into my brain to the point where it would take me a substantial amount of time to change my habits.
I'm sure you can still buy keyboards with the old layout, which would make it reasonable to forget about the errors of the past and have truly good keyboards that don't put themselves in unusable states all the time.
# September 16, 2004 3:42 PM

Jerry Pisk said:

If you use the numeric pad for one feature and only occasionaly switch to the other you can just use the Shift key (i.e. if your Numlock is off then num keys with Shift will type in numbers).

You can use the Pause/Break key to pause some games and if you hold down the Win key and hit Pause/Break you will get System Properties (which I use to start Device Manager when I need it).
# September 16, 2004 3:44 PM

tuthils said:

John, I use the pause and break buttons quite fequently within command prompts. Ctrl-Break is still used in ping to display statistics without actually halting the process and it also responds to pause, though I'm not sure there is a whole ton of use for that.

In any case, I whole-heartedly support the anti-F-lock key movement and if I could just get it turned off by default, the f@#$ing thing could be ripped from my keyboard and placed on my monitor as another decoration. Not once in the 6 months I've had the keyboard has that key been useful, and it is a real pain toggling F-Lock to use PrintScn then having to switch F-Lock back as I'm more accustomed to Shift+Ins for paste than Ctrl+v (holdover from my QuickBasic days). Granted, I can use both but my hands just naturally go for shift+ins when I go to paste.

Coming from the world of the Commodore 64, it took me a long time to get used to the fact that to go left with your cursor you did not have to hold shift and hit right. Brains can be retrained for new keyboard layouts but it's a bugger during the retraining phase.

My $0.02 USD.
# September 16, 2004 4:00 PM

Patrick said:

I got a new Microsoft wireless keyboard, and it's great except that HORRIBLE F-Lock key. As a programmer, this is the most annoying hardware device I've ever seen. Every reboot, I have to remember to turn this thing back on so that I can use my F-keys like I'm used to in Visual Studio.Net.

Horrible idea.
# September 16, 2004 4:34 PM

Florian said:

Absolutely agree !!! Moreover, it's impossible to unlock F keys on starting even with the keyboard driver (Natural Multimedia keyboard). Otherwise, i'm lucky my numpad is always unlocked :).
# September 16, 2004 4:55 PM

Alex said:

the F-lock key really pisses me off.

it wouldn't be so bad if the default operation enables the function keys!!!

who was the genius that decided the function keys should be subbordinated to the "new" keys. now people who actually learned all _original_ shortcuts have to remember to press the F-key before they start any work. pretty dumb.

ok so now you've pressed the F-key and all your shortcuts work. you can Alt-F4 with impunity

hmm, i need to get to the System properties really quickly. no prob, just hit Winkey + Brk key.

uh oh! someone skimped on a button. gotta turn of the F-key before that shortcut works.

lame!
# September 16, 2004 5:26 PM

Ben Constable said:

I learnt how to type on an Amstrad keyboard that had no directional keys, and I had to joystick. So I learnt how to use directional keys on the numeric keyboard. If I want numbers I type them using the number keys.

I agree about F lock though. I keep meaning to search for a way to permanently leave it on.
# September 16, 2004 5:33 PM

Edward said:

It'd be nice if the Numlock status could be based on which usb-based keyboard you have attached. On my tablet PC having numlock on with the detachable keyboard remaps part of the alphabet, so I can't type my password in, but when it is attached to the docking station I use a full size keyboard with a numeric keypad and I like numlock to be on all the time since I use it to enter IP addresses etc.

Basically I want numlock ON when I have a numeric keypad available and OFF when I don't.

The only thing I use the Break key for is when running VB6 programs through the IDE. Pressing CTRL-BREAK causes it to break straight away.

I have an optical desktop elite so I have the dreaded F-Lock key. It truely is useless and annoying, it wouldn't be so bad if it could be controlled through software like num-lock, but since it is not a real key and merely a hardware setting you always have to remember to turn it off every time you start up the computer.
I've never used scroll-lock for anything, except now it is the same key as break I keep pressing it when I don't know if F-Lock is on or not.
# September 16, 2004 5:45 PM

Geoff Appleby said:

I definately hate the flock key, but love my ms natural keyboard. I don't mind how the home/end keys etc were rearranged (took me a long while to get used to tho).

The first thing i did when when i got a keyboard with the flock was to go here and download the inverter:
http://www.mvps.org/jtsang/flock.html

It reverses the keystates, so that with flock OFF it's F1, and flock ON it's help, etc.

However, this is a permanent change, and if you plug in a keyboard that doesn't have flock, then your fkeys won't work (they'll send the otehr keys).

Hope this helps some of you, because it sure helps me :)
# September 16, 2004 7:01 PM

Bertrand Le Roy said:

Thank you, Geoff, and thank you Jason Tsang! This is great!
# September 16, 2004 7:03 PM

Barry Dorrans said:

Ah numlock. What a pain on notebooks, when Windows decides that it's a good idea to have numlock on after boot. When you don't notice. And get locked out of your account because you have a letter in your password that corresponds to the numeric keypad embedded in your laptop keyboard.

Note that you can fix this, with a registry edit

If you go to HKEY_USERS\.DEFAULT\Control Panel\Keyboard the flags in IntialKeyboardIndicators control the intial state of num lock, caps lock and scroll lock after boot.

0 - All off
1 - Caps Lock on
2 - Num Lock on
3 - Caps Lock on and Num Lock on
4 - Scroll Lock on
5 - Caps Lock on and Scroll Lock on
6 - Num Lock on and Scroll Lock on
7 - Caps Lock on, Num Lock on, and Scroll Lock on
# September 16, 2004 7:47 PM

TrackBack said:

The dreaded FLock key.
# September 16, 2004 10:32 PM

Jeff Parker said:

DEATH TO THE FLOCK KEY Just to chime in, god I hate that thanks though to the links to keep them permanently off.

No one has seemed to mention my other absolute hate The one I hate so much anytime I see a keyboard with it I take it apart and inject silicon in between the contacts under the rubber mat. A Shut down key. Seen these stupid things a key on your keyboard you press and your computer starts shutting down right away. After the 3rd time I lost a crap load of work by accidentally hitting the shut down key is when I started using silicon to completely disable that key permanently. I mean do people really need a shut down to be a simple keypress they can't click Start and shutdown, what it takes too much time?
# September 17, 2004 8:49 AM

Bertrand Le Roy said:

What all of this feedback seems to indicate (other than the universal hate for the F Lock key) is that we need a harware or software switch to permanently set the state of some of the keys (namely, F Lock, Num Lock and shut down/sleep).

Oh, by the way, who hates sticky keys too?
# September 17, 2004 1:36 PM

Roland Weigelt said:

I could live very well with a keyboard without the arrow keys and the other keys between main part of the keyboard and the number pad ;-) I prefer navigation on the number pad; when I rest my middle finger on the "5" key, I can reach all the keys I need by moving only my fingers.
If I use the arrow keys and the 6 keys above, I have to move the whole hand, which is much less efficient when editing text (or am I just using the keys the wrong way?) And when using the numeric keypad, I can use more fingers of my right hand (e.g. thumb, small finger). Also, I have a couple of macros for expanding/collapsing regions assigned to the numeric + and - keys.
I must admit that I never use the number pad for actually entering numbers. Maybe it's because I rarely need to enter numbers, or maybe because the key layout is different from that of a phone.
# September 17, 2004 5:54 PM

tuthils said:

Sticky keys just today caused me plenty of heartache and grief as I struggled to find out why as I was unlocking my computer my password would not work, knowing Caps Lock was not the culprit (tried it both ways)!

Since I'm complaining on about the accessibility features: I really dislike having holding Shift both disable AutoPlay for inserted CDs and to enable FilterKeys. Maybe I just let up too early or maybe I'm naive and Shift isn't the key you're supposed to hold at all to prevent AutoPlay but for me every time I've tried holding Shift to disable AutoPlay, the filterkeys screen comes up and the CD is run anyway.

I am not against the accessibility options at all, I know there are people out there with legitimate uses and I personally rely on MouseKeys when I'm in our data center at the KVM console as for some reason the mouse isn't responding anymore.

I guess I just have never looked close enough, I just found out those shortcuts (pressing shift 8 times for StickyKeys and holding shift for 5 seconds for FilterKeys) can be disabled! In any case, I'm still no fan of StickyKeys :-)

Back to the F-Lock key, I'm a software guy, not hardware so please forgive the simplicity of this question but would it be possible to just run to the local Radio Shack, pick up a tiny toggle switch, and somehow solder it into the F-Lock key (well, its contacts) and kind of... force... it's state one way or another? I'm sure that voids any warranty but I'm willing to forgo that warranty for the option of not having F-Lock on anymore.

Maybe someone in Microsoft's product design labs will see this great dislike of that key and produce an F-Lock free keyboard. I love the idea of the reverse mapping, but being on a laptop, I have to have my F keys away from the docking station as well :(

The rest of my keyboard is great and it's amazing how often I've used the Calculator key as opposed to hitting Win+R, type calc and hit enter. (Not a huge mouse fan either)

It's great to see so many people share my feelings on the F-Lock key though :)
# September 17, 2004 6:19 PM

jinath said:

good info
# September 18, 2004 1:10 AM

lowercase josh said:

What web browsers don't support png? That is, among those used by more than four people worldwide on a daily basis?

And the number of colors is more important than just for palette size. It reduces the "alphabet" that exists in the image data, making compression more effective.

Dithered images *are* harder to compress. Ordered/pattern dithered images less so, but they'll still end up bigger than no dithering.

You should use interlacing on large gif or png images. Some people still connect at 56k, and sometimes your server gets overloaded. If your image is large enough to matter, the slight increase in file size won't matter, but you should probably consider using jpeg or css instead.
# September 18, 2004 4:27 AM

Hal said:

You might wanna talk to the paint.net guys so then this article could be a demonstration of MS technologies too. :)

http://www.eecs.wsu.edu/~cs423/423spring04/Team2/
# September 18, 2004 9:05 AM

Dimitri Glazkov said:

Excellent. We need something like this as an MSDN article. Will you take me as a co-author? :)

A couple of things I would add:

1) It takes practice and developing a good eye to get the dithering and color optimization right. Spend some time playing with your first images -- it will pay off later on.

2) Photoshop versions 7.0 and CS have some color optimization built-in -- they will attempt to automatically come up with the minimal number needed to render the image, but the algorithms are not very aggressive (which is a good thing), so for complex, photo-realistic color images, the optimization doesn't get very far. It does, however, work really well for the simple-pallette images.

3) In my experience, the only Dither algorithm that is really useful is "Diffusion" when used with gradients. "Pattern" looks horrible on pretty much anything Web-related and "Noise" usually looks worse than "Diffusion" and adds a lot of weight to the file size. Like Bertrand said, there's rarely a reason to monkey with Dither quantity -- just leave it always on 100%.

4) If you are doing graphics, ask your boss to let you have both LCD and CRT monitors on your desk. It also helps to have more than one of each to check on (see my workplace for a slightly exaggerated example: http://glazkov.com/blog/archive/2004/06/19/195.aspx). Colors, especially slight variations, typically look more pronounced on an LCD panel.
# September 18, 2004 9:13 PM

Bertrand Le Roy said:

Josh: you're right, most browsers that are used today understand PNG. But for us, "most" is just not enough, we need all. But for your day to day web design needs, you're right, PNG can now be used pretty safely (and it has the advantage of not being restricted by patents). I agree 100% with your other comments, in particular on the fact that if your image is large, you should consider JPG.

Hal: Paint.NET is not really MS technology, it's a student project. It's pretty nice (i use it too sometimes) but still has a long way to go to compete against Photoshop. Then again, it's free, which is a really nice feature.
The MS imaging product is Digital Image Suite, which has amazing features, but is not targeted at professionals. It is more oriented towards familial users. I use it at home to fix my photos.
Anyway, the reason I used Photoshop in my tutorial is that it is by far the imaging product that's the most used by professional web developers.

Dimitri: OK for the MSDN article. Send me mail so that we can arrange that.
# September 19, 2004 2:27 AM

Bertrand Le Roy said:

One thing I had not thought about and that could explain why I use the numeric pad so much, and why native english speakers don't is that on french keyboards, you have to use shift to access the numbers on the main part of the keyboard. It makes the numeric pad a necessity much more than on a qwerty keyboard.
I guess that makes the num lock key much more annoying for people who have learned to type on azerty and similar keyboards.
# September 20, 2004 1:59 AM

Rob Cannon said:

It's a great facility. The only problem is that I would like to see a solution that will also work for non ASP.NET project. Shouldn't this be something that can be harnessed by Visual Studio/MSBuild (or is it already)?
# September 22, 2004 9:28 AM

Robin Debreuil said:

I had a natural keyboard knock off once, it had all remapped arrow/home/etc keys -- and right beside the left ctrl key was the sleep button. No kidding. So I actually one day unplugged this and smashed it against the floor, repeatedly. In my hunt for a new natural keyboard (I was overseas and couldn't get an ms or logitec one) I found a second brand. It had all normal mappings it seemed, however when I checked for the 'sleep beside undo' problem I noticed, and this is no joke, I may still have a photo -- the power off key.

Obviously that keyboard designer has moved up in the world, and now we have FLock. The worst part of that is the logic probably went, "if we allow people to disable it, then everyone will and no one will get used to my wonderful feature". If it was for the sake of new users, I hope they convinced the software side to rewrite all the help docs that say "press F1 for Help", etc. Terminally stupid.


# September 22, 2004 11:23 PM

dimitri.glazkov@gmail.com (Dimitri Glazkov) said:

Ah, technology vs. human, the age-old battle.

How's that article coming? :)
# October 6, 2004 10:54 AM

BillT said:

I agree with Rob. (I still do more WinForms that ASP.NET apps with VS 1.1.)
I'm not sure how you'd do this. (a) Perhaps just an API call to initiate the necessary examination and processing of the (or any) directory. (b) Perhaps a project (shipped with VS) that would be added to a solution. This project would implement all the needed processing.
# October 8, 2004 4:44 AM

Paul Wilson said:

Love it -- thanks for the post.
# October 8, 2004 5:20 AM

Bored programmer said:

Wonderful explanation of a very difficult concept! Very good, my friend.
# October 8, 2004 10:41 AM

Bertrand Le Roy said:

It's a great question. Though I don't have a precise answer right now, this new feature of ASP.NET is just a build manager that you can easily configure.
ASP.NET is very different from Windows Forms in that it is a server environment that has to compile on-the-fly. I suppose that in a Windows Forms application, the need to do it on-the-fly is much less important. The same thing could be done at application launch. I suppose MSBuild could be used for that, but I don't think you need it. It should be enough to look at the config, scan any registered directory in there and launch the declared build providers if a recent enough dll does not already exist. Then load the dlls and... voilà.
Actually, this would make a beautiful project if someone wants to do it...
# October 8, 2004 1:18 PM

Robin Debreuil said:

I really enjoyed that. The fact that it was (or wasn't) my destiny to enjoy it doesn't diminish the pleasure either.

# October 9, 2004 6:57 AM

preppy said:

AllGreek and Latin to me!!!!
# October 18, 2004 9:37 AM

TrackBack said:

And it IS considerably more verbose, though quite elegant thanks to delegates. Thanks, Sebastien!
# October 18, 2004 6:57 PM

TrackBack said:

# October 21, 2004 8:09 PM

TrackBack said:

# October 21, 2004 9:34 PM

TrackBack said:

# October 27, 2004 12:23 AM

haacked@yahoo.com (haacked) said:

I'd make one counter argument to this, though I agree with you for the most part. I wouldn't be opposed to a web framework in which controls could access certain properties of the page.

Bat only through a known interface and if the control degrades gracefully if the Page class didn't support the interface.

For example (inside the control):

IFrameworkPage specialPage = Page as IFrameworkPage;
if(specialPage != null)
//... Access properties of the page specific to this framework
else
//... degrade gracefully
# November 17, 2004 11:11 PM

mike said:

One reason to expose properties on the page is if you want to access them after a Server.Transfer, or in Whidbey, after a cross-post. However, I forget whether those have to be public. Also, I suppose, a reason that people do that is to get access to control properties that are children of the page.
# November 18, 2004 1:12 AM

TrackBack said:

# November 18, 2004 3:02 AM

TrackBack said:

# November 18, 2004 3:03 AM

Bertrand Le Roy said:

These are good points.
Mike's point is especially true, though I personnally don't like cross-page posting: even though we made great improvements in ASP.NET 2.0 in this area, I still think that when you go to a different page, there shouldn't be a strong coupling between both pages. And with the current mechanism, the target page relies on the source page inheriting from a special class or containing special controls. It's strongly coupled. I personally dislike this architecture and prefer to use weaker coupling such as querystring parameters when it's possible.
Mike's second point, though, is precisely what I'm arguing against, if I understood correctly.
# November 18, 2004 1:49 PM

mike said:

You understand correctly -- my point was only that I believe that people sometimes use public page properties to expose control values. (Such an example appears in the docs, I see.) I just checked, and it seems you can use FindControl on the page B to get values out of A -- it still (kind of) breaks encapsulation, since it requires the target page to know the ID of the control to get, but at least it doesn't also require the container page (page A) to add a property to expose the control value(s).
# November 18, 2004 5:54 PM

TrackBack said:

Here are two more great blog entries about preventing SQL Injection Attacks....
# November 29, 2004 10:55 PM

TrackBack said:

# November 30, 2004 9:23 AM

TrackBack said:

# November 30, 2004 9:26 AM

AndrewSeven said:

42...Second time I've seen that today. 6x9?


Abstractions leak, they must, if they didn't leak, they wouldn't be abstractions, they would be reality.

Abstractions are a special form of obfuscation, they hide the details that are not relevant to the "goal at hand".


The universe just is.
All our perceptions, all of our formulas; those are the abstrations.


http://weblogs.asp.net/andrewseven/articles/QuoteMe.aspx
# December 2, 2004 11:04 PM

Jeff Atwood said:

ASP.NET is *ULTRA* leaky though. Dynamically generated webforms almost always force me to peek under the covers, no matter how hard I try to stay abstracted. In some ways, it's the worst of both worlds: to get my work done, I have to fully understand the abstraction layer and all the plumbing underneath.

I acknowledge that it's a very difficult problem and ASP.NET is still much nicer than the alternatives, warts and all. I'm sure 2.0 will be even better!
# December 3, 2004 12:08 AM

haacked@yahoo.com (haacked) said:

That abstraction is the universe itself.
# December 3, 2004 1:07 AM

TrackBack said:

# December 3, 2004 10:46 AM

Brian said:

uh.. it's 6 x 7 not 6 x 9 :)

for the people who are complaining about abstraction, well.. how bout this, i'll start coding my web app in ASP.NET, and you just use binary. Let's see who get's there first. if you can manage it, I'm willing to bet your's would be faster. But, it will take you years to accomplish what I can get done in a week.
# December 3, 2004 2:25 PM

Bertrand Le Roy said:

Well, in base 13, 6x9=42.
# December 3, 2004 4:01 PM

TrackBack said:

# December 7, 2004 8:44 PM

Adi Oltean said:

Black hole evaporation is a real effect. The speed of evaporation is directly related with the mass of the black hole. Very small black holes are dying very quickly. Larger black holes have a much larger evaporation time. In general, the speed of evaporation is proportional with the cube of the black hole mass.

Here are more details on this subject:
http://en.wikipedia.org/wiki/Black_hole_evaporation



# December 14, 2004 8:52 PM

Bertrand Le Roy said:

Sure it's a real effect, but it sure isn't yet a fully understood phenomenon as it lies at the frontiers of quantum mechanics and general relativity, which, to say the least, don't mix well.
Thanks for the link, which is very informative and should give a basic understanding of the phenomenon to those who don't know about it.
An important piece of data in this article is the time it takes a black hole to evaporate. Black holes formed from a collapsed star seem to have no chance of disappearing anytime soon, or anytime at all. Only primordial black holes (formed at the same time as the universe) could evaporate in a reasonable amount of time. Furthermore, the article says that the equilibirum size for a black hole (where it absorbs as much as it emits) would have the mass of the Moon. Again, primordial black hole only. Unfortunately, no one knows if small primordial black holes exist. We have some clues about large primordial black holes, but so far not small ones, as far as I know.
Anyway, my main point was what happens really to a particle that plunges into an evaporating black hole? Does it enter the horizon at all?
# December 15, 2004 1:45 PM

Adi Oltean said:

>>> Only primordial black holes (formed at the same time as the universe) could evaporate in a reasonable amount of time.

This is not known yet.... At least in theory, small black holes are continously forming and dying quickly all the time. All you need is enough energy to "compress" matter in a very small area. Given enough energy, this is possible. It is suspected that cosmic rays (that have extremely high energies, above hundreds of MeV) can create these black holes. Fortunately, these black holes are dissapearing as quickly as they are created so there is no danger there.

See this link for more details: http://www.newscientist.com/article.ns?id=dn4446

>> Anyway, my main point was what happens really to a particle that plunges into an evaporating black hole? Does it enter the horizon at all?

Of course. There is nothing special about this horizon, except that anything that goes there cannot come back.

This might look weird, but it is not completely weird to have movement only in one direction in the four dimensional space-time. Actually, in space-time, this is a natural property of the time dimension - things are only moving one way, from past to future. With space dimensions, things can move both ways except in the case of black holes, when they move only in one direction.

# December 16, 2004 3:52 AM

Sigurdur G. Gunnarsson said:

Hi,

This is something that has been troubling me for awhile. While most of this sounds right to me, there are some things that I don't like.
I use quite a lot of custom reference types, and some are mutable. I use them in collections and want to be able to sort them. I do that by implementing IComparable and the collection classes sort them via that interface.
Well, the rules state that if you implement IComparable you must implement Equals and the operators ==, !=, < and >.
Doing all that I end up with reference types that don't match up with the rules you state.

Am I missing something?
# December 16, 2004 5:41 AM

Bertrand Le Roy said:

Adi, thanks again for the feedback. I didn't know that mini-black-hole could form so easily, I thought stellar and primordial were the only kinds. I guess my physics are a little outdated (I quit the field ten years ago). But now that I've read the article, it sure makes sense.
Now, on the second point, of course I'm not discussing the possibility that a particle can theoretically enter a classical horizon. I used to know General Relativity quite well having worked in a Cosmology laboratory during my PhD thesis so this is quite clear to me, no mystery there. The particle enters the horizon in finite time, we just perceive that it takes infinitely long and it's ok because our region of space-time is causally diconnected from the inside of the horizon so there's no paradox. What I'm talking about here is very different.
When a black hole evaporates, from our reference frame, we see incoming particles taking infinitely long to cross the horizon. At the same time, we see the horizon recess and finally disappear. So a logical conclusion seems to be that from our reference frame, we still see the particle after the black hole has disappeared, and it never entered the horizon.
But there is only one objective reality even in Relativity, so the only conclusion seems to be that the particle never enters the horizon. From the reference frame of the particle, what must happen is that events seem to happen faster and faster, including the recession of the horizon and its disappearance in finite time.
I think no particle ever enters the horizon of an evaporating black hole. Which gives a different answer to the information paradox. That's my point.
I'm very ready to be proven wrong, I'd be more than happy to: I'd learn something new, and I just love that.
# December 16, 2004 1:51 PM

Bertrand Le Roy said:

Sigurdur, that's a very good question. For value types, well, they should really be immutable anyway, but for reference types that must be IComparable, in short, for the moment, I don't know exactly. I've asked the question to some CLR gurus and I'm waiting for an answer. Stay tuned.
What I can recommend for the moment is that you base your implementations of IComparable, Equals and GetHashCode on immutable properties if you can (even if the rest of the type is not immutable).
As a last resort solution, if you don't need to use these types as keys in a hash table (which is the main reason to use the hash), you could throw from GetHashCode.
# December 16, 2004 2:15 PM

Adi Oltean said:

Oh, I see now your original point. Interesting problem...

So, let me dumbify a little the experiment so I can understand it... :-). A source of light is launched from some point outside of the black hole. The source approaches the event horizon and enters into it. From an external point of view, photons will be continuously detected with lower and lower energies.

Now here comes BH evaporation. At some detectable point in future (around t1 in the reference frame of the observer) the black hole completely evaporates. At this point in time (or around it) the source of the signal simply stops from the observer point of view. For sure, something happened with that source of light due to the interaction with the black hole. But I think that the end result should be that the observer must have NO way to determine whether the source already entered or not into the event horizon.

Anyway, all these are simply speculations which might or might not make any sense given that I am not familiar with the mathematics around this theory. Probably the event horizon becomes "special" when the black hole is near to its end of life and close to quantum dimensions? This special "fuzzy" event horizon will look like it is triggering other physical interactions which might cause the destruction of the source of light due to the black hole. And these interactions must also give the same end result to the observer as in the case when the source actually entered into the black hole, and the BH died shortly after that.


# December 16, 2004 5:15 PM

Bertrand Le Roy said:

I disagree with this interpretation. From our reference frame, the very moment when the object crosses the horizon is infinitely distant in the future, even though from its own reference frame, what seems infinite to us is actually finite for it. It's not just photons being detected with lower energies.
If you compare the two events (the moment the black hole evaporates and the moment the particle should enter the horizon - if it still exists -), their succession is clear: one happens in finite time, not the other. Thus, it is clear that the object enters the horizon after the latter has disappeared if at all.
Any physically relevant coordinate transformation will maintain the order of these two events as they happen at the same place. So the horizon must recess before the particle enters it.
Your hypothesis that something "happened" to the object which results in it being inobservable after the black hole has collapsed does not seem to be backed by any necessity or evidence (I know, we're speculating here anyway). But I think my hypothesis is backed by the fact that it does not rely on any new or mysterious phenomenon - no deus ex machina - and is consistent as far as I can see. There is no problem with the object not seeing the horizon recess (no object can see the horizon itself anyway).
I think you're right in saying that the actual disappearance of the black hole is pure speculation as we don't know the pysics of this scale, but we don't need to wait for that moment. Even when the final moment of evaporation is still far in the future, I think we can see that the horizon recesses faster than the particle approaches it from the arguments above.
Except of course if I'm overlooking some phenomenon or if my understanding of the evaporation of black holes is too naïve to be of any use.
But I'm really curious to see the advice of specialists of the field.
# December 18, 2004 6:06 PM

Bertrand Le Roy said:

OK, so the gurus agree that IComparable should really only be applied to immutable objects. So if you implement it on mutable objects, you must be breaking something. What you're breaking depends on what requirement you sacrificed in your implementation of Equals and GetHashCode. The documentation may be updated in the future to reflect that.
One other thing you could do is provide a method that enables the locking of the objects before you use them as keys in a collection object where the hash and Equals must be in sync (for example Hashtable), but that is a half measure as the users of your class must know about this problem and agree to lock the objects before using them as keys. Throwing from GetHashCode if the object is not locked could help prevent the problem.
Now, doing that is not ideal as it kind of breaks the pattern whatever you do: GetHashCode is implemented in object and it's not supposed to throw.
So the advice is "don't" and expect unexpected consequences if you do.
# December 18, 2004 6:19 PM

Sigurdur G. Gunnarsson said:

Thank you, that clarifies things quite a bit. And yes it would help if the documentation stated that "IComparable should really only be applied to immutable objects".
# December 21, 2004 6:13 AM

TrackBack said:

# December 22, 2004 10:43 PM

SuperJason said:

I really hope ASP.NET 2.0 makes this easy AND reliable AND cross-browser compliant. That would really allow some online applications to shine.

Traditionally, I have tried to avoid this as much as possible.
# January 4, 2005 8:31 PM

Bertrand Le Roy said:

Absolutely: it's easy, reliable and cross-browser.
# January 4, 2005 8:35 PM

rick said:

It will be cross-browser? Surprising, but that just made my day.

For other non-ASP.Net environments that want this functionality, there is the excellent JSRS (Javascript Remote Scripting) library (http://www.ashleyit.com/rs/). I was using this several years ago with PHP. I'm very excited that this stuff is finally catching on.
# January 4, 2005 9:14 PM

Adi Oltean said:

>>> If you compare the two events (the moment the black hole evaporates and the moment the particle should enter the horizon - if it still exists -), their succession is clear: one happens in finite time, not the other. Thus, it is clear that the object enters the horizon after the latter has disappeared if at all.

Well, my assumption was that the dissapearance of a black hole is an observable event (as predicted by theory when the mass of a black hole is extremely small), In this case, we can safely assume that some objects entered into it shortly before that event...

... If there is such thing as a black hole with a finite lifetime from our reference frame.
# January 5, 2005 5:28 AM

Bertrand Le Roy said:

Sure it's observable. Actually, that's kind of my point. How does that make it safe to assume that some object entered it (other than virtual particles created from the vacuum in the immediate vicinity of the black hole, whose information content is doubtful at best)?
# January 5, 2005 1:43 PM

Bertrand Le Roy said:

Not so surprising :) . Actually, most of the new features in ASP.NET 2.0 are cross-browser (Menu, TreeView with callbacks, the callback API, validators -finally-, GridView, etc.).
Interesting that you mention JSRS. There have actually been a few such APIs, including one by Microsoft, back in the classic ASP days, which was called remote scripting and surprisingly enough used a Java applet to communicate with the server.
The good thing is that the technology seems to be mature now with all browsers supporting it, and we can expect it to become mainstream this year.
# January 5, 2005 1:51 PM

bwaldron said:

So it looks like the compiler made an optimization because it knew that you were always concating the same number of values in your statement. I guess the rule of thumb for using StringBuilder is use it when what you appending varies based on something at runtime.

Good post...
# January 7, 2005 6:04 PM

Aapo Laakkonen said:

The compiler should take care of switching to StringBuilder whenever neccessary. Users' should just concatenate with '+'. That's what Java compilers have almost always done. And it seems like .NET compilers do the same, sort of.
# January 7, 2005 6:57 PM

Bertrand Le Roy said:

bwaldron: yes, absolutely.
Aapo: yes, I know Java does this kind of optimization. The C# compiler, as can be seen here, does similar optimizations when it is 100% sure it's relevant. Note that it doesn't use StringBuilder, but something even more efficient, though.
I'm no specialist of the Java runtime, but I don't think it can reliably know in which case a StringBuilder should be used. It can guess (just as the .NET compilers does in this case), but I mean, in some cases, it would have to be really smart about the structure of the whole application to do this kind of optimization reliably.
What if you instantiate a string in a package and pass it as an argument to another method in some other package where it will be concatenated with something else repeatedly? How does the compiler know what to compile to, String or StringBuilder, in each case? Or does it do some kind of conversion on the fly?
Then again, I'm not a compiler expert, and this blog entry should be seen as that of an ordinary user of .NET who tries to see how to improve performance of his applications. I'm not judging the Java or .NET choices.
I'd be interested to read about what really happens in Java, but I suppose that the rule here is more or less the same: if you're concatenating a fixed number of strings, just use +, and the compiler will take care of the optimizations (Java or .NET). But in .NET, if you concatenate a non-predetermined number of strings, consider using a StringBuilder.
# January 7, 2005 8:01 PM

Bertrand Le Roy said:

Update to what I just said. It seems like the Java runtime or compiler does not always know when to use a stringbuilder instead of concatenation, so in Java, it's exactly the same as in .NET: you should know when to use which.
StringBuilder was actually only introduced in Java 5 (previously, you could use StringBuffer, which does not perform as well because it was thread-safe).
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/StringBuilder.html
http://www.javapractices.com/Topic4.cjp
# January 7, 2005 8:08 PM

Fabrice said:

One thing to know when using a StringBuilder is that it's good only when using Append(). If you try to use the Insert() method, you'll get really bad performances, because existing characters get shifted to make room for the new text.
# January 10, 2005 8:05 AM

TrackBack said:

Here are two more great blog entries about preventing SQL Injection Attacks....
# January 20, 2005 10:02 PM

Eddie Garmon said:

Instead of hard coding just add this to your class...

private static int _UnitMaxValue = (int)typeof(Unit).GetField("MaxValue", BindingFlags.NonPublic | BindingFlags.Static).GetValue(new Unit(0));

Its only evaluated once, and of if needed.

Eddie
# January 25, 2005 9:29 PM

Bertrand Le Roy said:

Eddie, that is an excellent point. Thanks!
# January 25, 2005 10:11 PM

Sean Gahan said:

Great Link!
My NerdyNess was a mere 89; I'm only a "High-Nerd."

Best Wishes,

Sean
# January 26, 2005 4:20 AM

Will said:

WTF? Did I just stumble into a LiveJournal blog? Are you a 14-year-old girl? "What X are you?" tests are a blight on the intarweb, only slightly less irritating than foot fetish sites and Fark's comments sections. Please, never EVER take another test again, and if you do, keep it to yourself. Thank you.
# January 26, 2005 8:45 AM

Bertrand Le Roy said:

Will, this is my blog, and if you don't like what you read here, you're very welcome not to read it.
By the way, how do you know that foot fetish sites are irritating?
# January 26, 2005 1:22 PM

Robin Debreuil said:

Will clearly has a foot fetish, but I suspect he failed the online test to get into the metatarsals video section. Don't sweat it Will, the calcaneus is way more erotic once you learn to appreciate the twin arches. Two words for you: 'toe socks'.

That being said, I'm just a 90, I knew I shouldn't have let the kids take that microscope apart. I don't know about that Friday night question though - 'bed at ten' was as close as I could get, though in reality I'm just under the blankets playing with my feet. Surely that is worth 3 extra marks?

# February 2, 2005 7:04 AM

EtIeNnE said:

Please note a small mistake here: in VB you CAN use += as a concatenation operator!
# February 22, 2005 3:26 PM

Doug Seven said:


This is a great post. Russ Nemhauser and I just covered this exact topic as one of our "small-but-useful" tips in a recent conference workshop on Performance and Scalability. Its little things like this that when multiplied by hundreds and thousands of users really add up to tangible performance gains.

I should add that when you are concatenating strings with variable values, you should use a StringBuilder to "accumulate" the string. Concatenating variable values with "+" or "& _" can add up to a perf hit because at the IL level this is still multiple values that are concatenated at run-time.
# February 22, 2005 4:58 PM

Bertrand Le Roy said:

Etienne: sure, you can. Most VB6 developers are used to the & syntax, though.

Doug: see this other post: http://blogs.msdn.com/bleroy/archive/2005/01/07/348831.aspx on concatenating with variable values. It's not the fact that you concatenate with variable values that really matter in the choice of a StringBuilder, it's really if the number of things you concatenate is variable: the compiler uses String.Concat(object[] a) when you concatenate a fixed number of objects, and that's significantly faster than StringBuilder.
# February 22, 2005 5:06 PM

Sushant Bhatia said:

I have a question on strings and how they are represented in IL. A while back I ran into this.

PROBLEM STATEMENT - Going through my project for work with the ILDASM tool was quite interesting. I noticed the following line:-

IL_000b: ldstr "There was a problem while trying to cancel authent" + "ication. Please inform the trainer."

Why is the IL split? My first though was that the string is being concatenated at runtime by the JIT. Then I looked up the ldstr on MSDN and found this quote:

The ldstr instruction pushes an object reference (type O) to a new string object representing the specific string literal stored in the metadata. The ldstr instruction allocates the requisite amount of memory and performs any format conversion required to convert the string literal from the form used in the file to the string format required at runtime.


So I scratch my head again and wonder why the sting was broken into two parts. First part exactly 50 characters long?

POSSIBLE IMPLICATIONS - Anytime you have a string that is more that 50 characters long, it will automatically be split when written in IL. Then during JIT, it will be concatenated. I also read somewhere that if you have 4 or more string concatenated, then you really should use the StringBuilder. Does this mean that any string 200 characters or above should be created using the StringBuilder?

What effect does this have on Resource Strings from your Resx files?
# February 22, 2005 6:10 PM

Bertrand Le Roy said:

First, the plus sign that you see in ILDASM is *NOT* anything real. I think it's just here to make it more readable. In reality, there's only one string. You can check by opening the exe file in a hex editor instead of with ILDASM.

Second, saying that concatenating more than four strings should be done with a StringBuilder is an oversimplification, and it's simply not true when concatenating a fixed number of strings (see http://blogs.msdn.com/bleroy/archive/2005/01/07/348831.aspx ). Four is a little low, too, even if the number of strings is variable.
# February 22, 2005 6:23 PM

TrackBack said:

# February 22, 2005 8:06 PM

TrackBack said:

# February 22, 2005 9:23 PM

freedumb fighter said:

Manks thanks for explaining #1 -- I had been doing all my checks as != null and was mystified why they were failing.
# February 24, 2005 12:36 PM

Brian Beatty said:

What about using string builder
sb.append("line1")
sb.append("Line2")

or string. format?
# February 24, 2005 12:58 PM

Bertrand Le Roy said:

Brian: see this other post on why stringbuilder is not always a good choice: http://blogs.msdn.com/bleroy/archive/2005/01/07/348831.aspx

In particular, when concatenating a fixed number of static strings, it's just a waste of time and it will perform significatly worse than just putting the concatenations in a multiline instruction: the compiler optimizes this away perfectly. There is no way anything can be faster, and it's readable.

String.Format is the worst approach. It performs very poorly when compared to both concatenation and stringbuilder.
String.Format has the advantage that it's very readable, but if you care about performance, you should only use it when the format string is not known in advance (for example if it can be set by user code).
If you know the format string in advance, it will be functionally equivalent to a fixed number of concatenations of variable objects.
So this means that string concatenation is what performs the best in this case too, not StringBuilder, not String.Format.

By the way, if you're thinking about inserting variable elements in a Sql query using String.Format or any form of concatenation, think again. The security risk is just too high.
Read http://weblogs.asp.net/bleroy/archive/2004/08/18/216861.aspx for more details on this.
# February 24, 2005 3:10 PM

Laurent Kempé said:

Sounds really cool !!! I planned to have a XSLT rendering of the article of Tech Head Brothers website as Word 2003 documents, using WordML, but it is not on a high priority on my task list, at least far from the WSE integration to publish directly from Word 2003. But I will for sure have a look to this.

Thanks.
Laurent
# March 1, 2005 2:58 PM

Jeff Parker said:

Handlers are a great thing, I do wish they were more documented. But you can offload a lot of time comsuming processing to Handlers. I wish I could find the article on MSDN somewhere that shows how to use a threaded timer in a HttpHandler to do the heavy lifting of a website things like email and so on, It was written by one of the guys working on ASP.NET a knowledgable guy by the name of Ron Howard.
He touches on this technique in this article below but he has a complete write up on it somewhere.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspnet/html/asp11022004.asp

But you can use handlers for security as well this is one of the things like I said that has great potential unfortunately so very lightly documented http://www.dotnetspider.com/technology/kbpages/1011.aspx
# March 3, 2005 9:18 AM

Bertrand Le Roy said:

I think the guy you're looking for is Rob Howard. Ron Howard is the bald guy who makes movies and used to play Richie Cunningham in Happy Days.
You can get in touch with Rob on his blog:
http://weblogs.asp.net/rhoward/
# March 3, 2005 1:56 PM

Jeff Parker said:

Hah, yes you are correct Rob Howard. My Bad, well we both knew who I meant anyway.
# March 3, 2005 2:16 PM

Uwe Keim said:

Regarding point 2.): can you or any reader recommend some libraries?
# March 4, 2005 1:48 AM

Bertrand Le Roy said:

And this one that I just found on TSS.NET:
http://www.windwardreports.com/
# March 4, 2005 3:44 PM

MoonLite said:

#1 needs a little supplement though...

example:
the variable "val" does not yet exist.
if you do :

if ( val ) doSomething;
else doElseThing;

JavaScript will crash, because "val" does not exist, and does return neither "null" nor "undefined" nor "false".

The workaround I use is :

try { if ( val ) doSomething; } catch(e) { doElseThing; }

If used often, consider using a function:

function exist (a) {
try { var b=a;}
catch(e){return false;}
return true;
} // exist

so you can just use:

if ( exist (val) ) doSomething;
else doElseThing;


it's advisable to put all your code in :

try { ... your code ... } catch (e) { alert (e); }

browsers like FireFox will give a little detail on the problem when encountered.
# March 5, 2005 11:55 AM

Bertrand Le Roy said:

Moonlite: while you are right that an undeclared variable will trigger a javascript error, I would certainly not encourage anyone to go ahead and include the test in a try/catch.
The right workaround here is to declare all your variables, even if you don't initialize them immediately. In this case, they will undefined, but the test will not crash.
There are very few cases where you need a try/catch. They do exist, but this is not one of them.
Thanks for the heads up, though.
# March 7, 2005 1:32 PM

Salman said:

Yup its Rob Howard. Jeff P., download the latest version of CS and you will see that code snipped.
# March 9, 2005 7:40 AM

TrackBack said:

Bertrand LeRoy illustrates how easy (well, relatively) it is in Whidbey/Visual Studio 2005 to create HttpHandlers (.ashx files). Ease of development aside, he points out that handlers are a comparatively less-understood feature in ASP.NET. He says: "T ...
# March 14, 2005 6:44 PM

TrackBack said:

# March 22, 2005 8:33 AM

TrackBack said:

# March 22, 2005 9:31 AM

TrackBack said:

# March 22, 2005 11:00 PM

TrackBack said:

# March 22, 2005 11:01 PM

Jerry Pisk said:

So in Whidbey one has to template the method signatures in addition to the type definition? instead of C++:

class <T> MyClass {
T GetService();
}

we have to do:

class <T> MyClass {
T GetService<T>();
}

isn't that a little too much?
# March 28, 2005 3:16 AM

Bertrand Le Roy said:

No Jerry, you never write that second thing, which would probably not compile because that would create a conflict between the class type parameter and the method type parameter. You write something close to the first one:

class MyClass<T> {
T GetService();
}

I should maybe have written the code for the entire class. What you have in my example is a generic method in a non-generic class:

class MyClass {
T GetService<T>();
}
# March 28, 2005 2:02 PM

Rolando said:

so you're a Microsoftie... and by your blog title and the content of your posts you don't seem to be part of the ASP.NET team

Why is your blog still here at weblogs.asp.net ?

Did Somebody forget to move you to blogs.msdn.com ?
# April 1, 2005 8:44 PM

Bertrand Le Roy said:

I am part of the ASP.NET team. What makes you think I'm not?
# April 1, 2005 8:46 PM

Rolando said:

sorry Bertrand... the content of your latest posts confused me...

by the way... is there any chance that ASP.NET team bloggers could be identified ? maybe a link like "Posts by only ASP.NET team Bloggers" replacing the "Posts by only Microsoft Bloggers" that now returns nothing ?

# April 1, 2005 8:50 PM

Bertrand Le Roy said:

I don't know. You'd have to ask Scott. I agree that it would be useful.
# April 1, 2005 8:51 PM

Steven Smith said:

Good stuff. For more info on the various ways to manage state in ASP.NET, readers might check out my MSDN article:
http://msdn.microsoft.com/msdnmag/issues/03/04/ASPNETUserState/
# April 2, 2005 10:41 AM

sugandh said:

hi, i want to know what r the implications of Viewstate on XMLHTTP.
I am getting an error in that and i feel it is because of viewstate.
# April 2, 2005 11:54 AM

Bertrand Le Roy said:

Steven, thanks for the pointer. I knew your article but couldn't find it, so thanks.

sugand: there should be no implication of viewstate on XmlHttp. If you tell me a little more about your specific situation, maybe I would be able to help. Are you using the ASP.NET callback feature or XmlHttp directly?
You can drop me a note at bleroy at Microsoft.com.
# April 2, 2005 10:08 PM

TrackBack said:

# April 3, 2005 1:40 PM

Oleg Ufaev said:

# April 4, 2005 4:08 AM

Bertrand Le Roy said:

Oleg: what's wrong with the url? I just tried it, and it works. What happens when you click on it?
# April 4, 2005 2:19 PM

Ron A. Buckton said:

I was working on a project for DDI (www.ddiworld.com) back in 2002 when .NET 1.0 was released. The project used OOB/XmlHttp stuff from the getgo, and MS even did a case study way back when (http://www.chroniclesdesign.com/ddi.pdf).

Prior to that I was using XML-RPC way back before SOAP in my ASP days, yet more XmlHttp. Its definately nothing new, but until recently there's never really been much of a "framework" for OOB support. (Excepting webservice.htc, which was still only a small piece of the puzzle).

New features like client-callbacks should make this easier in .NET 2.0 (and even 1.x, I have some sample code in a SIG presentation I did (http://www.bennettadelson.com/downloads/NetSigSolution2-8-05.zip) and will have an article on it in a couple days on my blog), building in a lot of support directly into .NET.
# April 8, 2005 11:39 PM

JosephCooney said:

I think the WebService DHTML behavior (on the client) and ASMX on the server is much better than ASP.NET's async callbacks....so much so that I wrote this sample comparing the two.

http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=fd6acac1-da45-446c-822d-5b2ecdb396a6

and this critique of it

http://jcooney.net/archive/2004/02/26/343.aspx
# April 9, 2005 4:25 AM

TrackBack said:

# April 9, 2005 4:39 PM

TrackBack said:

^_^,Pretty Good!
# April 10, 2005 5:39 AM

TrackBack said:

^_^,Pretty Good!
# April 10, 2005 5:40 AM

TrackBack said:

Best of the Blogs - Ian Smith reviews the best of the last week's web development blogs so that you don't have to. Week ending 10th April 2005. Whidby, Visual Studio Team System, Visual Studio 2003, Training, Productivity Enhancers, Front-End Development and more...
# April 10, 2005 5:14 PM

TrackBack said:

Bertrand Le Roy, one of the rock-star developers on the Web Platform and Tools team has been doing a...
# April 10, 2005 7:51 PM

Uwe Keim said:

Great! I already played with this, too. Seems that this ASP.NET 2.0 Callback stuff also seems to be aware of different browsers and works correctly on FireFox, too?!?
# April 11, 2005 12:30 AM

Bertrand Le Roy said:

Uwe, it depends which build you're using. The beta builds should play nicely with Firefox, and the final version will address more browsers, like Opera.
In any case, any control you develop with this technology should degrade gracefully to ordinary postbacks on older browsers. It's the case of some of my samples, but not all, for the sake of simplicity (they are sample, not production quality controls).
# April 11, 2005 12:43 AM

Bertrand Le Roy said:

Joseph: The callback feature IS aimed at control developers. You seem to forget a small detail about behaviors: they're only available on IE. The ASP.NET callback feature already works on IE and Firefox and the final version will work on more browsers.
The example about wiring up several text boxes can be solved by the CallbackMultiplexer sample control that's included in my sample workspace (http://www.gotdotnet.com/workspaces/workspace.aspx?id=cb2543cb-12ec-4ea1-883f-757ff2de19e8).
Another problem with the web service behavior when compared with the ASP.NET callbacks is that you need to create a web service for each control, whereas with callbacks, everything is integrated in the page and control lifecycle.
That's very important: with web services, there's no way you're going to be able to access other controls on the page and integrate them in your update procedure. With callbacks, your update procedure executes in the context of the page, so all controls are fully available.
# April 11, 2005 1:13 AM

Steven Livingstone said:

Belive it or not the last few days i have been working on moving some old Remote Scripting features of a huge system to use XMLHTTP.

The feature above sounds very interesting. I assume it works fine through firewalls and proxies!? (i ask as this is on reason we are moving from Remote Scripting which runs into trouble over our proxy when using an older Sun JVm on the client!).

They key is if you guys can get this to just work cross-browser. I like the idea and would be very intersted in how this ties in with ViewState and postbacks.
# April 12, 2005 3:55 AM

JosephCooney said:

I was less-than-impressed with the async callback feature since it did NOT work in firefox IIRR in the PDC release that I tested, but it is great news if it will work on more in the final release. For control developers I can honestly see the benefit, but if you went the web-service route instead of the ASP.NET async callback route you don't necessarily need 1 web service per control, you just need one webmethod per type of async operation you want to perform.

I don't really buy into the "can't access other controls on the page" argument. If your using web services and need the state of the controls to be sent back to the web service you can just do that from your callback code. Using ASP.NET async callback you can't change the properties of the control inside the callback anyway, becuase the viewstate has already been written to the client (unless some very impressive script has been added in the last little while to re-write the viewstate on the client once the call returns).

I love the async idea (especially the part about making it easy) - I just wish it could have been more strongly typed. The client-side script that the current DHTML behavior could have been rolled into a control, so the fact that it is currently in a DHTML behavior is more of an implementation issue IMO.
[cross-posted from my weblog, with some more junk as I thought it up]
# April 12, 2005 4:58 AM

Bertrand Le Roy said:

Steven: it works with proxies and firewalls. Callback requests look just like any other http request from the exact same client as far as the firewall is concerned. And it does work cross-browser (IE and Firefox are supported for the moment, more to come for RTM).

Joseph:
It didn't work with Firefox in the PDC build, but let's be honest, what did? The PDC build was an early alpha. Beta 2 should be available any time now.
If you're using callbacks, you can have the same reusability you have with web services by isolating the code in a separate method and just calling that from your event handlers. Actually, it is pretty obvious that this is the good practice if your callback logic is not specific to this control.
The only state you can use with the web service approach is the client-side state, not the server-side state. That means more client code, and nobody want that, right? With callbacks, you just have access to your other controls as usual, it just works. With web services, your client-side code has to take the client-side state (if it exists at all in a usable form: think about the state of a TreeView) and package it into XML for the web service to consume.
The real reason why the ViewState is not updated during callbacks is that the page lifecycle is not completely executed, and because several asynchronous callbacks can happen at the same time in the current build (which is not beta 2). Otherwise, it would be fairly easy to send the new value of the viewstate back to the client.
Anyway, I'm not talking about *changing* the state of other controls on the page, I'm talking about using it.
The point is that ASP.NET callbacks are fully integrated into the page lifecycle and web services are not. This has many advantages, another one being ease of writing.
I understand your point about strongly typing. The problem is that there is a huge impedance mismatch between the JavaScript type system and the SOAP and .NET type systems. If you go the strongly-typed way client-side, where do you stop?
I kind of like the frameworks that try to give you client-side an object hierarchy that looks like what you have server-side, but that a *very* leaky abstraction. It looks nice, but it is actually an illusion IMHO. It increases the complexity of the client-script, and it's only nicer if you actually intend to write a lot of client-side code and need a clean object model there. The truth is, most people don't want to touch client-side code, they want to write as little as possible. So far, strings have been just fine for all our scenarios. We do some simple parsing in the TreeView case, but TreeView is already a very complex control.
Another thing to consider is that the callback API is just that: a relatively low-level API that enables you to forget about the complexities of communicating cross-browser with the server. The idea is that people will build stuff on top of it. For example, I don't know if you checked out my samples, but there is a very interesting thingy in there that's called CallbackMultiplexer and it does something like a more strongly-typed callback in a very transparent way. You could very well build a control on top of our callback API that does marshalling in a more strongly-typed way, à la Web Service. After all, XML is just a way to marshal strongly-typed data using a string.
You know what, I think I agree with you that there are scenarios where you will want something more strongly-typed that a string, and I think I'll build a control that does that for you. I'll add it to the sample collection when it's ready. :)
Thanks for the comments.
# April 12, 2005 2:28 PM

Fregas said:

I think all of this: AJAX, Callbacks, XmlHttp, etc. just illustrate how crappy the HTML/HTTP model actually is right now. In windows and java applications, this kind of stuff is relatively simple. In the web world, we always seem to be trying to catch up to where the desktop world has been for ages. Hell, forget about catching up, we're just trying to get close!

Simple things like Drag & Drop or populating a drop down list without a refresh are a huge pain in the ass in DHTML/Javascript. They shouldn't be. The need not be. All this stuff in ASP.NET 2 and its like (while definitely nice to have) are just band-aids over the real problem. I think the bottom line is that we need to scrap HTML as the client/presentation layer and replace it with something else. Call me a dreamer... :)

Long live SmartClients! Long live XAML! Long live FLEX!
# April 12, 2005 3:28 PM

Bertrand Le Roy said:

Fregas: I agree completely that in an ideal world, we would all be doing declarative rich client applications. But the web is here to stay for at least a few more years, and it's still the best answer for a lot of application types. Not for technical reasons (even though the web is still superior for a number of things, like being very flexible with document layout), but for pragmatic reasons.
It is our job at ASP.NET to make Web application development less painful (if not fun altogether). Callbacks are one more step in this direction.
But if your application can be done using rich client technologies and not loose a large number of its customers along the way (think Amazon in WebForms... doh!), go ahead and do it, sure.
# April 12, 2005 3:35 PM

TrackBack said:

Brian Goldfarb sent me an email pointer to the latest ASP.NET Support Voice posting.&nbsp; This one covers...
# April 12, 2005 5:33 PM

Fregas said:

Well, thats the rub isn't it? -IF- the W3C or some other organization would come up with a standards based presentation layer that made sense and allowed all this rich interactivity, -AND IF- all the browser vendors would support this standard without devolving into more browser wars...well then, we'd all be better off: Users, Developers and Companies who want a good ROI.

Not likely to happen, unfortunately. There are whispers of it in things like Flex and Xaml, but no standard in sight yet.

ASP.NET definitely makes things easier in most ways (although not all.) But i'm tired of hearing about things like AJAX which is sugar frosting on top of layers and layers of crap. AJAX doesn't make my job easier. Instead, it gives people who don't know any better the impression that there is now a new technology to make the web "desktop-like" and make all their UI dreams come true. Come on. We don't all have the resources and know-how of google.
# April 13, 2005 10:10 AM

Bertrand Le Roy said:

Fregas, I understand what you're saying and I almost agree. I know that some customers/bosses can be a pain when they've read about a cool new buzzword like AJAX. So as a word, I agree that AJAX may be harmful to the industry in the sense that it diverts attention from the fact that the technology it describes is in no way a universal answer to the fundamental suckiness of the web.
On the other hand, I hope that our work (which predates the buzzword) will make it a little easier for people like you (our customers) answer your boss's or customer's demands. I'm not trying to amplify the buzz in any way, just to make it easier for our customers.
I agree, we're not all Google. Actually, Google Maps is a very impressive piece of software in many ways and reducing it to just an AJAX application is an insult to the talent of the Google engineers.
# April 13, 2005 2:06 PM

Robert McLaws said:

Can you post the source for these controls?
# April 15, 2005 5:19 PM

Bertrand Le Roy said:

The link to the source code was in the first post, but I added it to the new post so that it's easier to find... http://www.gotdotnet.com/workspaces/workspace.aspx?id=cb2543cb-12ec-4ea1-883f-757ff2de19e8
# April 15, 2005 5:22 PM

TrackBack said:

# April 15, 2005 5:54 PM

TrackBack said:

# April 15, 2005 8:21 PM

TrackBack said:

Interesting finds this week
# April 17, 2005 12:38 PM

TrackBack said:

Ian's weekly review of the best of the blogs for the .Net developer week ending 17th April 2005
# April 17, 2005 3:55 PM

Cleve Littlefield said:

I disagree about the lack of need for strong typing. While full objects may be an allusion, something simple like supporting muliple parameters, not just a string input and a string output, is very useful. Here is a good example...

http://weblogs.asp.net/mschwarz/

Although this is a leaky abstraction, most of ASP.NET is a leaky abstraction of some sort or another...
# April 22, 2005 3:36 AM

Bertrand Le Roy said:

Cleve, with what exactly do you disagree? I never said there is no need for strong typing. One of my samples does precisely that: supporting multiple parameters...
About leaky abstrations, read my post about them: http://weblogs.asp.net/bleroy/archive/2004/12/02/274105.aspx
# April 23, 2005 10:37 PM

TrackBack said:

# April 24, 2005 1:37 AM

TrackBack said:

Steve Friedl has a great explanation of how he used a SQL injection attack to compromise a Web site. (Which is what he was asked to do.) It features a blow-by-blow account of what he tried, what results he got, and how he used his failed attempts to le ...
# April 27, 2005 1:09 AM

Sheetal Jain said:

Couldn't agree more - In our of our product we had written a strip out version of NanoXML parser as a applet to make server call to updaste <div> tags and this was back in 2000

# April 27, 2005 10:58 AM

TrackBack said:

# May 6, 2005 5:21 PM

TrackBack said:

wagnerblog.com &raquo; Fun with callbacks Part 1: What&#8217;s in the ASP.NET box?
# May 8, 2005 2:00 PM

TrackBack said:

# May 19, 2005 6:55 AM

TrackBack said:

# May 19, 2005 6:56 AM

TrackBack said:

Callbacks in 2.0
# May 19, 2005 2:27 PM

Peter Bromberg said:

Very classy stuff, Bertrand! Especially the RefreshPanel at gotdotnet.
# May 21, 2005 12:19 PM

TrackBack said:

# May 25, 2005 11:58 AM

TrackBack said:

# May 25, 2005 11:58 AM

Sergey Polyakov said:

Callbacks look like great techology capable to improve web controls development significantly.
Thank you Bertrand for introducing the technology and providing us with amazing demos.
My question is: are request params (the form input values) available during callbacks?
# May 31, 2005 6:37 AM

Bertrand Le Roy said:

Sergey: during a callback, the page is in exactly the same state it was during the last postback, so the Form and QueryString parameters are still available, in addition to the callback parameters. Does that answer your question?
# May 31, 2005 9:03 AM

Steve said:

This is good, but what about the current 1.1 version - this stuff you are doing is all beta material that can't be used on production environments.

See http://www.dart.com/powerweb/livecontrols.asp

I just wish these controls were cheaper :)
# May 31, 2005 9:25 PM

TrackBack said:

# May 31, 2005 11:29 PM

Sergey Polyakov said:

Bertrand, I meant whether are available the actual input values (at the moment of a callback) which have been changed since the last postback, but from your post I see that they are not available and only old values from the last postback can be obtained (and this is exactly what I observed in my test project). In other words I need to pass manually through the callback args all the information I want to gather from the page. Am I correct?
# June 1, 2005 2:59 AM

Bertrand Le Roy said:

Yes, you are correct. It looks a little counter-intuitive at first, but it ensures that the page is in a consistent state during a callback even if multiple callbacks are triggered at once.
The data that you want to be up-to-date must be passed as a part of the callback parameter, and Form will have the values it had during the latest postback.
# June 2, 2005 1:17 PM

TrackBack said:

This entry is an introduction to ScriptCallbacks in ASP.NET 2.0 and a few observations and comments on the design and implementation. It seems this interface provides a core engine behavior that is pretty low level, but doesn't do anything to facility the actual process of data exchange between the client and server.
# June 6, 2005 6:03 PM

Hank Fay said:

I resemble that remark, and here's my internal dialogue at such a moment:

If it's my marker: "I'd better keep it, so I remember what kind of marker and what color to buy."

If it's someone else's marker: "I'd better not throw it away: they might need to know what kind of marker and what color to buy."

It would be interesting to collect internal dialogues for this common behavior.
# June 14, 2005 11:40 PM

Peter Bromberg said:

So long as my callbacks don't die, I can live with the marker problem.
# June 15, 2005 10:20 AM

smelliot said:

this is why I always go for the brown markers- everyone hates brown, so it never gets used.

Also- I toss them- the prob (as stated by Hank), is that "if it's not mine, I can't throw it away"

In addition, they're always crap because "If it's not my whiteboard, I can't order supplies for it" or possibly rather, "If it's not mine, it'll still go onto my budget".

I haven't been to an org that has budgets for inanimate objects, but probably should.
# June 15, 2005 5:25 PM

Srikanth said:

I know this is n't the right message post for my question, but since you are an callback guru, i would like to post my question here.
How do we handle callbacks in the frame scenario.
For ex: Suppose i have three frames (pages) with Topnav,Sidenav and Remainingspace aspx page.I'm doing a callback from menu on the topnav that changes the data on the topnav page(html) and since we call response.end after the callback event,i could n't get to the leftnav to get loading with the new topnav changes.In otherwords the response stops with the topnav page and i'm not able to keep the pages rendering on the leftnav and mainspace page.Any ideas? appreciate your help.
# June 18, 2005 11:10 AM

Bertrand Le Roy said:

Well, if you do frames, it's the same as with postbacks, you'll have to use some client script to modify other frames (the server-side has no idea of frames).
# June 27, 2005 2:40 PM

Srikanth said:

Thank you. Someway or rather i figured out the answer after posting it in your blog.I guess reading your articles gave me the answer already.Anyway thanks for the excellent articles on callback stuff.
Keep up the great work!
# June 27, 2005 10:22 PM

AndrewSeven said:

I'm glad to see both.

I only looked at the Schwartz Interactive AJAX, but it is so simple to use.
You don't need to know about xmlHttp to use it and on the server you could just use an ordinary aspx page with the functions. In pages where you want to use those functions you call a register for ajax method.
# July 14, 2005 6:00 PM

Karl said:

Any solution that requires developers to manually serialize their wonderful objects and then do something meaningful in JavaScript with it is gonna fall flat on it's face. Until such time as good tool support for JavaScript exists, and developers learn that JavaScript is actually OO, even poor developers are going to realize that their code is unmanageable and hackish.


Ajax.Net might provide a "leaky abstraction" (thank's joel for that one!), it's still pretty productive:

var ds = response.value;
for (var i = 0; i < ds.Tables[0].Rows.length; ++i)
{
var firstName = ds.Tables[0].Rows[i].FirstName;
var lastName = ds.Tables[0].Rows[i].LastName;
}

for the win!!

Karl

# July 15, 2005 9:55 AM

Scott Wisniewski said:

You should take a look at the "Power Web Controls" provided by Dart.
One thing they do really well is preserve the user's (the app developer) mental model of how ASP.NET works. The client callback support in Whidbey does not do that, however.

In fact, I think you are in a bit of a catch 22.
You want to enable the developer to drop a control on a page and have the control be self contained in order to preserve their mental model for developing web applications.

However, the limitations of the way callback support is implemented break the user's model: callback event handlers cannot change view state, and the current form values are not collected and posted to the page. This means that a callback running inside a page (the simplest, and hence most likely, scenario involving callbacks) doesn't have access to any of the values users have typed in.

I know some people have expressed concern that collecting the form values can cause validation issues, but that can be resolved by requiring the callback mechanism to fire off the validation process.

In order to keep the callback mechanism, as its implemented now, without breaking the user's mental model you need to split it apart from the page. The callbacks don't have full access to the page (or control) on which they reside, and a result shouldn't be there. If a user places two methods on a page, one that responds to a callback event and one that responds to a post back event, he or she will naturally expect both methods to have access to the same state. However, they don't. The post back handler has access to the values the user (of the web app) typed in, where as the callback does not. The reasons behind the discrepancy stem solely from implementation details and are not immediately obvious to the user (the programmer). It's a prime example of the system implementation leaking into the user's mental model. That's not a good thing.

By splitting callback event handlers out into separate http handlers, the user's mental model is not violated in this manner. The handler is separate from the page, so it makes sense that it doesn't have access to the page.

However, separation is not the answer. It still violates the user's mental model. In particular, it flies in the face of modularity, something ASP.NET is really good at enabling. This is where the catch 22 comes in.

I think the solution is simple: enhance the callback mechanism to grab current form values before postback and to automatically update viewstate and control appearance after the callback. I'm not saying that's simple. In fact, I think it will be pretty difficult, and that it really isn't feasible to see something like that in Whidbey. However, I really think you should look into it for orcas.

I'm also not saying that the callback support isn't useful. For custom control developers (expert level ASP.NET users), the callback mechanism provides a great foundation for developing really awesome controls. I think as a result of it you will start to see some really great things come out of the ISV's developing controls for ASP.NET. As expert users, however, custom control developers are willing to "go the extra mile" necessary to maintain the correct user experience.

For the vast majority of "page oriented" ASP.NET developers (intermediate users), however, I think that the callback support in will prove to be a large source of confusion.
# July 15, 2005 12:31 PM

Bertrand Le Roy said:

Karl, I agree 100%. You need to check out my RefreshPanel library (follow this link: http://weblogs.asp.net/bleroy/archive/2005/04/08/397761.aspx and read on), especially the serialization stuff and the RefreshProxy. As I've been explaining in previous posts, the callback infrastructure provides you the low-level plumbing to enable out-of-band calls in a server custom control. It is easy to add a higher-level layer on top of that, as I hope I've demonstrated with this library.
I also mostly agree with the object-orientation remark, and this is precisely what we're going to address with Atlas. What I disagree with is the point of JS being OO. It is not really, but you can sort of hack it into being OO. What it has is closures. In Atlas, we're /implementing/, or adding if you prefer the notions of class inheritance, interfaces, strong types, etc. Stay tuned, I think you'll like what we're doing when we unveil it at PDC.

Scott, two things. First, believe me, we would have *loved* to maintain ViewState during callbacks, but it's very difficult for one simple reason that I've explained in a previous post: only one postback for any given page happens at once, whereas callbacks would be pretty much useless if you couldn't have several happening at the same time. So you may know the order in which you send the callbacks, but there's no way you can determine the order in which they'll come back. So which version of the ViewState are you going to choose? To maintain the monolythic ViewState, you need sequentiality. One solution we've been thinking about for Orcas involves making the ViewState less monolythic and enabling the page to be broken into smaller mini-pages that would have their own isolated state and where local sequentiality of the callbacks would be less of a problem. The problem with such a model is that it becomes more difficult for these mini-pages to communicate with the rest of the page. In fact, the ideal granularity is the control itself, so the ideal solution would be for each control to manage its own state, and guess what, that's the current callback model, except that we don't provide many helpers for client-state management in Whidbey, and it can be difficult to reconcile your client-side state with the global ViewState on the next postback. Read the Fun with Callbacks series for more details.
Second, I think you make my point: there are two needs (and solutions), one for custom control developers (callbacks), and one for application or page developers (Ajax.NET and the future Atlas framework). One tool does not fit all...
# July 15, 2005 1:47 PM

Bertrand Le Roy said:

(oh, and yes, we know of the Dart controls and of several other similar libraries. They're great and I can only encourage people to use them if they answer their needs.)
# July 15, 2005 1:49 PM

Etienne Richard said:

Friday 5:30 pm idea...

> One solution we've been thinking about for Orcas involves making the ViewState
> less monolythic and enabling the page to be broken into smaller mini-pages that
> would have their own isolated state and where local sequentiality of the callbacks
> would be less of a problem. The problem with such a model is that it becomes
> more difficult for these mini-pages to communicate with the rest of the page.

How about implementing better AJAX support for WebParts based solutions using each webpart as granularity? In such a scenario, "breaking pages into smaller mini-pages" = "defining webparts". WebParts communicate with each other using a provider-consumer connection model. The webpartmanager knows all the dependencies that exist between webparts at runtime.

In this model, WebParts would serve as the autonomous logical parts of the UI. The page's postback and state mechanism would be delegated to each webpart. Each webpart would then be responsible for it's own state and for posting back to the server. Upon return of a postback, the webpart's display and state would be updated. Just like a normal page postback, but scoped to a webpart and using AJAX to refresh only part of the UI.

Now, what if a webpart's state is dependent on the state of another webpart. For example, a master webpart and a detail Webpart. When the selection in the master webpart changes, the detail must be updated accordingly. If each webpart acts independently for postback, the detail will never be updated. However, in the webparts framework, dependencies between webparts are declared through a provider-consumer connection model. Therefore, when a webpart posts back, it is possible to know dependent webparts by finding all consumers of any connection provided by the parent webpart. To answer the dependent webparts problem, upon a webpart postback, a simple rule could be to execute postback logic for each dependent webpart as well as for the parent webpart. Upon return, update state and display for all the webparts implicated in the postback.
# July 15, 2005 5:40 PM

Bertrand Le Roy said:

Etienne, WebParts and callbacks/ajax sure are interesting scenarios for the Orcas timeframe as well as for Atlas, but at this point we don't want to force WebParts as the infrastructure people would need to use to get these features. Portal features and better callbacks are orthogonal and we're more thinking about a user control or panel, which can be combined with WebParts but do not force one to use them.
It's interesting to consider, though, because of the way WebParts maintain and persist state, which is very different from what ordinary Controls do.
Thanks for the feedback.
# July 18, 2005 3:46 PM

teddy said:

good
# July 26, 2005 3:17 AM

Brock Allen said:

Hmm... Software isn't easy is it? :)

I doubt there's time left to do this, but I could imagine this being rolled into the Control base class to manage some of this complexity when not using the async model.

-Brock
# August 7, 2005 3:57 PM

Bertrand Le Roy said:

Too late for Whidbey, yes, but I'd be interested to read precisely what you have in mind (for, you know, Atlas or Orcas).
# August 7, 2005 7:33 PM

foobar said:

You can also clip the select box.
# August 9, 2005 7:25 PM

Bertrand Le Roy said:

foobar: yes, you can if you have only one DIV to overlay. In the case of a cascading menu, you would have to clip to something that's not rectangular, which is impossible. And it would be so much more complicated than this anyway...
# August 9, 2005 7:59 PM

Jon Galloway said:

Interesting. I was pretty sure that the Beta 1 hid all selects on the page when the menu was shown. It looked really funky; this hack is at least much better from a user point of view.
# August 9, 2005 8:07 PM

Bertrand Le Roy said:

Jon: you're right. Beta 1 used to hide all select elements. The iFrame hack is available in beta 2 and later builds.
# August 9, 2005 8:09 PM

Scott said:

We use "javascript:;" as the src to avoid the secure/non-secure warning. Works better than putting a blank page in the site IMO. :)
# August 9, 2005 9:13 PM

Bertrand Le Roy said:

Interesting. I'll update the post. Thanks for the tip.
# August 9, 2005 9:16 PM

Bertrand Le Roy said:

Ron, that's very nice of you, but there's already a link to this article in the post, if you look carefully. Thanks for making it more obvious, though.
# August 9, 2005 9:29 PM

Collin Yeadon said:

Thanks for the "hack". I will need to try that out. I have gotten into the habbit of solving this problem by avoiding it but if I can avoid making sacrifices then that's great.

I wonder if this would also work for other objects. I have a large flash movie that pops up on a site I am working on. The flash is set to be transparent and all the standard stuff to let it stay above the other page elements. But I noticed the DIV problem exists with my flash movie as well. I have a hunch that this same hack will make the div my flash movie is in also appear over the SELECTS.

Do you know if this hack is browser version specific? I wonder if IE7 has corrected this problem.
# August 9, 2005 9:59 PM

Bertrand Le Roy said:

Collin, in theory, it should also work for other objects such as Flash movies although the transparency of the Flash movie may be trickier than the simple DIV case. If you can try it, can you post here the results of your experimentations?
I don't know if IE7 plans to correct this problem. It's probably too early to tell but if they fix it the hack won't break because the non-windowed behavior is correct too (try the code in Firefox to verify it). I know that the way windowed elements used to work in earlier versions of IE was different and that this hack may not work on older IEs, though.
# August 9, 2005 10:07 PM

Collin Yeadon said:

Bertrand, am I missing something? The IFRAME has a white background.. so how is this solution supposed to work? Possibly something else in my app is breaking the hack?
# August 9, 2005 10:52 PM

Collin Yeadon said:

OK, well, I guess I know what you meant about transparent being a problem.

Results are in:

Testing in IE6, It does show up over the SELECT as suspected. So flash is no problem. But, I guess there is no way to make that IFRAME transparent so this hack works great only if your menu has a background to cover up the IFRAME.

Lets hope IE7 get this fixed.

Good to know about this method anyways. Thanks BLR!
# August 9, 2005 11:12 PM

Bertrand Le Roy said:

Collin, yes, I think you've got it figured out: the point of the hack is that the iFrame is not transparent... So for a transparent movie, I don't think this can help. But it definitely helps for a menu DIV.
# August 9, 2005 11:55 PM

Josh Twist said:

Hi Bertrand,

Just as a note - I don't think *anything* is cached when accessed through https (for obvious reasons).

Josh
# August 10, 2005 2:45 AM

Sébastien FERRAND said:

Thx for this hack...
# August 10, 2005 9:41 AM

dylan said:

Easiest way to do this is by dynamically creating and positioning the IFrame, so you don't have to think about it. Below is pseudo code.

if (document.all)
{
divNode.insertAdjacentHTML("afterEnd", '<IFRAME style="position: absolute;z-index:4;" src="javascript:false;" frameBorder="0" scrolling="no" id="' + sTableID + '_hvrShm" />');
var iframeShim = document.getElementById(sTableID + "_hvrShm");
iframeShim.style.top = hoverDiv.style.top;
iframeShim.style.left = iframeShim.style.left
iframeShim.style.width = hoverDiv.offsetWidth;
iframeShim.style.height = hoverDiv.offsetHeight;
}
# August 10, 2005 11:07 AM

Bertrand Le Roy said:

Josh: I updated the text.
Dylan: thanks for the code. A few potential problems I see with it, though:
* if you insert the frame just after the div node, I'm not sure selects that are declared after the div in the document markup will get covered. Plus, you may need to reposition the div itself as the frame may cover it.
* the frame coordinates may need to be corrected in the case of multiple offset parents if you have to put the frame at the end of the document instead of next to the div.
* personally not a big fan of document.all as an IE browser detection test. For all we know, that may disappear in IE7 in standard mode (not very likely, but it may happen). Furthermore, the capability you're using is insertAdjacentHTML (which is IE only too), so why not use that as the test instead of document.all?
Big thanks for the code, though.
# August 10, 2005 2:01 PM

TrackBack said:

Comment mettre un DIV au dessus d'un SELECT avec IE.
# August 10, 2005 8:28 PM

Steve W said:

For simple menus (with no submenus) you can also use the window.createPopup() method, and that goes over windowed elements.
# August 17, 2005 5:04 PM

Bertrand Le Roy said:

Steve, that's an IE-only solution, and as you say, it doesn't work for cascading menus. It's used in the IE-only script for the verbs menu in webparts, though.
createPopup has its own share of problems, like its document being a completely different environment that does not have easy access to its parent document.
I'd strongly advise against using it.
# August 17, 2005 5:23 PM

Collin Yeadon said:

Here is a solution to use when all else fails. I put this together from some code I found on the net. Basically it will hide all selects that show up under the div you are showing. You would pass the left, top, width and height values to this toggle script which hides them ONLY if the version is IE6 or previous. We can only hope that IE7 will have cured this because this is an ugly way to do it.

I am forced to use this as a solution with a flash popup that has a transparent background. If te background was solid then of course the IFRAME solution would look much nicer.

I was tempted to make this script write a div to the page, position it where the IFRAME is and then style it to look like a drop down list but decided that was just not worth the hastle.

<code>
function toggleSelect(x,y,w,h){
var appVer = navigator.appVersion.toLowerCase();
var iePos = appVer.indexOf('msie');
if (iePos !=-1) {
var is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
var is_major = parseInt(is_minor);
}
if (navigator.appName.substring(0,9) == "Microsoft")
{ // Check if IE version is 6 or older
if (is_major <= 6) {
var selx,sely,selw,selh,i
var sel=document.getElementsByTagName("SELECT")
for(i=0;i<sel.length;i++){
selx=0; sely=0; var selp;
if(sel[i].offsetParent){
selp=sel[i];
while(selp.offsetParent){
selp=selp.offsetParent;
selx+=selp.offsetLeft;
sely+=selp.offsetTop;
}
}
selx+=sel[i].offsetLeft;
sely+=sel[i].offsetTop;
selw=sel[i].offsetWidth;
selh=sel[i].offsetHeight;
if(selx+selw>x && selx<x+w && sely+selh>y && sely<y+h)
if(sel[i].style.visibility!="hidden") sel[i].style.visibility="hidden";
else sel[i].style.visibility="visible";
}
}
}
}
</code>
# August 18, 2005 4:03 AM

Sébastien Ros said:

I tried Jade one time ... and I was killed by a bomb from a boat ... never tried again ;) The CD is still beside the xbox

I like Soul Calibur 2 pretty much as I can fight with my girl friend!

But the game where I spent most of my gamer time was on Starcraft, in multi player mode.
# August 18, 2005 3:03 PM

Bertrand Le Roy said:

Collin: thanks for the script. I can see just a little problem: if some of your selects are already hidden for whatever reason, you're going to make them visible. This can be fixed by remembering the initial state in an expando.
# August 18, 2005 3:08 PM

Bertrand Le Roy said:

Sébastien: that's a pity, that's just the very beginning of the game. This fight is a little too hard at this point, I agree, but the bombs are easily avoided, and what awaits you after that is just awesome. You should try again...
# August 18, 2005 3:10 PM

mike said:

>despite its name which only reflects its original intention

Although actually, if you think about it, any script that runs as a startup script has to be physically at the end of the page -- if it comes earlier, and if it references objects that haven't been rendered/instantiated yet, boom.
# August 18, 2005 11:37 PM

Bertrand Le Roy said:

Mike: sure, you're describing the original intention of the script and the reason why it suits our needs here even though it was originally designed for script.
# August 19, 2005 1:54 PM

Collin Yeadon said:

Yeah, I thought about that. For my purposes this was all that I needed since I am writing a small flash movie to the screen. Where toggling would become an issue is with menus that have multiple depths.

Post Correction: "I was tempted to make this script write a div to the page, position it where the IFRAME is and then style it to look like a drop down list but decided that was just not worth the hastle. " ... I meant to say SELECT not IFRAME.
# August 21, 2005 10:08 PM

Raymond den Ouden said:

I noticed a little bug on my implementation....

after resizing the window, my menu is dropped behind the selectboxes, until the page is reloaded, then it works again
# September 6, 2005 10:46 AM

Martin Dolphin said:

Hi

Tried this and it's very nice indeed - thanks for your efforts. Is the version on gotdotnet the same as your demo pics? When I tried it the output doesn't look as neat and the pictures all appear in a single column.
# September 9, 2005 3:54 AM

Mischa Kroon said:

Wow looks very nice... I will definately be testing this out for a image gallery part of a personal website :)
# September 9, 2005 4:23 AM

Bertrand Le Roy said:

You're absolutely right, the CSS that's included in release 1.1 is an old version. You can now download the right CSS file from release 1.1.1 or from source control.
Please tell me how that works for you.
# September 9, 2005 1:27 PM

Mischa Kroon said:

Stupid question but how do I get this to work.

Just putting it in the right directory didn't do much for me.
# September 12, 2005 2:51 AM

Bertrand Le Roy said:

Mischa, what happens when you browse to the handler?
# September 12, 2005 1:35 PM

Julien said:

Rulez :) This is great.
# September 14, 2005 4:25 AM

Brennan Stehling said:

I cannot wait for the examples to be on that website. I hope to use Atlas starting next week for a project which is currently under development.
# September 14, 2005 4:05 PM

Bertrand Le Roy said:

You can already check out the quickstarts on http://atlas.asp.net.
# September 14, 2005 4:34 PM

Luciano said:

LINQ is not a feature of VB but of the CLR. And I think it was first developed in c# as part of the omega# project.

Luciano
# September 20, 2005 10:21 AM

Bertrand Le Roy said:

Sure, I don't think I said otherwise, but I guess it was not clear enough. The article is about VB, though, and for the moment VB is slightly ahead on its XML support. The research project Linq comes from is C Omega.
# September 20, 2005 2:00 PM

Marco said:

Nice, thanxs for the example, gonna look into it in a moment!
# September 21, 2005 2:07 AM

Scott Allen said:

Excellent example.
# September 21, 2005 9:45 AM

test said:

I tried this but nothing happens?
# September 22, 2005 1:20 PM

Bertrand Le Roy said:

You probably made en error somewhere, but it's difficult to guess where given how little information you're giving. You can contact me through the contact page, I'll help you to figure it out.
# September 22, 2005 1:34 PM

test said:

Hi, thanks, I figured it out - I had used a different name for the DataService. Sorry for the lack of information.

Question - in the future will we be able to simply drag an 'Atlas' control from the toolbox and write code behind?

Also, in the same line of thinking, will we be able to drag an Atlas 'ListView' on the page and set it's datasource, templates, etc... similiar to the server controls?

I really enjoy the server side components, but they lack the client side that Atlas seems to have
# September 22, 2005 2:39 PM

Bertrand Le Roy said:

Yes, tooling is very high on our list of things to implement. There will be designer support (actually, there's already some support if you use the Atlas server controls) and Intellisense.
# September 22, 2005 2:42 PM

Edwin said:

LOL! I could never have imagined there would be a web site dedicated to it.
# September 24, 2005 3:10 AM

Raghs said:

I am also not aware
# September 24, 2005 4:51 AM

enki said:

Hi, thanks for article.
I didn't figure out one thing: how to rebind detail to take place of previous snapshot? (in my case I want to bind detail text to same ID where I render preview on pageload) It's not usual master/detail scenario, but it is usefull when you have datasource with some short text preview and full version of text. I can create same effect by show/hide javascript, but I want to load full text to client on request.
Adam
# September 27, 2005 4:59 PM

Bertrand Le Roy said:

Enki, I'm not sure I understand what you're asking, but I think you could bind the dataIndex to the index of the item that's chosen in the master view. For example, you could have a button in the master view's item template that triggers the evaluation of an outbound binding from "_index" (a built-in property of DataRow) to dataIndex on the ItemView.
# September 27, 2005 5:12 PM

enki said:

Bertrand, thx for help, but I don't understand step before this one. When I declare ListView with:
<label targetElement="resultsItemShortText">
<bindings>
<binding dataPath="e_shorttext" property="text"/>
</bindings>
</label>
and then ItemView with:
<label targetElement="resultsItemShortText">
<bindings>
<binding dataPath="e_longtext" property="text"/>
</bindings>
</label>
only ItemView is rendered (or ListView is first and ItemView renders over it instantly perhaps). I understand why, but cant figure out how make this schema working. It will be fine to have some example for this, because in database rendering apps you mostly need to draw detail right under related master data.
# September 28, 2005 12:17 PM

Bertrand Le Roy said:

You can't have two controls pointing to the same element.
If you need both labels to be at the same place, you could bind their visibilities to some condition and its inverse so that they never both show at the same time.
# September 28, 2005 3:05 PM

enki said:

Hm..okay, but nobody needs AJAX enviroment for show/hide logic. What is good in AJAX idea is asynchronous handling with data, which can result in beter user experience. I'll try javascript call to webmethod which update content of parent element thru DOM.
# September 29, 2005 6:37 AM

enki said:

solved, don't post it on forum, thx for kicking from bad idea :]
# September 29, 2005 2:23 PM

Bertrand Le Roy said:

Enki, if you don't mind I posted it anyway because I think it's an interesting comment.
Atlas is more than Ajax. It's a client-side application framework. What you really want to minimize is roundtrips to the server because that's the main source of user experience disruption. Ajax is a better approach than postbacks because the page stays in the browser during the round-trip, which makes the experience more continuous and reduces the disruption to the component that's updating instead of the whole page.
Atlas enables you to do much more on the client than simple updates for example by managing change notifications between components, which enables components to communicate without needing to round-trip to the server except when they need data that's not already on the page. This way, you're eliminating a disruption of user experience that plain Ajax is not.
# September 29, 2005 2:34 PM

lucasbfr said:

c'est malin tiens, j'avais du taf :D (j'en suis au 11)
# October 1, 2005 12:30 PM

Jesse said:

Thanks so much for this. I have used it on a couple of things already! I was wondering if there is any way to set the username to the membership username property automatically? I am sure it is probably really simple, but I am so used to using code behind for everything nothing comes to mind
# October 2, 2005 4:19 PM

Bertrand Le Roy said:

Not sure what you mean. What user name?
# October 2, 2005 6:32 PM

Jesse said:

I am sorry, I wasn't very clear. Basically what I want to do is populate the texbox "namefield" with the logged on users name when they click on the Add button. I am using forms authentication on my web with the ASP.NET 2.0 membership provider. In the past I would just use code behind to set the textbox text to Page.User.Identity.Name.ToString() but I don't know how to do that when the add button is clicked in an Atlas control.
# October 2, 2005 6:49 PM

Bertrand Le Roy said:

Actually, if you use a server-side Atlas Textbox control, you can still set the text property server-side like with an ASP.NET textBox.
# October 2, 2005 10:54 PM

Jesse said:

Thank you! I will experiment with this. I am so excited about Atlas and what it can offer, but right now it feels so different to me
# October 3, 2005 1:08 AM

Beto said:

Do you have the full source code from this mater page?
# October 19, 2005 9:05 AM

Bertrand Le Roy said:

There is no master page involved here. Do you want me to publish the full source code for the master/details page? I'll do that when I have a little more time.
# October 19, 2005 2:55 PM

Ran Davidovitz said:

Hi.

Good article, But I dont think that IE 6.0 support attribute selectors.
WHat versio support it?
# November 1, 2005 1:24 AM

Bertrand Le Roy said:

Right, so you'll need to settle for one size for all.
# November 1, 2005 3:47 AM

gb said:

cool one!!! it does not work on Firefox.
# November 8, 2005 5:45 PM

Bertrand Le Roy said:

Which, if you read my post more carefully (and Nikhil's) is in plain sight. The reason why it doesn't currently run on Firefox is not Atlas (which runs fine on IE, Firefox and Safari) but funny things like SVG, transparency and stuff. Nikhil didn't have time to fix all those before his November 7th deadline, that's all.
# November 8, 2005 6:20 PM

Ron Shelton said:

Agreed.

I have also had arguments with people about whether a master page (from which individual pages are derived) is an implementation of "Page Controller" or "Front Controller". I argue that it is a "Front Controller" since the derived pages act as concrete handlers of the request, but others argue "Page Controller" because the main view-decision code is centralized.

What do you think?
# November 9, 2005 9:11 AM

Bertrand Le Roy said:

That's a very interesting question. I think individual pages, as well as content pages, *can* implement a Page Controllers, and Master Page *can* implement a front controller.
Now, I think it's really a choice that you make as an application developer to use the tools that ASP.NET are providing (and that are more or less close by their design to formal design patterns) to implement patterns.
Personally, I'm advocating a model where the page itself has almost no logic and where the logic is in smaller parts. In this model, the controller is something that is on the page but it is not the page (think WebPartManager for an example).
# November 9, 2005 2:59 PM

Steve said:

Utterly fantastic. And boo-hoo to the naysayers, this is great work. I think what is most impressive is that it is all done declaratively like you mention, which is fantastic.

I hope to see a rich set of Atlas based controls (preferrably with drag and drop capability like the ASP.NET controls). Even better would be a good UI for interconnecting these controls.

Again, great work, it deserves some attention!
# November 9, 2005 10:10 PM

Danny Chen said:

Thanks for posting this. I'm going to start pointing all the forum Q's we get to this post. Maybe people will start picking up on this.
--
Danny
# November 10, 2005 1:42 PM

Scott Cate - Knowledge Base Software said:

I wonder what the market is like for the old XBOX all of the sudden :)
# November 22, 2005 6:23 PM

Julien Ellie said:

A few of us just had to show up for work this morning to get it :P Sorry about having to take off last night! Apparently the crowd at Best Buy was completly out of control...
# November 22, 2005 10:24 PM

bestcomy said:

# November 25, 2005 12:08 AM

Patrick Allmond said:

So is there a pro/con list or another thread discussing one approach vs another? i.e. Using the fancy shmancy new master page vs the classic "index.aspx?functionname=" approach? I am working on a new application and I was leaning towards master pages. But I am finding I am missing the functionality and some of the state maintenance of the "index.aspx?function=" approach.
# November 30, 2005 5:15 PM

Bertrand Le Roy said:

Patrick: they are two different things and do not exclude each other. Master pages are meant to provide a simple way to create templated pages and share common layout and/or logic between pages. The command in querystring approach is more suited to implement application logic and flow within one page. You can use both together or one or the other as you see fit. You can also use session when you need to maintain state across pages.
If you tell me more about your precise scenario, I can comment on it and tell you how I would do it (which would by no means be the "correct" way to do it, just my opinion).
# November 30, 2005 5:33 PM

Srikanth said:

Cool. Great Work!
# December 1, 2005 4:13 PM

stej said:

Hi, seems great..
Will you release this Alert for .NET 1.1? Or are there any limitations why it's not possible?
# December 2, 2005 2:18 AM

Bertrand Le Roy said:

It should be very easy to back-port to 1.1 (probably just change the script registering to the old APIs and recompile). Feel free to do it if you need it.
# December 2, 2005 1:48 PM

Raghu said:

Tried to run sample, fixed the following error, but once I click any button I get Page cannot be found - web page dialog, something is missing hear.

In the sample file Alert.aspx you forgot to add assembly in the register directive
<%@ Register Namespace="Microsoft.Samples.Alert" TagPrefix="ms" Assembly="Alert" %>
# December 2, 2005 4:34 PM

Bertrand Le Roy said:

That's true. Sorry about that. It's now fixed.
# December 2, 2005 4:40 PM

James Newton-King said:

I like your idea of trying to get the physical files last modified date to pass to Google.

I made my own version of this a couple of months ago but haven't had a website to release it on until recently.

Currently I'm letting the user set that sort of data in the sitemap file itself, but having the option to get the modified date directly from the file would be a nice option. Would you mind if I implemented it in what I made?

Here is a link to it (with the source) if you're curious:

http://www.newtonsoft.com/Products/GoogleSitemap/Default.aspx
# December 5, 2005 7:52 AM

Bertrand Le Roy said:

Feel free to modify what you want. I'll also add the possibility to add the Google-specific information directly in the site map file.
# December 5, 2005 2:41 PM

TrackBack said:

Scott about the handler and other SiteMap subjects
# December 5, 2005 4:44 PM

Plip said:

Great tip :)~
# December 8, 2005 5:30 PM

Nicolas Faugout said:

It work the same with String and Number.

(new String('foo')) == (new String('foo')) return false

(new Number(1)) == (new Number(1)) return false as well !
# December 9, 2005 9:44 AM

Srikanth said:

Building Number?!
# December 9, 2005 10:26 AM

Srikanth said:

Good One!
# December 9, 2005 10:38 AM

Bharani Mantrala said:

I clicked on the link in the post. Everything looks fine. One nice thing to have and I feel is a great feature is to have the address somewhere on the screen. I had to click on road view, zoom out to find the location.
# December 9, 2005 10:53 AM

Bertrand Le Roy said:

Nicolas: of course, you're absolutely right, but while it is relatively rare to instantiate strings and numbers through their object constructors, dates always are. That's what makes it trickier for dates than for strings or numbers.
# December 9, 2005 3:11 PM

Bertrand Le Roy said:

Building 42 (see the subtitle of the blog).
# December 9, 2005 3:12 PM

Fabien said:

What the hell are you doing at work today or posting here for that matter!?
Shouldn't you be playing your new 360?

Enjoy!
# December 9, 2005 3:42 PM

Chris Hammond said:

Congrats! Look for me on xbox live if you want sometime

christoc
# December 9, 2005 4:43 PM

Julien Ellie said:

So what's your gamertag?
# December 10, 2005 12:56 AM

Laurent Kempé said:

$379 for that bundle!!!!!
Here in europe it is more than 499 euro :-(
# December 10, 2005 3:31 AM

Andrey Skvortsov said:

Something wired about Atlas-it seems Atlas dosen't support xml two/one-way xpath data binding a'la Avalon,and it dosen't work with Indigo even through basicHttpProfile...
Is there any plans for some changes in these areas?

Thanks.
# December 10, 2005 6:16 AM

Wim Hollebrandse said:

Come accross the BSOD yet? ;-)
# December 10, 2005 12:59 PM

Jim said:

I. Hate. You.

:-)
# December 11, 2005 7:51 AM

Bertrand Le Roy said:

Laurent: of course there was a typo in the price. It's $479, not $379 of course. That would have been quite the bargain.

Julien: I'm BoudinFatal. I know, it's ridiculous :)

Wim: no BSOD. Works flawlessly. Smelled like hot metal in the first few hours, which kind of alarmed me but it's pretty common for new gadgets to smell a little at first and nothing bad happened. The power brick didn't even get nearly as hot as I expected having read some of the comments by first shipment buyers. I know lots of people who have a 360 and none of them had any problem. I really think these problems are uncommon but people who experience them are very vocal / listened to because of the whole blog phenomenon. Can't say I blame anyone for being vocal when they see that their hot new toy doesn't work after having waited in line for a whole night to get it, but a small percentage of defects is inevitable.

Jim: I know you do ;) Hope you get one soon.
# December 12, 2005 1:58 PM

Bertrand Le Roy said:

Andrey, xpath binding is currently not supported for the moment, mainly because xpath is not yet supported natively on all browsers we want to support. Still, you can bind a property to a data path using the dot notation familiar to ASP.NET developers.
Indigo interoperability exists as a prototype (and was shown at PDC during the keynote) but we're still working with the Indigo team to determine the details of the final implementation.
# December 12, 2005 2:08 PM

Andrey Skvortsov said:

Thanks for clarification,I posted about these problems on Atlas/Indigo forum but no one replied.It's always good to know what's going on.

Best wishes.
# December 16, 2005 4:54 AM

Andrey Skvortsov said:

Thanks,very interesting info;-)
# December 16, 2005 5:04 AM

Nicolas Faugout said:

I totally agree with the fact that the 'A' in AJAX is very important. But I'd like to add that there are ways to fake an 'unfrozen' UI. One that we use in our AJAX applications is to show an animated GIF with a message in front of the UI (ie Please wait...) just befor the Synchronous call. This way, the GIF (for example we take 'the little animation') make as if the UI was not frozen. Plus, we are sure that the user doesn't click anywhere because he can't. That's the good point about Synchronous calls that we like.
# December 16, 2005 8:28 AM

Dave said:

Synchronous Sucks. The first time I ever used an app that used xmlhttprequest object was back in 1999. It would fetch reports "Synchronously". Gosh, that was a terrible user experience. The browser would just freeze for 30 seconds.

# December 16, 2005 11:27 AM

Bertrand Le Roy said:

Nicolas, that's absolutely true and is the way to go. This way, you can even disable just the part of the UI that is dependant on the pending call and have an application that's still as responsive as possible in addition to the whole browser still being usable. Read more about this technique in Atlas here:
http://weblogs.asp.net/bleroy/archive/2005/12/01/432031.aspx
And read about an example of disabling UI declaratively:
http://weblogs.asp.net/bleroy/archive/2005/09/20/425698.aspx
# December 16, 2005 2:07 PM

Geoff Van Brunt said:

Headline: "Web Developer deep-sixes development project by pretending to know AJAX but making calls synchronously"

Translation: "Man accidentally shoots son in the head while teaching him hunter safety"
# December 16, 2005 2:43 PM

Bertrand Le Roy said:

Geoff, I agree with you so much it hurts. I just hope I made a good job explaining how this whole thing is a very bad idea. But you know, people just want that very much, so if that's what they want, here's how to do it... Maybe they'll realize how bad an idea it is after a while and when their users complain. Hopefully.
# December 16, 2005 3:09 PM

asynchronous dude said:

I have had just the opposite experience - using asynchonous on IE with its limited pool of concurrent TCP connections causes race conditions and deadlocks...
# December 16, 2005 3:43 PM

TrackBack said:

Didier Girard a la gentillesse de pointer vers ce post.
# December 16, 2005 4:09 PM

Bertrand Le Roy said:

Asynch dude: I think in all browsers, you're limited to two simultaneously open connections per domain. Is that what you're referring to? I've never seen that cause race conditions or deadlocks but if you have a sample repro I'd be happy to take a look at it. Contact me through the contact page of this blog.
# December 16, 2005 8:29 PM

sushi said:

Ok, so I'm one of the developers that wants to shoot myself in the head - and I'm starting to think that may not be a bad idea after receiving the following request. :)

I have a very unique situation however.
I have a request to implement a VERY complicated security scheme in an INTRAnet
business application. Depending on a users security profile, INDIVIDUAL items
on any given screen may be accessible but some may not be. The security profile
is data driven by the back end which uses an Active Directory like
schema to implement user and group securities. User security
and profiles are controlled by the end users that have
the Administrator Group OR Security Administrator permissions assigned to them. Any combination of individual or group permissions is possible. This means the
entire security scheme is dynamic.

I have only been able to think of two ways to implement this.

1) Use a client call back that uses an out-of-band RSP on the backend to check the
users permissons at the time the item is clicked. The client callback
responds accordingly if users don't have permission. If there is no permission,
an error window is opened telling the user they don't have permission to perform
the requested action and the requested action is cancelled. If the user has
permission, then the action proceeds. This worked very well in beta 2.0. Yes the
the browser was blocked, but the response time was always < 1 sec for either the
the error window to open or the original request action to proceed. Keep in mind
Im working in a known network environement where I know everyone is using the
latest version of IE.

2) When the user logs in, write a cookie with all of the user permissions in name
value pairs. Use javascript to navigate the name value pairs to see if the user
has permission. The rest of the actions are the same as number 1. The routine
for navigating the name value pairs would be complicated because of security
rollups in the form of groups.

Either way I'm looking at some sort of "synchronous" activity. If I could think
of a way to get this to work asynchronously I would do it that way. Number
1 was a much cleaner implementation. I also thought that it would
be more secure because security information was never stored on a
client. I can certainly see a way for a user to "hack" the cookies methodology. Any ideas?

Thanks for your help.
# December 17, 2005 8:44 PM

Pierre said:

Wow ... that's really Amazing ! Thanks Bertrand for the article ! :D
# December 18, 2005 3:34 AM

Bertrand Le Roy said:

Sushi: Thank you for taking the time to explain your scenario in details. Sure, synchronous programming is usually easier, I'm not denying that, but I see nothing in your description that necessitates a synchronous call. 2 is certainly not the only way to solve the problem and is not something I would recommend.
How about disabling the relevant part of the UI while the callback is going on?
# December 18, 2005 3:36 AM

sushi said:

Bertrand: Thank you for your response. I'm not sure I understand your suggestion clearly. Let's say a user clicks a link that takes them to an entire page they are not suppose to have access to. In the sycnronoush scenario, when the callback ran I returned a false to the click event. The error window opened and the action was cancelled. (e.g. similar to OnClick="JavaScript: return false;"). Asynchronously the link event is carried out regardless because it occurs while the call back is running. How would I disable the UI since the user already clicked it? I was hoping to avoid complicated page load scripts that disabled all of the relevant UI. In the synchronous scenario, I was able to use a custom class and all of the security code was encapsulated. I like your idea though - if you could give me a little more detail it would help a lot. BTW - I don't like option 2 either :). Thanks a lot!
# December 18, 2005 7:51 PM

dan said:

this who 360 situation is making me sick. A few friends of mine and I have been following the 360 for about a year. from the days of zenon (or however you spell it) up until the time magazine artical (which i have framed in my room) till now when i still cant get one. I did not have the money at the time to pre order last spring so i decided to take a risk and order from a somewhat sketchy site. Well, i didnt order it, a person was trying to do me a favor by preordering it. Unfortunatly this friend was not one of the ones following it and didnt know that any site claiming on getting 500 xbox's on the release date had to be a fraud. long story short, i tried camping at best buy but the employees cut the campers of at about 50 so i was not able to get in. Too bad for most of them that only 20 xboxs arived and 30 some odd ppl got sent home empty handed after over 24 hours of camping. well, now im stuck. From my parents and relatives i asked for games, a faceplate, controllers, live subscriptions and everything possible for xbox. Unfortunatly, i wont have a system under the tree on xmas. mabye i can try hitting my head with the controller i bought to make me forget about the 360. xboxless in New Jersey..... dan
# December 18, 2005 8:46 PM

Bertrand Le Roy said:

I see. I didn't understand you were using an event to cancel the normal operation of the link. Anyway, you have a security check on the target page, right?
Well, in that case you should not have the target url in the link initially. Instead, just navigate from the callback function, after the security check has returned, using window.location.href.
So it goes this way. The onclick event triggers a script that disables the UI and triggers the callback. When the server has given its response, the client callback function is called, which re-enables the UI and navigates if the user was validated.
One more thing: why does the server render these links at all? Couldn't it determine from the server side that the current user does not have access to it and directly disable or make it invisible? It's a frustrating user experience to have buttons or links on a page that you're not allowed to use.
# December 18, 2005 10:48 PM

Bertrand Le Roy said:

Dan, I empathize completely and wish you luck on getting your XBOX. Talk to your local retailers, be nice to them and try to get them to give you the date of their next shipment. This worked for me. I got mine from Costco.
# December 18, 2005 10:50 PM

sushi said:

I agree. IT seemed logical at first to make the links invisible or disable them. However - there are numerous functions on any given page that would have to be enabled/disabled. I chose this implementation due to performance considerations at the time the page loaded. I saved numerous transactions becuase the security check was only performed when the action was clicked. I considered breaking up the UI - however this would have created a broken/difficult navigation interface. It would be like breaking up XP. Navigation links are not the only things that have security. For example - some users may be able to view data, but not change it. This means at load time all of the edit/insert buttons would have to be disabled on the screen within every single grid or form view. Or I could have had two screens. One with edit capability the other without. However, that means having two screens to maintain. A change on one screen forces a change on the other. The two would at somepoint diverge. It would also create a source code difficult and time consuming to update.
As it stands now I can implement security on anything that is clicked by just adding
a single JavaScript call to the OnClick or OnClientClick event handler of any clickable object. I also gained screen consistancy. How would I disable the edit linkbutton in a gridview after the user clicked it? Is there a way for the JavaScript call back event to put a gridview into edit mode on the proper record?
# December 19, 2005 2:25 PM

Jackson said:

Hi All,
I'm not too sure if It's just me or VWD Express. But when I try to incorporate this sample in to my application, I can NOT get the 'ms' tag to appear in the intellisense and when I try using <ms:alert></ms:alert> tags I get an error "Validation (Internet Explorer 6): Element 'ms' is not supported"

Basically, I'm taking these steps:
1. copy the Alert.dll (and I've tried copying everything else as well) to my bin directory.
2. Then referenced the .dll through the "Add references..." dialogue.
3. Added the registery directive "<%@ Register Namespace="Microsoft.Samples.Alert" TagPrefix="ms" Assembly="Alert" %>"

Still can't get it going .... maybe someone can show me the error of my ways.
Cheers!
# December 20, 2005 5:15 PM

Bertrand Le Roy said:

I don't know how often permissions change, but you could cache the security information server-side and solve that performance problem.
About grid linkbuttons, they are going to post back anyway if the security check succeeds, in which case you'll have to re-check the security (the request could very well be forged).
So with your solution, in the success case you have:
- two network requests (one for the security callback and one for the postback)
- two security checks
In the deny case, you still have one network request and one security check.

If you removed the callback from this button and only did the security check during the postback, you'd have only one network request and one security check in both cases. It seems like this is the way to go.

There is currently no way for the JavaScript callback to put the grid in edit mode. You need a postback for that.
# December 20, 2005 5:24 PM

Bertrand Le Roy said:

Jackson: Is the problem only in the designer or do you also have a problem at run-time?
# December 20, 2005 5:26 PM

Jackson said:

When I try to use these new tags. They are NOT available through intellisense and If I manually type it in, they are underlined with the red 'sqiggly' line. Which displays an error automatically and prevents me from starting the application/debugger.

Now I'm fairly new to ASP.NET, so I don't know if I am adding the .dll reference correctly or if the issue is with my designer, Visual Web Developer Express.

Thanks for your help Bertrand.
# December 20, 2005 5:39 PM

Bertrand Le Roy said:

You may still run the site using CTRL+F5 from VWD. This should start the web site and open a browser on it even if there were compilation errors. Then you can see what happens at runtime.
# December 20, 2005 5:44 PM

Jackson said:

The site won't compile and gives the following errors:

"Request for the permission of Type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

"Element 'Alert' is not a known element. This can occur if there is a compilation error in the website"

Note: This error is not specific to my application. I opened a new blank project and get the same errors.

Do you have an email address I can forward a copy of my test project to? Maybe diagnosing the problem will be easier if you can see it, first hand. Cheers.

-Jackson-
phluong@hotmail.com
# December 20, 2005 6:10 PM

Bertrand Le Roy said:

Yes, it seems like you have a more general problem in your web server setup. If a blank project does not compile... When you say blank, you mean completely blank or blank except for the alerts dll in the bin folder?
You can e-mail me at bleroy (at Microsoft.com).
# December 20, 2005 6:26 PM

Steph said:

I do understand your concern, however what to do if - for example - a user refresh a combo box content from picking a value in another combo box?
This is a simple example where asynchronous can lead to a mess at your server side.
The user select something in the combo, nothing happens within 2/3 seconds. So, the user gets nervous and selects again the value, or another one, and so on...
Resulting in tons of request on your server...
Are you sure you want to stay asynchronous?
I do prefer to freeze one or two browsers rather than killing my server...



# December 21, 2005 11:58 AM

Bertrand Le Roy said:

Steph: You absolutely want to stay asynchronous in this case as well, but as I said, you should disable the relevant UI (in this case the first combo) while the callback is going on. And you should give visual clues to the user as to what's happening (like a "loading" message).
# December 21, 2005 2:05 PM

TrackBack said:

Nikhil's post on the December CTP
# December 23, 2005 2:54 AM

Pierre said:

Just curious : would you have some demo applications of what Atlas can do ? Thanks !
# December 23, 2005 8:05 PM

Bertrand Le Roy said:

Pierre: Sure, check this out:
http://apps.nikhilk.net/VirtualPlaces/

We also have a Wiki application, but it's not yet in sync with the December release of Atlas.
# December 24, 2005 3:32 AM

arvind surana said:

How does the RaiseBubbleEvent() of control class C invoke the OnBubbleEvent() of its parent control class when we know that OnBubbleEvent() is protected member
# December 28, 2005 4:07 AM

Bertrand Le Roy said:

I think you're making a confusion: an instance of a class can call a protected method on other instances of the same class.
# December 28, 2005 4:19 PM

TrackBack said:

Scott on confirmation from inside a GridView.
# January 3, 2006 7:59 PM

Azra said:

You add a tape recorder in?
# January 7, 2006 5:57 PM

Wim Hollebrandse said:

Err...you decided to put a mod chip in? ;-)

Problems with overheating?
# January 7, 2006 6:53 PM

Wallym said:

Its turned the wrong way?

Its broken?

You had laid it flat and had something on top of it?
# January 7, 2006 7:05 PM

BrandonFurtwangler said:

looks like you spilled Tang on it and had to throw away the face plate.
# January 7, 2006 8:23 PM

Chris Hammond said:

Cause you got a new faceplate?
# January 7, 2006 8:54 PM

Travis said:

No, why? Tell me before I pick one up. Planning on it when they become available at the local Walmart.
# January 7, 2006 10:04 PM

Dror Engel said:

i think you baought PS3 faceplate :)
# January 8, 2006 2:59 AM

Brian Scott said:

You are painting your faceplate.
# January 8, 2006 12:49 PM

Chris Hammond said:

well that would mean you are customizing your faceplate. Cool.
You just inspired me, I think I may go paint my OEM faceplate this afternoon.
# January 8, 2006 3:21 PM

chris hammond said:

Wow, that's far more indepth than I had imagined!
# January 9, 2006 11:43 AM

Ziolrooski said:

really nice job!
# January 14, 2006 10:27 AM

Robin Debreuil said:

Yeah, really love it too, those colors really work well. And hey, your drawings aren't bad either. Inside every programmer is an artist trying to get out. Or something like that : ).
# January 17, 2006 1:45 AM

mike said:

You appreciate, I hope, that cultural references in documentation are highly discouraged due to problems with localization. This one is benign, I would guess -- the string can safely be meaningless without the cultural context (although what's a reader to make of a meaningless error string?). But the general rule (unfortunately, perhaps) is that bland is best. In fact, one occasionaly hears the verb "to blandize" to describe the process of removing "interesting" stuff from examples.
# January 20, 2006 12:29 PM

Bertrand Le Roy said:

I do, Mike, that's why I thought it interesting to find this "unblandized" sample. The reference here is actually quite subtle, which probably explains why it wasn't spotted.
# January 20, 2006 1:54 PM

Patty said:

Alright, obviously (please don't make fun of me) I'm a newb. I just bought my 360, how do u take the faceplate off, and to a newb, how hard is it to install a silent fan system.
# January 22, 2006 1:35 AM

Bertrand Le Roy said:

Gently insert a flat screwdriver's head between the plate and the console on the top, and then very gently pull the plate towards you. It should give fairly easily. If you're careful, you should be able to do that without breaking anything.
About installing silent fans, I'd love to do that too, but I don't want to void my warranty. If you really want to do that, I guess there should be tutorials on the web. Just Google it.
# January 22, 2006 3:42 AM

TrackBack said:

His post contains link to interesting and related samples.
# January 24, 2006 5:41 PM

Pierlag said:

Trop bien ;)
# January 25, 2006 4:49 AM

Wim Hollebrandse said:

I guess the explanation for this is down to one thing:

Loose typing.
# January 26, 2006 7:26 AM

Aapo Laakkonen said:

Another workaround:

Use strict equality operators: === and !==.
# January 26, 2006 7:30 AM

Aapo Laakkonen said:

Yet another workaround for older browsers (IE4 and below and old netscape browsers):

((typeof("") == typeof(0)) && ("" == 0))

And why it's like that:

http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Operators:Comparison_Operators
# January 26, 2006 7:43 AM

Ron Buckton said:

== In javascript is a lazy comparison operator and makes an effort to normalize the values before the comparison. If you want a strong comparison operator that also compares types, use ===. This is the strict equality operator.

""==0 // true
""===0 // false
# January 26, 2006 9:44 AM

Alan Oursland said:

Here is a theory:
An empty string is a length 1 array containing '\0' (which is equal to zero). Javascript automatically casts single length strings to characters and vice versa. '\0' == 0 therefore "" == 0.
# January 26, 2006 12:02 PM

Bertrand Le Roy said:

Loose typing is not enough to explain it: Javascript could very well just do the implicit cast to bool only in a boolean context. Instead, it's booleans that are converted to numbers.
Thanks for all the workarounds, which are of course better than the toString thing.
Updating the post.
# January 26, 2006 12:18 PM

Christian Wenz said:

if you do PHP a lot, you get used to these built-in type conversions ... :-)
# January 30, 2006 11:56 AM

Eric Lippert said:

> If anyone has a reasonable explanation for this, I'm all ears.

This is a consequence of two simple rules.

1) When comparing a string to a number, convert the string to a number.

This makes more sense than converting the number to a string. After all, you would like "1.010" to compare equal to 1.01, right?

2) Empty or all-whitespace strings convert to zero.

This is maybe a little more borderline weird, but it makes some sense.

Once you have these two rules in place, 0 == "" --> true is an obvious consequence.

>Oh, and about a workaround... You can use toString() on both sides of the equals operator once you've checked that they are not undefined or null.

A better workaround is:

a + "" == b + ""
a - 0 == b - 0
!a == !b
a === b

which force string, numeric, boolean or strict comparisons respectively.

> changing it would have been a breaking change so they had to add the === operator to finally get it right

No, the === operator was added because strict type comparison semantics are necessary to implement a sensible switch statement, which was not in the original Netscape version of ECMAScript. It would be really weird if you could create a switch statement but not the equivalent series of if statements, so we added a strict type equality operator.
# January 30, 2006 1:20 PM

Bertrand Le Roy said:

Eric: Thanks for the comment, I really appreciate, and as I've said, there are things I really do love about Javascript. I understand all that (and have actually included one of the better workarounds), but I don't think it qualifies as a reasonable explanation, it just reinforces the idea that the need for strict comparison was an afterthought and that's how the == operator should have worked from the start (that's how it works in some other dynamic languages).
I just don't see any good reason to use == in place of === except to save one char as === always just does the expected thing.
# January 30, 2006 2:10 PM

karl said:

What's the perception from the ASP.NET team on how interested the developer community is in Atlas? Personally, I’m extremely apathetic about the technology and the hype around it. Since the day Atlas was announced, it’s always seemed like an un-innovative attempt to catch-up. Of course, there’s still plenty of confusion about what Atlas is and why you’d want to use it versus client callback (man, is that still around?) and other 3rd party AJAX providers (Ajax.NET, MagicAjax, …). I played with the PDC bits, and was thoroughly put off by the declarative programming samples – it burdens the development process and seems like an “oh isn’t this cool” when it really doesn’t have anything to do with the problem space being solved.

You and I talked at TechEd. I was writing the AJAX.NET documentation and wanted to bounce some ideas off you about client-callback and ajax.. At that point, Atlas wasn’t publicly known (not sure if it was internally known, since client-callback was still the in-thing). Frankly, the ASP.NET team seemed totally disconnected about the topic, and to this day continues to go down an unclear path.

On July 14th you had a wonderful post titled “Some thoughts about server callbacks and Ajax.NET”, in which you identified a possible alignment issue between the ASP.NET team and average developers. To me that should have sent a red flag to Scott and crew, but I’ve never really seen the topic followed up. If you guys think of things one way, but “most users” think differently, then there’s a problem. What checks have been introduced since callbacks to make sure Atlas is better aligned?

To be fair, my exposure to Atlas hasn’t been great. The problem is, I’m not really sure why I need to bother with it. I just don’t see what added-value Atlas will bring to my already-rich XmlHttp toolset. I realize that part of Atlas is another prototype (prototype.conio.net), and that’s great (assuming I don’t want to use prototype for some reason).

About the article, parts of it deserve to get slashdotted and ridiculed. JavaScript isn’t OO? No exception handling? No inheritance? Googling any of these terms “javascript object oriented”, “javascript exception handling” and “javascript inheritance” results in a number of useful hits. There are other quote-worthy things in that article.
# February 2, 2006 9:53 AM

Bertrand Le Roy said:

Karl, you know what? I think your feedback deserves a full post. I'll do that in a few minutes.
# February 2, 2006 2:16 PM

foobar said:

Atlas is one of the most glorious things to come out of the ASP.NET dev team.

It's simplicity is simply amazing. There's so much tedium saved when using the paradigm provided by Atlas. The lone fact that code-behind usually never needs to be touched is a testament to how encapsulated Atlas is.

Compared to all of the other solutions I've seen, Atlas is the most feature complete and definitely the least intrusive in terms of modifying existing code.

Keep up the good work.
# February 2, 2006 5:01 PM

scottgu said:

Here is a sample of using the <atlas:updatepanel> control with the December CTP to build a Task-List application that is Ajax based and enables paging, sorting, in-place editing and RSS feeds in ~40 lines of server code and 0 lines of client-javascript: http://weblogs.asp.net/scottgu/archive/2005/12/26/433997.aspx

You can download it and play with it locally if you have either VS 2005 or Visual Web Developer installed.

Hope this helps,

Scott
# February 2, 2006 5:22 PM

blowmage said:

What really frustrates me about the Atlas libraries right now is that it seems to be very difficult to do what is so easy in other libraries. I guess I'm speaking specifically of behaviors. I want to drag an item, any item, (not necessarily a list item - it could be any element) and when I drop it I want it to *revert* to its previous location.

And then I want to know if it was dropped on an element I care about so I can handle that event.

Here is the code from the "drag-and-drop" section on the script.aculo.us web site (http://script.aculo.us/):

<img id="product_1" class="products" src="images/product-1" alt="mug">
<img id="product_2" class="products" src="images/product-2" alt="t-shirt">
<div id="shopping_cart" class="cart">
<img src="images/drag-here" alt="">
<div id="shopping_cart_text">Drag all the stuff you ever want right here.</div>
</div>

<script type="text/javascript" language="javascript" charset="utf-8">
new Draggable('product_1',{revert:true});
new Draggable('product_2',{revert:true});
Droppables.add('shopping_cart', {
accept: 'products',
hoverclass: 'drophover',
onDrop: function(element) {
$('shopping_cart_text').innerHTML =
'Dropped the ' + element.alt + ' on me.'; }});
</script>

I wouldn't mind writing the script code declaratively, but I don't want to write my own controls implementing IDragSource and IDropTarget to do this either. I just want to wire it up and have it work. So right now it seems Atlas is solving problems I don't have, and makes it difficult to solve problems I do have.
# February 2, 2006 5:29 PM

Bertrand Le Roy said:

Blowmage: I don't know the Atlas drag & drop feature too well so I can't provide you with a solution from the top of my head but I'll ask around.
Maybe you can tell me exactly what your scenario is and what you feel is missing. From what I know we can handle html elements (like your sample is doing) or arbitrary data so I doubt this sample could not be reproduced with Atlas.
I'll get back to you when I have an answer.
# February 2, 2006 5:41 PM

blowmage said:

Thanks Bertrand. I also don't doubt that Atlas can't deliver the same result, but the question is how? And how much effort is involved? I investigated the November release for quite a while, and the "right way" to use Atlas seemed to be to write new IDragSource and IDropTarget controls to achieve the desired result. I found this to be too much effort for (rapidly changing?) pre-beta scripts and went with the solution I've already written using prototype/script.aculo.us.

If you, or anyone else, could show an Atlas version of the previous code snippet that delivers the same result I will gladly dump prototype/script.aculo.us in favor of Atlas for the project I'm working on.
# February 2, 2006 6:08 PM

Wilco Bauwer said:

Blogmage: you should be able to do something similar already using Atlas. In fact, Scott Guthrie did something similar in his keynote demo at PDC05 (declaratively).

Anyway, I believe the DND API in Atlas is flexible enough to allow for all sorts of scenarios - from floating elements to drag/drop between zones to drag/drop between external applications (IE-only). However, the current behaviors that use these API's don't integrate that well with the other controls which makes it a bit difficult to do anything useful with it.
# February 2, 2006 6:08 PM

Bertrand Le Roy said:

You know, that's exactly the kind of feedback we need. If a feature is not covering your most common scenario except by having you jump through loops we want to know and we'll make that better.
I'll definitely follow-up on that and either post an equivalent sample or make sure this is addressed in a future release.
# February 2, 2006 6:11 PM

Graham Dyson said:

Personally when I installed the first versions of Atlas, had a quick look and couldn't see how I would ever make productive use them. But from reading this blog and being a page and control developer myself I took them for what they were, a prototype.

The newer stuff is fantastic and is coming from a much better angle. The openess of how your developing it is giving it a user focused direction. I can see how I'd use them directly in alot of the web applications I'm working on and give massive benefits to my users expriences.

Keep up the good work lads!
# February 3, 2006 7:28 AM

Lukas Peyer said:

As far as i know there is no drop event in Atlas DnD by now, but promised for the next release. So we have to be patient until we can use simple declarative Drag n' Drop within Atlas.
Definitively looking forward to that too.
# February 3, 2006 12:35 PM

karl said:

Damnit, burnt on the first point :) I was sure it was you, oh well.

I never said I was right (well, except for the declarative part ;) ), but I did think my perception might be shared by others. I haven't given Atlas a fair chance, and that's part of what bothers me - normally I'm an early adopter and excited about this kinda stuff, but somehow Atlas hasn't managed to float my boat as it were.

When I get some spare time, I _will_ take a thorough look of Atlas and hopefully use my skillz to help others see the light I'll hopefully find :)

Cheers,
Karl
# February 3, 2006 12:38 PM

Steve said:

I have a sample:

Today, I needed to validate that a value was entered into a textbox if a radiobutton list item was selected in a radiobutton list. I explored the validation controls but they didn't help me much since the customvalidate accepts just a client side function name, without parameters.

I first off had to have the client side code in a .js file for easy debugging.

But ASP.NET gives control id's - so I had troubles using javascript 'getElementById'. Since I couldn't pass the clientid to the customvalidator I got stuck.

The whole time I was working on this issue, I thought 'I wish Atlas could solve this because I really don't like generating javascript code'

# February 4, 2006 12:41 AM

Bertrand Le Roy said:

Steve: I'm not sure what you're trying to do here. Are you using ASP.NET validators or Atlas validators?
You can get the client id from the server control by looking at its ClientID property.
# February 4, 2006 12:53 AM

Bob Campbell said:

In all fairness to the consultant/journalist, Eweek and Karl, part of what is being discussed here comes directly form the "Understanding AJAX Applications and ASP.NET 'Atlas'" document that is part of the Atlas Hands-On Lab vsi. The document states under the AJAX Technical Concepts section "...Furthermore, because JavaScript is not an object-oriented programming (OOP) language, it does not have strong typing, namespaces, exception handling, and other OOP features." Note: the hands on lab is great.

Bob
# February 4, 2006 10:18 AM

Steve said:

ASP.NET creates its own id at runtime - that is some of my problem.

I haven't tried the Altas validators yet - I will give them a go.

Thanks!

Guess my overall question is - will Atlas satisfy my client side needs or is it just about 'ajax' ?

I'm a huge fan of C# - not a big fan of javascript - but I love the results of good client side code
# February 4, 2006 6:42 PM

Bertrand Le Roy said:

Bob: that's a good point. The hands on lab document is wrong too, then.

Steve: I'm still not sure I understand the problem here. Did you try using ClientID? Yes, Atlas is much more than just Ajax: it's a complete client-side framework and not just a communication infrastructure.
# February 4, 2006 8:13 PM

Steve said:

ClientID?

Yes, in my .js file I try to get the id - but the ID is not the Id of the control as I put in the page.

ie.

I get some ctl01_<name of control>

This 'ctl01' is not my id and there is no way to know that id from my .js file.

I don't put script in my pages since I can't easily debug my scripts.

Also - I can't pass the id when I use a customvalidator - there is no place for parameters, all you can you do is specify the client side function.

How do I under how this new framework works for javascript? All I've seen is typical javascript with calls to web services with JSON.
# February 4, 2006 11:24 PM

Bertrand Le Roy said:

As I've said before, you can get the client Id server-side using ClientID, but you don't even need to do that. The client-side custom validation function has a signature that enables you to get a reference to the element and arguments: function(sender, args). The arguments have a Value property and an IsValid property. Please read that article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIWebControlsCustomValidatorClassTopic.asp
# February 6, 2006 2:09 AM

Steve said:

Betrand, I'm sorry but you can't get the clientid in your javascript, it's dynamically created at runtime.

Maybe your misunderstanding my post, but everyone knows this issue where ASP.NET generates id's at runtime that are not the same as the id you set, especially when the control is 'inside' another structure.

As far as the validator, it only gives you the control itself, but if you want to check the value of a different control to against that control , you can't pass get a handle on it. The only reason again that I would want to do this is because you can't access the generated clientid.

I know the <%= control.clientid %> - but this does not work unless you put the javascript in the aspx page, which I don't - it's in a separate .js file.

Again, I don't want the client id on the server side, I want the id of the control in the javascript code.

ie. I have a radiobuttonlist and a textbox. Based on whether a valid is selected in the radiobuttonlist determines if the textbox is required. ie. selected value 3 in the radiobuttonlist requires text in textbox. Therefore, my validator needs to know both the radiobuttonlist clientid and the textbox clientid in the javascript. But, instead of id's of 'TextBox1' and 'RadioList1' it's something like 'ctr01_TextBox1' and 'ctr02_RadioList1". (This really poses an issue if you add a new control because it can change this dynamic id).

Surely you understand this?

# February 6, 2006 8:28 PM

Steve said:

Here is another issue - when you use anything in ContentPlaceHolder:

it doesn't use the id of, ie' TextBox1 - it uses ctl00$ContentPlaceHolder1$TextBox1 as the client id - which you would have to use this second name in the .js file and hope it doesn't change.

I'm encountering this with the previouspage cross post:

TextBox txtName = PreviousPage.FindControl("txtName") as TextBox;
TextBox txtName2 = PreviousPage.FindControl("ctl00$ContentPlaceHolder1$txtName") as TextBox;


The first one above doesn't work - I have to use the ASP.NET generated id instead.
# February 7, 2006 11:57 AM

Steve said:

I have discovered the problem:

Master pages.

When I use regular pages, the clientid's work fine.

When I use master pages - ie. a cross page post it changes or rather creates it's own id.

TextBox txtName = PreviousPage.FindControl("txtName") as TextBox;
TextBox txtName2 = PreviousPage.FindControl("ctl00$ContentPlaceHolder1$txtName") as TextBox;

The top example fails, the second works with a master page.
# February 7, 2006 12:24 PM

Bertrand Le Roy said:

Steve: Server-side, when you want to use FindControl to find controls that are in any kind of naming container, don't call Page.FindControl, use the container's version of FindControl. So in your second scenario, you'd get the master page from the previous page and then find the control from there. Same thing for a panel or any container control.
For your validator control, the way most people do this is by creating their own validator class and adding it a property for the second control's id. At pre-render time, the new validator control will have to register a startup script that initializes a small javascript structure that the validator's js file can find from its own id and then lookup.
To be clearer, the validator generates something like ClientID + "_secondControlID = \"" + FindControl(SecondControlID).ClientID + "\";"
The validator script evals its own id + "_secondControlID", and the result is your second control's client id, which can then be obtained using getElementById.
The FindControl here may be replaced with something that looks up the naming container chain so that it works inside repeaters and other containers.

But here's something I'd like to ask you: this is completely off topic and is polluting the comments thread. Furthermore, I see that you've posted similar questions on Nikhil's blog on a post where it is equally off-topic. Next time, please contact me directly through the contact page of this blog or ask your question on the relevant forum on http://www.asp.net.
# February 7, 2006 1:30 PM

Steve said:

The issue was concentrated around this topic and did get off topic, my apologies.

The main question and details I was looking for was about this:

"Yes, Atlas is much more than just Ajax: it's a complete client-side framework and not just a communication infrastructure. "

My example was really about the integration between writing javascript and accessing the controls on a page. It's in this whole setup that I would like to learn more about how Atlas will help on this.

My example was sideswiped by conversations on 'clientid' when actually that is the point of my question: it's these type constructs when working in javascript that I hope Atlas addresses.

I'd like to see more talk and conversation about this client-side framework and less about the communication infrastructure. I think the closest I've seen is on Nikhil's talk on behaviors. It seems more oriented toward 'control developers' than page developers.

This is not a complex sample, but I was working with the ASP.NET Menu control yesterday and I noticed that when you select a menu item that the page does a postback. The page also has a submit button. I'd like to be able to have the menu not do a postback but still be able to pass me the selected value before submitting. Unlike last time with validators, don't get caught up in the details - because what I'm asking is - will Atlas be the approach to take for this type of senario? Or do I need to, ie, attach attributes to the menu items and store values in hidden fields?

I'd like for Altas to make it a rich experience in the UI without all the javascript - mostly because I'm more of a C# developer who is asked many times to provide a richer interface that requires javascript. With Atlas I see a solution.

Again, sorry to go off topic, but I think it's really on topic because it shows the 'work arounds' required to do something as simple as accessing a control id through a DOM.
# February 8, 2006 7:37 AM

Bertrand Le Roy said:

Steve: Sure, I see your point here. Typically, an Atlas aware server-side control will generate xml-script instead of all the JavaScript that's needed today, like in your validator example, which should be much cleaner. But in essence, the solution is not that different: you have a js file that contains the definition of your client-side behaviors, html and something that glues the two together. In ASP.NET 2.0 you had ad-hoc JS functions in the js file, and javascript code to do the glue. In Atlas, you'll have classes in the js file and xml-script to glue. It will be much easier to generate the glue from the server-side than when you had to come up with hacky JS like I described in my last comment.
I'll try to write more posts on the client-side framework as it can be used by page developers.
For the menu control, you can already prevent the postback by using NavigateUrl with the javascript: protocol. It's not an ideal solution but it gets the job done and it's fairly simple. An Atlas Menu control would be best here, but we don't have that yet.
C# developers who want a richer web experience without the JS are a primary audience for us. Rest assured that will show in the final designs for Atlas.
(and I think we're back on topic now, thanks).
# February 8, 2006 1:28 PM

Rick Strahl said:

Yeah me too. I was out Windsurfing on one of the biggest days of the season with 20+ foot swell faces and there were only a few people out. Gotta love all those couch potatoes for making way...

Football? What is this goofy sport anyway? <g>
# February 8, 2006 4:51 PM

blowmage said:

I agree, I love that presentation style. So much better than death-by-PowerPoint! The first time I saw this style was at RubyConf 2005. I gave a 90 second, 20 slide presentation at my local .NET user group last month using a similar method.

Jim Weirich has a great Ruby on Rails presentation using a very similar presentation method. You can find here:

An Quick Introduction to Rails
http://onestepback.org/index.cgi/News/IntroToRailsMovieAvailable.red
# February 10, 2006 8:07 PM

Chris Brogan... said:

Bill- I absolutely LOVED this presentation, but what you've gotta appreciate is this: the first time I learned of it, I *heard* the presentation on the podcast ITConversations. Can you imagine? I was blown away in AUDIO ONLY. When I finally got to see what the crowd saw, I wanted to BE Dick Hardt. And now, with his slideshow, I CAN! Muahahaha. Oh. Sorry.

--Chris of [chrisbrogan.com]
# February 15, 2006 9:43 AM

Maestro said:

I would like to see better javscript library support for those of us who are willing to brave the big bad world of javascript. (perhaps even explore the use of prototypes for code organization??? the current javascript code looks aesthetically like shit, as I'm sure you know) Also I would like to see JSON added to Atlas (or something JSON-like) utilizing full .NET attribute support etc. Also there are some timing bugs in the XMLHTTP wrapper code that occasionally delay the execution of synchronous calls till after queued asynchronous calls instead of right away. Give us lightweight optional tools like JSON, not heavyhanded all-encompassing "solutions". Otherwise, looks good.
# February 20, 2006 6:47 PM

Bertrand Le Roy said:

Maestro, we ARE providing better OO support for JavaScript (namespaces, interfaces, enumerations, etc.) and we ARE using JSON on the wire (there are JSON.serialize and deserialize methods client and server side) so I'm not sure what you're referring to.
Also, the bug you're talking about seems to be coming from most browsers only allowing for 2 simultaneous connections to the same domain but it could also be the batching code that we have in place that will become optional in future releases. But without more details, it's hard to tell.
# February 20, 2006 6:53 PM

Alan Oursland said:

I think this is especially error prone since it lets you put the var keyword in front of each "declaration". I don't know really know the full semantics of "var". I know that it declares a symbol to be a variable and that it is optional, but it seems like it might be useful for it to give some warning if you use it on a symbol more than once.

Python uses the same scoping rules as JavaScript. It might have something to do with syntax associated with weak typing. Because you do not actually have to declare variables, there isn't a good way to tell when you want a new variable or reuse an old variable. So you have to attach the scoping rules exclusively to code blocks.
# February 24, 2006 3:41 PM

Bertrand Le Roy said:

If you turn on strict mode in Firefox (which I recommend to all JS developers out there), you do get a warning for multiple declarations.
I think you're right. I'm also suspecting that it has to do with the very nature of dynamic languages but the exact precise reason why they could do it for function blocks and not other kinds of blocks eludes me.
# February 24, 2006 3:44 PM

Edgardo said:

Ehm, where is the weirdness in this? C# works exactly the same, nested if blocks use the same scope.
# February 24, 2006 7:01 PM

Bertrand Le Roy said:

Actually, C# won't let you compile that. BUT a variable is not accessible outside of its scope. This:
{
int x = 1;
Response.Write(x);
}
Response.Write(x);
will not compile, whereas JavaScript would be perfectly happy with it and write 1 twice.
# February 24, 2006 7:25 PM

James Newton-King said:

I have been bitten a number of times using "i" in nested for loops without realising it. The inner loop overwrites the value of the outer loop.
# February 24, 2006 7:29 PM

Aby Mammen Mathew said:

I am not sure how effective AJAX is, basically you need two things - 1. Asycnhronous mechanism
2. XML feed

however I noticed most efforts using javascript are reinventing the wheel which java had already designed and built. why can't we just have a control that provides just the above two artifacts and have java component meddle the dynamic aspect.

Second thing I noticed is there is no code signing for javascript libraries, hence any garbage can be fed on the uplink.

This weekend i am going to take a good look at this AJAX nonesense.
# February 24, 2006 7:30 PM

Bertrand Le Roy said:

Way to go. Just start with the assumption that it is nonsense...
Seriously, Java is out of the question for a number of reasons, the most obvious being that it's not installed on all machines. The goal here is to be able to easily build rich applications on just a modern browser using HTML and JavaScript without any optional plug-in.
Do you have a scenario where the lack of code signing is a problem?
# February 24, 2006 7:39 PM

Brian said:

Here is another weird thing:

function what()
{
for(x=0;x<5;x++)
{
alert(x);
t();
alert(x);
}
}

function t()
{
x = 12;
}

In IE I know you you'll get "alert(0)" then "alert(12)" and it will exit your function.
I have run across this a couple times when I have a function that is calling another function that uses the same variable without the "var x;".

That has bit me in the butt a couple of times, if you don't "declare" your variables.
# February 24, 2006 8:06 PM

Bertrand Le Roy said:

Brian: I don''t think this one is especially weird. It *is* a bug factory, yes, but you need a way to reference global variables so this is more or less needed.
If you run this in Firefox in script mode, it will issue a warning for the use of an undeclared variable, which really helps avoiding this kind of problem.
# February 24, 2006 8:10 PM

Scott said:

Bertrand,

Execution scope in Javascript is pretty hard to get used to. Especially when using the 'this' keyword. I've got a couple of links that saved me from having to read teh ECMA spec.

Private members in Javscript: http://www.crockford.com/javascript/private.html

Closures in Javascript: Explains execution scope and how closures work. http://jibbering.com/faq/faq_notes/closures.html

Javascript closures took me a long time to understand, I'm still not sure I really understand how they work. But I'm getting closer to understanding.
# February 25, 2006 12:25 AM

Steve said:

More good reason to have a client side version of C#.... :)
# February 26, 2006 12:06 PM

chris hammond said:

Oh my brain hurts. I never did well in physics in college :)
# March 1, 2006 12:03 PM

Richardc said:

Ca y'es, c'est reparti ;-)))))
# March 1, 2006 3:10 PM

Richardc said:

Mais j'ai oublié: ca fait d bien dans ce monde de brute!
# March 1, 2006 3:10 PM

Pierre said:

# March 1, 2006 9:02 PM

steve said:

the link to the power plant doesnt work
# March 3, 2006 10:13 AM

Bertrand Le Roy said:

Yes it does. It's just that this article hasn't been written yet.
# March 3, 2006 1:26 PM

Roger said:

Of course they would. Tides are caused by the interaction between the Earth's rotation and the gravitational pull of the Moon. The tides themselves introduce friction into this system and dissipate energy because of their drag on the coastlines and ocean floor. Even without any tidal power plants the tides are slowing the earth's rotation and causing the Moon's orbit to recede. However the effects are so small it takes thousands of years to be noticed. Tidal power plants would increase this effect in a microscopically small way.
# March 3, 2006 2:50 PM

Bertrand Le Roy said:

Sure, I think that's what I was trying to say. You make a good point on the fact that the Earth has the same kind of energy dissipation on water and rock that synchronized the Moon's proper rotation with its orbit. That effect is probably huge when compared to what tidal plants could do.
# March 3, 2006 3:01 PM

uber1024 said:

Rotation is overrated anyway.
# March 4, 2006 4:55 PM

DetroitJ said:

While this is an interesting topic for a discussion, you have the tail wagging the dog. The moon does not orbit the Earth because of the tides. Even if the power plants were to absorb all of the tidal energy in the sea it would have no impact on the moon's orbit. Furthermore given that the mass of water on the earth compared to it's mass as a whole is so small the effect if any would be negligable.
# March 6, 2006 2:54 PM

Bertrand Le Roy said:

DetroitJ: I never said the "moon orbits the Earth because of the tides" but tidal energy is gravitational energy and if you pump it it's going to have an impact on the relative movements of the Earth and Moon, it's plain simple energy conservation. And I think I made it quite clear in the conclusion of the post that these effects would be negligible...
# March 6, 2006 4:01 PM

Walt Lounsbery said:

First, I'd like to see a proof that the so-called tidal effects in the Moon's crust made it rotate faster or slower. What was the original rotation rate? Why? I have seen theories that the Earth and Moon split apart early in their evolution, which would require synchronized rotation as an initial state (although conservation of angular momentum would make the moon speed up a bit on separation as it coelesced into a sphere). Is the current theory about the origin of the Moon any different?

All seriousness aside for a moment, you should be a lot more concerned about the damming of the natural rivers of the Earth. Those lakes and powerplants have got to be ruining things. I'm pretty sure of it. And those Segways. Zipping around on electric thingies is just not natural. If all the Segways started driving in the same direction, it would totally screw up Daylight Savings Time. Then they would run off the edge of the contiinent, fall into the sea, and electrocute the whales. That would be bad.

I'm moving to a cabin in Montana.
# March 7, 2006 9:36 AM

DetroitJ said:

Bertrand: I think Roger's post "causing the Moon's orbit to recede." threw me off because you responded "Sure, I think that's what I was trying to say". I did not mean any disrespect.

The tides (or lack thereof) would not cause the moon's orbit to recede. The mass of the world's oceans are included in it's overall mass. The moon's orbit would decay due to it's orbital velocity being decreased by space particcles, comets, whatever else is up there crashing into the moon. Classical mecanics descibes gravity in the following; the standard formula for gravity is:

Gravitational force = (G * m1 * m2) / (d^2)
where G is the gravitational constant, m1 and m2 are the masses of the two objects for which you are calculating the force, and d is the distance between the centers of gravity of the two masses.

Given that G is a constant and m1, m2, and d would not be effected by any tides the gravitational force would be unefected.
# March 7, 2006 11:51 AM

Bertrand Le Roy said:

Walt: thanks for the funny post. On the serious stuff, I think you make a very good point. I have to admit I'm not a specialist of planetary system formation (and I quit physics altogether 10 years ago shortly after I got my PhD), but why would the moon be synchronized in its proper rotation and not the Earth? I think you'll agree with me that without any calculations it's easy to see that the minimum energy state for the moon is the synchronized state no matter what the initial state was. And maybe if the initial state was synchronized it was for a similar reason (i.e. minimum energy)?
On the other stuff, I want to reassure you: I'm not concerned at all and will continue happily driving my Hummer here in Seattle. You may want to stay away from Montana though. You know? Cause of the bears. They're the real threat to all Americans.

DetroitJ: good point: the "receding" part had failed to register in my brain. Of course it would not recede, that would mean bringing energy to the system instead of taking it away. I think Roger himself meant the opposite of what he said. Thanks for the formula for gravitation ;) You may want to try this one which has some nice additional features (but may make calculations a little trickier):
Guv = 8 pi G Tuv / c^4
# March 7, 2006 12:41 PM

Analgesia said:

I'm not an expert, but I read somewhere that the moon is very slowly moving away from earth. The lack of gravitational power coming from the moon rotating around the earth would make the earth spinning irregularly in stead of its current axle.
As far as I can tell getting power from the tide will only accelerate this process of the moon moving away.

some quotes I found:
"Tidal friction, caused by the movement of the tidal bulge around the Earth, takes energy out of the Earth and puts it into the Moon's orbit, making the Moon's orbit bigger"

"The Earth's rotation is slowing down because of this. One hundred years from now, the day will be 2 milliseconds longer than it is now."
source: http://curious.astro.cornell.edu/question.php?number=124
# March 8, 2006 8:10 AM

Bertrand Le Roy said:

Analgesia: thanks for the link. It confirms the story about the Moon's orbit locking down because of the tides, and it even tells how long it took (althoug it doesn't explain how this was measured or calculated). I'm surprised at the Moon actually receding because of the tides: instinctively, when I thought friction, I thought dissipation, but it seems like the energy is actually pumped from the rotational kinetic energy of the Earth into the gravitational energy of the system. The article makes a good job at explaining that.
Now, if I'm not mistaken, if you use the tidal energy (and block part of the tides), you'll divert part of this energy and dissipate it into whatever we do with it, which means that you's participate in the Moon slowing down its escape. In virtue of action and reaction, would it also slow down the slowing down of the Earth rotation? Maybe. Anybody wants to compute that?
# March 8, 2006 12:38 PM

Jb Evain said:

Hey Bertrand,

I've just learned how blocks can be simulated in JavaScript:

var x = 1;
if (true) {
____(function () {
____var x = 2;
____if (true) {
________(function () {
____________var x = 3;
____________alert (x);
________}) ();
____}
____alert (x);
____}) ();
}
alert (x);

Well, it's a trick :)

(From: http://www.application-servers.com/links.do?reqCode=showLink&lid=3092 )
# March 10, 2006 12:21 AM

Michel said:

The answer is in your post.
- With standards we don't have to write the same application several times => standards enrich the web.
- There is an Ajax boom although Ajax is not a standard => standards don't sterilize the web.
The fact that IE5/IE6 were much better than Netscape 4.x and that Netscape didn't improve sterilize the web.
The fact that IE6 had been put in sleep until Firefox was much better sterilize the web.
When standards (HTML, XHTML, CSS...) will be correctly implemented, we can say : that it's done. And then we can make still better things.
# March 10, 2006 2:29 AM

Joakim Sundén said:

Browser vendors must be able to come up with new innovations without having to wait for the standardization process; except that the audience would have to wait for new features the vendor would loose a competitive edge. But new innovations should be introduced with responsibility and good guidelines. Non-standardized web sites in many cases make it impossible for people with different disabilities to gain access to them. From this perspective the Ajax hype is worrying; we were finally getting somewhere with WAI/WCAG/Section 508, e.g., the built-in support in VS2005, when suddenly AJAX enters. I have not yet had the time to investigate what kind of problems AJAX introduces in this regard, but somehow it seems that developers does not want to let these considerations getting in the way of building cooler and cooler apps. I would love to see Atlas (help) handling this problem better than many AJAX web sites out there. Oops... I guess I wanderd off the topic there.
# March 10, 2006 3:22 AM

Wesley said:

I think your asking the wrong question.

If browsers fully support the standards... they can add as many extra's as they please! Nobody will be againts that! If browsers don't support the standards and bring in there own implementation and interpretation of standards... THAT'S a nasty thing. Two examples:

1) The boxmodel: Microsofts IE 5(I believe) did some strange thing in not implementing the boxmodel in the correct way. This resulted in a messed-up website if I built my website according to the standards. So I had to built one website for IE and one for all the standards compliant browsers. That's a nasty thing!

2) Filters: Microsofts IE has some very nice filter which can greatly enhance a javascript slideshow. This gives me the change to produce nice looking slideshows for IE and lesser looking slideshows for the other browsers by simply checking for the filter property. So this is a nice extra feature. (have a look at my site)

To my opinion it's good to EXTEND the standards in order to grow to a higher level and to give a feed for new standards. Unfortunately it takes a long time for a feature to become a standard. That's more of a problem that's caused by the stadardization authorities and definately not by the browsers or developers. Developers would be more than please to have a standard for AJAX. As of right now the have to implement 15 hacks to make it work on every browser!

And it's a very bad thing to simply not obey the standards.

Cheers,
Wes
# March 10, 2006 5:05 AM

Steve said:

Honestly? I think the teams of IE, Firefox, Netscape, Opera need to work closer together.

As far as XmlHttp - Isn't IE the only 'odd man out' since it uses ActiveX whereas with Firefox/Netscape it is not an ActiveX control?

I think you are better off to create good models for programming against the standards than to try to change the standards without all the members onboard.

It creates a nightmare for developers who have to create public facing webpages for 3-4 different browser standards.

Compliance and a common underlying browser model benefit the community.

Does it mean some cool things are left out? Yes. ie. I would like to also learn XUL for Mozilla - but it seems a waste of my time since I'll never be able to use it.

In summary of my opinion: if more work was done to to work together on standards with other browsers rather than just to try to extend their own, we'd be in a better place.

by the way: What ever happened to Javascript 2.0 ?
# March 10, 2006 7:34 AM

Micael Baerens said:

I don't think the problem is new features - the problem is when there IS a standard on the implementation of a feature, this standard should be followed.

Any browser innovations are, by definition, not anything other people have done before - so you would in reality be setting the standard.
# March 10, 2006 8:10 AM

Ruben said:

I don't think people gripe as much about implementing non-standards based functionality as you're suggesting. People gripe about not implementing standards.

For example, many modern browsers (such as Gecko-based browsers, but others as well) implemented XmlHttp and a drawing canvas, neither of which is standard. But they also provide standards support for silly things like (X)HTML, CSS2.1 and up, SVG.

It's an and-and thing. And in the past (and present) MS is taking the either-or approach. And always going for the non-standard approach, leaving half-implemented buggy standards implementations and yet-another-way-of-doing-things(tm) for the world to deal with.

Another thing that influences people's poor perception of MS (and IE in particular), is progress. IE has been on hyatus for incredibly long, while other browsers prospered, building on standards, whether official or defacto, and adding new ideas. Sure, the initial implementation of certain standards wasn't complete or flawless from the start. But a few months later it was better. And another few months later even more so.

Yet IE didn't even try, and still doesn't really; IE 7's rendering engine is just a 5.3 bugfix release (5.5=5.1, 6.0=5.2, if you're honest). That's what people gripe about.
# March 10, 2006 8:42 AM

Joe Fiorini said:

Standards are a very good thing. They enforce interconnectivity in a world where it is badly needed. Web developers need to be able to design a web site without fussing over how it looks in five different browsers (or even three). Web pages should be design once, and that's it.

However, I do think there is value in innovating with a browser, especially for those who know their userbase will be using a particular client. For example, I worked at a company that was standardized on IE5.5+. Therefore, I knew I could web apps with IE specific controls in them and not worry about it. However, this never would have flown if some people were using Netscape or Mozilla (Firefox was not around at the time).

Manufacturers really need to concentrate on making sure their browsers adopt the W3C CSS standards before they try to innovate. Once designers can create a web site that looks and feels exactly the same in Firefox, IE. and Safari, without having to include browser specific workarounds, then they can work on platform-specific innovations.

How can we help make this happen? I propose education. There aren't many official, professional resources out there for web standards. Most designers rely on Google and blog entries. What if Microsoft added a web design section to the patterns & practices group? This could go a long way in educating people on best practices for web design.

Just my $0.02,
Joe Fiorini
# March 10, 2006 9:20 AM

Stan Guss said:

It is sad that you would even ask the question. The fact is that standards are very innovative and one of the greatest lacks in innovation has been IE 6. I think that Netscape and Firefox are actually better browsers and support Web Standards much better.

I have been using VS 2005 for a couple of months now and there are things that I see that still convince me that there is a lack of understanding of what the standards bring to the table. Why do many of your controls, especially your navigation controls and validation controls still emit JavaScript instead of putting the script in a js file? Why, when you format a control using a properties window do the controls emit inline styles? Why do your navigation controls still emit table tags?

The real sad part is that front end development work for the web in VS 2005 is centered on trying to make is similar to building a Window form. Just mindlessly dragging and dropping controls onto a form. If you understood CSS and Style Sheets and some of the unbelievable things that you can do once you understand what a selector is I think that your view of standards would change. Many tasks such as building dropdown menus and flyouts are very simple using CSS and inheritance of elements with little to no JavaScript. All you have to know is unordered lists and how to format them using CSS and CSS Positioning.

Lastly, I have already encountered some very annoying things using VS and Master Content Pages. For instance, you cannot change the “id” of a form. Also, you cannot change or add JS events to the body tag. I use a literal control for my body tag and create the text in the “Page_LoadComplete” event. This would all seem probably very unimportant if you did not know CSS. It is also very annoying that you change the id of the controls to that ctl00_MasterContentControl_id format when the page is sent. Some of us like to do our own JavaScript and DHTML and like placing that script in a js file.

Finally, when I put my Masterpage File path in my web.config so that I do not have to put the path in the directive on each content page, I get errors under my asp controls in my content pages saying: ‘Unrecongnized tag prefix of device filter asp’. which disables my autocomplete. I generally use Source View to create my pages.

So yes, I think that Standards can enrich the web if Microsoft trully embraced them.

They say:
if (window.XMLHttpRequest){
req = new XMLHttpRequest();
req.open("GET", url, true);
req.send(null);

You say:

else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.open("GET", url, true);
req.send();

Let’s call the whole thing off…
# March 10, 2006 10:36 AM

Bob Campbell said:

Loose standards seem fine. But the current trend of "one size fits all" (ODF) is BS. There is a time and a place and a way to develop standards, ODF does not fit any of the criteria in my view. And I think strict aherence to standards in general stiffles innovation...especially in technology.

I think a good example of something that has not always followed standards but has proved to be an exceptional value on the web is none other then good old IE. Yes...I mean that. I have used IE since 4.1 and despite its shortcomings, it has stood up very well. And it has been the same in every company I've worked for... where would AJAX be if IE had strictly adhered to the standard du jour?
# March 10, 2006 12:55 PM

Bertrand Le Roy said:

JB: I think we read the same blogs ;) . I've seen this one. The problem with it is that it uses nested closures. I'm fine with closures when used reasonably, but this one for me is too much. I think it's not very readable, it has all the dangers of closures and it's just not worth the trouble.
I think it's best just to be conscious of this problem and deal with it without hacking around it.
# March 10, 2006 1:08 PM

Bertrand Le Roy said:

Excellent feedback guys, thanks all! I expected some to fail to notice the tongue in cheek, provocative quality of the title and I wasn't disappointed ;)
I also expected some interesting ideas and I got them too.
I'm updating the post with the most interesting feedback and my own comments in a moment.
# March 10, 2006 1:14 PM

Wilco Bauwer said:

I totally agree with this being a chicken and egg problem. Sometimes it’s almost frustrating to see what kind of fancy things you can do on the desktop, especially with WPF (Windows Presentation Foundation). When I compare this to how the web seems to be evolving, it sometimes feels that web developers are stuck in the past. I see a lot of cool things going on in for example WPF ranging from a high level of flexibility/extensibility to interesting concepts such as timelines which enable you to do visually interesting things. On the web, we only just had a hype about incremental updates using “AJAX”.

Ideally, the progress that we make on the desktop would be available on the web as well. It’s just much harder to push new technologies on the web, because people will generally avoid technologies that don’t work in the major browsers (even if it requires a download of some dependency). When people however target the desktop, they seem to care less about dependencies. Both the deployment options and (relatively often a specific) audience play an important role in this.

To embrace innovations on the web, I think at least the companies behind the modern browsers need to work close(r) together to work on providing 'universal technologies'. As long as that’s not going to happen, we’ll probably have to wait endlessly for new technologies to see the light in the world that is the web.
# March 10, 2006 1:52 PM

Wilco Bauwer said:

"If browsers fully support the standards... they can add as many extra's as they please! Nobody will be againts that!"

I'm not sure I agree with this. The problem I see with this approach is that this makes innovations harder. When different browsers each decide to add non-standard features, there's a chance that at some point things start to collide. I think it would be more effective if there was a roadmap that was shared by all modern browsers.
# March 10, 2006 1:57 PM

Aaron Seet (icelava) said:

Can somebody explain to me, the thousands upon thouands of high-rise buildings we have established around the earth, plus rows and rows of windmills, have no drag effect on global air currents?
# March 11, 2006 7:33 AM

Wesley said:

@Wilco Bauwer: first of all... Great weblog you have!

Second: Off course I don't want to encourage browser vendors to all invent a different approach for the same thing. Once something is invented and proves it value... let there be built a standard in a short timespan. Once there's a standard, other browsers can implement the same thing in a consistent manner.

And I - as a spare time developer - can built one website working on all browsers and wil have some extra's in other browsers. If slowly all other browsers would implement 'the extra' according to the standard being set... my extra's would work on all other browsers.

And sure you're right... if there was a roadmap, shared by all modern browsers... life would be much easier for us. And more boring perhaps;-)
# March 11, 2006 6:00 PM

Bertrand Le Roy said:

Well, Aaron, everything has an effect, and no energy comes free, but the question is how large the effect. If you consider the area of cities and windmill farms and compare that to the total area of the Earth, it's negligible.
# March 11, 2006 11:17 PM

Rick Strahl said:

A lot of people show their respective opinions in light of browser favorites here. I personally think that this isn't about browsers in general although they have their part to play. A lot of the difficulty of client side development would go away if browsers supported the standards correctly. While it's not easy to do this I'm sure, it shouldn't be a technological hurdle and it should get fixed, but I don't see this as likely. Instead the browser vendors point fingers at each other's implementation.

But the real issue I think that Bertrand is getting at is this: HTML and JavaScript standards have been stale for many, many years. Standards body or not there's been zero innovation in this space that reflects of what applications are actually being built ontop of the HTML platform. Think of the lack of more powerful controls like a decent scrollable multi-column list object (ie. like a ListView) or Tree control, or a better inline editing API. These are things that get re-invented over and over and over again by you and me as developers or by tool vendors in non-standard ways, resulting in much less uniformity and countless wasted hours on re-inventing the wheel.

It's clear that that sort of thing belongs in the platform (ie. the DOM) not the tools that ride ontop of it. Yet nobody bothers. These sort of things would be fairly easy to do, to extend the existing standard without breaking any existing functionality - there's no reason not to do this, yet nothing in this respect has happened.

So from that aspect I can certainly agree with Bertrand that stodgy standards are hurting any sort of forward momentum.

Every few years we some some other sort of 'exciting' UI technology come out that has a lot of this functionality, but it never gets off the ground because one or another big vendor is not going to support it and well, frankly, because it's not HTML. The only sizable contender to HTML at all is Flash and even Flash is completely dismissable in terms of mind-share for Web application development (not counting pure UI Glitz).

It's clear that HTML is going to continue to be the way to build Web uis for some time to come, even though richer UIs are available.

The question is: How do we drive some action into this direction? I admit - i have no anwers. But I can't imagine that there's a seasoned Web developer out there who's happy with what's available 'out of the box'.

# March 13, 2006 1:24 AM

ulu said:

Get a life NERDS
# March 13, 2006 2:10 AM

Bertrand Le Roy said:

Ulu: you know nothing of our lives, which may very well be a lot more interesting than yours for all I know.
# March 13, 2006 3:24 PM

Scott M. Stolz said:

This really is more of an "open-source" vs. "proprietary" type of argument here. On one side they say the standards should be open and agreed to by all and on the other side they say that people and businesses have a right to not disclose their code and create systems how they want. You have two camps and its more about politics than technology.

And then there is the issue of de facto standards and official standards. Open-source and standards advocates cringe when I say this, but quite honestly, anything that 80% of people use is a de facto standard regardless of whether or not it is an official standard. A perfect example is Microsoft Word documents. They are a de facto standard. At least 95% of computer users have encountered such documents, thanks to Microsoft Office being so popular and the fact that Microsoft Windows includes WordPad (which saves documents in Microsoft Word format) for free... and the fact that OfficeOffice.org and other programs open and save Microsoft Office documents.

Before people start arguing that Microsoft Word is not a standard, lets look up the meaning of the word standard. It means "Something, such as a practice or a product, that is widely recognized or employed, especially because of its excellence."

So, what we are really talking about is open standards agreed to by standards bodies and not talking about standards, which can be proprietary.

One thing that open standards do is allow smaller guys to be on the same page as the bigger guys. It also reassures the marketplace that they are spending money developing products that will be around for while. Look at the HD-DVD and Blu-ray. Many manufacturers are holding off because they are not sure which will become widely adopted. They don't want to spend money developing products that no one will use or that will get replaces with something else soon. Example: Betamax tapes.

So standards bodies provide some stability to the market, but that doesn't stop anyone with a good idea and some money for marketing to go out there and convince others to adopt his way. Which I think is a good thing. It keeps the standards bodies from becoming complacent, and it also encourages innovation.

The fact that there is a competition between open standards and proprietary ones is a good thing. And many of the proprietary ones become open standards (after much negotiating and compromising).
# March 13, 2006 3:53 PM

Collin said:

You can't always follow standards. I suggest you follow as many as possible but then decide if some neat new feature is great enough to justify dropping a percentage of users of a browser that may not have picked up that new method or way of doing things. Cross browser/cross platform is important but it's more important to look at the big picture.

Standards in no way have stopped innovation, it's just a matter of choosing which innovations are more important then 100% standards compliance.
# March 14, 2006 3:49 PM

Colin McGraw said:

While some here claim standards stifled innovation, I actually think the opposite is true. Standards are what has DRIVEN innovation for the past generation of technology.

The formation of the HTML standard represented a departure from proprietary document format which enabled us to create perhaps the biggest innovation of our generation: the Internet. The adoption of the standard and the portability it represented made it feasible to build a worldwide network. This simply wouldn't have happened if competing vendors presented 500 different viewing options for web documents.

Additionally, the ease of use and portability of HTML drove the formation of the XML standard which spawned SOAP and Web Services which then influenced people to consider the feasibility of an ultra-portable messaging architecture and the eventual adoption of SOA and hence the WCF. Sure you could have had SOA without XML and Web Services, but I firmly believe the idea never would have been as popular without their invention, standardization, and resulting widespread use.

So I’d say that standards (like HTML, XML, SOAP) are what drove progress the past few decades while proprietary technologies (DCOM, .NET remoting, Microsoft Office documents, IE filters) haven’t really resulting in anything earthshaking breakthroughs despite their quality and usefulness. Furthermore I think departure from standards only serves to undermine the assumption of universality and portability that drives progress, so I think IE can be a hinderance in this regard (and I say that as a die-hard Microsoft fan and IE user).

That said, I think what the Web needs is not a departure from standards, but increasingly better extensibility within the standards: Javascript needs to become object-oriented, and it wouldn’t hurt to push the concept of encapsulated UI in the markup itself (something like server control tags, but with a Javascript object or referenced XML/XHTML template driving the rendering on the client-side).
# March 14, 2006 7:34 PM

John said:

In response to Colin McGraw. Instead of adding extensibility options like your suggesting, why don't the browser manufacturers work on creating a joint coalition under which a new engine is produced. One that conforms to a set of standards that both companies can use and build around. Then as new features come into play they can decide what makes it and what doesn't, but in either case if it is approved, it will be approved across the board.

I don't think that we, as developers and designers, should be hampered by the vehicle we display our work in. The browser application should be the focus of the manufacturer. I don't think that this question is answerable in the current lack of compliance with any one solid set of standards.
# March 15, 2006 3:13 PM

Bigolnickthephysicsteacher said:

So when using tidal energy, are we slowing the moon down, or slowing the rotation of the earth?
# March 15, 2006 3:54 PM

Stan Guss said:

Hi Bertrand,

Well, first let me say that I have only been using VS 2005 for about 2 months and my comments were only first impressions. I am truly committed to using VS and do not know what else I would use. At this point, Dreamweaver is not an option… As for my joke about “XMLHttpRequest()”, that is all it was meant to be, I was just joking, not trying to take a cheap shot, truly.

Anyway, I love CSS and Web Standards. What can I say… This is the extent of my html code on my master page that I used to build my personal site at StanGuss.com:

<div id="wrap">
<div id="logo"></div>
<ul id="nav"></ul>
<asp:contentplaceholder id="Title" runat="server"></asp:contentplaceholder>
<asp:ContentPlaceHolder id="Content" runat="server"></asp:ContentPlaceHolder>
<asp:ContentPlaceHolder id="Sidebar" runat="server"></asp:ContentPlaceHolder>
<div id="footer"></div>
</div>

As for IE, it’s really not that I have anything against the browser, I continue to use it because it is so well integrated into the Office products and it is my default browser. It just seems that since Microsoft integrated IE into the operating system that not a whole lot has gone forward. In fact, there are now more browsers than ever before. I would just like to see Microsoft out in front of the pack and I think that supporting the W3C Standards goes a long way to that end. I am very much looking forward to 7.0.

As for navigation controls like the treeview control, I just dropped the control onto a form and I am still seeing the JavaScript embedded in the client source when I run the page. So I am not sure what I am doing wrong. But I also do realized how easy the control is to code and it does work in Mozilla so I did not mean to be so critical.

When you asked the standards question, I just assumed that you asked because you had not used technologies like CSS and CSS Positioning. To me, with very little effort anyone can produce beautiful web pages. I went to an interview recently for a .NET position where a fairly large company had farmed out the development of their corporate website to an outside entity. The reason was not that they did not have the resources, it was that: “We do not have the capabilities”. And the product that was delivered was not very flashy, in fact it was pathetic. I could go on, but it was just something that had been talked about in the interview. So I guess it was still resonating in my head that higher level developers cannot uses simple technologies like CSS. I’m sorry, it was a slack comment…

Anyway I am working on VS 2005 and did not want to give the impression that I had given up. Actually, it is very interesting to actually be interacting with you guy’s.
# March 15, 2006 4:06 PM

Bertrand Le Roy said:

Bigolnickthephysicsteacher: from what's been said above, I'm pretty sure it's slowing down the rotation of the Earth (by a very tiny amount of course). Also, it's established that tides transfer energy to the Moon-Earth couple and bring them farther apart. So I'd say that if you act against them by virtue of action and reaction you should be bringing them back together (relatively, I mean, the effect will be minuscule). Then again, no calculations done here, just hands reasoning so I may be wrong.
# March 15, 2006 4:13 PM

Bertrand Le Roy said:

Stan: I'm not sure what you mean by "JavaScript embedded in the client source". It may be the event handlers (onmouseover, etc.) or it may be the instance-specific initialization code at the bottom of the page. But the actual code for the control's logic is always in a separated resource file and is *never* embedded into the page. You can drop me email (bleroy at you know where) and we can discuss it.
# March 15, 2006 4:25 PM

Edgardo said:

Fantastic news.
# March 16, 2006 9:54 PM

Dflying said:

Really cool!
# March 17, 2006 2:28 AM

Wilco Bauwer said:

Hm. I better hurry up if I want to be the first ;). I've been working on exactly the same thing every now and then since last Christmas now. Here's a very little teaser:
http://www.wilcob.com/wilco/downloads/ruby005.png
# March 17, 2006 3:14 AM

relok said:

Wilco, so why not to join your forces with them?
# March 17, 2006 3:53 AM

Mischa Kroon said:

A bit further along is:
http://www.iunknown.com/

Have a look at it it looks slick :)
# March 17, 2006 5:18 AM

Mario said:

Try Boo, boo.codehaus.org Very ruby-esque and is supported (debugging, winforms development, refactoring) in SharpDevelop.
# March 17, 2006 10:13 AM

Clive said:

I think all the trees we cut dowl will allow the wind to blow more freely, so turbines are not a problem, tidal friction has been going on since water flowed on the earth, so tidal schemes are of no real effect. the main worry for me is all those solar panels, if we keep putting them out at the rate we are, we could end up using up all the sunshine and we could be plunged in to permant night! ;-))
# March 17, 2006 11:47 AM

Bertrand Le Roy said:

Mischa: if I'm not mistaken, this is a bridge between .NET and Ruby, it's not an implementation of Ruby on the CLR.
# March 17, 2006 3:09 PM

TrackBack said:

Rick continues the discussion on his blog
# March 17, 2006 4:13 PM

TrackBack said:

Ars Technica / M-Dollar points to this post.
# March 17, 2006 4:33 PM

TrackBack said:

The ServerSide .NET points to this post.
# March 17, 2006 4:33 PM

miguel jimenez said:

But a new language implementation is not what I would expect from Ruby... I would rather prefer an implementation of On Rails for .NET ... that would be great!!!
# March 18, 2006 8:12 AM

John Lam said:

Yes it is a bridge, but I suspect that for the 80+% case this is what most people want - have .NET and Ruby objects seamlessly integrated in the same Win32 process. It will be *very* difficult to get a real Ruby implementation up and running on the CLR - the language is just so, well, dynamic. The bridge is already pretty usable now - I've built Avalon apps as well as Windows Forms apps (not to mention most of RubyCLR itself) using Ruby.
# March 18, 2006 7:48 PM

Bertrand Le Roy said:

Bridges have not been trhat successful so far (no matter what the language is) so I really doubt that. IronPython shows us that it is possible to have a dynamic language perform very well in the CLR. Actually, I would express doubts the other way around: I doubt a bridge will utlimately perform well because it will have so much marshalling to do.
# March 19, 2006 12:06 AM

John Lam said:

Bridges are not about performance. Neither are dynamic languages (necessarily). What dynamic languages buy you is the flexibility to write less code, and (hopefully) better algorithms because there's less language noise that gets in the way.

Most apps spend most of their time not doing very much. Yes - there is marshaling that has to be done, but how expensive is the cost of marshaling some EventArgs into a Ruby block in a UI-based app that runs on a processor retiring several billion instructions per second?

It's not that I haven't paid attention to performance in my bridge; if you take a close look at the implementation, you'll see that I don't use Reflection at all at runtime - instead I generate compiled CIL shims that do the marshaling in the most performant manner possible.

Burn the CPU cycles in the name of programmer productivity - I make it trivial for folks to use native CLR code in their app wherever it is warranted.
# March 19, 2006 3:01 PM

Bertrand Le Roy said:

John, don't take this the wrong way, I'm sure you're building a great and useful product. It's just that I'm more convinced by a full CLR implementation of the language than by a bridge. I wish you a great success with your project.
And yes, it's all about developer productivity.
# March 19, 2006 4:15 PM

Tom Medhurst said:

No No No! Compiling Ruby just seems wrong!
Why not talk to the .NET Framework through standard ruby scripts?

http://www.iunknown.com/

All we need now is a decent IDE for ruby (I'm working on it guys?! :p)
# March 20, 2006 6:26 AM

Michael Bradley said:

For a .NET implementation of the Rails framework see http://www.castleproject.org/index.php/MonoRail
# March 20, 2006 1:05 PM

Bertrand Le Roy said:

Yes Yes Yes! Just look at IronPython and how well it works. Why would Ruby be any different?
# March 20, 2006 1:51 PM

Max Mulawa said:

Cool stuff, but .NET is still to slow for games :( but I wouldn't mind writing games for XBox 360 as .NET develper. What about Commodore 64 ? :)
# March 22, 2006 9:00 AM

Geoff Van Brunt said:

TI-99/4A? Wow, that brings back some memories. I remember hacking apart some of the default words the speech synthesis module could "say" into phomens so the computer could say anything. Of course the next step was teaching it to curse... :)
Nothing like hearing a computer say byte me...
# March 22, 2006 10:14 AM

Pieter Siegers said:

Thanx for the pointer Bertrand, I've managed to integrate the March Release into the ASPToday.com article.

What I'd like to know still is if you have any pointer to Atlas´ Roadmap - where are you heading with Atlas and how do you see integration into Vista or is Atlas more a temporary step?

Cheers, Pieter
# March 22, 2006 11:41 AM

Bertrand Le Roy said:

We're going to continue to release CTPs on a regular basis like we've done since the PDC but I can't give you a more precise roadmap than this for the moment.
# March 22, 2006 12:16 PM

Bertrand Le Roy said:

Max: the truth is that not many people have tried it but those few tries I know of showed performance between 50% and 80% and I'm suspecting that we still have to learn how to optimize managed code for games. Now consider this: how many times faster is the 360 when compared to the old Xbox? Would you say the Xbox is "too slow for games"?

I don't think so.

(to answer your other question, I have a Commodore 128 in my basement but I never developped any games for it)
# March 22, 2006 12:21 PM

Max Mulawa said:

Hi Bertrand,

The only technique to "optimize managed code for games" I could come up with is to use wrappers for Win32 functions for all graphical operations. What you would suggest?

I cannot agree to using XBox resources by managed code would make XBox users happier, but effectiveness of writing code is .NET is unquestionable.
# March 22, 2006 4:58 PM

Julien Ellie said:

There are many things that can be done to improve or just get good performance for games with .Net and the XNA Framework, both on the PC and on the Xbox 360. Performance is a very important part of what we do and as the platform evolves we are very confident that .Net can become a very good platform for many kinds of games both on PC and on Xbox 360. Not to sound closed to discussion or anything, but, as with any technology, the proof will be in what people actually do with it ;)
# March 22, 2006 5:47 PM

Jb Evain said:

IMHO, using their own PE writer is a big mistake for such a dynamic language as Ruby. If perfect for batch compilers, it's not very well suited for dynamics language where Reflection.Emit and LCG rocks.

At each assembly emitted, they will have it twice in memory...
# March 23, 2006 3:04 PM

Nils R Grotnes said:

There's a link to a PDF file at the bottom of http://www.badastronomy.com/bad/misc/tides.html that will give you many gory details of how to calculate these things. Well worth the read, you can for example learn there that the weight change of going upstairs is about five times larger than the weight change during a spring tide.
# March 24, 2006 7:43 PM

Mike 2006 said:

Doubtless the tidal energy comes from somewhere and it's not free?
The tides he have been dissipating energy on the Earth's coast for 3Byears approx.
If we extract energy from the tides it will not make the slightest difference to the moon's orbit. The moon will slow down over time and thus recede from the Earth as it has been for the past 3E9+ years.
# March 26, 2006 5:20 AM

Bertrand Le Roy said:

Mike, sure it will have *very little* effect, just like anything that diffuses the tidal energy, which is what I'm saying at the end of the post and what's been extensively discussed in previous comments. But you can't say that it won't "make the slightest difference" because it will.
# March 27, 2006 2:14 PM

Lindsey said:

Does anyone know the angle of the wake, what controls the angle, and who first discovered it? It's for a physics assignment, so any help is appreciated.
# March 27, 2006 5:39 PM

Bertrand Le Roy said:

Lindsey: I don't want to patronize you or anything but if this is an assignment, that's all the more reason not to give you a full answer, you need to work it out yourself. I'll give you some clues though.
Draw the following: one dot for the duck at instant 0, one for the duck at instant t. The duck emitted a wave front at instant 0 so that makes a circle centered on the first point. The speed of the wave front is the speed of waves at the surface, let's call this c. So the radius of the circle at instant t is c times t. At this moment, the radius of the circle the ducks emits at instant t is still zero. The distance between both points (duck at instant 0 and duck at instant t) is v times t where v is the speed of the duck.
The wake is formed by the enveloppe of all circles so its summit is the second point (duck at t) and it must be tangent to the circle emitted at zero. So if you draw a line that's tangent to the circle and goes through the second point, you've drawn the wake.
If you draw a line between the two points and a line from the first point to the point where the wake tangents the circle, you have drawn a triangle. This triangle has a 90 degree angle at the tangent point. You know one angle of the triangle, as well as the length of two sides. It's elementary trigonometry to find the angle of the wake.
# March 27, 2006 6:00 PM

Zman said:

Where's the evidence for 50-80%... sources please.... the cloest to official from MS is >95% and tha matches my experience too.

Plus take a look at any casual game - even it it was 50% who would notice. Nobody is suggesting writing half life 3 in managed code here.
# March 27, 2006 10:32 PM

Bertrand Le Roy said:

Hey, ZMan, I'm on your side here. I'm just being very conservative, and as you point out, even at 50% (which would be very poorly written managed code) it's still largely enough for even demanding casual games. These are figures that I gathered from various sources (I did say "those few tries I know of"), but if you take one of the earliest tries at that kind of things like the Quake port to managed C++, the perf without any optimization was around 80%. I haven't seen any >95% stuff nor have I seen that figure as an official MS figure but then again I haven't had the occasion to see any of the new Xbox CLR running. If confirmed, that would be awesome. Would this be on a technological demo or on a real complete game scenario?
Thanks for the info. You obviously know a lot more than me about that stuff (I'm just an ASP.NET dev you know).
# March 28, 2006 2:14 PM

Bryant Likes said:

Just wondering, the control in your post is showing some odd stuff:

A|Body Color
B|Dot Color
...

Is the accordian control supposed to be showing there?
# March 29, 2006 12:45 PM

Bertrand Le Roy said:

Bryant: no, as I said in the post, the accordion control doesn't render anything, it's pure behavior. These are just the headers that are in the HTML in the demo application.
# March 29, 2006 12:49 PM

TrackBack said:

Nikhil uses the accordion control to discuss the separation of UI and behavior.
# March 29, 2006 1:26 PM

TrackBack said:

Brad hosts the source code for the accordion control.
# March 29, 2006 1:30 PM

TrackBack said:

Scott has a nice collection of post-Mix Atlas samples, including the accordion.
# March 29, 2006 1:33 PM

Bryant Likes said:

Ok, then I'm just confused. You comment that the control "does pretty much what you expect, which is to show only one of its panes at a time." However, I don't see any panes changing or animations being done so the control doesn't really make sense to me. How does what is shown in the post relate to the accordian control? Is it just showing all the panes at once because of a javascript issue?
# March 29, 2006 2:46 PM

Bertrand Le Roy said:

Bryant: you probably failed to include the Atlas scripts. You can send me your page at bleroy (at Microsoft.com) and I'll have a look and tell you what's wrong.
# March 29, 2006 5:50 PM

Zman said:

The problems I see are that in directx (managed or native) is very easy to structure your program so that it is very very slow. YOu have to know how best to send stuff to the card and what to avoid. The naive way is almost always the slowest. So you get beginner DirectX programmers start with managed directx and hit these problems. Since beginner programmers are *never* wrong, it must be the technology so they go to the newsgroups and forums and bitch about how slow managed directX is when in reality native directX would be just as slow if they wrote their code in the same way.
The only large benchmark that I have found is this one http://realmforgewiki.castlegobs.nl/index.php/Main_Page which shows plenty of speed. (forget Quake.Net thats really not a good example of most things and its very old now). The Xbox CLR is too early to make speed comparisons, but all the simple demos at GDC ran with plenty of leftover fps.
# March 29, 2006 7:41 PM

TrackBack said:

Rédo points to this post.
# March 30, 2006 2:48 AM

Runi Thomsen said:

Im having trouble using the accordion - client only- control (accordion.js).
What steps are nessesary in order be able to run the above example? (besides downloading, installing march CTP and creating a Atlas project and copy the accordion.js to a script folder under the project?

Thanx
# March 30, 2006 4:35 AM

Bertrand Le Roy said:

Runi, I've updated the post to include the scaffolding you need.
# March 30, 2006 2:53 PM

Steve said:

I am just using the accordian setup and get the following err:

'Dice' is undefined.

I have the Accordian.js file in the scriptlibrary folder
--

<body>
<form id="form1" runat="server">

<atlas:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<atlas:ScriptReference ScriptName="AtlasUIGlitz" />
<atlas:ScriptReference ScriptName="Custom" Path="~/ScriptLibrary/Accordion.js" />
</Scripts>
</atlas:ScriptManager>

<div id="accordion1">
<a href="javascript:;">Pane 1</a>
<div id="Pane 1">
This is Pane 1 in the accordion control.
</div>

<a href="javascript:;">Pane 2</a>
<div id="Pane 2">
This is Pane 2 in the accordion control.
</div>

<a href="javascript:;">Pane 3</a>
<div id="Pane 3">
This is Pane 3 in the accordion control.
</div>
</div>
</form>
<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005" xmlns:dice="http://schemas.microsoft.com/xml-script/2005/dice">
<components>
<dice:accordion id="accordion1"/>
</components>
</page>
</script>
</body>
# March 30, 2006 7:22 PM

Steve said:

Here is the fix - the accordian.js file was missing the top:
Type.registerNamespace('Dice');

It's also case sensitive - so I had to correct this:

<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005" xmlns:Dice="http://schemas.microsoft.com/xml-script/2005/dice">
<components>
<Dice:accordion id="accordion1"/>
</components>
</page>
</script>
# March 30, 2006 7:28 PM

Bertrand Le Roy said:

Steve: that's because Brad forgot to copy the namespace definition into accordion.js. Add this line at the top of the script file:
Type.registerNamespace('Dice');
I've sent mail to Brad so that he can fix the file.
# March 30, 2006 7:29 PM

Bertrand Le Roy said:

Steve: the Javascript namespace is Dice with a capital D, but the xml namespace should be kept dice with lower-case d. Otherwise, I think it will fail on some browsers.
So no, you don't have to and shouldn't correct the xml-script here.
# March 30, 2006 7:31 PM

Bertrand Le Roy said:

Steve: I should probably add for the sake of clarity that the namespace that is used in the Javascript is Dice as defined by the registerNamespace, whereas the xml namespace that is used in the xml-script comes from the
Sys.TypeDescriptor.addType('dice', 'accordion', Dice.Accordion);
line at the bottom of the file, and this one uses lowercase d.
# March 30, 2006 7:34 PM

Steve said:

thanks for the clarification - that helps
# March 30, 2006 10:53 PM

Stephane Rodriguez said:


I entirely disagree with the premise of this post.

"The transition of websites from isolated information silos to sources of content and functionality" : the bulk of blogs out there have no RSS feeds to subscribe to.

"This is the community aspect. It consists mainly of user-provided contents " : we are still in phase one where service providers freely give storage and feature almost for free only to reach critical mass. Once the critical mass gets reached, doors will be closed, and blood will follow.

"A more organized and categorized content" : RSS does not solve information overload. It calls for even more information consumption. I have personally switched from 30 minutes a day to 8 hours a day. It's a pathology. I can only remember the good ol' days of Internet over RTC 28.8kb where I would see only a handful of websites before I told myself that I had seen enough. Besides this, today's tools to reading hundreds of RSS feeds are just inapropriate. We certainly need ways to recoup information for us without us doing all the recouping info. In a way get facts without having to play journalists (that's time consuming).

"The resurgence of excitement around the possibilities of innovative web applications" : like what? What is innovative in the web right now? Nothing is done right now that could not be done back in 1998. And for the record, we are seeing rendering stacks like DirectAnimation, HTML+TIME being replaced with WPF/E. How do you call this? I call this a 10-year cycle. Everything old is new again.

# April 2, 2006 4:54 AM

Bertrand Le Roy said:

Stephane: you're answering the Wikipedia article about Web 2.0, not my post, which begins with "think what you want about web2.0". Ignore it if you want. It's not my point.
# April 3, 2006 2:31 AM

Christopher Bennage said:

Have you heard about Spore? It follows the Gaming 2.0 idea you outlined. User created content plays a significant (and innovate) part in the game. Here's a lenghty video of the game being demonstrated at GDC:
http://video.google.com/videoplay?docid=8372603330420559198
# April 3, 2006 9:55 AM

Bertrand Le Roy said:

Christopher: yes, you're absolutely right. I knew this video but for some reason it didn't register in my mind. Yes, Spore is a perfect example of what I'm talking about. I'll update the post.
# April 3, 2006 1:35 PM

Ryan Heath said:

Nice post!

I have already changed it into a behavior and added code so I can also close a section by clicking it again.

I also tried to add a fadeAnimation but removed it again since the collapsing wasnt smooth anymore ...

An other question: is it possible to somehow inject xml-script into the page via javascript code? Of cource xml-script has its javascript equivalence, but that is some much more verbose.

// Ryan
# April 5, 2006 5:36 AM

Bertrand Le Roy said:

Ryan: I suppose you could inject xml-script into the page, after all there's nothing we're doing that you couldn't do but we won't support that. If you're writing JavaScript, the supported way of adding stuff to the page will be to instantiate the controls and set the properties in JavaScript.
# April 5, 2006 1:56 PM

Ryan Heath said:

Thats a bummer. May I ask why you will not support it?

See it as the counter part of innerHTML.

doing:

.innerHTML = "<div><div>etc etc"

is so much more easier to do (and to maintain) than:

var div = document.createElement("DIV"); etc etc

// Ryan
# April 5, 2006 4:03 PM

Bertrand Le Roy said:

I see your point, Ryan. I'll relay your suggestion.
# April 5, 2006 4:19 PM

Brian said:

Is it possible to do the accordion in an update panel? I'm trying it, but the accordion effect is lost.. Is there any way to get the effect back and not have a lot of screen refresh/flicker? I keep trying to find a way to use the UpdateProgess to fire off some javascript, but I can't get anything to work.

I was using Rico.Accordion (another opensource accordion solution) but the same thing happened with it. I can reset the accordion with rico manually (which still doesn't acheieve the effect I'm looking for), but I still can't find any way to reset the accordion effect after the update panel completes the update.
# April 5, 2006 4:27 PM

Ryan Heath said:

I think you meant Ryan? ;)

My scenario is as followed:

I'd like to have a certain functionality available on a lot of pages, but to me it seems a bit of waste to send the UI of the functionality with each and every page request, but not the code of the functionality (javascript).

So I'd like to create the UI from javascript. Right now I am using your suggestion to create the components and set their properties through javascript.
But its so verbose, right now I am not sure if I coded it right, it is working, but still ...

It would be far more easier to have the same xml-script functionality available at the javascript level, actually, all the parsing code is already there ;)

// Ryan
# April 6, 2006 4:46 AM

Bertrand Le Roy said:

Brian: UpdatePanel really is for server controls. What is your scenario exactly?
# April 6, 2006 2:32 PM

Bertrand Le Roy said:

No, I meant Brian but I answered the wrong post... Sorry you had to write this additional post :)
I did relay your suggestion and opened a work item for it so if it is accepted it will be implemented in a future release.
In the meantime, I suppose you could do what updatepanel is doing but these APIs in their present state are meant for internal use so they may be a little difficult.
# April 6, 2006 2:35 PM

Ryan Heath said:

Ah many thanks!
Keep us updated ;)

Meanwhile I'll have a look at those APIs updatepanel is using.

// Ryan
# April 6, 2006 3:49 PM

Ryan Heath said:

var xmlScript = new XMLDOM( "<page etc etc
Sys.Application._loadIncremental( xmlScript.childNodes[0]);
delete xmlScript;

did the trick I was after.

Thanks again.
// Ryan
# April 7, 2006 7:35 AM

Scott said:

No malice here. That's what I've been prescribing for some time. Since you can't extend IE, it's best to treat it like the slow child ("yes, IE you can keep using innerText"(pats IE on head)) and have the other browsers implement it's quirks.

It's all about spackling the DOM model sad to say.

http://www.lazycoder.com/weblog/index.php/archives/2005/02/08/adding-innertext-to-mozilla-and-other-browsers/
# April 8, 2006 2:22 PM

Wayne Kelly said:


As I understand it, Reflection.Emit does a number of other things beyond generating PE files (such as performing verification). Our PE writer performs only the work that is required.

And just because Ruby is a dynamic language, doesn't mean it can't be compiled.
Only features such as eval require the compiler to be invoked at runtime, and Ruby programmers already expect eval to be slow.

We may very well have performance issues, but I doubt our PE writer will be the most critical.
# April 11, 2006 3:37 AM

RAJIV said:

SOME FLICKERING IS THERE WHILE USING ACCORDION . ANY SOLUTION FOR THAT
# April 11, 2006 8:56 AM

Bertrand Le Roy said:

Rajiv: no need to shout ;) I don't see any flickering. What browser is that on? Maybe the animation could be made more fluid by using a composite animation (the control uses two simultaneous animations: one to reduce the old pane, the other to make the new one appear). This is only a sample so I went for the simplest solution but there are certainly more than a few ways to improve on that.
# April 11, 2006 1:10 PM

Brian said:

I am using the update panel for a server control. The server control connects to a web service for weather info and returns nested divs that I then want to apply the accordion effect to. The nested divs then act as a list of buttons for each day that expand out and show that days forecast (when the accordion control is applied). The problem is I'm wanting to use the updatepanel to refresh the weather information periodically. The updatepanel is working and the accordion control is working, the problem is that the accordion effect is lost when the updatepanel refershes. If i could find a way to call some javascript after the updatepanel runs I could fix it, but I'm guessing it would have lots of flicker.

My weather control is basically a .net implementation of:
http://openrico.org/rico/demos.page?demo=rico_weather
My control hooks into Active Directory to get the users location and then gets the appropriate weather info.
# April 11, 2006 5:19 PM

Bertrand Le Roy said:

Brian, as I said, UpdatePanel is for server controls. We're considering enabling some limited support for xml-script inside UpdatePanel but that would be in a future release.
There are at least two things you can do.
First, you can put UpdatePanels inside the divs of the accordion.
Second, and that's what I would recommend, you can build a server control that implements IScriptComponent and spits out the accordion's xml-script.
# April 11, 2006 5:27 PM

Dion said:

Great example. Is this an example of what we can expect from the Atlas Control Pack?

About the accordion control: I made a very small modification to the original accordion.js code, so clicking on an already expanded DIV will now cause it to callapse again (more logical I guess).

This is the modified code for the set_viewIndex function (even less code!):

this.set_viewIndex = function(value) {
_viewIndex = (_viewIndex == value) ? -1 : value;
_ShowCurrentPane.call(this, true);
this.raisePropertyChanged('viewIndex');
}
# April 12, 2006 5:34 PM

Dflying said:

very cool!
# April 13, 2006 9:21 PM

Olivier said:

De toute façon dès qu'on essaye de faire un produit qui va satisifaire tout le monde Microsoft comme libre, ça geule du côté libre ...
Faut pas trop se prendre la tête, Atlas ROCKS!!! ;)

Continuez votre bon boulot les gars!
# April 14, 2006 4:27 AM

Andrey Skvortsov said:

Excuse me,I'm not impressed,look at http://jquery.com/demo/accord/-it's much,much more convenient and simple.I don't see clear benefits Atlas bring to this example,except obfuscate things a little enforcing "framework" burden;-)
It seems to me you're not solving real problems.Atlas binded to server side more than other JS frameworks and tring to adhere "server side" principles using .NET BCL guidlines,asp.net controls model etc.,and it dosen't looks very nice because you think on the "other" side and approximate server to client and not vise versa,that is more natural IMHO:-)

Regards.
# April 14, 2006 8:11 AM

Richard Hillman said:

How will IE7 affect this?
# April 14, 2006 9:13 AM

Keith said:

I believe what you are doing is good. But I ran into a problem with an open source javascript calendar that wouldn't work in Firefox because the compatiblity layer made the events IE like and the calendar knew it was running under Firefox. This was with the March CTP. Maybe it was fixed with the April CTP, but I haven't tested it. It is a basic mistake and I am surprised more 3rd party controls don't fail under Firefox.

I understand trying to make javascript with work all browsers is a difficult thing, god knows I do. It just means you guys really have your work cut out for you to not make mistakes like this.

http://forums.asp.net/thread/1256274.aspx
# April 14, 2006 9:20 AM

Scott said:

"Safari is making things difficult: how do you dynamically load arbitrary script and get notified when the script is done loading?"

Actually, I don't think Safari is supporting the standard here. From what I understand, the big sticking point is supporting onLoad for any DOM element. I belive the "standards" specifiy that onLoad should be supported on any HTMLElement, but safari only supports it on the BODY element. Been waiting, and watching the webkit repository, for them to support this for a while so live.com will work in Safari.

BTW, the Atlas tool kit has a lot of issues in Safari. It's odd that other toolkits, Dojo, Scriptaculous, Mochikit, etc... can get accordian panels and drag-drop workingin Safari, but Atlas can't. Perhaps the Atlas script library needs to be re-worked a little. It seems to me that MS started going down one architecture path with Atlas, and then checked to see what browsers worked with that architecture after the fact. Not sure if it's malace or lack of time. I always attribute anything that seems to be malace to a tight schedule instead.
# April 14, 2006 1:15 PM

Bertrand Le Roy said:

Keith: I don't understand. Is this component doing browser detection? If it is, that's why it's not working, not because of the Atlas compat layer. It should be doing capability detection, not browser detection.

Richard: this will affect IE7 only where they remove old IEisms from the object model, which they're not doing in a way that affects Atlas for the moment.

Scott: Drag and drop works in Safari. There are other things that don't work currently in Safari but we're not even in beta, so give us some time here.
# April 14, 2006 3:09 PM

Bertrand Le Roy said:

Andrey: reusable components, declarative syntax and a consistent framework.
# April 14, 2006 3:12 PM

Scott said:

Bertrand,

You're right. The drag drop does work in Safari. I just tried the Drag Panel example at the Atlas control toolkit page. I first tried the re-order list example and it did not work.
# April 14, 2006 5:26 PM

Bertrand Le Roy said:

Hey Scott, thanks for the heads up. I'll relay that to the right people. We're really committed to Atlas being cross-browser but there sure is some more work.
One thing that should probably be mentioned is that sometimes, when the compat layer method can't work, we're reverting to one of the other two.
# April 14, 2006 5:31 PM

Robert McLaws said:

It hasn't been ratified yet so it's not a standard.
# April 14, 2006 6:19 PM

Bertrand Le Roy said:

Robert: that's why I mentioned that it's a draft.
# April 14, 2006 6:27 PM

ruby said:

Here's Ruby on linux. Live. Unabridged. Open. Fine-tuned. Also works on Mac OSX or any other unix. Get a life.
# April 14, 2006 9:51 PM

Bertrand Le Roy said:

Dear Ruby, thanks for your suggestion to get a life, but I already have one and I suspect it's more interesting than yours seeing how you waste your time on such comments.
# April 14, 2006 9:56 PM

Andrey Skvortsov said:

Does XmlHttpRequest object works in latest IE7 CTP drop?
Previous versions throw "not implemented" exception.

Thanks for info.
# April 15, 2006 12:32 PM

Andrey Skvortsov said:

You mean components written for Atlas and declarative syntax for binding that components to BOM/DOM?Why you need another client markup beside of DOM?To support declarative part of framework?But what if framework not so consistent as you think?I always thought "consistent" means easy and jquery is more easier IMHO(in this example)-all other JS frameworks has their own components and level of consistency too.
By the way,I prefer client DOM counterpart implementation on server side instead of ASP.NET control model,why not other way around-DOM on server?;-)

P.S.
I don't say that xml marup syntax is bad-it's beautiful solution by itself,but it's simply declarative part of framework and framework in turn looks not so beautiful compared to other frameworks.
# April 15, 2006 12:56 PM

Brian said:

I'll check out the IScriptComponent. btw - I totally understand that UpdatePanel is for server controls. I'm sure a lot of people create server controls with client-side functionality, animation, etc.. Going forward, lots of people will be mixing client-side controls with server controls. I thought that was the whole point of Atlas.
# April 15, 2006 11:40 PM

Bertrand Le Roy said:

Andrey: you're entitled to your preferences, choose whichever framework you find the most elegant. The xml-script declarative syntax expresses concepts that are entirely different from the XHTML DOM. We're not replacing XHTML here or even extending it. We're keeping it as is (it is adapted to what it's for: expressing the semantics and structure of your document). What we're doing with xml-script is attaching JavaScript behavior to the existing markup. This is exactly similar to what any well-designed component framework is doing with the difference that Atlas can do it declaratively with a clean separation between document structure (XHTML) and behavior (xml-script).
To be more precise about the example you show, it does reproduce the accordion behavior, but in a way that is not encapsulated and easily reusable.
# April 16, 2006 3:10 AM

Bertrand Le Roy said:

Brian: there are constraints in how you can do it. Our first approach to this was to reproduce the client-side model server-side (that was the September/PDC CTP) so that pure client-side components can interact with the server-side controls. This didn't work out too well and we actually hit showstoppers in doing so, in addition to a model that was just too clumsy. So we moved to a model where the server-side model is closer to the ASP.NET model and farther from the client-side Atlas model.
What you do now is that server-side controls can emit self-contained client-side code that only has pre-defined client-side interaction with the rest of the page. In particularwhile it is possible to build an entire application using the client-side components, we discourage the mixing of the client markup and the server markup. If you make the choice of server controls, you should only use server controls (which may emit client-side xml-script).
# April 16, 2006 3:21 AM

Michael Geary said:

onload may not work in Safari, but you can certainly use dynamic script insertion, where the way you are "notified" is that your script runs. Combine this with a JSONP-style callback and you are golden.
# April 16, 2006 4:57 PM

Sander said:

But isn't the benefit of using the "detect capabilities" approach that when browsers will implement said capabilities your library will automatically work without you having to do any work to it?

Writing to capabilities seem to make more sense then writing to browsers as browsers change but capabilities won't (unless they get respecifieid of course).

Also you say about detecting capabilities:
Adding a new browser means touching all of the code base.

But if you write to capabilities it means it's browser independent, you don't have to add a new browser? I'm probably not understanding your argumentation fully but would be interested in hearing more about it. Thanks :)
# April 17, 2006 5:00 AM

AO said:

W3 XMLHttpRequest object standard (draft) - http://www.w3.org/TR/XMLHttpRequest
# April 17, 2006 8:40 AM

AO said:

This was posted on forums.asp.net a little under a month ago... http://forums.asp.net/1242119/ShowThread.aspx

Some browser modes will need testing in lines such as: if (child.nodeName == 'UL') for child != null or some browsers (Opera, NS if I remember correctly) will give some errors at times.
# April 17, 2006 8:49 AM

Bertrand Le Roy said:

Michael: we know how to work around it, it was more an illustration of the fact that standard-compliant browsers do not eliminate the need for a compat layer.
With the solution you describe, in the general case, you need the server's collaboration to inject the callback/notofication at the end of the script, or you need the script to be executable at a non-global scope (which is fine for data). It becomes more difficult if you need to be able to dynamically load and execute an arbitrary script and be notified. We know a way to do it but it doesn't work cross-domain, which limits its usefulness in an environment like live.com.

Sander: you misunderstood me. The important part about the first solution is not "detect capabilities", it's "every time you need them". In the third solution (the one we're using), we *are* detecting capabilities, but only once, when the compat layer is initialized. If a capability is not there, we implement it so the rest of the code can just assume it's there from this moment on.
Even writing like that, and even with standard-compliant browsers, there are things that you can't detect just by looking at capabilities because they are there but are implemented with subtle differences. The extension mechanism may also vary from a browser to another. All that makes it necessary to add new layers even with standard-compliant browsers (Opera would need a new compat layer for example).

AO: yes, I know, see this post: http://weblogs.asp.net/bleroy/archive/2006/04/14/442970.aspx
# April 17, 2006 3:28 PM

Bryant Likes said:

a;lksjdfka;jds?

al;kjdfj! hsldhfsdfs shdlfhwe lhksdfjlsfd.sdf.

slkdfjsd!
# April 17, 2006 7:34 PM

David Findley said:

I can not stop laughing.....
asdasd
asdas
dasd
asdas
dasd
# April 17, 2006 7:50 PM

Paula Boléo said:

Hahahhaha

Its called Globalization, one can find any thing unless its something real important lol

I hgdgf you forever
# April 18, 2006 7:01 AM

Tran Nguyen said:

hahaha, this is so funny
# April 18, 2006 11:47 AM

Tobias said:

Yes it does!
But no longer as ActiveX control but as native XmlHttpRequest.
More details: http://blogs.msdn.com/ie/archive/2006/01/23/516393.aspx
# April 18, 2006 1:39 PM

Brian H said:

The amazing thing is someone has already bought the album. Goes to show you people have too much money, time, and ignorance.
# April 18, 2006 2:38 PM

Peter Bromberg said:

Bertrand,
This is hilarious. I ek2eowdk sdsdk sdskhgdf!


# April 18, 2006 3:33 PM

TrackBack said:

I guess I'm becoming a regular source of news for these guys :D I like that, I'm a fan. They're one of my main sources of tech news.
# April 19, 2006 3:41 AM

TrackBack said:

Shawn leads the Atlas Toolkit team.
# April 19, 2006 3:43 AM

TrackBack said:

I can't read a word there but it doesn't look like spam as far as I can tell...
# April 19, 2006 3:45 AM

TrackBack said:

Ars Technica points to this blog (again). Can't complain...
# April 19, 2006 3:47 AM

TrackBack said:

a19s points to this post
# April 19, 2006 3:49 AM

Bruno Alexandre said:

# April 19, 2006 9:16 AM

Andrey Skvortsov said:

How about support of IE's event model?Is there onfocusout/onmouseenter/onmouseleave support in firefox?

Thanks.
# April 19, 2006 11:25 AM

Bertrand Le Roy said:

Andrey: there is support for the IE event model in general (attachEvent, detachEvent, window.event, etc.) but not for specific events for the moment. We may add these in the future if there's enough demand for it.
# April 19, 2006 4:33 PM

kevin delafield said:

does this include previous downloads of Visual Studio express edition,
which have already been registered?

thanks,

kevin
# April 19, 2006 11:30 PM

Prasad P. Khandekar said:

It's really a nice move by Microsoft. I am really finding these tools very helpful.
# April 20, 2006 1:20 AM

Bertrand Le Roy said:

Yes, Kevin, of course :)
# April 20, 2006 1:48 AM

ender++ said:

is it possible to have mutliple version installed?
ie C# express along with C++ Express and Web Developer Express ?

# April 20, 2006 12:46 PM

Hugh J. Frazer said:

I have been reading and downloading plenty of 'free' stuff on ASP.NET. I am a retired software/hardware engineer from the old Rockwell International Missile Division (now Boeing). Running into a shortage of the cash for I have only a fixed income retirement and ss. So I decided to get back to my old living; and thanks to Microsoft learning; I am remembering alot of my old history in the Electronic Field.
So all you keep it up and I will try and akai write a few things. But I have alot of Republican hateful actions here and that will slow me up. May the Sun shine on our old bones (75) and keep the old Microsoft thinkings going.

Hughy or hu hu ha hi (ha hi is from my ham days wb6njr).
# April 20, 2006 1:20 PM

Bertrand Le Roy said:

Ender: not 100% sure, but I think yes.
# April 20, 2006 2:49 PM

Herleson said:

Hi, Ender

Yes, you can install all Express Editions without any trouble.
# April 20, 2006 3:02 PM

richardc said:

yo man, cu ;-))) (Thursday)
# April 20, 2006 6:43 PM

Shawn Burke said:

Lucky guy. I love Nice...
# April 20, 2006 10:10 PM

Heemanshu Dave said:

ha ha ha ha ..I am thing to design a software language in which we have to write code in this format.

# April 21, 2006 6:47 AM

Can Erten said:

Now google gives 202 results :) So it doesn't suggest anymore.
# April 24, 2006 1:59 AM

Saudhall said:

Looks good, and i hope it describe every thing in detail that too from scratch.

Thanks,
Saurabh
# April 30, 2006 11:57 PM

Plip said:

Mike Taulty posted a review here too where he raved about the book: -

http://mtaulty.com/blog/archive/2006/04/15/9307.aspx
# May 1, 2006 10:49 AM

kris said:

hi,

i still don't understand why there is a full blown compatibility layer in Atlas. javascript, (x)html, css ... are all well defined by the w3c.

so if you use the standards (as they should be used) it will work in any modern browser. i'd say only in 5% you will have to to a dirty trick to make your scripts work in ie. because ie6's implementation of standards is quite poor.l

also there a so many opensource js libraries that already figured out the flaws of ie and correct them. just take a look at dojo, prototype, script.aculo.us, behaviour.js and so on. why reinvent the wheel?

regards,
kris

ps. i dont want to be rude.... just a little provocation with a hope of getting answers :)
# May 2, 2006 9:41 AM

Bertrand Le Roy said:

Kris: that's only the theory. I really wish it was true but it's not. The standard implementation is incomplete or inconsistent in *all* browsers (although I agree that IE6 is the worst on that point (but on the other hand, it implements non-standard stuff that's absolutely necassary like pixelLeft and that other browsers are slowly implementing despite the non-standardness because they are just useful and were oversights of the standards but I digress)). The incompleteness can especially be felt in Safari (example: the lack of onload event on all elements) and the inconsistencies comes from the fact that many standards are vague in places and open to interpretation.
Plus, the 5% you're talking about is a huge number for us as framework developers who need to make it as easy as possible for third party developers to develop new components. These 5% (or whatever is the real number) is precisely what we need to abstract. These are very complex problems that the average developer just hasn't time to investigate and solve. Look at how complex it is to get the pixel coordinates of an element relative to the top-left corner of the page. It is absolutely necessary to abstract that. Look at the differences in the event models (IE is the one that's wrong here of course but I don't care about who's wrong, I just need to fix it). We just can't constantly deal with two incompatible event models, we need to make that consistent.
It's absolutely true that there are already other libraries out there that do a good job at cross-browser support but you need to take into account that:
* they all have some form of compat layer even if it's implemented differently.
* they do a lot less than Atlas (none of them do anything like xml-script for example).
* Atlas has constraints that other frameworks don't have (such as back-compat with ASP.NET, including third-party controls).
* Atlas is not even in beta state. We're fixing bugs actively.
# May 2, 2006 12:54 PM

Reinaldo Torrales said:

I use Professional ASP.NET 2.0 from WROX and even that some areas could use some re-work, in general the book is fairly decent. I think the sections that explains Callbacks and SqlBulkCopy could use rework. I write a lot of code that deals with huge amounts of data transfers and even that I use SQL DTS / SSIS this is not always an option. As for the Callbacks, I think Atlas is the best way to go.
# May 2, 2006 3:12 PM

lordabdul said:

I've already got CLR via C# (for .NET 2.0)... Is it worth it to get Practical .NET too?
Btw, now wonder that book is great... Patrick Smacchia is a french guy who studied at the ENSEEIHT school of computer engineering which incidentally is where I studied :) Yeeeaaaah!
# May 4, 2006 1:50 AM

Sigurdur G. Gunnarsson said:

Lol that's nothing! Try playing World of Warcraft, or rather.. don't :)
# May 15, 2006 5:54 AM

Greg Kniffin said:

I am with you on Oblivion. There are many nights when I have been playing the game when I should have been doing other things (blogging, sleeping, etc.) It is a great game, rich in content, and a good storyline - which I have on pause currently as I build my character.

The overall ROI of the game is great, just reflect on how many hours of entertainment you get out of a $60 game. I'm Glad to see I'm not the only one spending too much time with this game.
# May 15, 2006 8:13 AM

AndrewSeven said:

I was told it was a little bit shorter than Morrowind...
# May 15, 2006 8:59 AM

the numbers don't match said:

April, 2006 contains your second highest post count. 2.5 weeks still exist in May, 2006.
# May 15, 2006 9:58 AM

Bertrand Le Roy said:

Andrew: then Morrowind must have been very very long. A friend of mine spent about 250 hours on it and he's only 92% through the game (not the main quest, of course, all of them).
# May 15, 2006 12:55 PM

Martin Smith said:

Picture doesn't show up? Clicking on it takes you to Flickr sign up screen!
# May 16, 2006 3:19 PM

DotNetCoder said:

Let's see... 122 hours total in Oblivion...

Main Quest: Completed
Arena Quest: Completed
Mages Guild: Barely started
Fighters Guild: about 60% completed
Theives Guild: about 70% complted
Dark Brotherhoon: about 50% completed

AND... that is not counting all the exploring of the various ruins, caves, and landmarks...

The game is simply massive! Morrowwind didn't hold a candle to Oblivion. I'm even planning on starting a new character just to figure out some of the other race/class abilities.
# May 16, 2006 3:50 PM

Ducky said:

Well since I am stuck at work all week-end I had planned to bring Oblivion....Glad to know I wont finish it :)
# May 18, 2006 11:15 AM

Mini said:

That's nothing compared to world of warcraft, i have played 14 days now, and i ain't halfways complete. :)
# May 18, 2006 2:48 PM

Pierre said:

excellente information pour aider les Newbies a debugger :-)
# May 20, 2006 3:05 PM

Jason Haley said:

# May 22, 2006 10:26 AM

ScottGu's Blog said:

http://atlas.asp.net is the best place to visit to learn more and download the latest Atlas CTP Release...
# May 23, 2006 2:14 AM

ナオキにASP.NET(仮) said:

Nikhil&amp;nbsp; さんと Bleroy さんの blog &amp;nbsp;からです。
&amp;nbsp;
Script# Prototype
Script# brings compile-time...
# May 24, 2006 1:41 AM

Nikhil Kothari said:

Thanks for the link, Bertrand!

I should mention that Bertrand actually was a great person to ping and discuss ideas with all along.

In fact, one of the things Bertrand proposed was a cool way to model foreach C# statements to enumerate dictionaries into for (var .. in) script statements, which is one of a few C# & script constructs I really wanted to support.
# May 24, 2006 2:29 PM

Pierre said:

Live Local now displays traffic (and more), example : http://snurl.com/SeattleLiveLocalMap :-)
# May 25, 2006 6:40 PM

Rohit said:

Has anyone here faced a problem when using the client callback functionailty of ASP.NET 2.0 while having an iframe in the contentpage?

I have used an iframe in my contentpage since I use to display a calendar. However, upon doing so, the client callback no longer works. Upon trying to dig into this,  I realized that the postData variable in WebForm_DoCallback is initialized to a different value. Any help on this will be highly appreciated.
# May 26, 2006 12:05 PM

Andrew said:

The PrtScn situation really pisses me off... What's the Ctrl Alt Shift Vulcan sleeper hold combination to use PrtScn?
# May 27, 2006 1:07 AM

Mike Parsons said:

Hi Bertrand ...

Be interested in your opinion of this

http://www.michaelparsons.ca/ajax/MyAJAXToolKit.html

# May 27, 2006 7:07 AM

Bertrand Le Roy said:

Rohit: if you choose to use an iFrame, what's inside the iFrame is basically another page so I wouldn't even use callbacks in this situation, I would just point the frame to a page that contains only the calendar and does regular postbacks.
Even better, don't use an iFrame...
# May 27, 2006 7:34 AM

Bertrand Le Roy said:

Mike: I've watched the video and I think this is really cool. But it's very different from what we're trying to achieve for a number of reasons.
The main one is that you're not really creating a web application but rather running a Windows Forms application in a web environment (which is still pretty cool).
It seems to be really close to what XAMLON is doing. They have an engine that can run a Windows Forms application in Flash or DHTML (which is exactly what you're doing). I saw it at the PDC in September and it is pretty cool too.
One thing that's not shown in the video is how you create the web services that you're calling and if they are secured.
Also, you're only showing labels and textboxes. What about more complex controls? What about control authoring? What about existing third party controls that your customers may assume can be used directly?
# May 28, 2006 2:02 PM

<script> said:

<script>
</script>
# May 29, 2006 8:11 AM

Pieter Siegers said:

Hi Bertrand, I'm Pieter.

Do you know where an exact diagram can be downloaded? The link seems dead.

I need to look up why some events do fire twice during a postback; for instance having a gridview, why is the RowCreated event fired twice for each subsequent postback, for each header / row / footer / pager? How do I workaround when I only want RowCreated to execute some code only once a postback?

Many TIA!
# May 30, 2006 4:52 PM

Pieter Siegers said:

Hey, this sounds cool Bertrand - I'll recommend the book here at work! :-)
# May 30, 2006 4:54 PM

Labhesh Shrimali said:

I have asp.net 2.0 application, i have tryed using front controller to implement MVC in the Application.
I could able to get the IhttpHandler for the page.
but on my page i have some controls like text box, drop down etc. I would like to have values of those controls to be populated. so that i can do some operation.

In Base Line: I have page for AddUser & Edit User. So when i want to add the user the control goes to IhttpHandler and it checks that the Mode is to add user. but how do i get the user name from Page.- textbox. in ihttphandler or Controller.

If you have any problem in understanding me, please do write me. please respose as soon as possiable.


--
Desperately seeking closure
Labhesh Shrimali
http://www.shrimalis.com/
Bangalore-India
# May 31, 2006 8:23 AM

Bertrand Le Roy said:

Pieter: I'll ask Léon where the diagram can be downloaded.
In the meantime, the RowCreated event is fired twice if the grid is created twice. So look in your code for stuff like binding too late: I'd bet you're databinding on every postback after viewstate has been restored. Just a wild guess.
# June 1, 2006 12:14 PM

Bertrand Le Roy said:

Labhesh: I think you're trying too hard to use the MVC pattern which is not as natural in ASP.NET as it is in Java for example. There are quite a few MVC frameworks for ASP.NET, but I recommend that you read Martin Fowler's Patterns of Enterprise Application Architecture and in particular the Page Controller pattern which describes the natural pattern for ASP.NET. I hope you'll find that it's a reasonable approach that works well with ASP.NET. Accessing control values will then become absolutely natural.
# June 1, 2006 12:22 PM

Dexter McCloud said:

Will this book be published in hard-cover as well?
# June 1, 2006 2:29 PM

Bertrand Le Roy said:

For the moment it's PDF only as it's a short book that will probably be updated regularly (at no extra charge).
# June 1, 2006 2:32 PM

neks said:

this is great
# June 1, 2006 9:04 PM

Richard Becker said:

I purchased this work and want to thank you for making me look like a hero!  No more flashing :-)

However, I have a problem:
I have a button, list box, and two radio button lists on my form.  The radion button lists are causing a full postback, even though I've coded the triggers as follows (radio button lists are triggers #3 and #4):

<atlas:UpdatePanel runat="server" ID="chartPanel" Mode="Conditional">
 <Triggers>
   <atlas:ControlEventTrigger ControlID="btnChart" EventName="Click" />
   <atlas:ControlEventTrigger ControlID="ddlBenefits" EventName="SelectedIndexChanged" />
   <atlas:ControlEventTrigger ControlID="rblChart" EventName="SelectedIndexChanged" />
   <atlas:ControlEventTrigger ControlID="rblSort" EventName="SelectedIndexChanged" />
 </Triggers>
 <ContentTemplate>
     <asp:Image runat="server" ID="chart" CssClass="chart" />
 </ContentTemplate>
</atlas:UpdatePanel>
# June 2, 2006 11:27 AM

Bertrand Le Roy said:

Richard, I'll investigate that. Thanks for buying the book :)
# June 2, 2006 11:49 AM

Richard Becker said:

Thanks Bertrand.

One additional piece of info that might be helpful; I have a CustomValidator control coded between the two controls that work and the two that don't.  I commented the CustomValidator, but this didn't solve the problem.
# June 2, 2006 12:24 PM

Bertrand Le Roy said:

Richard, I've reproduced the problem and have opened a bug to track the issue. Thanks.
# June 2, 2006 8:06 PM

this is very good said:

this is related article
# June 3, 2006 8:31 AM

Myself said:

"Nevertheless, many climate researchers have been unable to explain why evaporation figures have decreased in areas where rainfall and cloudiness have become more prevalent. If less water vapor is moving into the atmosphere, how could more rain and clouds be forming?"

The above comments was witdrawn from a CNN report on the evaporation "paradox". However, there is no paradox as well as there are no other paradoxes in this area, and the CORRECT AND REAL solution to these questions you find in http://noparadoxes.tripod.com. These "paradoxes" appeared only due to the lack of a suitable background on the evaporation and atmospheric processes. That is really THE solution.


# June 3, 2006 5:10 PM

Bertrand Le Roy said:

"Myself": what does this have to do with black hole evaporation???
# June 4, 2006 4:26 PM

Richard Becker said:

Sorry to be a bother, but is this the url to be used for support info (i.e., info on bug fixes, updates, etc)?

Thanks again for this control.
# June 6, 2006 4:19 PM

Bertrand Le Roy said:

Richard: the best place for support currently are the ASP.NET forums:
http://forums.asp.net/1007/ShowForum.aspx
Info on updates is published on the Atlas blog:
http://atlas.asp.net/default.aspx?tabid=47
# June 6, 2006 4:26 PM

Steve said:

Quick question: Do updatepanels have a 'timeout' value?

A coworker is using the updatepanel and progress indicator for a long running process - with scriptmanager disabling partial refresh, the code finishes.  With SM enabling partial refresh - it eventually just stops running with no error, etc...

Any ideas?
# June 10, 2006 8:54 AM

steve said:

Microsoft Atlas make developer life easier in creating Ajax Website. New Microsoft Atlas Resources is created at : http://www.AtlasASP.com/
# June 11, 2006 1:30 AM

Bertrand Le Roy said:

Steve: good question. I'll open a bug to track that issue.
About your website, if you had dropped me a quick message through the contact page, maybe I would have made a post to point at it, but seeing that you posted it as an off-topic comment like the average spammer, it will have to stay in the comments ;)
# June 12, 2006 2:17 PM

Jeff W. Barnes said:

A lot of cool stuff on the wire this week:

Consequence of leaving debug=&quot;true&quot; enabled
Rick Strahl...
# June 12, 2006 4:18 PM

Jeff W. Barnes said:


Vista Release Date Speculation
Windows Workflow Foundation Beta 2.2 Released
New IE7 Release for...
# June 12, 2006 4:30 PM

Ryan O'Connor said:

This is one of the most useful pages I've found on overriding equals and gethashcode. It clears up so much, and applies equally to Java too! Thanks!
# June 14, 2006 6:08 AM

jvierra said:

That's why  Ihave been using XMLHTTP since it was made available.  It works, it's straght out useable and it looked like a good bet for a standard.

MSXML objects are very user friendly unlike th eearly days of "ADO".

# June 15, 2006 7:35 PM

Tooky said:

This stuff is all so cool.
Im 14 and wish to go into this field later on.
Is there any such thing as a worm hole?
i dont think there is but if there is what is it??
# June 21, 2006 2:46 PM

NiklasEngfelt said:

Thanks alot for a very cool component. It would be even nicer if you could start a slide show in which you could choose how many seconds you want it to wait between each fully loaded picture. Perhaps some Ajax/Atlas could take care of that?
# June 21, 2006 3:32 PM

Kevin R Hurst said:

Collin Yeadon,

As far as your code sample, do you just put it on a page? It didn't really work when that was tried. any suggestions?
# June 21, 2006 5:02 PM

Bertrand Le Roy said:

Tooky: wormholes are a theoretical possibility in many cosmological models but nothing has been observed so far. They are connections between parts of a spacetime that are otherwise remote in time and/or space. Imagine cutting two holes in a sheet of paper and gluing them together. If you had to travel from the place where one hole is to the other, if the holes weren't there you'd need to follow a path on the sheet. Now, with the holes, you can travel instantly from one place to the other. Furthermore, you could even theoretically travel to otherwise inaccessible places like the past. It's a shortcut in spacetime, if you want.
# June 21, 2006 6:51 PM

Bertrand Le Roy said:

NiklasEngfelt: Yes, this is on the list of things to do.
# June 21, 2006 6:52 PM

Rio said:

Can u tell me how implement this.
I mean that how to create simple album application.
Pls
# June 27, 2006 4:11 AM

Bertrand Le Roy said:

Rio, why don't you start by downloading the source code and studying it?
# June 27, 2006 4:19 AM

Adrian said:

The problem is not present in IE7. However, I very much appreciate the solutiion presented above. IE6 will be around for some time yet.
# June 28, 2006 7:08 AM

Timo said:

Another happy book owner :) I don't know if this one falls in to the category "Dealing with Caveats", but I'm having issues with nested UpdatePanels. I have an "UpdatePaneled" Wizard-control and it works partially ok. However in one wizard step I'm using PopUpControlExtender so that whenever user clicks the form field, a popup calendar is displayed. So whenever I'm trying to step in to that wizardstep I get an JavaScript error: 'null' is null or not an object. This extender works ok when there is only one UpdatePanel present (with PopUpControlExtender), but not with both set (on the wizard and extender). Any ideas?
# June 29, 2006 1:54 AM

Jason Kealey said:

Brian: I think I had the same problem you did with openrico accordion. My accordion behaviour was still working, but the accordion lost all its styling (background colors, etc.). Turns out that I was linking to my stylesheet using outside of my head. I added my stylesheet the right way (server-side) and not it works fine. public void addCss(string url) { if (Page.Header != null) { HtmlLink cssLink = new HtmlLink(); cssLink.Href = url; cssLink.Attributes.Add("rel", "stylesheet"); cssLink.Attributes.Add("type", "text/css"); Page.Header.Controls.Add(cssLink); } } } My accordion is not inside an update panel though...
# June 29, 2006 11:22 AM

Bertrand Le Roy said:

Timo, please send me a repro page at bleroy (at microsoft).

# June 29, 2006 1:28 PM

Skinny Runt said:

dork :D
# June 29, 2006 6:05 PM

Bertrand Le Roy said:

I know :|

# June 29, 2006 6:07 PM

dave said:

that's hilarious :-/
# June 29, 2006 7:37 PM

ced said:

good work
# June 29, 2006 9:35 PM

Mukesh said:

Hi... Thanks for .... Can you give one more example of this in detail. Mukesh
# June 30, 2006 3:15 AM

Chris said:

It is wrong to be as amused as I am. And yet, I am. :)
# June 30, 2006 11:20 AM

Michael Beebe said:

folks, I have made multiple tries/uninstal/reinstall & etc. to install Atlas on my VS 2005 app with OS=Win 2003 server/SP1 and the template will not show up when I try to create a new web site. Altas seems to install and files are in the proper directory, but template is never available. When I try to simply copy web config inform into web config file (and dll into Bin folder) I get multiple web config errors. HELP, please. Thanks, M.Beebe PS I have IIS loaded, too & SQL server 2000
# July 2, 2006 4:23 PM

おがわみつぎの SQL Server な BLOG said:

[ASP.NET]Atlas CTP June 2006

# July 2, 2006 10:40 PM

Gregor Suttie said:

Cool cant wait to try it out and get a look at the updated pdf.
# July 3, 2006 4:08 AM

Bertrand Le Roy said:

Michael, please contact me directly and describe the multiple errors that you get. bleroy (at microsoft).

# July 3, 2006 2:20 PM

Atlas notes said:

Info and download here. Be sure to checkthis post by Bertrand LeRoythis post by Nikhil Kothari

# July 4, 2006 3:40 AM

My2Cents said:

Well, seems I was censored first time, so let us put it mildly now. I know Ruby is a great success and has a good web framework called Rails, well, I still don't see the reason for such a brouhaha, given Ruby's similarity to Smalltalk. Clever guys knew twenty years ago that dynamic languages are good, hipsters just need all those "Rails" and "pragmatic programming" books and websites to jump in.
# July 5, 2006 6:00 AM

Kalimuthu govindasamy said:

Hi., plz, give the demo version controls.,
# July 5, 2006 6:27 AM

Bertrand Le Roy said:

My2Cents: you were not censored by me. Maybe you got filtered by the automatic filters the first time. I didn't see another comment from you.

I don't think I'm making a brouhaha, but it's more exciting and interesting from my point of view to see Ruby being adapted to .NET for two reasons. First, it hasn't been done before. Second, Ruby is being immensely more successful than Smalltalk ever was so having it for .NET is just more significant. I'm not judging in terms of quality, just in terms of success and reach. Maybe there's a reason why Smalltalk never really took off, by the way?

If you need Smalltalk for .NET, it seems like there are already several implementations:

http://www.refactory.com/Software/SharpSmalltalk/

http://www.smallscript.net/Community/community_home.asp

# July 5, 2006 2:33 PM

Bertrand Le Roy said:

Kalimuthu: I don't understand what you mean by "demo version controls".

# July 5, 2006 2:34 PM

Cyril 's Blog said:

Bertrand Leroy, un des d&#233;veloppeurs du projet Atlas de Microsoft a fait une interview o&#249;&amp;nbsp;il parle...

# July 7, 2006 3:48 AM

Cyril said:

Peux t'on savoir quand a été tourné la vidéo ? et où en êtes vous au niveau du support d'opéra? :-)
# July 7, 2006 3:52 AM

Nico Oosthuizen said:

I cant get this to work could somebody please help
# July 7, 2006 8:40 AM

Bertrand Le Roy said:

La vidéo a été tournée ce printemps, je ne sais plus exactement quand.

Opera: On y travaille, rien n'est fermement décidé, donc tout feedback est apprécié. :)

Quel niveau de priorité Opera représente-t-il pour toi et/ou tes clients?

# July 7, 2006 2:21 PM

Bertrand Le Roy said:

Nico, please give me more details by mail. bleroy (at microsoft).

# July 7, 2006 2:22 PM

cyril said:

Opéra n'est pas trés important pour moi. J'aime bien ce navigateur pour ces diverses fonctionalités mais malheureusement le JavaScript est trop bridé ... :s J'ai vaguement regardé où était le problème entre Opéra et Atlas et j'ai vraiment envie de voir comment vous allez contourné le problème ;-) Je pense néanmoins qu'il est important d'être compatible avec Opéra pour ne pas laisser dire qu'une fois de plus Ms ne fais rien de standard etc ...
# July 8, 2006 7:42 PM

cyril said:

Opéra n'est pas trés important pour moi. Mais si Opéra n'est pas pris en charge c'est laisser une porte ouverte aux trolleurs : "Ms ne fais que des trucs non standards" etc blablabla ... Voici pourquoi d'aprés moi Opéra est important : pour l'image ... :-/
# July 9, 2006 1:08 PM

Bertrand Le Roy said:

Cyril: merci de ta réponse. C'est triste à dire, mais ceci est à peu près la seule raison qui nous pousserait à supporter Opera...

# July 10, 2006 1:56 PM

Cyril said:

Bon courage :-)
# July 11, 2006 3:49 AM

Lee said:

Thanks for the code. Because Atlas is still so new it really is frustrating when no working example of the code is displayed.
# July 11, 2006 10:17 PM

EzecKiel said:

Je pense qu'il est effectivement très important que Microsoft supporte Opera. C'est un navigateur qu'il ne faut pas négliger même s'il est beaucoup moins utilisé que les 2 autres. A mon avis ce serait une erreur de ne pas le supporter. (D'autant que c'est un navigateur de bonne facture). Bon maintenant, c'est vrai, c'est facile à dire et je ne sais pas vraiment ce que çà représente de supporter un navigateur de plus.
# July 18, 2006 10:54 AM

Bertrand Le Roy said:

Ezeckiel: je suis personnellement en faveur de le supporter, mais il faut bien admettre que tes arguments n'en sont pas vraiment. As-tu des raisons plus... business que "ce serait une erreur" de ne pas le faire?

# July 18, 2006 1:53 PM

Derek said:

This control does not work properly with Master Pages. The callback from an Alert never fires.
# July 18, 2006 2:37 PM

Bertrand Le Roy said:

Derek: this has been fixed more than six months ago in release 1.0.1 that you can download from here:

http://www.gotdotnet.com/workspaces/filesharehtml/filesharehtml.aspx?id=30be1e25-30c6-44ed-8a0e-f9713a22b175

The source code also reflects that change.

# July 18, 2006 4:56 PM

Derek said:

Yes. Using the 1.0.1 Release, it still does not fire the event.
# July 18, 2006 5:20 PM

Bertrand Le Roy said:

Derek, you'll need to send me a repro of your problem. I retested this morning with a master page and didn't see a problem.

Ideally, file a bug here:

http://www.gotdotnet.com/workspaces/bugtracker/home.aspx?id=30be1e25-30c6-44ed-8a0e-f9713a22b175

# July 18, 2006 5:24 PM

Derek said:

Alrighty. I contacted you via GotDotNet's system with a URL to download a sample of it. I hope this helps some.
# July 18, 2006 5:36 PM

Bertrand Le Roy said:

The bug is fixed in 1.0.2 that I just uploaded. Thanks for the bug report.

# July 18, 2006 9:31 PM

Christophe Lauer, Blog Edition said:

La question du partage des variables de sessions revient assez souvent, pas plus tard qu'hier pendant...

# July 19, 2006 5:15 PM

Masoud Shokri said:

I like to mention these(Though I am not sure if people read these at the bottom of the list) 1 - ASP.net 2.0 comes with the GREATE PROVIDER MODEL 2 - You can deploy your dlls without registering them , this is a very great leap! 3 - You can use the same library for Console app, Windows App and Web App 4 - Masterpage, Themes and skins (More comment needed?) 5 - the View State stuff! All of you forgot it. 6 - The very great language (mr C#) 7 - The portal framework 8 - You can use Enterprise Library Anything else? Yes, I see the day that PHP dies, sorry for saying that. But I see that day. Like java appletes. Who uses them now? Flash is out there, and it kills java applets, and If you want to use something but ASP.NET why do not you try Cold Fusion or JSP? And about the price, it is not really different on a shared hosting is it?
# July 19, 2006 7:32 PM

Masoud Shokri said:

Ahh, how many people use MAC? a few. How many people use Linux? a little more. So why hackers attach MS? Have you ever know the rich guy hasn't so many friends?
# July 19, 2006 8:01 PM

Masoud Shokri said:

http://www.zend.com/news/zendpr.php?id=108 take a look here, does it work for you?
# July 19, 2006 9:00 PM

EzecKiel said:

Je ne voulais pas argumenter mais simplement donner mon avis et aller dans le sens de Cyril. Qualifier le Framework de "Cross-Browser" et ne pas supporter Opéra est un peu gênant même si effectivement Opéra est utilisé par une minorité d’utilisateurs (1% des navigateurs utilisés en Juillet je crois). Cependant Safari est aussi utilisé par une minorité d’internautes. Et je crois qu’Opéra est utilisé par de plus en plus d’utilisateurs alors que Safari est abandonné au profit d’autres navigateurs. Je pense comme Cyril que c’est une question de réputation. Pour la majorité des développeurs, Microsoft n’a pas le droit à l’erreur. Et c’est de cette réputation que va dépendre (entre autre, il ne faut pas exagérer non plus) le succès d’Atlas. Après côté Business, je ne sais pas quel coût représente le fait de supporter un navigateur de plus, je ne peux effectivement pas peser le pour et le contre d’une telle prise de décision. Maintenant c’est clair que je me fais l’avocat du diable et que quoiqu’il en soit, Atlas est très prometteur et je l’utiliserai de toutes façons !
# July 20, 2006 5:53 AM

Bertrand Le Roy said:

Masoud: what is supposed to be on this page? It comes out empty for me.

# July 20, 2006 1:52 PM

Bertrand Le Roy said:

Comme je l'ai dit plus haut, je suis en faveur de le supporter, mais nous n'avons toujours pas trouvé d'autre raison de le faire que "nos ennemis vont s'en servir contre nous si on ne le fait pas". C'est triste.

Opera gagne un tout petit peu de terrain depuis qu'il est gratuit, et il en gagnera encore en termes de navigateur mobile, mais il en perd aussi au profit de Firefox. Ça reste aux alentours de 1%.

Je ne crois pas que Safari perde du terrain, au contraire. Les Macs se vendent bien en ce moment et c'est le navigateur par défaut sur cette plate-forme, ce qui est un argument fort pour le support de ce navigateur, bien plus que sa part de marché, qui avec 2% est dans la même catégorie qu'Opera. ne pas supporter Safari, c'est ne pas supporter le Mac en tant que plate-forme, alors que ne pas supporter Opera, c'est juste ne pas supporter un navigateur marginal.

Pour répondre à la deuxième partie de ta question, supporter un nouveau navigateur coûte cher en test, pas tellement en développement. Sans vouloir faire la langue de pute, c'est pour ça que d'autres frameworks dont le support est assuré par la communauté ou par quelques personnes, sans engagement contractuel, peuvent se permettre beaucoup plus facilement de supporter 120 browsers différents. Ils peuvent se le permettre car ils ne les supportent pas vraiment...

# July 20, 2006 2:00 PM

Masoud Shokri said:

It is supposed to be one of the zend's website's pages, talking about relationships between zend and oracle, but it doesn't work for me, like many pages in zend.com I had this experience with so many php sites, Why?
# July 20, 2006 2:58 PM

Masoud Shokri said:

And something else, where can I ask some questions about Atlas? I am new to Atlas.
# July 20, 2006 2:59 PM

Bertrand Le Roy said:

Masoud: you'd have to ask them why their pages don't work ;)

About Atlas, I encourage you to visit http://atlas.asp.net. The site has lots of information and forums where you can get assistance.

# July 20, 2006 3:06 PM

Masoud Shokri said:

Thanks, I have seen it, Its cool though it was much better if they had this documents in pdf format!
# July 20, 2006 6:30 PM

EzecKiel said:

Hmmm... je ne vois pas d'autres raisons à part pour l'Image et le fait que ce soit compatible tous navigateurs. Par contre je pense que c'est une raison suffisante, même si çà coûte cher en test. Je pense que çà incitera les chefs de projets à utiliser ce framework si il est 'compatible tous navigateurs' (je pense notamment aux projets web pour les administrations en France qui veulent des trucs pas croyables genre site xhtml 2.0 + css compatible Netscape 2.0 :-) Il faut reconnaitre que ce serait un sacré gain de temps pour les développeurs de ne pas avoir à se pastiller les tests de compatibilité Opéra. Ca peut peut-être même entrainer les développeurs / chefs de projet à changer de technos... JSP -> ASP.NET par exemple. Il faut voir çà comme un investissement. Je pense que la compatibilité tous navigateurs sera un gage supplémentaire de la qualité du Framework Atlas et donc çà poussera davantage les développeurs à l'utiliser. Quand penses-tu que la décision sera prise ? Tiens nous au courant et bon courage ;-)
# July 21, 2006 9:42 AM

Bertrand Le Roy said:

On ne supportera jamais "tous" les navigateurs. Par exemple, nous ne supportons officiellement que la dernière version de Safari et Firefox, et les deux dernières d'IE. Si nous supportons Opera, ça sera pareil: dernière version seulement.

# July 21, 2006 2:12 PM

Tariq said:

hi...i want the code that admin alert that the database is updated or alert the admin ..that user have a compalin....
# July 22, 2006 8:21 PM

Andres said:

Thanks for this tip! I was looking exactly that.
# July 23, 2006 2:28 AM

EzecKiel said:

Oui c'est sur, faut pas non plus tomber dans l'extrême !!! C'est déjà pas mal. Et maintenant j'arrête çà frise le flood :)
# July 24, 2006 3:52 AM

Bertrand Le Roy said:

Tariq: can you be a little more explicit about what you're trying to achieve? If you're trying to send mail alerts, you should try to go to http://www.systemnetmail.com/

# July 24, 2006 2:54 PM

Stine said:

Thanks a lot for the hack!! I was not at all happy with hiding my selects..... Now I am just wondering if there is any reason not to put the content of my div into the iframe instead?:)
# July 25, 2006 8:30 AM

Bertrand Le Roy said:

Stine: yes, there is a very good reason not to do that. If the select is in the iFrame, it will be in a different page, and thus in a different form, so you won't see it when you post.

# July 25, 2006 1:55 PM

cathartik said:

Scroll lock is often used in unix to scroll up the console. Print Screen is a good key to have, hit printscreen, go into photoshop and ctrl+v. Instant screenshot. I'm not sure why some of these people are having trouble with PrtScn... you press the key... ooooh tough. No key combo required.
# July 27, 2006 11:45 AM

Bertrand Le Roy said:

Cathartik: from memory, how do you take a screenshot of the current window? Anyway, you missed the point: on these newer keyboards with the ridiculous F-key, just hitting the print screen key does not work, you need a key combination to get it to work. Please don't make fun of people unless you're sure you understood what they were talking about (<sarcasm>thank you so much for teaching me what the print screen key is for</sarcasm>).

# July 27, 2006 2:53 PM

Alexis Kennedy said:

I second Ryan's comment - you've cleared a gathering headache, thanks.
# July 29, 2006 8:46 AM

Kris van der Mast said:

Hi, great example. But in order to get it to work I had to import the namespace System.ComponentModel and create a Button_Click eventhandler. The Button_Click event can be easily added by selecting Edit Template on the DataList control and double clicking the button. The namespace can be imported by adding this statement to the top of the page: <%@ Import Namespace="System.ComponentModel" %> Grz, Kris.
# July 29, 2006 9:42 AM

Jason Haley said:

# July 29, 2006 11:46 AM

Bertrand Le Roy said:

Kris: you're right. I've simplified the sample and removed these requirements so that one can concentrate on the datasource, which is the really important part. Thanks for the heads up.

# July 29, 2006 3:06 PM

mike said:

Note that XmlDataSource defaults to assuming that "column values" are represented as attributes rather than child elements; in the latter case, you have to add a transform for it to work. Also, inline XML can't be updated, right? So if your sample wants to illustrate update, things are a bit more complex ...
# July 29, 2006 3:56 PM

Kevin Nixon said:

how do i set an id in xml that will increment by one every time i add a new table? ex red blue
# July 29, 2006 9:22 PM

Bertrand Le Roy said:

Kevin: not sure I understand the question. This is literal contents, so you just set any id attribute you want to each of the records.

# July 30, 2006 4:07 AM

Ronny said:

You can not compaire it with java script
# July 31, 2006 10:58 AM

Bertrand Le Roy said:

Ronny: I don't have the slightest idea what you're talking about but I'm pretty sure I didn't compare anything to JavaScript in this post. Can you please elaborate?

# July 31, 2006 12:18 PM

Nis Wilson Nissen said:

I agree with you that if you don't buy into the whole unit testing thing then you are just hoping for the best with dynamic languages. But to say that unit testing is just there to do the job of the compiler (in statically typed world) is false statement I believe. In a statically typed world unit testing has many benefits too. Also, I believe that the ability to treat objects that exhibit the same characteristics in a uniform way is powerful. In a dynamically typed world I believe it is easier to utilize this, because you are not dependent on some object to implement some interface. For instance, if your daugther plays the role of a duck in a school play, she'll need to participate as a duck and answer to that interface if you will. Your daugther does not implement the duck interface because the designers didn't think of that and refactoring your daugther to implement that interface may not be an option. Still she's able to play the part of a duck in a school play. Things often exhibit dynamic properties that their designers hadn't thought of - which is what I like about dynamic languages. Cheers, Nis
# August 1, 2006 4:47 AM

ナオキにASP.NET(仮) said:

More Atlas stuff&amp;nbsp;からです。 &amp;nbsp; Using the XmlDataSource Data property for easy samples &amp;nbsp;...

# August 1, 2006 6:37 AM

Bertrand Le Roy said:

Nis: I never said that. We're using TDD here and we completely buy into unit tests. I did not say that unit testing is just there to do the job of a compiler. Quite the reverse actually, I said that using unit tests to do the job of a compiler is a vain exercise.

I think the crux of the discussion is that both duck typing and interface based programming are about contracts. The point is that duck typing is a very loose and unexplicit (when not completely hidden) contract. How and by whom this contract is fulfilled is irrelevant, it's the contract that matters.

This blog post aims at finding a way to enable interface based contracts that work in a dynamic language and to understand why duck typing is considered such an important aspect of dynamic languages. We have a few ideas in the Atlas team about this but the feedback is important to us.

# August 1, 2006 1:56 PM

ASP.NET Team Blogs said:

It's the second time in just a few days that I see blog comments attack Atlas on its compatibility layer.

# August 1, 2006 2:48 PM

Mike Moore said:

I've been using Ruby for a while now and, yes, there are problems. But the expressiveness of the language and the ability to design my code in a pure Object Oriented way eliminates my need for interfaces and static compilations. I think duck typing is an easy way to show how different dynamic languages are. Being able to take a string variable and make it an array cuts to the core of the language differences. I've found that I can wring my hands about the lack of X or the differences of Y, but to me the point is that once you give yourself to it you will code differently. And you will be a better programmer - in any language. And I happen to think that code will be better.
# August 1, 2006 6:54 PM

Bertrand Le Roy said:

Mike: that's interesting feedback. I'm curious about the string thing: in .NET, a string pretty much behaves like a char array if you want it to. It has an integer indexer, you can foreach it, etc. So what more does Ruby buy you in this case?

Also, how do you answer the points about duck-typing contracts being hidden and difficult to discover? What about explicit error messages when it fails? Do we care more about that because we are framework developers and have more users or is it a universal concern that app devs face too?

# August 1, 2006 9:05 PM

Simone said:

Bertrand, did you actually read it? The language he uses is almost incomprehensible. Thumbs down to the editor, I would never publish such a book.I agree on the value of the contents, but reading it is a pain.
# August 1, 2006 11:58 PM

Nis Wilson Nissen said:

Hi Bertrand, sorry if I misread your statement about unittesting. I was probably skimming too fast :-) I see your point about contracts being important. It would be neat if you could somehow check if an object adheres to a certain interface (contract) at runtime without the object explicitly implementing that interface. It is often easy to do that manually, but I'm thinking more in terms of some language construct like "is_a" or just "is". Also, some languages (like Javascript) allows you to add methods to classes (and some also objects) so the contract might only be fullfilled at some point later during runtime. If you mixin a number of methods at runtime, it would be nice if these methods could carry with them an interface that belonged to that particular mixin.
# August 2, 2006 3:56 AM

Bertrand Le Roy said:

Simone: I've read the French edition. The English one seems to be self-translated and I've heard from a few folks other than yourself that it could take some serious editing.

# August 2, 2006 12:56 PM

Bertrand Le Roy said:

Nis: that's an interesting idea (checking against an interface's members even if the interface itself was not declared). My thoughts were more leaning towards the second option of allowing for modifications to the type information of the object at mixin time. This way, one can be sure that the code that did the mixin actually intended on fulfilling the contract.

# August 2, 2006 1:04 PM

Mike Moore said:

Bertrand, I'm working on a blog entry to give a more detailed response. But to address your second question about duck-typing contracts being difficult to discover I'm going to simply say that if you find yourself wanting to implement interfaces then your design is too complex and should be refactored. Dynamic languages allow you to simplify your domain more than system languages like Java and C#. What I need an interface to do in C# I can do simpler with open classes in Ruby. I hope to have a more concrete example in my blog entry.
# August 2, 2006 5:11 PM

ASP.NET Team Blogs said:

We already knew that JavaScript had some issues with semantics. Here&#39;s another funny one. Guess what

# August 2, 2006 7:38 PM

EricW said:

Not as silly as you think. NaN is a property of the Number object. It is intended to be uses in comparisons, not as a value (object or not) of its own. You can think of it as a special form of Number or as a special type within the Number object. Number is really a helper object, mainly to deal with conversions to strings. So if you keep in mind that NaN is intended to be used -- by javascript -- as a test value for the function IsNaN, it perfectly makes sence.
# August 3, 2006 3:44 AM

Development Odyssey said:

Bertrand LaRoy, over at More Atlas Stuff, has discovered some truly weird JavaScript behavior. Apparently...

# August 3, 2006 11:19 AM

Bertrand Le Roy said:

Eric: sure, I was just pointing out that it's funny. Please notice that I didn't say it was stupid ;) but I wouldn't go so far as saying it "perfectly makes sense".

# August 3, 2006 1:58 PM

Abo Saqr said:

Dear Sir, Can you please send the code in VB to my email: abosaqrs@yahoo.co.uk thanks
# August 4, 2006 6:30 PM

Bertrand Le Roy said:

Abo: the VB source code is available from the GotDotNet workspace. Just follow the link.

# August 4, 2006 6:32 PM

Kori Francis said:

Wow .. I think the idea is novel, but the name ... could use some work (imo).
# August 5, 2006 4:11 AM

Bertrand Le Roy said:

Kori: actually no, it's not a new concept, nor is the name. Look it up in wikipedia:

http://en.wikipedia.org/wiki/Mixin

# August 5, 2006 3:08 PM

Travis James said:

This is very cool stuff that was highlighted as an important and powerful language feature at the recent Lang.NET Symposium.
# August 6, 2006 7:12 AM

InfinitiesLoop said:

Even if its not strictly "necessary", just the fact its comparable to extention methods in C# makes it a good fit for Atlas. Atlas has many analogies to .net, why not take extentions methods too? In fact, why not call it an extention method instead of a mixin (even if that is what it is).
# August 6, 2006 2:00 PM

InfinitiesLoop said:

It's almost too bad you can't reassign other primitives. It would open the door to a whole new world of client-side obfuscation! :)
# August 6, 2006 2:04 PM

Zach Parrish said:

I would go so far as to say that is strictly "necessary". I'm glad to see someone do it for Atlas coding. I use Prototype quite a bit and it would be pretty useless to me without its Object.extend functionality, which is essentially the same idea.
# August 7, 2006 9:18 AM

David Taylor said:

Yeah...it probably makes sense given many developers will be learning about extension methods in C# anyway. On another topic: It would be great to see Atlas or the control toolkit to include a Tab (TabbedPanel) control allowing you to move between different tabs and have different panels show. The accordian control is great, but a tab control would be more useful for most people. I dont know if you remember...but back in 2002 Microsoft release a DHTML ASP.NET control that did this for IE only, but for all other browsers it fell back to postbacks. David Taylor
# August 7, 2006 12:07 PM

Bertrand Le Roy said:

David: I'll hand that comment over to the toolkit folks.

Zach: I didn't know prototype did that. I'll have a look at their public docs.

# August 7, 2006 2:35 PM

Billy said:

Any suggestion on how to alter the viewIndex that is used on page load? I have used these panels in a window that pops up, but certain times I would like the first panel to be displayed, and other times I would like the second panel to be expanded initially.
# August 7, 2006 4:11 PM

Bertrand Le Roy said:

Billy: yes, you can set the viewIndex from the xml-script tag. This way, it will change without playing the animation. If you're not using xml-script, just set the index before you call initialize.

Maybe what you want to do is make sure only the pane that you want is shown, even before the scripts are initialized and the control gets a chance to hide the other panes? If that's the case, you'll have to do that in the HTML and CSS, by setting the overflow to hidden and the height to 1px on the other panes.

# August 7, 2006 4:35 PM

Brian said:

"BLOCKED SCRIPT;" as the src still causes the warning message to show on https pages for me in ie6sp2... I have found that src="BLOCKED SCRIPTfalse;" works perfectly (though in firefox the iframe will display 'false', so make sure to set a background for the div above it). The reasoning behind this still eludes me - meh.
# August 9, 2006 7:03 PM

mike said:

yeah, thats one of the key things that keeps me using prototype is the mixins, along with extending the dom element to do quick styling or using css selector to bind to many elements. Being about to do $('id').setStyle({position: 'absolute', zIndex: 99}); is just wicked. however you do have the xml script and the nice intregration with asp.net server control going for the atlas project, those i wish it was somehow more simplified. I'm sure whenever they upgrade Vs to handle javascript intellisence that it will take care of much of that issue. I know its not easy to please everyone and that you have to make it easy for the common developer who knows nothing of javascript, so thanks for extra hard work and time for pushing MS technologies forward. and i can't wait for c# 3.0
# August 10, 2006 6:15 AM

genium said:

You are not alone ;-) Similar for me :)
# August 11, 2006 2:22 AM

Paul E said:

Awesome, gotta get me one of those ;-)
# August 11, 2006 4:05 AM

ナオキにASP.NET(仮) said:

ScottGu's Blogからです。 August 9th ASP.NET Link-Listing 今回の投稿では Scott さんが発見した素敵な記事のリンクとそれぞれの紹介コメントが書かれています。見てみたところ、全て英語(当然)ですが内容はやはり濃かったです。個人的に特に気になったのは...

# August 11, 2006 5:28 AM

I'm just pasting this here for the case that somebody would need it. said:

using System; using System.Data; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Globalization; using System.Reflection; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; namespace OmaAvaruus { public class Oma : WebControl { private Toinen m_Testi; [TypeConverter(typeof(Toinen.Converter))] public Toinen Testi { get { return m_Testi; } set { m_Testi = value; } } } [TypeConverter(typeof(Toinen.Converter))] public class Toinen { private string m_Nimi; public Toinen(string nimi) { m_Nimi = nimi; } public Toinen() { } internal class Converter : TypeConverter { public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (destinationType == typeof(InstanceDescriptor)) { return true; } // Always call the base to see if it can perform the conversion. return base.CanConvertTo(context, destinationType); } // This code performs the actual conversion from a Triangle to an InstanceDescriptor. public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof(InstanceDescriptor)) { ConstructorInfo ci = typeof(Toinen).GetConstructor(new Type[]{typeof(string)}); Toinen t = (Toinen)value; return new InstanceDescriptor(ci, new object[] { t.ToString() }); } // Always call base, even if you can't convert. return base.ConvertTo(context, culture, value, destinationType); } public override bool CanConvertFrom( ITypeDescriptorContext context, Type sourceType) { if (sourceType == typeof(string)) return true; return base.CanConvertFrom(context, sourceType); } public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object name) { if (name != null) if (name is string) return new Toinen((string)name); return base.ConvertFrom(context, culture, name); } } } }
# August 11, 2006 7:15 AM

Albert Pascual said:

How did you test that?
# August 11, 2006 11:26 AM

WoZoI said:

Hi, No need to say it's a game! How could you grip to this kind of results? As a scientist you know the truth! your cells are dying more and more numerous each day... Did I already said that I'am younger than you? ;o) hin hin hin WoZoI
# August 11, 2006 12:31 PM

Bertrand Le Roy said:

Albert: this is Nintendo's Brain Age DS game.

Wozoi: all right, you're younger, but that won't last. Wait?!

# August 11, 2006 1:44 PM

Sebastian G. said:

Have you guys tried Big Brain Academy for the DS? It measures your intelligence in terms of your brain's estimated weight.
# August 14, 2006 4:29 AM

Bertrand Le Roy said:

Sebastian: yes, I have that one too. It's actually a little more fun than Brain Age, and it doesn't try to recognize your handwriting or your voice, which makes it a lot easier to use, and immensely less error-prone (one of the most annoying things in Brain age is when you give the right answer but don't get credit for it because the stupid recognition algorithms are too lame).

# August 14, 2006 2:26 PM

Alan Le said:

Thanks for posting this. I put up a demo of the code here: http://blogs.vertigosoftware.com/alanl/archive/2006/08/14/Atlas_TabStrip.aspx
# August 14, 2006 6:38 PM

Kenneth Elliott said:

Pretty Cool.. Same here!!!
# August 15, 2006 9:26 AM

Devil's Advocate said:

Since IE doesn't follow the W3C standard for events: http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/ Wouldn't it have made more sense to provide compatibility scripts for IE to get it up-to-speed with the standard instead of dragging the other browsers down?
# August 15, 2006 12:45 PM

Colin said:

I really think you made the wrong decision with the compat layer and all the window.event stuff. If you're not going to adhere to standards, and you're creating such a rich, proprietary javascript API anyway, then why not have a new function for observing events like the Prototype Framework does with Event.observe()? Basically you're asking developers to learn a beautiful library which introduces things like inheritance, Atlas XML script, etc. Asking developers to learn two new functions: observe() and stopObserving(), for example, would be extremely trivial. Also, I think your worry about changing the entire code-base upon introduction of a new browser is unwarrented. A properly engineered system can simply provide self-registering strategies which would require no change to the code-base, only a new strategy file. E.g. //expose some function like: Atlas.MapEventModel( browserEventStrategy ){} Assuming that each browser/compatibility strategy implements the proper contract, all the functionality needed to map DOM events to the Atlas framework would be taken care of compositionally in an extensible and maintainable manner. As it is now, you're claiming that the reason you implmented the compat layer the way you did is because other browsers are extensible in ways IE isn't. This implies the assumption that any new browser that comes out will be as extensible as the rest which is very very dangerous. What if a browser comes out that doesn't allow you to hook up window.event? It's very possible! The suggested alternative, on the other hand, is more likely to be able to work around the quirks of browser/capability event incompatibilities present and future. Event handling would happen through a consistant interface that is easy to learn, and the underlying details of providing the mapping to the consistent interface would be properly encapsulated into files such that each are independently updatable and easy to introduce as new browsers with different capabilities come along.
# August 15, 2006 1:27 PM

Bertrand Le Roy said:

Devil's advocate: see http://weblogs.asp.net/bleroy/archive/2006/04/13/442815.aspx where I explain that: "why did we extend Firefox and Safari and not IE? Simply because Firefox and in a lesser extent Safari are far more extensible than IE [...] If IE had the same extensibility, we would happily have made it converge to the standard instead of bringing Firefox and Safari to implement the IEisms. We would have absolutely loved that but it's simply not possible."

# August 15, 2006 1:58 PM

Bertrand Le Roy said:

Colin: these are great points. We had arrived to the same conclusion about the extensibility of the model. The new solution we're developing is more conventional and won't perform as well, but it will be easier to add new browsers even if they don't provide good extensibility points.

Fortunately, Atlas did not ship yet, so we can still take user feedback into account and revise what seemed to be good decisions at the time.

# August 15, 2006 2:03 PM

Colin said:

That's very good to hear! I'm consistently impressed by the overall coolness of Atlas and am excited to see it grow. There are a few kinks to work out, but I have no doubt the Atlas client libraries will eventually wipe the floor with other AJAX/JavaScript frameworks.
# August 15, 2006 3:13 PM

More Atlas stuff said:

It seems like I&#39;m not alone in my hatred for useless keys.I mean, who hasn&#39;t pressed Caps Lock

# August 17, 2006 1:52 PM

Adam said:

I think it should be moved near the Scroll Lock/Num Lock keys... makes sense doesn't it? Still not as useless as the Windows key, however. (Yes, I said it) I still can't believe it was put between the 2 most widely used shortcut keys - at least that is where it is located on my keyboard. There is nothing more frustrating than working in Photoshop and accidently triggering the start bar or some other strange windows action.
# August 17, 2006 4:09 PM

K4GDW said:

Hmmm... I think it'd be a great idea to move the caps lock key somewhere out of the way. I do find myself using it frequently when writing SQL statements and occaisionally in writing *nix shell scripts. Perhaps put it somewhere near the Num Lock key.
# August 17, 2006 4:57 PM

Bertrand Le Roy said:

Yes, the consensus seems to be to move it to some other place. Personally, I don't care as long as it's out of the way.

As for the Windows key, for me it's one of the most useful, maybe because I'm using Vista. Hit Windows, type photo, return, and boom, Photoshop is launched. A huge time saver for me. But I do agree that it gets in the way sometimes, especially in games (but I only play on the 360 and the DS now so it's not a problem for me).

# August 17, 2006 6:01 PM

Eric Wild said:

Don't forget the insert key! That is the most useless key.
# August 18, 2006 3:55 PM

Mike said:

Caps Lock is prime keyboard real estate, immediately adjacent to home row. So don't remove it -- remap it! With standard keyboards, Ctrl is the most popular remapping. On a Kinesis Ergo (that I happen to use), Escape is the most popular, since the default Escape key is in a crappy spot.
# August 18, 2006 4:52 PM

Disappointed said:

Tried Response.Redirect("~/blah.aspx", false) ... I still have the same issue. I've seen a lot of "I have teh SOLUTIONZ!!!111" articles on this issue, but have yet to see anyone with a real fix. :(
# August 19, 2006 12:18 PM

Manish said:

I think caps lock is placed at that location coz in the typewriters, this is the location where the key to hold shift key down is placed, if you've seen a typewriter, the shift and caps lock (i dont know what it is called in typewriter) are joined to the same shaft, only the (so called) caps lock has a locking system attached. About windows key, i've no idea why the placed it here, it is really sometimes very frustrating.
# August 21, 2006 3:46 AM

Caps Mishaps said:

If you are writing SQL statements it is a godsent to be in the position that it is. Why not try pressing shift 5 times quickly on your keyboard and enable the beep sound for when you toggle the capslock option? Then at least you would have a reminder for when you hit it. The other option would be to not look at your keyboard while you were typing.
# August 21, 2006 4:54 AM

Gary Taylor said:

I use a keyborad that allows me to turn of the windows key, so I no longer accidently get the start menu. (The keyboard has been designed for gamers but I find usefull in my coding).
# August 21, 2006 8:44 AM

FDumlao said:

The question is... what goes in the Caps Lock key's place? A blank space on the keyboard is going to be ugly, as well as a waste of space, especially on my laptop's keyboard. As far as the Windows key, that is a nice feature Bertrand, I know because I have been using it for more that a year on Mac OS X. However the Windows key is not needed in this instance. On the Mac you get to this feature by using "Command + Space Bar" which is easy enough because these are right next to each other, on windows we have the "alt + Space Bar" used to access the title-bar menu (is this the same on Vista?) but perhaps we could use the unmapped "crtl + Space Bar" to do the same thing?
# August 21, 2006 9:16 AM

vizeetor said:

CAPS lock key has never bothered me and I do use it every now and then. But I do agree, it makes sense to move it somewhere else but then the question arises, what should be placed there instead? :-)
# August 21, 2006 12:07 PM

Carol said:

> Response.Redirect("default.aspx", true); > Response.Redirect("default.aspx", false); > Response.Redirect("default.aspx"); Should I be losing Session() variables 'sometimes' or 'always' when I redirect? I tried all 3 of the above in a small bit of test-code... and didn't seem to lose any vars, ever. But my production code (about 500 lines) does lose session() vars... but only at randoms times. I can't seem to "make" it happen (with redirect... or without.) Help!
# August 21, 2006 8:42 PM

A voice said:

I really really... really really hate f-lock. I use the print screen key often and have one of these stupid keyboards. I can't get the print screen key to work at all, what is this combination. To make things worse the knockoff keyboard I have doesn't let you turn on f-lock until windows is booting for some reason... so you guessed it, I need a different keyboard to get bios or safe mode, yay! About the num-lock key, I used those numbers frequently and I hate it when I turn numlock off and instead of typing my cursor flies all over the screen. I need to disable that... I've also been a victim of the sleep and power down keys, instead of silicon I just took them out and crushed them. The last annoying thing has already been mentioned, the forward slash under enter and to the right of shift, arrrrrrrg! Not much fun when you trying to create html and type in a URL. Although, I did learn ninja fast speeds at hitting delete to remove mistaken slashes and carriage returns.
# August 22, 2006 4:41 AM

Tom said:

Adam, the windows key is not useless. It can be very useful for shortcuts. Try hitting window-r and see what happens, or windows-l, or windows-d. There are many useful shortcuts with the windows key. I am sure there is a list out there somewhere. I definitely would not consider the windows key useless. You can buy a keyboard that does not have the windows key on it.
# August 22, 2006 8:08 AM

MJL said:

I think they should develop a keyboard for developers, one designed by a developer, they could call it Microsoft Developer Keyboard. It could be both good for games and development. For extended usage, and the short cut keys should be - extended find and replace and things like debugging. As for the cap lock + window keys - these are both keys I would never dream of using. I too would love to see them gone!
# August 22, 2006 11:01 AM

Bertrand Le Roy said:

Caps Mishaps: I'm clueless about what you mean when you say that not looking at the keyboard while typing (which all reasonably fast typers do) helps in any way in not hitting the caps lock key... I would argue that it helps in accidentally hitting it, that's the point.

# August 22, 2006 1:52 PM

Bertrand Le Roy said:

Disappointed: drop me e-mail using the "e-mail" page of this blog with a simple repro (avoid dependancies if you can, try to make it as simple as possible) and I'll try to find what's wrong.

Carol: you will only lose session variables if the session does not yet exist when you do the redirect. What doesn't get set here is not the session variable in itself, it's the cookie that identifies the session.

# August 22, 2006 1:59 PM

Patrick Spieler said:

Why not just remap these keys? http://www.usnetizen.com/fix_capslock.html I use an IBM Laptop and missed the Windows-Key. So I just remapt the Caps Lock. - Now, Caps Lock make sense for me! ;-)
# August 23, 2006 12:22 PM

LFX said:

I personally would prefer the caps-lock to be a shortcut (shift + alt + control + C) I don't care how long, as long as it out of the way!
# August 23, 2006 5:28 PM

Rick Strahl said:

Bertrand, I agree. This is an excellent book even with the horrible editing in the English version . I've used this book as a reference continuously for the last 3 months and it's become indispensable. It covers an incredible amount of content for a single book. I don't know if I would say it's incomprehensible Simone . It's definitely not smooth English but getting the author's meaning hasn't been a problem in my case. Maybe it's my European background ...
# August 24, 2006 2:58 AM

tom said:

F##k! I'm going crazy! I bought a new microsoft wireless keyboard (700), finally without the damned F-BLOCK key, but now, I can't use combos with CTRL+ALT+SHIFT, so I lost many shortcuts, such as the "save for web" on photoshop [ctrl+alt+shift+s] or I can't write the "{" anymore [ctrl+alt+shif+è]... Die microsoft, DIE!
# August 24, 2006 5:52 AM

Sick and Tired said:

Do you guys want some cheese with that whine?
# August 24, 2006 10:21 PM

vikram said:

This is a good stuff. THis would help me when providing with example to some other people
# August 25, 2006 1:06 AM

vikram said:

I love asp.net and one thing that is not talked about here is the httphandler and http modules provided to us by ASP.NET. How can you not take that into account while talking about this
# August 25, 2006 2:22 AM

Martin Bennedik said:

Hi Bertrand, yes, I like the force feedback wheels too - but is it just me or is there really no support for them in the newer games? Some of the old devices you cannot even plug into a modern computer anymore - PC joystick port anyone?
# August 25, 2006 4:50 AM

Not an XBox fanboy said:

I didn't realise the XBox controller was 'effective against more than one toxin or strain of micro-organism'. But anyway, the Wii controller comes with the nunchuck extension that'll allow you to lie on your sofa eating pies to your heart's content.
# August 25, 2006 6:48 AM

jag said:

Have you had the oppurtunity to use the Wii controller? Or are you just going by what you see in nintendo's insane ads? I've seen several videos of people playing the new zelda game, and they are barely moving the nunchuk (controller) around. It's just like a regular control but slightly different in the way it moves. I think the impression that you HAVE to do cartwheels while you are using it is way off. Also, i think involving more parts of the hand instead of your thumbs only is a good thing. My friend said he'd play games until his thumbs blead. It will help against RSI and other issues that arise from doing any activity for a long time.
# August 25, 2006 1:35 PM

Bertrand Le Roy said:

Jag: no, I haven't used it and I may very well be completely wrong about all this. I'm just skeptical about the whole motion sensing stuff because it's been tried before and it failed miserably, but Nintendo may very well succeed where everybody else failed. I guess we'll have to wait and see the execution of all that.

# August 25, 2006 2:55 PM

Bertrand Le Roy said:

Not an Xbox fanboy: sorry about that, I updated the post to use a better word. Bear with me here, English is not my first language and in French, polyvalent is a synonym of versatile.

# August 25, 2006 3:54 PM

Kenneth Elliott said:

I am not a great fan of the new nintendo game controller. I don't feel that it will lend itself well to game play. Of course I have not used it yet, but with all the information that I have read so far I believe it will be very awkward.
# August 25, 2006 4:47 PM

Scott Mitchell said:

I haven't played the Wii, but the concept seems fun. The controller and gameplay - from what I've read - has already got me excited about picking up a Wii once they're available. I have an (old school) XBOX, but I've not played it in over three months. I just hope the Wii controller doesn't turn out to be as disasterous as this "well-conceived" product: http://www.videosift.com/story.php?id=7901
# August 25, 2006 5:15 PM

Carol said:

> you will only lose session variables if the > session does not yet exist You are going to have to explain that 1. How can I lose something... that doesn't exist? Can you give an example in asp.net v1.1? I need code that I can run... and watch my session vars disappear *EVERY* time. (Not the current "randomly" method... that I can't seem to track down or prevent.) Thanks.
# August 26, 2006 2:37 AM

Jeorge Lukasing said:

Very many thanks for a good work. Nice and useful. Like it!
# August 27, 2006 2:47 PM

Bertrand Le Roy said:

Carol: if the session does not exist yet, *then* you set a session variable and redirect right after, the session variable you just set will not persist.

(this, by the way, is the example in the post)

If the session already existed before this request, the session cookie is already set and everything should work fine.

# August 28, 2006 12:42 AM

Lonnie Best said:

Leave off the var operator and you will have your global scope. Don't var unless you want the variable to be local in scope.
# August 28, 2006 3:06 PM

Bertrand Le Roy said:

Lonnie: if you do that, you'll get warnings from Firefox in strict mode. If you want global scope, you can use expandos off window. Unfortunately, EcmaScript doesn't standardize on a consistent global object, so this won't work in other hosts than browsers.

# August 28, 2006 3:58 PM

Brad said:

Would be really interested in the chat room example. ay idea when it will be available?
# August 29, 2006 3:42 AM

Lee Fear said:

I think your comments are way off the mark and sound very much like someone who has been born into the playstation generation! I have a 360 and I am already becoming bored and annoyed with it. £50 for a game that I can get on the pc for £30!!! why? I would not mind paying £50 for a 360 exclusive but not one that is available elsewhere for cheaper. Also it is not exactly innovative, the graphics have improved but don't look (so far) 5 times better than the xbox or even 3 times better for that matter. The only Stand out feature is Live Arcade (which is still not innovative as it appeared on the original xbox!). This has great potential although so far not many original games have appeared. The other thing that is annoying is the backwards compatability. The vast majority of my xbox collection is still unplayable (Please can microsoft forget 'Shamu's Deep Sea Adventures','Shadow The Hedgehog' and 'Barbie Horse Adventures Wild Horse Rescue' and get on with converting Streetfighter collection, Outrun 2 and Pro Evo 4?) and even some that have conversions still do not work (Half Life 2 just goes to a black screen during the game!). Also While we are on the subject of controlers, can microsoft one day work on designing a good digital pad? have you ever tried playing a 2D fighter with the original x-box or 360 controllers? it is almost impossible due being less than directionally positive, pressing slightly up when wanting to move left and so on. Maybe this is something that you can take from nintendos controllers. The Wii will be the only true Next Gen console as it is the only one really doing something the current ones don't. And don't forget that there is also a normal controller available for it to play normal games with too.
# August 29, 2006 5:10 AM

Bertrand Le Roy said:

Lee: funny that you would say such a thing. You couldn't be farther from the truth: I played my first video games in the 70s (Pong and its variants), got my first computer in 1980 and published my first professional video game in 1982. Since then, I've never ceased to play. I've had dozens of computers, some of which I built, a Sega Genesis, a classic XBox, *almost all* GameBoys that Nintendo put on the market, a GameCube and now a 360. I also have a very capable gaming PC that I don't use because the games are nicer to play from the couch on the big screen TV, and because console games don't require setup or take 2GB on my hard drive.

You're also way off topic: this post is about controllers, not which console I/you prefer. But if you want to go down that road, fine.

If you like to play on the PC and find the same games for a lower price, fine, go for it. As for me, I prefer to play it on the console even if it costs me more. Guess I'm not the only one or the prices would be different. <sarcasm>mmmh... Maybe there's a reason why games are cheaper on the PC... Let's try to remember our Economics 101... Oh, maybe that would be because nobody wants to buy them?</sarcasm>

I don't know how to evaluate "5 times better" graphics. What I know is that the graphics are incredibly sharper on the 360 than they were on the Xbox and that a lot more stuff can move on the screen at once: just look at the battles in 99 nights (I know, baaaad game, but still) or Kameo.

I think the innovation in the 360 version of Live are the achievements and gamer scores. This is the thing that will make gamers buy more games (and ultimately that's what makes or breaks a console).

Back-compat? I couldn't care less. I still have my classic Xbox and it works fine. Plus, I spend too much time playing my 360 games to go back to the Xbox games.

And don't pretend you don't know why Barbie works and not more interesting titles (but my choice would have been waaaaay different from yours: Outrun??). The minor titles work more easily because

A. They are simpler technically.

B. They are side effects of making other, more interesting games work.

Ultimately, back compat is only interesting in the beginning of a console's lifetime.

The D-Pad issue has only become important with the release of Street Fighter and Pac-Man. Before that, the controller only got praise and now it's the worst controller ever? Give me a break. Actually, if you read my post, this was kind of my point: no controller is good for everything but the default controller should be fine for all games. Quoting myself: "an arcade stick will be better for Street Fighter and Pac-Man". There is such a stick already (the DOA arcade stick) and more are in preparation (Mad Catz is doing one, and Microsoft gave some hints about alternate controllers). But yes, it would be great if they could improve the built-in one.

By the way, the worst thumb numbness I got because of bad D-Pads were from GameBoys and I don't remember anyone being vocal about those. They were reasonably precise but really painful, which again, made me play less (and hence buy less games).

Your sentence about the Wii being the only true "Next Gen" is just hilarious. Yes, and the PS3 is the only "true hi-def". Right. At least Sony was right on one thing: the Wii isn't hi-def (which is something you can define accurately, contrary to "Next Gen").

But the greatest thing is that you're making my points: "[...] there is also a normal controller available for it to play normal games with too". Exactly, the normal controller is the option, and the exotic one is the norm. All I've been saying is that it should be the other way around. Plus, it's not exactly a normal controller, it's more like a normalish wart that you add to the wiimote.

# August 29, 2006 3:24 PM

grgran said:

no face plate
# August 30, 2006 1:24 AM

miechu said:

you can always remap keyboard via windwos registry: 1. open regedit 2. HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Keyboard Layout 3. right click & add a new binary value named: Scancode Map 4. enter value: 00 00 00 00 00 00 00 00 02 00 00 00 00 00 52 e0 00 00 00 00 5. log out; log in; - last four numbers mean: zamien 52 e0 (insert) to 00 00 (null) - the first lone 2 number describes te amount of remaped keys + terminator - at the end there's gotta be a terminator (null) - you can add more binds, just add another four increse the first numer, and don'tforget that terminator this way you can rebind every key :D die insert, die! ;) best regards miechu (wanna thank me? ;) mail me at: miechu # miechu.pl)
# August 30, 2006 5:09 AM

Lee Fear said:

I didn't say you were playstation generation. I said you were sounding like one. You point out that the 360 has some new arcade controllers. Is this not the same thing as the Wii having an optional controller too? I don't think my comment about Wii being the only true next gen is 'Hilarious'. I do not consider Hi-Def (or Graphics at all) to define Next Gen, In fact in Europe (Especially the UK) Hi-Def Tvs have only been on sale a short time and are incredibly expensive (around $3,500 for a medium size one!). We will not be seeing even a moderate perentage of 360s connected to Hi-Def here for at least 3 or 4 years. So The fact that Wii is not Hi-Def is not of particular importance (Especially if it helps make the games cheaper and hence I will buy more of them). --Quote-- If you like to play on the PC and find the same games for a lower price, fine, go for it. As for me, I prefer to play it on the console even if it costs me more. Guess I'm not the only one or the prices would be different. mmmh... Maybe there's a reason why games are cheaper on the PC... Let's try to remember our Economics 101... Oh, maybe that would be because nobody wants to buy them? ---- Most of the people I know do not even own a 360 due to the prohibitive price of the console, the lack of many good games and the price of the games. I too prefer playing most games on a console but I fully understand why my friends use their PC's. Prey for £50, took 2 days to complete and the multiplayer is not that great either!!! now that is good value.. NOT! When I talk about the graphics on the 360 I am not denying that the graphics look crisper but I was not blown away like I was when I first viewed the PS2 after the PS1. I am told that Project Gotham 3 has as many polygons in 1 car than PGR2 had in the entire game world. I can fully believe this but it does not show so much in the finished product. Yes they look a lot crisper but not that much crisper! This just goes to prove to me that Nintendo were correct in moving in a different direction. ---Quote--- I think the innovation in the 360 version of Live are the achievements and gamer scores. This is the thing that will make gamers buy more games (and ultimately that's what makes or breaks a console). -------- I have to disagree. This has not made me buy more games. It just gets annoying in multiplayer when people are concentrating on getting achievements rather than playing the game. The Purchasing of extra content is a nice option but I am worried that it will be taken too far especially with microsoft suggesting consumable content which wears out leading you into buying new ones. I have thought of one feature that has made my gaming life better and that is the ability to stream music from my pc into the game. Now that is cool!
# August 30, 2006 5:26 AM

Dustin Halstead said:

I can't believe how much you discount the idea (or hard evidence) of backwards compatibility. It obviously wasn’t the biggest selling point when the PS2 came out since PS1 and PS2 games looked like night and day graphically (it was hard to go back) … regardless, the classics have still lived on (thank God the PS2 can still run Final Fantasy VII). In addition, the lack of backwards compatibility only added to the shadow over Nintendo’s weakening presence (people still love the SNES to this day and consider it the heyday of gaming). While it may not be the biggest selling point, it still plays a major role (Nintendo learned their lesson the hard way and have preserved the backwards compatibility within the handheld systems). How many ‘old’ games do you know of that people still play and love regardless of graphic advancements (StarCraft anyone?). Magazines, like GameInformer, and even G4tv recommend classic titles that gamers may have missed at one time … leading me (and countless others) to buy and enjoy sleeper-hits and overlooked classics. Now-a-days backwards compatibility is more important than even because consoles can’t make the same level of advancements that they once did … and games that looked amazing 3-4 years ago, still look good today (Halo anyone?). Microsoft knew backwards compatibility was important, that’s why they promised it before the release of the 360 … unfortunately, they have yet to fully deliver on that promise; and if you’re not playing 360 online, then forget about it completely. In short, consoles can no longer depend on graphic improvements and extra buttons to sell their product, especially since games have already reached a visual level that most people are satisfied with … and without an HDTV, it’s hard to notice anyways. So now, more than even, it takes more than that … it takes support for the library of great games that already exist, and innovation that goes beyond “graphic improvements”. Networking gamers and providing online play is a definite plus, but gamers cannot live on MMOs alone. It’s not surprising that Microsoft hasn’t realized this yet (they still think IE6 is ‘good enough’) … and Sony seems to think that everyone has a 6 figure income (and with a poor track record for building quality electronics (PS1 overheating and the flimsy PSP)). This is Nintendo’s chance to make a comeback, and I sincerely hope they do. Despite their history of poor decisions (VirtualBoy anyone?) Nintendo has proved that they have learned from their mistakes … something that Sony and Microsoft have failed to do. Not only does the Wii offer the possibility of a more immersive environment to gamers, but it will appeal to parents of the gaming youth, eager to see a console that will help thwart the obesity that plagues children today.
# August 30, 2006 7:03 PM

Bertrand Le Roy said:

(crap, my comment was eaten by community server... I guess I'll have to rewrite)

Lee: I don't know what defines "next gen" if it's not the new wave of consoles, which includes all three. I do not consider hi-def to define next gen either, I'm just saying it's something that you can objectively define. I know that in Europe, hi-def sets are still very expensive, but here in the US, they're getting mainstream and relatively cheap. By the end of this generation, not having hi-def will be a strong handicap. Even though it may not hurt the Wii in the beginning, it will eventually.

I don't think the price of the 360 is prohibitive. If you look back on the price of past generations, it sits exactly in the launch price range of all successful consoles.

You make an excellent point about games being cheaper on the Wii making people buy more.

Then again, Prey may be very short for the price, it doesn't mean that's a general thing with 360 games: just look at Oblivion or the Half-Life 2 package.

And the thing about graphics is that it takes increasingly more power to achieve ever smaller improvements. So yes, the difference between PS1 and PS2 was more impressive than what you'll observe in this generation (even with a hi-def setup), and I bet that the next one is going to be even less impressive. <sarcasm>On the other hand, this begs for another question: why didn't Nintendo just release the Wiimote for the GameCube if it's all about fun and gameplay?</sarcasm> Seriously?

You may think what you want about achievements and gamer score, but the fact is that the 360 has a *very* high attachment rate. Also, my friends who own a 360 care about their gamerscore and achievements and compete with each other, so your mileage may vary.

I also agree that the optional contents thing may go too far. Hey, it already has... The Oblivion horse armor was a joke and... it didn't sell. This stuff will self regulate. The consumable contents thing will flop in my opinion (except in places where it really makes sense, like in Second Life or the Sims).

Dustin: I don't discount the problem of back compat: "Back-compat? *I* couldn't care less. *I* still have my classic Xbox and it works fine. Plus, *I* spend too much time playing my 360 games to go back to the Xbox games." (emphasis added) So again your mileage may vary. I'm just saying that for *me*, it's unimportant, and I just tend to think that if you own xbox games, it means you have an xbox. But yes, I may be totally wrong about back compat only mattering in the beginning of the console's lifetime. Classic gaming is a distinct thing though and XBLA does a good job of offering classic games on the 360. Classic gaming != xbox classic games.

Apart from that, there are a few unfounded assertions in your post:

Sony has a "poor track record for building quality electronics"??? What? I'd say they have one of the best track records in the industry for that...

Nintendo has a "history of poor decisions"? No company can always succeed with all of its products or chances are they're not being creative. You could say that of any successful company (let's try... "Apple has a history of poor decisions (Newton or Lisa anyone?)", etc. etc.)

"Microsoft hasn't realized [gamers cannot live on MMOs alone] (they still think IE6 is 'good enough')". Well, I don't know where you got that quote of yours, but last time I checked, IE7 was in RC1. Also, I personally don't play much online, and I didn't realize that my 360 prevented me from playing offline games. Oblivion is an MMO? Hell, there isn't even one MMO on the 360...

"Nintendo has proved that they have learned from their mistakes … something that Sony and Microsoft have failed to do". Can you substantiate that claim?

Anyway, this blog post is *not* a flame war about which next gen console is the best, it is about whether or not it's a good strategy to have an exotic default controller.

So you are both waaaay off topic.

# August 30, 2006 8:44 PM

Simon said:

I think the quality of the games will be key to the success of this type of controller. Surely there's nothing to stop Microsoft (or Sony for that matter) from producing their own version of the Wii controller for their consoles if they think it's worthwhile? Maybe future generations of consoles will ship with several different types of controller. With regards to the 'HD isnt next gen' debate. I just bought an HD TV for my 360, and it's definately made a BIG difference in the quality of the visuals. HD sets are stil expensive though (I live in the UK).
# August 31, 2006 9:37 AM

miechu said:

argh! where did those "\n\r" go?!
# August 31, 2006 4:23 PM

LoooooL said:

The angle of the wake of a body moving steadily in deep water is always 2arcsin(1/3)
# August 31, 2006 10:48 PM

Bertrand Le Roy said:

Right. I should have done my homework more seriously. Updating the post.

# September 1, 2006 2:03 AM

Dustin Halstead said:

Holy crap Bertrand!  It sounds like you read only what you wanted to read.  If you don’t think that my comments have deep rooted foundation, then you lack the understanding to make “game predictions.”

Allow me to provide some backup to my “claims”:

>> Sony has a "poor track record for building quality electronics"?

--- um yeah.  The first PS1 systems overheated themselves.  The original PS2 design has suffered from constant lens failures and featherweight controllers that “rattle” and exhibit dead buttons after extended use.  The slim PS2 had overheating adapters, resulting in Sony recalling/replacing around 960,000 adapters (Of course the Xbox had it fair share of recalls due to fire hazards as well).  The PSP is the most flimsy handheld system to date (unless you want to call the Noki N-Gage a handheld system … which would be a joke) … not to mention, the PSP cases (that encompass the UMD) are poorly made and have a tendency to fall apart, dead and/or lit pixels, poor screen durability, and self ejecting UMD (if the unit is ever twisted … which shouldn’t have been possible in the first place).  Also, when G4 performed “stress tests” on the GameCube, PS2, and Xbox.  The PS2 broke into pieces after test one … the Xbox held up a little better … but the GameCube was the ONLY system that survived every test (although these tests were extreme, you can easily see the flimsiness of the PS2).

You can watch it here (Or search for: GameCube vs PS2 vs Xbox):

http://www.youtube.com/watch?v=PUWFpZ7DksI

Do your homework pal … Case closed.

>> Nintendo has a "history of poor decisions"?

--- Obviously most companies DO make poor business decisions from time to time, my point was, it seems they learn from it where-as Microsoft and Sony have NOT.

>> "Microsoft hasn't realized [gamers cannot live on MMOs alone] (they still think IE6 is 'good enough')".

--- Now you’re misquoting me.  I said: “Networking gamers and providing online play is a definite plus, but gamers cannot live on MMOs alone.”  I’m simply stating that you can’t sell a console with online capabilities alone (there has to be more to offer)… and that encompasses a lot more than World of Warcraft type games.

Concerning Microsoft … Internet Explorer 6 turned 5 YEARS OLD on Aug 28, 2006 ... 4 days ago.  Webdesigners (I’m one myself) are forced to use code hacks and can’t embrace the full CSS support that EVERY OTHER BROWSER has.  Let’s not even mention the poor OS support M$ has shown over the years (WindowsME anyone?).  Strange how Mozilla can out-perform a company that has enough money to buy and sell them 100 times over.  Although I will admit that Microsoft has shown better support towards the Xbox … which is kinda sad.  Although, It’s probably because Microsoft actually has competition in the console arena … so maybe if the 'Google OS' rumors come true, M$ will finally get on the ball.

Also, If you haven’t seen the IE7 blog, now would be a good time: http://blogs.msdn.com/ie/default.aspx

(See what I mean?  You can actually feel the disgust from webdesigners everywhere.)

Although Nintendo has made mistakes, they’ve never done anything as obviously and as consistently retarded as Sony or Microsoft … such as piss off EVERY person that uses their system.

Nintendo may disappoint, but never have they created the hatred that exists for Microsoft.

>> So you are both waaaay off topic.

--- Then you missed my point completely.  The point I was making is that MORE innovation has to exist than better graphics.  It comes down to many factors … not just controllers, not just online connectivity, and not just backwards compatibility.  Nintendo seems to be taking much more into consideration than Microsoft or Sony, so I wouldn’t go around blasting them for their innovative (albeit risky) controller design and assuming that it will solely determine the outcome of it’s success.

# September 1, 2006 3:32 AM

More Atlas stuff said:

It&#39;s the second time in just a few days that I see blog comments attack Atlas on its compatibility

# September 1, 2006 3:56 AM

astopford said:

Does'nt explain why smith and neo was suddenly able to cross both worlds if they are were so predictable and why neo was granted a deal in return for destroying smith. My theory is that the real world was another Matrix but populated by machines and humans, it took six attempts to see if the boundary could be crossed but the machines never counted on Smith and in return for his destruction Neo was granted his freedom.
# September 1, 2006 5:01 AM

Steve said:

Well Mr. Bertrand Le Roy, I am a huge fan of the matrix and I can't deny that everytime I watch I figure out things I didn't knew or noticed before. The Architect did declare that five previous versions of the matrix existed. well let's try to think of it as a computer program where u install the first release then you install another pacth and another and another then u do the update then an upgrade probably. What u said about a super-matrix is not exactly what I had in mind but close ot it. What if the real world which the Neo, Morpheus, Trinity and Zion think they exist in is nothing but a previous version of the matrix. What happened is that simply when quit the 6th version they woke up in the 5th... think of it as a hierarchical structure whee Matrix version 1 comes first then second then third.etc...etc.. As for forseeing some1's actions... well if I make you choose between say (for the sake of the example): dying a very painfull death or maybe running a 100 meters... then I am sure you'll go for the 100 meters. after all it wasnt really a choice. Concerning Neo's name... I also thought of that, but then again it doesn't mean it's true. Lastely, if as you said. The human race was wiped and some programs are running to make the machine working. then I think the agents & the so called humans (neo, trinity, morpheus) could be canceled without impacting the operation of the whole system... they will even free system resources ;-) That's all i have to say for now. I realize I may not have the best answers. But I guess the thrill of everyone believing what they want to believe is what count.
# September 1, 2006 5:46 AM

vikram said:

Good write up. I liked the writing skill
# September 1, 2006 7:05 AM

WTF? said:

Why is this an "Atlas Blog" ?????
# September 1, 2006 7:18 AM

Mads said:

In the Matrix Trilogy DVD Collection, on the Matrix Revolutions disc, there is an interesting commentary from two philosophers about all this. They also have a theory on Neo’s powers in the real world. You should check it out :)
# September 1, 2006 7:36 AM

Amit said:

Very interesting! Loved your comment about SQL Server - that would be ideal whenever a Matrix spoof comes out (wasn't there one in the making?)
# September 1, 2006 8:18 AM

ali said:

"The Oracle, according to its name, is the Matrix's database (I guess Sql Server would have been too obvious )" Now you mention it, its funny !
# September 1, 2006 9:07 AM

Nadim said:

wait wait wait, from what i understood is that the oracle beleived that there was someone ( or should i put it a program )in the matrix(i.e. Neo ) who could come to the real world and be more human than the previuos 7 or 8 ( cnat remember the exact number ) versions. the Oracle had seen previous versions before Neo and that is why she new what was happening. She wanted everythign Neo did to be based on his CHOICE. ( i.e to see whether his decisions will be more human ).... Personally i think it was something like a bet between the Oracle and the Architect. Coz at the end of 3 when the Architect walked to the Oracle , the little agirl and the chinese guy, the chinese guy asked her how did she know, and shes goes "Because I Beleived"
# September 1, 2006 10:09 AM

Mike said:

When you realize that all the machines had to do was to build nuclear reactors for power instead of using humans for it, you realize the whole thing unfortunately falls apart. From seeing what they were able to accomplish in their city, there's no way they couldn't have throw some reactors together. :) Still some of my favorite movies of all time though.
# September 1, 2006 10:31 AM

David Taylor said:

This is very dangerous territory for you to be covering Bertrand - people are quite opinionated on this. I think that we all watched the Matrix; loved the first; loved the second....then we all had time to think about what the 3rd would be. Then it was a total let down to the point of not making sense or being consistent. Thus people like yourself, in their frustration try to give the Wachowski more credit then they deserve by coming up with very imaginative plots to make it a good movie when it wasnt.
# September 1, 2006 11:53 AM

Bertrand Le Roy said:

For some reason, Dustin's comment was eaten by Community Server (again).

Here it is as salvaged from my mailbox. Not sure it was worth salvaging but for the sake of freedom of speech...

"Dustin Halstead said:

Holy crap Bertrand!  It sounds like you read only what you wanted to read.  If you don’t think that my comments have deep rooted foundation, then you lack the understanding to make “game predictions.”

Allow me to provide some backup to my “claims”:

>> Sony has a "poor track record for building quality electronics"?

--- um yeah.  The first PS1 systems overheated themselves.  The original PS2 design has suffered from constant lens failures and featherweight controllers that “rattle” and exhibit dead buttons after extended use.  The slim PS2 had overheating adapters, resulting in Sony recalling/replacing around 960,000 adapters (Of course the Xbox had it fair share of recalls due to fire hazards as well).  The PSP is the most flimsy handheld system to date (unless you want to call the Noki N-Gage a handheld system … which would be a joke) … not to mention, the PSP cases (that encompass the UMD) are poorly made and have a tendency to fall apart, dead and/or lit pixels, poor screen durability, and self ejecting UMD (if the unit is ever twisted … which shouldn’t have been possible in the first place).  Also, when G4 performed “stress tests” on the GameCube, PS2, and Xbox.  The PS2 broke into pieces after test one … the Xbox held up a little better … but the GameCube was the ONLY system that survived every test (although these tests were extreme, you can easily see the flimsiness of the PS2).

You can watch it here (Or search for: GameCube vs PS2 vs Xbox):

http://www.youtube.com/watch?v=PUWFpZ7DksI

Do your homework pal … Case closed.

>> Nintendo has a "history of poor decisions"?

--- Obviously most companies DO make poor business decisions from time to time, my point was, it seems they learn from it where-as Microsoft and Sony have NOT.

>> "Microsoft hasn't realized [gamers cannot live on MMOs alone] (they still think IE6 is 'good enough')".

--- Now you’re misquoting me.  I said: “Networking gamers and providing online play is a definite plus, but gamers cannot live on MMOs alone.”  I’m simply stating that you can’t sell a console with online capabilities alone (there has to be more to offer)… and that encompasses a lot more than World of Warcraft type games.

Concerning Microsoft … Internet Explorer 6 turned 5 YEARS OLD on Aug 28, 2006 ... 4 days ago.  Webdesigners (I’m one myself) are forced to use code hacks and can’t embrace the full CSS support that EVERY OTHER BROWSER has.  Let’s not even mention the poor OS support M$ has shown over the years (WindowsME anyone?).  Strange how Mozilla can out-perform a company that has enough money to buy and sell them 100 times over.  Although I will admit that Microsoft has shown better support towards the Xbox … which is kinda sad.  Although, It’s probably because Microsoft actually has competition in the console arena … so maybe if the 'Google OS' rumors come true, M$ will finally get on the ball.

Also, If you haven’t seen the IE7 blog, now would be a good time: http://blogs.msdn.com/ie/default.aspx

(See what I mean?  You can actually feel the disgust from webdesigners everywhere.)

Although Nintendo has made mistakes, they’ve never done anything as obviously and as consistently retarded as Sony or Microsoft … such as piss off EVERY person that uses their system.

Nintendo may disappoint, but never have they created the hatred that exists for Microsoft.

>> So you are both waaaay off topic.

--- Then you missed my point completely.  The point I was making is that MORE innovation has to exist than better graphics.  It comes down to many factors … not just controllers, not just online connectivity, and not just backwards compatibility.  Nintendo seems to be taking much more into consideration than Microsoft or Sony, so I wouldn’t go around blasting them for their innovative (albeit risky) controller design and assuming that it will solely determine the outcome of it’s success."

# September 1, 2006 1:38 PM

Bertrand Le Roy said:

First, Dustin, let me tell you that I love how your opening comment amounts to saying that if I don't agree with you, I'm not qualified or too dumb to make ""game predictions"". The quotes here are yours. I don't try to "predict" anything. This is my blog and that makes me perfectly qualified to give my opinion here. I don't expect everybody to agree with me and I may be wrong on a lot of things (I know I've been on more than a few occasions). You, on the other hand, are a guest here.

Your claim about Sony was not exclusively about game consoles but about electronics in general. Their consoles may not be the most robust things they built, but consoles are sold at a loss, so you can't really expect the same quality they put into their TV sets for example. I don't know what their return numbers are on the PS2 or the PSP and they may be higher than the other guy's, that's entirely possible, and I concede you that point if it's the case, but don't say that Sony in general doesn't know how to build good electronics because that's just not true. The G4 stress tests (which I had already seen) were a *joke*. Didn't you notice the funny german accent and stuff? Man, here I am, defending Sony. Who would have thought?

(Oh, and I'm not your "pal".)

I don't know about Sony (but you may want to check this piece in Wired: http://www.wired.com/wired/archive/14.09/sony.html?pg=1&topic=sony&topic_set= ) but saying that MS doesn't learn from its mistakes is unsubstantiated BS. Putting "not" in uppercase doesn't bring more weight to your argument.

"M$"? What's that? Oooh, I get it. How clever. You replaced the S with a dollar.

I'm not especially defending IE and the lack of evolution it's showed over the last few years. That was a very bad thing for the industry. I was just answering your "they still think IE6 is ‘good enough’" remark, which is just plain wrong. They just don't or IE7 wouldn't exist. I agree that the team started working on it waaaay to late and that there is still a lot of work to do. But as a web developer myself I'm a lot more annoyed by Safari than I am by IE. But your mileage may vary. Saying that Sony and MS pissed off "EVERY" person that uses their system is completely out of proportion. Think about it for just a minute. Would both companies have any customer left if that were the case? I just think that both are companies that some people love to hate (partly because they are so huge) and that those people are very vocal while the immense majority of their customers are just satisfied (silently). But then again, I'm biased, I work for Microsoft on a product that I believe is a good one.

You're right about this console war not being about just one thing, but you have to admit Nintendo centered its communication around the controller. That's what I'm doubting. You're doubting the 360 focus on online play, fair enough.

# September 1, 2006 4:08 PM

Kash said:

Huge fan of the movie. I think it is same as Microsoft (Architect & Oracle) inviting hackers (Neo) or creating automated tests (Smith) to break vista (The Matrix) security so they can fix the flaws and make it a better OS that will make more cash(energy). The programers have access to all the versions (Matrix or real world) of application(The matrix) through backdoors(Trains). well it might not be very good review but more later i guess.
# September 1, 2006 4:38 PM

Christophe said:

Bravo pour l'analyse... ça donne envie de les revoir :) Thanks
# September 1, 2006 7:18 PM

cowgaR said:

thank you David Taylor, I could'nt write it better. Exactly. The Matrix 1 is a cult movie. The 2nd one is quite good, althought far away from the qualities of the 1st one despite it brings new ideas and explanations. Becasue it is bringing also some confusions...maybe for the misch-masch 3rd part, which is, really...not a good movie. Do not give credit for spaghetti glued trillogy. Give credit to one of the best sci-fi movie ever made, which Matrix One is.
# September 2, 2006 5:49 AM

Eddie said:

Thanks, This is an excellent control. I am having problems getting server side code output to display in the pop-up page. I set a public string variable based upon a particular error in a If block in VB.NET code-beside, and I have the ALERT control setup to display the variable using an <% # %> block. The message does not display. Does this have to happen at page load time? Thanks
# September 2, 2006 8:38 PM

Bertrand Le Roy said:

Eddie: without seeing your code it's hard to say. You can drop me e-mail at bleroy (at microsoft.com) and I'll have a look. Try to remove any dependancies from the code and make it as simple as possible, so that I can easily run it. Thanks.

# September 3, 2006 3:02 AM

Steve said:

It was my understanding that the 2nd and 3rd movies were filmed in conjunction, as one long movie, a la "lord of the rings". I for one felt that both movies were similarly lacking in substance compared to the first which I found to be brilliant. But both do seem to act as foder for mind games to be played on ourselves for and indefinate amount of time, so i guess they've done their job.
# September 3, 2006 3:27 PM

AJ said:

You guys do realise that ITS NOT REAL!!!!!
# September 3, 2006 5:32 PM

Bertrand Le Roy said:

Errrrr... Sure... No need to shout. You?

# September 3, 2006 5:39 PM

terraslate said:

oh leave it alone. everyones trying to come out with something new. there are more ways to do the same thing coming out than you can shake a stick at. yeah i've been a developer for over a decade, i've seen it all i reckon, and this is just one more of those things that someone has come out with in the hope that we'll all think - wow - how did i ever do my job without it. sure if it makes your life more interesting keep at it - me - i don't need one more thing that nobody needs.
# September 4, 2006 9:32 AM

Matrice64 said:

I think Mr. Bertrand Le Roy, that you did a very good job of describing your take on all three movies. I think the 3rd movie requires you to see alittle more than the previous versions, and some people can analyze metaphors better than others. Your view on it is certainly one that I found more interesting than others :-).
# September 4, 2006 4:17 PM

Bertrand Le Roy said:

Terraslate: I understand what you're saying and that's precisely the reason why we're submitting this to public feedback. I'd like to point out once more though that this is actually nothing new and that this concept is present in quite a few dynamic languages.

# September 4, 2006 5:07 PM

lukerk said:

Again, why is this an 'Atlas Blog'???
# September 5, 2006 1:16 PM

Bertrand Le Roy said:

lukerk: This is my blog and I get to choose the contents. The most common contents you'll find here is Atlas because that's what I'm working on currently but there will be other topics too. Feel free to ignore them.

# September 5, 2006 3:18 PM

周晖(Cola) said:

ASP.NET Event Validation

# September 5, 2006 11:33 PM

EMCF said:

I'd like to pipe in for a moment, the Wii-mote (as it's affectionately being called by some) does in no way need to be waved around like you're retarded. The motions can be large and craz-o, or small and refined. No more than you naturally move the controller as you play games with a normal controller. You'll still be able to lay on your back with the controller on your stomach for most games. Something like Wiisports might require an upright stance at first, but you will learn to play those too on your back. Though it might take away from the realism (baseball is played standing up, not on a couch :D).
# September 6, 2006 1:51 AM

Bertrand Le Roy said:

Yes, I've read that argument a lot, but there's still something bothering me: the smaller the movements, the more precise the detectors need to be. This kind of device has been notoriously imprecise in past attempts so while Nintendo may have perfected the technique, it remains doubtful to me you can have both precise control and small amplitude movements. But yes, until we get a chance to test it (which only Reggie knows when that may be) we won't know for sure. As I've said before, all this is only conjectures and I may very well be completely wrong.

# September 6, 2006 2:33 AM

Bertrand Le Roy said:

Then again, the Gyration remotes are fairly precise even with relatively small movements, so yes, why not? I guess we'll see how the games exploit that.

# September 6, 2006 2:38 AM

Blogs said:

Very Cool
# September 6, 2006 2:40 PM

Test 1 2 3 said:

Test 1 2 3 This is exactly what I was looking for...Thank you...
# September 6, 2006 2:50 PM

Mirza said:

I really like your view. Never thought in that way. great thinking.... n yeh matrix trilogy is great sci fi movie
# September 6, 2006 8:31 PM

Eddie said:

Bertrand LeRoy, Thanks, Sorry it took so long to get back to you, I have been swamped. I actually figured it out. I had partial rendering on the page and needed to add an update panel with a trigger. It works great now. Eddie
# September 6, 2006 9:48 PM

Keith Bradley said:

I can get the control to work but a message comes up and says Page Can Not Be Displayed. I have tired on several test pages and the same thing appears. The Popup works as it is supposed to but the text and buttons will NEVER appear a web error comes up saying the page can not be displayed. Does anyone have any clues to what I am doing wrong. Thanks.
# September 7, 2006 2:26 PM

Bertrand Le Roy said:

Keith: without seeing your code it's hard to say. You can drop me e-mail at bleroy (at microsoft.com) and I'll have a look. Try to remove any dependancies from the code and make it as simple as possible, so that I can easily run it. Thanks.

# September 7, 2006 3:21 PM

Sektor said:

When I watch de 3rd film, I thought just like you Bertrand. But after checking out the 1st film I easely changed my mine. Now I'm think that it was meant to be only one film, but with the 1st film's success they tryed to continue the idea. To my disapoint it was a failure. Aldo the 2nd was very nice whit that martial arts. (Sorry, my english is not so good)
# September 8, 2006 6:19 AM

Xander Pascal said:

@David Taylor, I think people are a bit confused when it comes to the Trilogy. It's not a Trilogy in the sense of one. Matrix 1 was great, Matrix 2 was cool, Matrix three was confusing, Animatrix hey wait lets watch Matrix three again, Matrix three NOW it makes sense. The Animatrix has a lot of information that clearifies things in the third one. But still how does this relate to Atlas?
# September 8, 2006 7:03 AM

Bertrand Le Roy said:

Xander: it doesn't have anything to do with Atlas but see above comments.

# September 8, 2006 1:34 PM

Suneil said:

Just writing a test message to see how Atlas is being used.
# September 9, 2006 7:43 AM

Paul said:

I've had similar thoughts, although yours I think are better formed. The best I'd come up with was that Zion was exception handling like a try...catch block. Rogue 'programs' (in my concept still of human origin, but I like your take that nothing was human) would be 'handled' by getting sent to the error trap of zion and then later cleaned up by garbage collection. . . To this day my Exception object names are all called 'zion'. :D try { //something } catch (Exception zion) { //handle zion } :D
# September 9, 2006 9:37 AM

Robert Cowart said:

Ctrl was immediately left of the A key for ever, before IBM decided to rearrange the PC keyboard on the IBM AT in the '80's. Computer terminals such as the famous ADM 3A all had it there. IBM decided to make the keyboard more like a typewriter. Big mistake, since virtually anyone using a PC for word processing was using WordStar which used the Ctrl key for editing, scrolling, cutting and pasting, block moves, and everything else. I still use those commands and can edit fast as heck with them (way faster than with a mouse, pgup, PgDn, arrow keys, and backspace. I can do all kinds of things like delete to end of line (Ctrl-P), delete line (Ctrl-Y) using macros I wrote for Word that emulate Wordstar. SO I always have to remap the keys. I put Ctrl where CapsLock is, put Alt where Ctrl is, and put Caps lock where ALt is. Much better layout. Currently writing about Windows Vista and realize my trust program RemapKey isn't working in Vista because it can't find the registry....:( Bob Cowart Author of 20 books about Windows including "Using Windows XP" (Que) upcoming...Using Windows Vista
# September 10, 2006 2:52 AM

Bertrand Le Roy said:

Suneil: ooooh, do you mean that all the comments about this not being about Atlas are really wondering how Atlas is being *used* by/in this blog?

Well, writing a blogging engine is serious business (it's so much more than Post 1 * n Comments) that I leave to others who do it much better than I would. Me, I have enough work developing Atlas itself, and working on my own private projects.

In the same way that I did not write the word processor or the OS I use everyday, I did not write this blog engine (if you have to know it's Community Server which is built by the smart people at Telligent on top of ASP.NET 2.0).

I hope this clarifies.

# September 10, 2006 3:46 AM

Carlos said:

No, no, no... the Oracle is just error-handling and Neo is exception. :O
# September 10, 2006 3:33 PM

Slava Naumenko said:

Here is an example of a menu using iframes and z-index to shield select element in IE. http://www.menu4web.com/demo/d_ml.html
# September 13, 2006 10:33 AM

emortal said:

Works with https, no message.
# September 13, 2006 10:54 AM

emortal said:

Sorry that should have been BLOCKED SCRIPTfalse; NOT BLOCKED SCRIPTreturn false;
# September 13, 2006 10:56 AM

zois said:

i was watching a sientific show on tv long time ago , about going back to the past and forword in to the future , they sead the only way to acive that task is to use computer emulation,also that will be possible in to the future,with the atvancment of our computer technology. Then one ask the guestion"if we are in a program that simulate the past,how we know who is real and who is not (The Matrix)? Dream on , we still sleeping.
# September 14, 2006 9:00 AM

JF Trichard said:

It works fine with IE7
# September 14, 2006 10:03 AM

Bertrand Le Roy said:

Zois: wow, I wonder where they got that from, but that certainly wasn't a scientific show ;)

# September 14, 2006 1:01 PM

Ludmal's Blog said:

Really good post about Creating Session variables and Redirecting the page.http://weblogs.asp.net/bleroy/archive/2004/08/03/207486.asp...

# September 15, 2006 12:40 PM

Yale said:

I have a parent DropDownList (like province)and dependent DropDownList(like city). after callback, i update the city dropdown list. when I do a postback, the second list items are all gone due to the ViewState not refreshed during the callback. How should I deal with this situation?
# September 16, 2006 2:13 PM

Peter said:

It is very Good for learning Atlas.
# September 18, 2006 2:49 AM

Bertrand Le Roy said:

Yale: short answer is to start using Atlas (Microsoft AJAX). An UpdatePanel should make that scenario ultra-easy. Even better, use the chained drop down lists from the Atlas Toolkit which I think are doing exactly what you want to do. Long answer, you need to keep track (in a hidden field usually) of the client-side changes. On the next postback, look at this field and "replay" the changes that happened client-side so that the server-side state can catch up. That's what the TreeView is doing. But really, you should check out Atlas. Hope this helps.

# September 18, 2006 12:51 PM

InfinitiesLoop said:

The crew actually being programs in a supermatrix is what I always suspected. The whole notion of "the body cannot live without the mind" is kind of a stretch -- I mean, you fall in the matrix and it makes your lip bleed? The mind is tricky and powerful but it's not THAT accurate! But if you think of them as programs in a supermatrix you can attribute this behavior to the rules programmed in the supermatrix. Also, their program is transfered into the sub-matrix while they are plugged in (or at least interfacing with it at some level), and not disconnecting it properly (pulling the plug out of their heads) causes it to enter an unsupported state. I guess they dont implement IDisposable, pitty.
# September 18, 2006 5:24 PM

ナオキにASP.NET(仮) said:

Nikhil さん と Bleroy さん の blog からです。 Script# Prototype Script# brings compile-time and C# niceties to JavaScript

# September 19, 2006 3:29 AM

Infinity said:

possible to support bmp, gif and png also ?
# September 20, 2006 3:01 AM

Bertrand Le Roy said:

Infinity: it's shared source, so feel free to implement that, but I won't in the near future, jpeg being the dominant format for photos. Sorry.

# September 20, 2006 7:53 PM

ナオキにASP.NET(仮) said:

nikhilk.net と Atlas and more と ScottGu's Blog からです。 Back Button Support for Atlas UpdatePanels ( nikhilk.net

# September 22, 2006 4:54 AM

John fron OK said:

Keyboard: Microsoft Ergonomic 4000 I thought F-lock would be an issue but it really is not – it stays on and the light at the bottom of the keyboard is both visible and unobstrusive. But what to make of the key functions themselves? “Close” – F6 – is a ctrl-F4, not an alt-F4. The ergonomic layout now makes either of these combinations ergonomically painful, so I mapped one of my 5 “favorite” buttons to do alt-F4, and occasionally turn the F-lock off if I need repeated ctrl-F4’s. “Send” – F9 – does not “send/receive” in Outlook. F9 does. Which F-key? Why, it’s the one with “Send/F9” written on it. So I get the benefit of the new function without actually resorting to that function. I have yet to figure any rational purpose for the other “alternate” functions. Why was is it so hard to use ctrl-Z, ctrl-P, ctrl-S, that they had to give them their own keys? Thanks for the tip on Excel and Scrlk. Thanks for the original rant, too. PrtScn,Sysrq,Scrlk,Pause,Break have always been a mystery. Num-lock drives my coworkers nuts.
# September 22, 2006 12:13 PM

John Porter said:

I've got the lattest 60914 Prod dll but when I add it to my toolbox I have the accordion component but do not seem to have the AccordionPane component and so am ubale to use this. Is anyone else having the same problem? How do I go about fixing it?
# September 22, 2006 7:18 PM

Bertrand Le Roy said:

John: I have no idea what dll you're talking about. If you're using the Toolkit's Accordion, you should ask this question on the toolkit forums:

http://forums.asp.net/1022/ShowForum.aspx

# September 22, 2006 7:26 PM

John Porter said:

Sorry yes I'm using the toolkit on, my bad thought this was the same one.
# September 22, 2006 7:31 PM

Bertrand Le Roy said:

No, this one was written way before. I'll update the post to make that clearer and to point people to the toolkit one (which should be used instead of this sample).

# September 22, 2006 7:37 PM

Atlas and more said:

I thought I&#39;d write a few posts about the controls I&#39;ve created for Brad&#39;s Mix06 demo, which

# September 22, 2006 7:40 PM

STFO said:

I think the Wii, is aimed for a different audience. PS2 and Xbox are mostly played by teenagers and older men. But this can bring in children and the elderly. Also I think they will have normal games as well. Because they also have an anologue stick (whatever you call them)

# September 23, 2006 2:15 AM

Troubled said:

Hello Bertrand Le Roy, I'm using : Session["MemberNo"] = 5; Response.Redirect("~/ViewMember.aspx", false); and i'm still losing the sesion value once steping over Response.Redirect. What might be the reason causing this behavior.
# September 23, 2006 4:14 PM

ASP.NET Chinese Blogs said:

[来源:Bertrand Le Roy] 传统的web应用一般含有多个页面,用户在浏览时,浏览器地址框里的地址会随着页面的变动而更新。用户可以bookmark页面把网页地址收藏,之后通过收藏夹里的地址回到同个页面。用户在网站浏览时,也可以使用浏览器的向前/向后按钮来回访问多个网页。

# September 23, 2006 5:10 PM

Bertrand Le Roy said:

Troubled: send me mail at bleroy at microsoft com with code to reproduce the problem and I'll have a look.

# September 24, 2006 12:56 AM

Marcelo said:

Keith: I found the same problem as you did, and I got to solve it by copying the folder Alert that comes with the source code to the root of my website. Then everything started to work. I hope this helps you. Bye.
# September 27, 2006 4:55 PM

InfinitiesLoop said:

We shall call it "the double negative trick" :)
# September 29, 2006 4:09 PM

InfinitiesLoop said:

Isaac Asimov: The most exciting phrase to hear in science, the one that heralds new discoveries, is not Eureka! (I found it!) but rather, "hmm.... that's funny...."
# September 29, 2006 8:51 PM

Dan's Bloggings said:

Normally I wouldn't expect myself to find a reason to blog about Javascript. After all, for anyone who's gone through the browser wars having tried to do dhtml the hard way and be browser friendly, Ja ...

# September 29, 2006 10:45 PM

Vikram said:

"Electricity wasn't discovered by trying to improve the candle." to add to that neither was Asp.Net discovered in trying to improve ASP.
# September 30, 2006 7:22 AM

Nick said:

Is it possible to open a web page with accordion to open with a particular pane? For example if i have pane1 pane2 and pane3 and when I call a page, it will start with pane2 open. Thanks.
# September 30, 2006 1:14 PM

Bertrand Le Roy said:

Nick: of course. Just set the current pane before initialization (which is easy if you're using xml-script, just write the attribute). When the page loads, all panes will be visible until initialization (this is desirable because if people visit your page with JavaScript disabled, they will see all panes and should still be able to use your application) but as soon as initialization happens, the panes other than the current one will collapse without animating.

# September 30, 2006 8:44 PM

ScottGu's Blog said:

SQL Injection attacks are reallynasty security vulnerabilities, and something all web developers (regardless

# October 1, 2006 12:29 AM

Christophe Lauer, Blog Edition said:

C'est une annonce relayée coup sur coup sur les blogs de Bertrand Le Roy et de Scott Guthrie : ComponentArt...

# October 1, 2006 11:42 AM

Showme said:

MS said SQL Reports will work in Firefox, it doesn't. MS said ClickOnce will work in all browsers, it's IE only. MS said Atlas will work in Firefox, it .... give me a break. (It's not done until Lotus 123 won't run)
# October 1, 2006 8:44 PM

Mal said:

I'm no Javascript whizz, but if I were you, I'd stick to your previous technique (the ternary operator), as it's more explicit in its use of Boolean values. Just feels like it gives more clarity.
# October 2, 2006 6:54 AM

Bertrand Le Roy said:

Showme: I don't know about the other products you mention but Atlas *already* works on Firefox. You can very this yourself as it's a free download.

So yes, MS said Atlas will work in Firefox and it already does.

# October 2, 2006 3:07 PM

Bertrand Le Roy said:

Mal: I would usually agree with you but in this context, we need the Atlas script files to be as small as possible even if it means that they are a little less readable. Plus, we're far from the extreme C++ samples that come to mind when you look at such code.

Ideally, a JavaScript cruncher should be able to translate X?true:false into !!X.

# October 2, 2006 3:20 PM

Alex said:

I'm just getting this error: Parser Error Message: User control source files must have a .ascx file extension. Any suggestions?
# October 3, 2006 2:40 PM

Bertrand Le Roy said:

Alex: can you give me a little more context? What version of ASP.NET are you using? What did you do exactly, etc.? Drop me e-mail at bleroy (microsoft.com)

# October 3, 2006 2:45 PM

Mike said:

Has anyone used this? Thoughts?
# October 5, 2006 7:20 PM

sys1jal said:

I am somewhat new to the Asp.Net environment. I'd also like to get the VB code but I can't locate it. Could you be a little more explicit in your directions where it is. I have looked... Thanks.
# October 6, 2006 12:16 PM

sys1jal said:

Bertrand, Thank you for the link for the VB code. I copied the files to my PC, but I am getting multiple errors when I try to run Default.Aspx and the page won't open. I am new to the environment, so I am sure that it is something basic that I have done incorrectly. These are typical: "Element 'Alert' is not a known element. This can occur if there is a compilation error in the website" Element 'ConfirmButton' is not a known element. This can occur if there is a compilation error in the Web site. 'AlertButtons' is ambiguous in the namespace 'Microsoft.Samples.Alert'. Name 'ServerAlert' is not declared. Thx.
# October 6, 2006 6:27 PM

Bertrand Le Roy said:

Many possible causes to that but the most likely is that you didn't copy the folder that contains the VB code as a web application. So ASP.NET is probably not even looking at the App_Code folder because it's not at the root of an applicaiton.

# October 6, 2006 6:47 PM

Rick Strahl said:

I've run into this on a few occasions, and it's one of those things that are totally non-obvious about JavaScript - until you hit it... I've come to think of prototype like a sort of static interface with closures being more like a typical instance interface. It depends on the situation, but it seems to me one should be really careful with assigning protypes because you may never know how a class is used.
# October 8, 2006 5:23 AM

Manuel Abadia said:

Bertrand, the output in both cases is: Bar #1[object Object] Bar #2[object Object] as stuff is an object. Anyway, going to the root of the post, to be on the safe side when using the prototype based approach, use null when defining properties that will hold objects in the prototype and create the object in the constructor. In this case just changing the stuff definition for: Foo.Bar.prototype.stuff = null; and using the first constructor for the second case works. As you mention, the prototype based approach is better for memory (specially if there are a lot of functions) so my question is why most of the atlas classes use the closure style??? I posted something a bit related to this when talking about atlas javascript OOP enhancements: http://www.manuelabadia.com/blog/PermaLink,guid,c59facc0-301e-4e30-898d-428038828dcd.aspx
# October 8, 2006 6:20 AM

Bertrand Le Roy said:

Manuel, you'll see in the next CTP that all Atlas classes are now prototype-based.

I'll fix the post.

# October 9, 2006 12:02 AM

Manuel Abadia said:

Bertrand, that's good news! Is the next CTP comming out soon? :)
# October 9, 2006 3:08 AM

Garbin said:

Hi, I still remember that headache... I've read about this tip only in a book entirely dedicated to JavaScript. Thanks for sharing it.
# October 9, 2006 1:46 PM

Bertrand Le Roy said:

Manuel: we're working really hard on the new CTP currently. I can't tell you when it will be ready exactly yet, but we're doing everthing we can to get that into your hands as soon as possible.

I'll make another post soon about the transition from closure to prototype, its motivations and caveats.

# October 9, 2006 2:49 PM

Manuel Abadia said:

Bertrand: Thanks for the information. As the last release was a few months ago I'm a bit impatient to get the latests bits in my hands. The post you talk about sounds really interesting...
# October 9, 2006 6:24 PM

Manuel Abadia's ASP.NET stuff said:

This posts completes the Microsoft AJAX library OOP enhancements, giving a lot o

# October 11, 2006 7:20 AM

Craig Serold said:

Hey guys, I'm pretty green on javascript/Atlas script. do you guys have any suggested reading for learning more about the prototype and closure references you make here? Thanks!
# October 11, 2006 8:01 AM

Travis James said:

This is a great article. I suppose in the next installment you will cover how prototypes can be dangerous when expecting "virtual" function behavior and the fact that prototypes are static instances that, once defined, change the behavior of all versions of the function called after a new prototype has been defined? Because the Atlas closure model with the "getTypeDescriptor()" semantic allows for overriding and calling "base class implementations" it might be confusing to make the right decision about what model to use.
# October 11, 2006 8:51 AM

michael said:

what about the following? same thing, just seems easier to read/associate the grouping. function Point(x, y){ this._x = x; this._y = y; } Point.prototype = { get_x: function() { return this._x; }, get_y: function() { return this._y; } } var x = new Point(2,5); alert(x.get_x());
# October 11, 2006 10:05 AM

Wallym said:

Awesome. Thansk Bertrand.
# October 11, 2006 10:20 AM

Matt G said:

Since I came across this post I was curious if a problem I'm have getting Response.Redirect working with an UpdatePanel is related to this issue. According to what I've seen this issue was resolved a while back, but response.redirect does not seem to work for me.
# October 11, 2006 11:34 AM

Bertrand Le Roy said:

# October 11, 2006 12:18 PM

Bertrand Le Roy said:

Michael: yes, absolutely, this will be covered in part 2, and it is the style we're using in our own classes but I wanted to stay out of any Atlas-isms in the first part. There's something missing in your example though, as if you set the prototype this way, you also need to (re)set the constructor. If using Atlas, this is taken care of when registering the class. More on that later.

# October 11, 2006 12:22 PM

Bertrand Le Roy said:

Matt: send me a simple repro of your problem at bleroy (at microsoft). I'll have a look.

# October 11, 2006 12:41 PM

Atlas notes said:

It seems that the next MS AJAX preview will be very, very different from the previous CTP. Bertrand Le

# October 11, 2006 1:52 PM

Atlas notes said:

It seems that the next MS AJAX preview will be very, very different from the previous CTP. Bertrand Le

# October 11, 2006 3:45 PM

David Barkol said:

So it's been a while since the last Atlas CTP was released (July). By now, if you've been following...

# October 12, 2006 3:07 AM

Jportelas said:

I like the: if(typeof(VariableName)=='undefined'){...} It works fine.
# October 12, 2006 11:10 AM

Atlas and more said:

Here are three common mistakes I&#39;ve seen recently in script files.Undefined is not null.If you&#39;ve

# October 12, 2006 2:32 PM

Kelly White said:

Betrand Le Roy of Atlas fame has an interesting writeup on what he understood from the Matrix Trilogy.

# October 12, 2006 4:11 PM

Marc said:

Cant get this work with Masterpages and script manager in Master... :s could not reference to object named "_PageRequestManager" for "datacontext" property on object of Type "sys.Binding" any help ? its working on standalone but in masterpages :s
# October 13, 2006 1:51 PM

Bertrand Le Roy said:

Marc: I don't think this has anything to do with the code sample in this post, which only uses client-side logic and thus will not be affected by anything server-side. I'm suspecting that removing the accordion from the page entirely you would still have the problem.

Anyway, you should probably start using the Atlas Toolkit's accordion control, which is open-source and more advanced than this sample.

# October 13, 2006 3:08 PM

Atlas and more said:

In part 1 of this post, I exposed the differences between the closure and the prototype patterns to define

# October 14, 2006 3:22 AM

Atlas and more said:

In part 1 of this post, I exposed the differences between the closure and the prototype patterns to define

# October 14, 2006 3:28 AM

Marc Brooks said:

With the ambiguity about reference versus value types for fields, why not ALWAYS put the fields in the constructor and never in the prototype? It would be simpler and more consistent, not to mention faster since the lookup against the object instance always occurs before the lookup against the prototype. You example translation even stops there, but the guidelines then get ambiguous. Please, before this gets too far, can we rethink these guidelines and aim for something that is far less likely to result in accidental errors?
# October 14, 2006 3:57 AM

Luis Abreu said:

hello. in my opinion, _baz should be declared inside the constructor, not inside the object that it's assigned to the prototype property. in other words, it should be: Foo.Bar = function() { this._baz = ""; } Foo.Bar.prototype = { }
# October 14, 2006 11:36 AM

Luis Abreu said:

not sure if my previous comment was submitted, so i'll put it here again. in my opinion, private constructor variables should be assigned inside the constructor and not in the object assigned to the prototype property. ex.: Foo.Bar = function() { this._baz = ""; } Foo.Bar.prototype = { } i think that prototype may not give you the semantics you want in all cases...
# October 14, 2006 11:41 AM

Bertrand Le Roy said:

You're both right, I fixed the post. Luis: I explained that in this post:

http://weblogs.asp.net/bleroy/archive/2006/10/07/Careful-with-that-prototype_2C00_-Eugene.aspx

In principle, null and value types are fine to initialize from the prototype, but it does make clearer guidelines to do them all from the constructor.

# October 14, 2006 12:17 PM

Marc Brooks said:

One other thought... I much prefer doing the seperator comma as a leading instead of trailing comma. This prevents accidentally leaving that dangling comma. I do the same thing in SQL queries.
# October 15, 2006 2:00 AM

Luis Abreu said:

hi. yep, you're right...i've missed that post...
# October 15, 2006 2:16 PM

Alex said:

you left it out and a crackhead stole it and sold it for a dollar
# October 15, 2006 7:02 PM

Ryan Heath said:

[quote] Note the convention that private members (fields and methods) are prefixed with an underscore. This convention will be adopted by Visual Studio Orcas in IntelliSense. [/quote] We need to prefix the variables with this. to access them, so why the extra _ prefix? // Ryan
# October 16, 2006 3:43 AM

Alex Osipov said:

Bertrand - do you have any benchmarks on these changes when compared to closure based Atlas? What kind of improvements can we expect? I only ask this because in experimenting with different optimization in js I have found very far and few improvements.
# October 16, 2006 11:22 AM

Bertrand Le Roy said:

Ryan: from the *outside*, you need a way to tell public and private members apart. Users of your classes (and Visual Studio) must be able to determine easily if Foo.bar() or Foo._bar() is public or private.

Alex: from our benchmarks, creating an instance is between 3.5 and 16 times faster depending on the browser. Firefox is getting the biggest benefits. Calling members is a little slower on all browsers (between 8 and 58 percent) because of the need to lookup on the instance, then the prototype. But the biggest benefit is in terms of working set with the prototype model taking about 30 times less memory than closures. Finally, parsing times are about twice as fast on IE with closures, and four times as fast with prototypes on Firefox.

So all in all, closures are generally a little faster on IE, but prototypes really shine on Firefox. All this was with IE6 but I don't think the JavaScript engine was changed in IE7.

Of course, all those are micro-benchmarks so your mileage may vary, depending on your type of application.

# October 16, 2006 8:04 PM

Rick Strahl said:

Bertrand, does this mean the syntax conventions will make it possible to forgo the type descriptor interface that's required in the current builds?
# October 16, 2006 8:54 PM

Bertrand Le Roy said:

Rick: this in principle doesn't change anything to type descriptors, which still need additional type information. The design for type descriptors *did* change, but for different reasons. More on that later.

# October 16, 2006 9:03 PM

Michael Stuart said:

I had heard that the next release would be sometime this week. Do you know if there's any truth to that prediction? Thanks for these Atlas posts...they're very helpful.
# October 17, 2006 2:23 PM

inventive title said:

Microsoft has been hard at work on the next Microsoft ASP.NET AJAX (formerly &quot;Atlas&quot;) CTP,

# October 17, 2006 5:40 PM

Jon Flanders said:

Bertrand - any ideas when a public CTP using prototypes will be available?
# October 17, 2006 6:04 PM

Bertrand Le Roy said:

Michael, Jon: it's imminent.

# October 17, 2006 6:14 PM

inventive title said:

Microsoft has been hard at work on the next Microsoft ASP.NET AJAX (formerly &quot;Atlas&quot;) CTP,

# October 20, 2006 9:52 AM

Christophe Lauer, Blog Edition said:

Scott Guthrie l'annonce sur son blog via un billet fort détaillé . La version Beta 1 de Microsoft ASP.NET

# October 20, 2006 12:25 PM

ASP.NET Français Blogs said:

Scott Guthrie l'annonce sur son blog via un billet fort détaillé. La version Beta 1 de Microsoft ASP.NET

# October 20, 2006 12:30 PM

Pieter Siegers said:

Congrats Bertrand! :-) Cheers, Pieter
# October 20, 2006 1:59 PM

Fox Blogs said:

Pour compléter le billet de Patrice il y a la beta 1 de Microsoft ASP.NET Ajax Extentions de dispo mais

# October 20, 2006 7:26 PM

Fox Blogs said:

Pour compléter le billet de Patrice il y a la beta 1 de Microsoft ASP.NET Ajax Extentions de dispo mais

# October 20, 2006 7:29 PM

Cyril 's Blog said:

Patrice et Fox vous l'a déjà annoncé hier : Une nouvelle version de Microsoft Ajax Extensions (nom de

# October 21, 2006 6:25 PM

I Love C# said:

Good post on this subject by Bertrand Le Roy

# October 21, 2006 8:14 PM

Johnny said:

Hmmm... To Taiwanese and maybe other Asian users Caps Lock is a little bit important because we need it to switch between IME and English input. I don't remember pressing the Caps Lock key when I actually want to press the Tab key, but I do sometimes press the Function key instead of Ctrl on my notebook. Yes, it is sometimes quite bothering.
# October 21, 2006 9:14 PM

Aaron Seet said:

There is another twist to that quote. "If you think education is expensive, try ignorance!"
# October 22, 2006 10:22 PM

Zenute Marins said:

This is very confusing! I have two web applications with Atlas and in the first one I can save and retrieve Session variables after redirecting like in (Response.Redirect("Clientes.aspx")). The second application using the same code as described above fails with a null exception when I try to retrieve any Session variable prevously saved. i'm going nuts here!
# October 23, 2006 10:26 AM

Bertrand Le Roy said:

Zenute: one thing to look for is wether the session already exists before you do the redirect but if in doubt, use the overload as explained in the post.

# October 23, 2006 3:54 PM

Rumen Stankov (telerik) said:

Hello Bertrand, IMHO, internal changes are way to radical. I know that long-term everyone will benefit, but still... for people that want to build on top of your Ajax framework there is a lot of pain while migrating our codebase from Atlas CTP to Ajax Beta 1. Somehow, we needed to know earlier about the need to register scripts in ScriptManager instead of using Page.RegisterClientScriptBlock, the change from Xml to that strange "|" delimited response, what happened to "delta", etc. We will be able to migrate of course, but again, a lot of pain for us and our (and yours) customers. A couple of questions: 1. What is the easiest way for an ASP.NET control to detect if an MS Ajax update is in progress (server-side)? 2. Are there any client-side hooks (events) where we can run custom code (for example to run disposing code that avoids IE memory leaks)? Regards, Rumen Stankov (telerik)
# October 24, 2006 2:37 AM

Bertrand Le Roy said:

Rumen: I've read your recent blog post in addition to your comment and I have to admit I'm a little surprised by one or two things there.

We are and have been willing to share with you (and all component vendors) early builds of ASP.NET AJAX, as well as integrate your feedback on our design choices.

We've always been very clear that the intent of the CTPs was to gather feedback *and* integrate that feedback in the form of design changes. The go-live licenses have never been a "promise" of no breaking changes. On the contrary, we have always said that there *would* be breaking changes.

We have made the information about registering with the script manager available to the community (in particular in dev labs) as early as in July so I'm surprised it comes as news to you. Maybe we need to keep in touch better in the future so that you get all that data ahead of time.

1. ScriptManager.IsInAsyncPostback http://ajax.asp.net/docs/mref/db2bbeac-e762-e1ac-ca74-1a3e6ab76979.aspx

2. There are many client-side events. Do you mean related to UpdatePanel? If so, they are listed here: http://ajax.asp.net/docs/ClientReference/Sys.WebForms/PageRequestManagerClass.aspx

If you make your controls and behaviors implement IDisposable, you don't have anything special to do, as the dispose method will be called before the DOM is disposed of.

Just so you know, other component vendors have been able to migrate their whole codebase in just a few days so I'd be very interested to know exactly what difficulties you hit. Don't hesitate to drop me mail (my alias is bleroy).

# October 24, 2006 3:29 AM

Rumen Stankov (telerik) said:

Thanks for the quick response. Just wanted to let you know that I'm talking about existing ASP.NET 2.0 custom web controls (System.Web.UI.WebControl) - how do you access ScriptManager from there without referencing the MS Ajax Beta 1 assembly? We need a suite that works with or without MS Ajax and for the time being cannot reference the assembly explicitly.
# October 24, 2006 4:06 AM

Gridview requires Viewstate for certain types of paging.. said:

Disable viewstate, and the First/Last paging will incur a hit (at least thats what happened when I tested it).
# October 24, 2006 9:36 PM

Bertrand Le Roy said:

What do you mean?

# October 25, 2006 1:22 AM

Chak said:

Are there any changes with regard to 'UpdatePanel' and the trigger used in it ? Is that part of ATLAS backward compatible ?
# October 25, 2006 2:09 AM

Bertrand Le Roy said:

Chak: this blog post by Scott Guthrie has a detailed description of the changes in the beta from the July CTP:

http://weblogs.asp.net/scottgu/archive/2006/10/20/ASP.NET-AJAX-Beta-1-Released.aspx

# October 25, 2006 1:53 PM

Moderage Waas said:

Have you tried doing asynchornous calls while you are inside a loop ? It does not work. I mean while(i< 5) { send_request_to_server(i) } Only the last request will successfully make it. Question: How do we send a request, then wait till we get an answer and then go for a second round ?
# October 26, 2006 1:14 PM

Bertrand Le Roy said:

Moderage: Well, first I'm not sure it's a good idea to do server requests in a loop. You should probably batch those requests together to minimize network roundtrips. But if you must, using a queue is the right way to do this asynchronously.

# October 26, 2006 3:46 PM

Boldi said:

Using "#" as the src of the iFrame works fine with transparent iFrame too but I'm not sure is it good for the https: case. Would someone try it, please?
# October 29, 2006 4:33 PM

LudovicoVan said:

Hello, I really do not get the point of this article. I would point out that JavaScript is a great dynamic language, and it is not simply a downgraded version of an OO language. Here is how I would write a real life Point constructor: this.Point = function (x, y) { this.x = x; this.y = y; }; When you need a private member, or a closure, it is because you need it. That is, know your language... My two cents. -LV
# October 29, 2006 10:48 PM

Bertrand Le Roy said:

Ludovico: this is *sample code* that has no other goal than to illustrate the discussion.

If I had to write a point in "real life", I would do var point = {x: x, y: y};

Thank you very much for explaining JavaScript to me but you have to think in the context of a larger and more useful class and transpose what I'm saying to that context.

# October 30, 2006 1:44 PM

LudovicoVan said:

Indeed, that is what I meant: there are no "classes" in JavaScript!!! (And, btw, what you show above does not make more sense, unless you need a singleton point.) Please, don't take this personally, it isn't. IMHO *all* the .Net JavaScript built-in code, be it AJAX, validation, or whatever, is simply broken since its very design. You guys are thinking in terms of object orientation, but JavaScript is completely another beast. It is not a question of the single constructs. It is how you architect a program in JavaScript. It is apparent that you guys are not more than very knowledgeable beginners in this, coming from another field, that is OO... Here is a JavaScript guru: http://www.crockford.com/javascript/ Best regards. -LV
# October 30, 2006 9:35 PM

LudovicoVan said:

> Your position is highly dogmatic and difficult to hold.

The ECMA standard has since the very beginning been tagged to be buggy from the JavaScript gurus. And they not only didn't fix the flows, they are since then trying to add more. On the other hand, I would note that C# 3.0 is making the opposite move. So I am confident in regard to the future. An even bigger mess.

> How do you explain "new", "this", "instanceof" or "constructor"?

Here is a quote from Mr. Crockford:

Is JavaScript object-oriented? It has objects which can contain data and methods that act upon that data. Objects can contain other objects. It does not have classes, but it does have constructors which do what classes do, including acting as containers for class variables and methods. It does not have class-oriented inheritance, but it does have prototype-oriented inheritance.

The two main ways of building up object systems are by inheritance (is-a) and by aggregation (has-a). JavaScript does both, but its dynamic nature allows it to excel at aggregation.

> quite a lot of people still to this day consider that OOP is the best way to build reusable code and applications above a certain size

Yes, as well as we know most of the software projects around keep miserably under-perform.

Please, don't laugh at that...

Cheers. -LV

# October 31, 2006 2:57 AM

Bertrand Le Roy said:

Is that so? How do you explain "new", "this", "instanceof" or "constructor"? What about sections 13.2 and 15 of the EcmaScript specs? How come JavaScript 2.0 has "class" and "namespace"? Are these also misguided attempts from beginners in the field to make JavaScript what it's not?

Your position is highly dogmatic and difficult to hold.

Furthermore, quite a lot of people still to this day consider that OOP is the best way to build reusable code and applications above a certain size. There is a demand today for frameworks that enable the application of reliable engineering methods to the browser. Our users, as well as the users of Dojo or other frameworks don't seem to consider modern JavaScript frameworks to be "broken since [their] very design". At least it seems to solve a real-world problem.

# October 31, 2006 3:03 AM

Bertrand Le Roy said:

Except from citing "JavaScript gurus", what good arguments do you have? Saying that EcmaScript is broken is arrogant at best if you don't elaborate. What about JavaScript 2.0? Is it broken too? So are all these people highly incompetent and only you and Mr. Crockford have understood the True Nature of JavaScript?

How does the Atlas type system prevent you from doing aggregation? I've even published a blog post on the subject a while ago with some sample code, and although I quite like the whole idea, most of the feedback I got was that it was only marginally useful.

I'm really sorry that you don't share our views on client-side development but we're going to continue in this direction anyway as most of the feedback we get encourage us to do so.

# October 31, 2006 3:12 AM

Miljan Braticevic said:

We have recently completed converting our suite of user interface controls from the latest Community

# October 31, 2006 4:45 PM

Miljan Braticevic said:

We have recently completed converting our suite of user interface controls from the latest Community

# October 31, 2006 4:52 PM

LudovicoVan said:

</cite></cite>

<p>I won't explain what is in the FAQ and any self-claiming JavaScript programmer should know, like we know what Response.Write does in ASP. For those new to JavaScript, and have never heard about <strong>Mr. Crockford</strong>, here are few hints:</p>

<p>These are the contributors to the comp.lang.javascript FAQ: http://www.jibbering.com/faq/faq_notes/contributors.html, and you will see a certain <strong>Mr. Cornford</strong> there.</p>

<p>Now, here is Cornford's introduction to OO techniques in JS: http://www.litotes.demon.co.uk/js_info/private_static.html, and you will see it makes reference to a certain <strong>Mr. Crockford</strong> since the very first paragraph, and builds on his work.</p>

<p>Any decent JavaScript programmer knows who Crockford is and what he did for this language. The rest, I have already said.</p>

<p>Hope this clarifies and helps.</p>

<p>Sincerely. -LudovicoVan</p>

# October 31, 2006 11:39 PM

Bertrand Le Roy said:

LudovicoVan's latest comment was somehow confused for spam, but I salvaged it from my mail notifications so here it is:

"I won't explain what is in the FAQ and any self-claiming JavaScript programmer should know, like we know what Response.Write does in ASP. For those new to JavaScript, and have never heard about <strong>Mr. Crockford</strong>, here are few hints:

These are the contributors to the comp.lang.javascript FAQ: http://www.jibbering.com/faq/faq_notes/contributors.html, and you will see a certain <strong>Mr. Cornford</strong> there.

Now, here is Cornford's introduction to OO techniques in JS: http://www.litotes.demon.co.uk/js_info/private_static.html, and you will see it makes reference to a certain <strong>Mr. Crockford</strong> since the very first paragraph, and builds on his work.

Any decent JavaScript programmer knows who Crockford is and what he did for this language. The rest, I have already said.

Hope this clarifies and helps.

Sincerely. -LudovicoVan"

Dear Ludovico, I know very very well who Mr. Crockford is, thank you very much. Quotes can be used to cite, not only in a sarcastic way. I was not being sarcastic about him being a JavaScript guru, I was merely citing you: "The ECMA standard has since the very beginning been tagged to be buggy from the JavaScript gurus," and encouraging you to be more specific. How is it buggy? Who are "the JavaScript gurus" you talk about? Do you have anything more than authority arguments to substantiate that claim?

And for the third time, what about JavaScript 2.0? Ever heard of Brendan Eich?

I encourage you to read this, which should clear a lot of confusion:

http://developer.mozilla.org/presentations/xtech2006/javascript/

# November 1, 2006 2:09 AM

LudovicoVan said:

Hey man, with all respect, you keep pushing up the "great" work in progress, and we might discuss that in depth, yet my original observation was of a more basic nature: JavaScript is an object-based dynamic language, while you are approaching it as a standard OO language, and building frameworks over this misconception.

I might be wrong, but I can't be clearer than I am.

Best luck to the team, and also to the unfortunate that happens to build on this stuff.

Bye. -LV

# November 1, 2006 4:10 AM

LudovicoVan said:

Now, you know, that is as well feedback from the community. ;) -LV
# November 1, 2006 9:38 AM

Bertrand Le Roy said:

Yes, that is feedback, but you are so far the *only one* to give us that kind of feedback. You seem to be confusing object oriented and class-based. JavaScript is object-oriented, but not class-based in the current version. We recognize and use the prototype and dynamic nature of JavaScript, but at the same time, we agree with experts such as Brendan Eich that there is also a need for classes and we're answering that need while waiting for JavaScript 2 to be available on all browsers. For example, representing widgets and behaviors with class instances is extremely useful and opens up lots of possibilities.

# November 1, 2006 12:01 PM

xgene said:

Downloaded this and it worked perfectly out the gate. Thanks much!
# November 1, 2006 3:42 PM

NITMAL said:

Please let me know the status of your POC, has it been tested on production by someone now...or some better way to do the ASP and ASP.Net session sharing...bcoz i need to implement it in my new migration project. We were thinking of using the database approach given on msdn...but looks like u have a better idea...Please suggest
# November 2, 2006 12:24 AM

Bertrand Le Roy said:

Nitmal: not that I know of so I'd say it's relatively risky. It totally depends on the type of project. On the bright side, the source is totally free to use and modify. If I can be of assistance, you can e-mail me through the contact form.

# November 2, 2006 3:37 PM

NITMAL said:

Thanks for your inputs...the project is a financial domain project...which is currently in asp3.0 and little bit in asp.net1.1...We are in the process of migrating it to .net 2.0...However we plan to do it in the incremental way rather than the Big bang approach...So we were exploring the best ways to use session in .net in terms of performance,scalability and failover..but also keeping in mind the coexistence of asp and aspx..We have a few options on which we want to expolre before doing POC's on the best two...A few options we have are... a)The msdn suggested way using database as an intermediate session store...We can also use this Db as out-proc session store..for our web farm.. b) Third party products...Like StateStich and AspBridge..for asp/aspx session shsring.. c) Your POC way.. However performance and security are some major things we need to keep in mind before picking our solutions...as the application is a heavy traffic,high security site... Please provide us some inputs which can help us in moving forward... Thanks Again for all ur help Nitmal
# November 2, 2006 11:07 PM

Bertrand Le Roy said:

Looks mission critical from your description...

Another thing to consider is the amount of data you store in session and how often you query it.

Contact me through the contact form of this blog, we can talk about the different options that you have.

# November 3, 2006 3:31 PM

Dave T said:

Awesome. Vbscript is gonna make a comeback in a huge way!
# November 3, 2006 8:22 PM

Atlas and more said:

In previous CTPs, the client-side DOM event model was the IE model. You would use attachEvent and get

# November 6, 2006 7:26 PM

Atlas notes said:

You can download the bits here . The "value-add" package is now called "Futures" and it's available as

# November 7, 2006 8:18 AM

Michael Stuart said:

Thanks for this kind of info (the current Microsoft AJAX Library documentation is really lacking right now).
# November 7, 2006 8:20 AM

ChrisO said:

This is very similar to the dojo approach which truth be told was one of the biggest reasons of my choice to use dojo instead of atlas on my projects. It looks like you guys are on the right track though. Nice work.
# November 7, 2006 10:27 AM

michael said:

I like how you can wire multiple events for the same handler. Is there a similar way to wire multiple elements to the same handler? Ideally it'd be great to do some sort of CSS-Event Selector or Behaviour type of thing.
# November 7, 2006 12:44 PM

Jon said:

I'm confused why you are even bothering putting the $ in the front of your alias'? Oh wait, it is because we are worrying about overwriting other people functions... Which of course is the reason why you use namespaces such as Sys... I guess you guys feel that prefixing your alias names with $ is a safe Microsoft "namespace"... too bad other frameworks like prototype already use the same "namespace"... Hopefully you guys won't get burned like you already did with $()... My suggestion for alias' is to come up with something you can legitimately claim like ms.addHandlers. - Just My .02
# November 7, 2006 5:33 PM

Atteint de Javascriptite aigüe said:

Fox nous a TRES brievement annoncer la mis en ligne de la beta 2 de Microsoft Ajax Extension : ASP.NET

# November 7, 2006 9:02 PM

Bertrand Le Roy said:

Jon: so the other frameworks can use short aliases, but we can't? All $ aliases are shortcuts for a properly namespaced function, as the post explains. That means that if any of those collide, you can still use the fully-qualified name and include the conflicting library after ours (that's why the aliases are not used from within the core library's code). It seems like we're the only ones to actually care about not colliding with existing aliases from competing frameworks, and we don't even get some credit for that?

# November 7, 2006 10:29 PM

scathe said:

#, if clicked - will refresh the root page, not a good idea nowadays with ajax, cms sites and the like. In other words # doesnt work fine with me :)
# November 8, 2006 5:53 AM

Jon said:

There is a big problem if any of those collide and your script is registered last (controlling which script is registered last is not always easy). For it will overwrite the functionality in the original, as you found out with the $() with prototype. There is also a big problem if control developers (who don't know what other frameworks their end developers will be using) use alias'. I suppose you could discourage control devs from using alias'... To me you are using a $ to serve as a namespace, for I see no other reason for using it. If that is the case, why would you not choose a namespace that is unique compared to all other frameworks out there (at least the major ones)? say something like ms. or m$ (<-- joke) A unique namespace seems like the most logical choice to avoid these issues and extra disclaimers to control devs.
# November 8, 2006 1:54 PM

Jon said:

> so the other frameworks can use short aliases, but we can't? No, you can (and should) use alias', you just should not choose the same prefix as other frameworks... > It seems like we're the only ones to actually care about not colliding with existing aliases from competing frameworks, In my opinion, if you cared enough about colliding, you would not have chosen the same prefix. (Also, you are not the only ones caring about colliding.) > and we don't even get some credit for that? Sure you do, but you are Microsoft. I would think that you guys expect the bar to be higher for you than anyone else, being the leading software company in the world...
# November 8, 2006 2:15 PM

Bertrand Le Roy said:

Jon: fair enough, but what other (short) prefix could we have used (MS is not an option for legal reasons)? It's becoming a common convention that such aliases start with $ (which is the only special character allowed with underscore which is more used to denote internal/private) to avoid most collisions with global functions defined by the page developer. Anyway, we checked that we didn't collide with any known alias in the known major frameworks. For the future, nothing can really guarantee that you don't have collisions, even if you use namespaces like we do, save for having a standardization group that coordinates everybody's efforts. That's exactly what OpenAjax is trying to do.

# November 8, 2006 2:38 PM

Bertrand Le Roy said:

scathe: actually, # does *not* navigate away from the page if clicked, but it adds to the browser history. You can use BLOCKED SCRIPTvoid(0) instead anyway.

# November 8, 2006 3:18 PM

Jon said:

>Fair enough, but what other (short) prefix could we have used I suggested some earlier. If you have a problem with ms. then pick any other combination of 2 or 3 characters. I am only suggesting for it to not start with $. This is the same mentality that I don't create make any of my own .NET namespaces starting with System. If I created a new utility class (say AJAX), I would never consider placing it in System.AJAX. If I did, and Microsoft later added that same namespace, I would be the one to blame, not Microsoft for things breaking. The way I see it here, you are using an already established framework's namespace. As a side note, I find it interesting that you are concerned with its length. For the name you are choosing after the namespace/prefix are rather verbose (IMO). If it is an alias, why not make the entire thing as short as possible? Of course you would want to make it understandable, I think prototype goes a little too far with its $A(), $F(), etc.
# November 8, 2006 3:24 PM

Atlas notes said:

Introduction Microsoft Ajax defines a component as a class that inherits from the base Sys.Component

# November 9, 2006 9:03 AM

Leland Scott said:

It's not at all clear to me why Microsoft, which was very late to the Ajax party to start with, felt the need to try to reinvent the wheel and develop their own "brand" of Ajax to begin with. Both Prototype and Dojo are very well established, mature libraries, and by choosing one of those, you wouldn't be stepping on any well established namespaces either. Oh, wait... Microsoft can't use open source software because it's opposed to it, right? Well, you could have licensed Google's or Yahoo's, then. But wait... they're competitors. It wouldn't do to behave in any manner that isn't simply crushing competitors. The same reason Microsoft couldn't use Java, PostScript or PDF either, I guess. I guess the question I'll try to answer when I get around to evaluating the "new" Atlas is, What does it bring to the Ajax party that wasn't there before? How does it improve the development, delivery, and useability of Ajax-enabled web applications? If you've indeed made Atlas more cross-browser friendly, that would certainly be a good thing. But it still seems to me that it was an unnecessary effort to begin with, given the large number of top-notch Ajax frameworks and toolkits that already exist. At least Adobe's Spry framework is taking a startingly different approach to the whole thing, one that also works seamlessly across browsers and platforms and whose benefits to developers and end-users seem very clear.
# November 9, 2006 9:57 AM

Bertrand Le Roy said:

Jon: it's not just Prototype who's using the $ prefix. It's just about everyone.

Leland: Were we really that late? What about Outlook Web Access, arguably the first major Ajax application? What about inventing XmlHttpRequest in the first place? What about callbacks in ASP.NET?

If we were "opposed to" open source like you claim, how do you explain the the AJAX toolkit is fully open-source (and already includes external contributions)? How do you explain CodePlex as a whole?

Anyway, *none* of the frameworks you mention are nicely integrated with ASP.NET. The Microsoft AJAX Library not only is very well integrated with ASP.NET, it can also be used without it, say with PHP or Java.

And by the way, Microsoft *has* used Java in the past, but Sun didn't see it this way. In the same way, Microsoft wanted to include PDF support into Office, but again Adobe didn't see it this way so now it's a separate (free) download from Microsoft.

So what does Atlas bring to the party? UpdatePanel, xml-script, tight integration with ASP.NET to name a few. Our customers seem to like it.

# November 9, 2006 12:59 PM

Jon said:

For the record, I feel it is a good move for both Microsoft and developers that you are integrating AJAX functionality into ASP.NET. The fact that more than one framework uses the same prefix, is all the more reason to choose something else! I don't think you need a standards body to decide who owns what namespace any more than I think the .NET framework needs a standards body to tell developers what namespaces to use. Just so you know where I am coming from, I too jumped on the $ bandwagon and got burnt. http://www.dotnetnuke.com/Community/BlogsDotNetNuke/tabid/825/EntryID/370/Default.aspx The week after that DNN release I got emails stating that my framework broke existing modules. I soon came to the realization that it was me, not them (and their framework) that was at fault. Unlike, Atlas, I could not go back and simply remove the function, for DNN tries really hard to not break backwards compatibility (I know MS cares about backwards compat as well, lucky you were in beta and could back away). I am stuck now... I had to hack my $() function to detect prototype and do the added functionality... it will really suck if/when they change this functiality, for I will need to branch that function even further. Needless to say, any new alias that I come up with will have a sole prefix (dnn.) That way I only have one entry point to worry about. In my view, if Atlas continues to use $ as a prefix and so does everyone else, why use a prefixed $ in the first place?
# November 9, 2006 1:48 PM

James Alexander said:

Oh snap! You just got served a cold plate of humiliation Leland!
# November 10, 2006 6:11 PM

Bertrand Le Roy said:

Jon: I completely see your point and it's something we've always taken seriously, as the $get rename attests. We've had lots of discussions on this very subject, both internally and with early adopters. There are tradeoffs we have to make between keeping the majority of our users happy and reducing the risks of collisions with other frameworks. As a matter of facts, when we asked, the majority of our users told us that they preferred to keep the $ function even if there was a known collision with just about any other existing framework. We actually went against that feedback and did the rename to $get. Similarly, we went against the convenience of extending the Array prototype and moved everything to Array statics. By the way, the built-in type extensions have a much higher risk of collision than the $ functions, but in the same way, we think that if we (and other frameworks) are going to keep an acceptable level of usability, the only way to avoid stepping on each other's toes in the future is just to talk to each other. OpenAjax is proof that other framework authors feel the same way.

Again, we take these considerations very seriously, so thanks for the feedback.

# November 10, 2006 8:14 PM

Nathar Leichoz said:

> All $ aliases are shortcuts for a properly namespaced > function, as the post explains. According to the ECMA spec, "$" is conventionally reserved for machine generated variables.
# November 12, 2006 8:52 AM

Abhi said:

have few queries on it: 1)To use this utility do I have to write any additional code in my ASP or ASP.NET page? 2)Is this utility shipped with framework 1.0 and above version? 3)Where this utility should be deployed to make it useful in web farm scenario? 4)I have an application which has few ASP, few ASP.NET and few JSP pages. So will this utility work for all of them in case to share session variables? Specifically JSP. Apart from this can you suggest me some links/books which can give more details on this and samples where it is implemented?
# November 13, 2006 8:16 AM

Bertrand Le Roy said:

Abhi:

1. No.

2. No, it's entirely unsupported and experimental.

3. On each server, which should be set up to share the ASP.NET session. The ASP part will pick it up, which is a nice bonus.

4. No luck for JSP. I don't know of a session sharing solution between JSP and ASP/ASP.NET.

# November 13, 2006 8:15 PM

Patrick J. Fox said:

Bertand - Thanks for your informative posts. I tired out he example and came up with a combination of the two patterns shownm above:
Foo.Bar = function() {
		this.stuff = {}
	}
Foo.Bar.prototype = {
	number: 0,
	toString: function() {
  	return "Bar #" + this.number + (this.stuff.id || "");
	}
}
Any reason why someone shouldn't code it this way?
# November 15, 2006 2:17 PM

Bertrand Le Roy said:

Patrick: sure, that's what we're doing in ASP.NET AJAX, see my more recent posts on prototype. In this post, I tried to keep it simple and without dependancy on AJAX.

The problem with your code if you add nothing else is that you broke the prototype's constructor by overwriting the whole prototype with a JSON object. We solve this in the AJAX Library by resetting prototype.constructor to Foo.Bar from the class registration method.

# November 15, 2006 5:20 PM

Hill said:

Not to be stupid but, what is the exact combo for getting the print screen (PrtScn) button to work with the microsoft wireless optical desktop 4000? I have been trying every combination for an hour now and I am getting really frustrated?

I used to use that button constantly back when it was truly just "one button"

# November 15, 2006 7:24 PM

Bertrand Le Roy said:

Don't ask me...

# November 16, 2006 1:51 AM

Chad Smith said:

Sort of a simplistic question after the discussion above; but does the MouseButton enumeration actually work? I'm currently developing an app that when run in Firefox works fine, when run in IE6 the buttons are mixed up, this occurs when I do something in a mouseup event, in a click event of course it returns left all the time (presumably because in IE window.event.button is always 0 in the click event.)

Regards,

Chad.

# November 21, 2006 2:21 PM

Bertrand Le Roy said:

Chad: this is a known problem that is fixed in the RTM version. Thanks for reporting it.

# November 21, 2006 2:35 PM

Ronny said:

Hi Bertrand, Thanks for the code. I was just wondering whether I can change the location of the "YesNo" button. Because they're next to the other and I would like to add more space, so user won't mistakenly click on the wrong button.

Other than that.. It works perfectly.

# November 21, 2006 7:21 PM

Bertrand Le Roy said:

Ronny: feel free to modify the code and add more space. Would you need help with that?

# November 21, 2006 7:25 PM

Ronny said:

One more thing, Bertrand.

Is it possible for the button to check the validation first before confirmation pop up.

I am using ConfirmButton and when the button is clicked, it doesn't check validation control that I have on the page, even after I use CauseValidation = true.

Thanks so much

# November 22, 2006 12:10 AM

Bertrand Le Roy said:

Ronny: good point, you'dprobably need to modify the code a little so that it respects the property.

# November 22, 2006 12:16 AM

Ronny said:

Thanks for your quick response, Bertrand. It amazes me..:) I couldn't figure it out how to add space between the button and also for the validation, I am still trying to understand your code..

# November 22, 2006 12:29 AM

Bertrand Le Roy said:

In RenderChildren, just create a bunch of literal controls that contains "&nbsp;" and add them to the list of controls between the buttons.

The validation thing may be a little trickier, you'd need to change the script that's being registered from Show, depending on the value of the property. You can cheat a little by looking at the code that's being generated by another control that gets it right, like a submit button which causes validation.

# November 22, 2006 1:55 AM

Josh said:

Well... after finally making it to the bottom, I wanted to thank Bertrand for trying to stay as rational as possible here.  I think that ASP.NET provides for a more structured development environment to build more complicated and robust applications (of which I have built many), but this is simply my opinion.  PHP I can't really speak on as I am not a PHP programmer.  

I am in the process of helping a client decide on what platform and development language to use moving forward (currently using PHP and linux) and reading both sides (after weeding through some nonsense) has helped me gain a better understanding of both languages (pros and cons).

In the end your client's requirements really are the primary deciding factor. If the client has a small budget, no preference on OS and webserver and PHP trained personnel are more available and afordable, I would say PHP.  If you were building a multi-tier web application with complex processes, and many database driven components.  Leverage the .Net Framework classes and reduce coding time by as much as 65% ($$$ savings for your client = happy client) and time to market is faster.  It is a win-win situation, and you as the developer are the hero and get a ton of referals and work as a result (actually occurred)!

# November 22, 2006 3:46 AM

Ronny said:

Thanks Bertrand, I've managed to add more space between the buttons. I am still working to get the button cause the validation.

Could you tell me how I can see the code that's being generated by submit button?

# November 22, 2006 7:13 PM

Bertrand Le Roy said:

Add a button to the page, make it cause validation, browse to the page, view source.

# November 22, 2006 7:19 PM

foobar said:

Hmm, RTM version eh?  So you guys are pretty close then :)

# November 22, 2006 8:37 PM

kleolb02 said:

Maybe you have the same problem I had. Response.Redirect doesn't work after a Postback before OnInit. Another possible error could be a Session- Timeout, the solution would be to set the timeout in the web.config- file.

hope this helps..

# November 23, 2006 4:08 PM

Johnnie said:

Great conference!  Would have liked to see it go another day since there were so many great sessions.  Not sure how they could have so many sessions and nothing on security.  Yikes!

# November 27, 2006 8:25 AM

Jb Evain said:

Hey, amazing how David Ebbo on this picture reminds me Benigni.

# November 29, 2006 7:25 PM

ASPCoder said:

I have a strange but a problem similar to one reported here. I have an ASP.NET application in which after loggin in, I set a session variable and then do a response.redirect. So far everything has worked well and I am able to access this variable from all other pages. But recently, the users noticed a problem. In a particular page, after showing a message, we do a <meta http-equiv=refresh content=3;url=someurl.aspx>. Which is refresh the page and redirect to another url. In the someurl.aspx, we check for session variable and some inexplicable reason, it is getting lost and the users are redirected to the login page. Appreciate any ideas.

thanks

# December 1, 2006 12:06 PM

Sandeepan Kundu said:

i am using ATLAS with a timer which updates the grid every 2 to 3 seconds.....  i was facing the same problem ...

i am doing response.redirect and based on a session variable i fill data according to user....

if user's credentials are not avaiable from session i used to redirect to login page... as only on session expiry the information became void....

i am making postback using the ATLAS's timer.

now on session timeout the timer tick event(i.e.) post back i am refreshing the session's timeout which is one way solving my problem.....

if ne1 can get with a better solution... please revert back at sandeepan.kundu@tv18online.com

Thanks

Sandeepan

# December 2, 2006 6:05 AM

Edwin said: said:

LOL! I could never have imagined there would be a web site dedicated to it.

# December 3, 2006 7:35 AM

madhu said:

hi,

  probs with alert msgs , when iam using atlas its not working ....i mean popup boxes are not coming ..with out atlas its working if any wrong ...and also ....tel me

# December 5, 2006 12:56 AM

Jackal said:

This helped clear a few things up I am looking forward to the article on AJAX class events since that is where I am stuck.

# December 5, 2006 3:43 PM

Bertrand Le Roy said:

Do you get any script errors?

# December 5, 2006 4:58 PM

JacquesC said:

Hi,

I have a file upload control in an iFrame and I try to add two event handlers in JS code run from teh parent window for the keyup and propertychange events.

I have noticed from Ajax Beta 2 source that $get supports a document parameter:

var g_UploadIFrame = $get("iframeFileUpload");

var g_FileUploadTextBox = $get("FileUpload", g_UploadIFrame.contentWindow.document);

but then the following fails:

$addHandler(g_FileUploadTextBox, "keyup", doSomething);

$addHandler(g_FileUploadTextBox, "propertychange", doSomething);

Any help would be appreciated.

# December 6, 2006 8:46 AM

Bertrand Le Roy said:

Jacques: sorry, $get takes two parameters. One is the id, the second, optional parameter is the parent element. Passing it an element that is in a different window is an abuse of the API and something that's entirely unsupported. The reason is mainly that $addHandler not only abstracts the browser differences but also helps components dispose of these events, which depends on the window where it happens. How exactly is it failing? Does it just not work or do you get any kind of error message?

I'll make sure this is documented. I think you need to hook up your events yourself and handle dispose yourself, not using $addHandler in this case.

# December 6, 2006 2:11 PM

JacquesC said:

Thx for your response.

Internet Explorer reports the following JS error on the page:

Error: object required

Code: 0

I think this is a serious limitation and I am not sure I understand its justification considering:

1) the following works in IE (addEventListener works too)

g_FileUploadTextBox.attachEvent("onkeyup", updateFileName);

g_FileUploadTextBox.attachEvent("onpropertychange", updateFileName);

2) In the Ajax framework, $addHanlder/$removeHandler maintains an array of events which help the dispose process but I am not sure why this depends on the "window where it happens".

3) I think scripting components in an IFrame is a fairly common Ajax scenario, epecially for file uploads, and you this should have been considered.

# December 6, 2006 4:31 PM

Bertrand Le Roy said:

Jacques: the problem is that it would be very complex to subscribe to the unload event of all windows you attached events in and dispose of them properly. We just couldn't ensure the level of functionality that we can ensure in the same window.

If you're using an iframe, what I recommend is that it has its own copy of the AJAX library and pretty much works in isolation, with just the level of communication you need between JavaScript components (which you can achieve by exchanging delegates between components in different windows. Avoid DOM-based communication like you're trying because that will be a nightmare to clean up and avoid memory leaks. If you are using an iframe, that's usually because you want the iframe to be able to post and navigate independantly, which means that the dispose logic will need to be taken care of. That will be a lot easier with the iframe working as a full page, with its own copy of the framework.

# December 6, 2006 4:41 PM

Ronnie said:

Hi, great control

but I would love to set the text in the code behind

is there a way to do it

something like

ServerAlert.Text = "message here"

this way I don't need to hard code the text in the html side

# December 6, 2006 5:28 PM

wanderer said:

Any support for using the ms:confirmbutton w/ a delete imagebutton within a gridview?

# December 13, 2006 5:06 PM

thowe said:

Hello

I think this album handler is ideal for building photo albums in an intranet, where people have file access to the server via a share. So upload is simple...

Unfortunately the album handler is not working on Windows 2003 server. No such problems on Windows 2000 server.

I get the follwoing error:

Parser Error Message: User control source files must have a .ascx file extension.

and the follwing line is highlighted red:

Line 2:  <%@ Register Src="~/album.ashx" TagPrefix="photo" TagName="album" %>

Do you have a hint how to get the album running on Windows 2003? Or do you know of another product offering the same functionality?

Thank you!

# December 14, 2006 8:20 AM

RichB said:

Alternatively, debug it is using Sysinternals DebugView and lots of Debug.WriteLine() statements...

# December 14, 2006 11:26 AM

Bertrand Le Roy said:

Thowe: I'm running it at home on 2003 so that can't be the problem. Are you sure you have ASP.NET 2.0 installed? Apparently you're using the handler as a user control in a page. Does it work when you hit it directly?

# December 14, 2006 2:18 PM

Ben said:

Got here from Sitefinity 3. Great add-on I am going to give this a try shortly.

# December 18, 2006 2:05 PM

craig said:

I have a site I am building and I need to redirect, transfer, or forward to another site.  I don't want to have the query string parameters visible to the user, so I have a link that goes to a page that loads the session with the parameters and redirects to the other site.  See code below:

           Session["Service"] = DataLayer.getProperGroupName((string)dr["TICKET_GROUP"]);

           Session["Requester"] = dr["NAME"];

           Session["Telephone"] = dr["PHONE"];

           Session["CallReason"] = dr["DESCRIPTION"];

           Session["RequestDate"] = dr["TICKET_CREATE_DATE"];

           Session["ID"] = id;

           Response.Redirect(DataLayer.getSurveyURL());

I am new to .Net, so what are my other options.  This site sends emails to customers with a link to a survey and I have a page with links for a person at my company to do phone surveys using the same link.  I would like to hide my data, to keep the user from trying to muck with it.

# December 19, 2006 8:27 PM

Bertrand Le Roy said:

Craig: yes, that sounds ok. An alternative that avoids session altogether is to use cross-page posting. You can set the postback url of your submit button for example, and the target page can then get an instance of the previous page and access all its state (including textbox values, etc.) using the PreviousPage property (it may be necessary to cast it to the right type to avoid having to do too many FindControls).

# December 19, 2006 8:38 PM

craig said:

It seems to have a problem though.  The other site is not getting the parameters.  Does Redirect only work if it is on the same server?  My final deployment may put both sites on the same server, but I can't guarantee that yet.

Any ideas?

Thanks you so much!

# December 19, 2006 8:44 PM

Bertrand Le Roy said:

Ah, no, it's not the redirect that doesn't work here, it's session. If it's a different server, it's a different session (unless it's a web farm).

# December 19, 2006 8:49 PM

kaitlyn said:

the nerd tests are sweet!i was definetly not a nerd!!!

# December 20, 2006 1:56 PM

resh said:

how to display message boxes from server-side code?

# December 22, 2006 12:12 AM

unknow said:

Moderage:I think you can use window.setTimeout and golbal virable for your poupose.

# December 22, 2006 2:43 AM

Bertrand Le Roy said:

resh: I don't quite understand the question, that's exactly what the blog post is about...

# December 22, 2006 1:37 PM

D-dog said:

what is the best xbox 360 game available???

# December 23, 2006 12:14 AM

Bertrand Le Roy said:

Depends what you like. Gears of War and Oblivion are both marvelous time sinks.

# December 23, 2006 1:15 AM

Robert Erickson said:

omgee, I really had so much trouble when I couldn't see the mouse cursor on screen when it was pointed away. But then I found out that pointing the remote back to the object I wanted to focus on the cursor came back immediately.

It was such as daunting task to find that cursor after that event. I hate nintendo, all their products are non-american garbage. Get that stuff away from me, I'm sticking with my made in China Xbox 360. Go america!

# December 28, 2006 9:35 AM

Bertrand Le Roy said:

Robert: yes, I see your point, it should be easy enough to just point to the object but for some reason, it doesn't quite work naturally. It's hard for me to explain exactly why it feels weird, but it does. Must be years of mouse using that got us used to pointer movement being relative whereas the Wii is absolutely positioned. I guess you get used to it.

As far as the non-american-ness, I don't know about you (I assume you're joking. You are? Right?) but I'm French so I don't care that much... I care more about the Xbox being designed by my employer...

# December 29, 2006 12:39 AM

Tom said:

This is a great software.

But I can only run it on Windows 2000 Server. I've tried two different Windows 2003 servers. With no luck.

Does anybody know how to get this running on Windows 2003 Server?

# December 31, 2006 4:52 AM

Bertrand Le Roy said:

Tom, I'm running it at home on Windows 2003 Server without a problem. What exactly is the problem you're seeing? Are you sure you have ASP.NET 2.0 installed? Is ASP.NET activated in IIS?

# December 31, 2006 3:15 PM

Thomas said:

I personally think that its pointless bickering over "what's better" because the answer is simple: It doesn't matter whats better, it matters what YOUR CLIENT WANTS. If they want asp, you use it. If they want PHP, you use it.

Each scripting languages has advantages and disadvantages.  If you don't like a language - good for you, you're putting yourself out of business.

I go for more open-mindedness - I will use what is needed or requested - you have more opportunity that way.

# December 31, 2006 5:51 PM

Bertrand Le Roy said:

Thomas: Sure, except that you can't master all technologies around. And what if *you* are the client?

# January 1, 2007 4:23 PM

Kelly said:

How about we make this easier for the people that have to do a science paper on this crap!!!

# January 1, 2007 6:33 PM

Bertrand Le Roy said:

Great attitude, Kelly. Good luck with that.

# January 1, 2007 7:04 PM

Lloyd said:

I dropped the files in an image directory, and I'm getting the following error: "The type or namespace name 'com' could not be found" on the com.drew.metadata namespaces.

# January 2, 2007 2:03 AM

Bertrand Le Roy said:

For the moment, you also need to copy the dll to the bin folder. I'm working on a new version that removes that requirement.

# January 2, 2007 2:08 AM

Lloyd said:

Thanks for the quick response.  To clarify, I moved MetaDataExtractor.dll to my site's root bin directory, and that solved the problem.  Looks like a great tool.

# January 2, 2007 2:15 AM

niall said:

Why is this blogs showing in MS Ajax when its about a silly computer game. I am not interested in computer gamnes, just MS Ajax.

# January 2, 2007 4:32 AM

Bertrand Le Roy said:

I find it very flattering (and a little scary) that you're "just interested in MS Ajax", but this blog's title is "Atlas and more", which should give you a good hint that it's likely to talk about more than just Atlas/MS Ajax. Furthermore, it's very easy to filter out the contents you're not interested in: in the left margin, you'll find a "tags" section that will give you the contents filtered by topic.

# January 2, 2007 3:51 PM

Dantheman said:

I have draggable div elements on my page which float over select and input elements. In IE this is very broken, as you described, so instead I've forced these draggable div elements to load in a relatively positioned span (using a bit of Collin Yeadon's code to detect the browser).  

I didn't use iframes because i had difficulties making these position properly with the draggable element.

I've opted to leave the IE version of the site partially crippled (but still functional) until people either chuck IE into the toilet or upgrade to IE7.

# January 2, 2007 10:54 PM

ndnsoldat said:

Go AJAX, the old fashioned way!

# January 4, 2007 7:59 PM

Travis Cable said:

I am having this exact problem with Classic ASP. Any ideas to use something other than Response.Redirect?

# January 5, 2007 3:55 AM

Bertrand Le Roy said:

Classic ASP? Wow.

I suppose you could set the redirection headers and status, which would simulate what Redirect is doing, only without the thread abort.

# January 5, 2007 2:07 PM

Robin Debreuil said:

Man one says you are too American, the next says you aren't close enough to MS Ajax... tough crowd : ).

Just getting into XNA now, very cool. Not sure if the developer matters as much for consoles, but if so  the XBox clearly has a leg up. Not only is is easiest, but everything you learn can be applied to Windows programming as well. Oh, and it helps that you are actually allowed to develop for it!

# January 6, 2007 8:46 PM

kurtsune said:

This works:

page1.cs

protected void Page_Load(object sender, EventArgs e)

{

throw new Exception("hhhhhhhhh");

}

void Application_Error(object sender, EventArgs e)

{

Exception ex = Server.GetLastError();

HttpContext.Current.Session["Error"] = ex.Message;

Server.ClearError();  

Response.Redirect("error.aspx");

}

in error.cs

protected void Page_Load(object sender, EventArgs e)

{

if (Session["Error"] != null)

{

Response.Write(Session["Error"].ToString());

Session.Remove("Error");

}

}

This does not work:

page1.cs

protected btResponseRedirectToNonExistantPage(object sender, EventArgs e)

{

Response.Redirect("NonExistantPage.aspx", False);

}

void Application_Error(object sender, EventArgs e)

{

Exception ex = Server.GetLastError();

HttpContext.Current.Session["Error"] = ex.Message;

Server.ClearError();  

Response.Redirect("error.aspx");

}

in error.cs

protected void Page_Load(object sender, EventArgs e)

{

if (Session["Error"] != null)

{

Response.Write(Session["Error"].ToString());

Session.Remove("Error");

}

}

==> Object reference not set to an instance of an object.

# January 8, 2007 3:05 AM

Tony said:

I have the same problem for Redirect methid. For me i have 2 server that have the same code(just set Session and Redirect after that), then one server(Windows XP Professional) is not lost the Session but another server (Window 2000 Server SP4) is lost the Session. I'm so confuse.

# January 9, 2007 4:25 AM

Bertrand Le Roy said:

Tony: it's hard to tell exactly what's happening in your case. You should contact support.

# January 9, 2007 1:45 PM

Hamish said:

Heh, I just spent an hour or so writing a very pretty div-powered fading tool-tips for some forms I was writing when I came accross this problem. Cheers for the solution - hopefully one day we won't have to hack things together like this.

# January 16, 2007 8:01 PM

Orlin Georgiev said:

I think the right way to do callbacks in a loop is to use a client-side pattern like:

function InvokeServer()

{

//invoke server-side functionality here via

//Page.ClientScript.GetCallBackEventReference

}

function ShowResultFromServer(result, context)

{

if(someCondition)

   InvokeServer(); //again

}

InvokeServer is the function containing the Page.ClientScript.GetCallBackEventReference script. ShowResultFromServer is the function that is invoked on the client to render any results (remember that its name is passed to GetCallBackEventReference along with another function in case of a server-side excetion). When the browser renders the results of the first callback you eventually do a SECOND callback (based on someCondition), thus performing a recursive client-server-client while-loop thingie. This way you guarantee that the next callback in the loop starts exactly after the previous one, no need to set timeouts.

# January 17, 2007 2:22 AM

James Gregson said:

The reason for all the "why not play something else" messages has to be to cover their own ass, so people can't sue for repetitive strain injury, or becoming addicted to their games!

# January 17, 2007 5:06 AM

Bertrand Le Roy said:

Orlin: as I said in a previous comment, the right pattern is not to do that at all. If you know that you're going to have to requiery as soon as you're done, why don't you batch the calls? This looks like a typical case of Ajax abuse that's going to result in catastrophic performance. If you really, really have to do something like this, at least the timeout approach gives an opportunity to introduce a pause in the whole process and relax the pressure on the server and network. But really, try to find another way.

# January 17, 2007 3:00 PM

AM said:

To use PrtScn, press 'F Lock' to turn it off, then hit CTRL-PrtScn, and the picture will have been copied to the clipboard.

(This works on my keyboard anyway)

AM

# January 22, 2007 9:02 AM

Bertrand Le Roy said:

AM: err, thanks. I think you're missing my point here but thanks. <g>

# January 22, 2007 1:37 PM

Paul Mendoza said:

I have a question about AJAX. When using UpdatePanel, does all of the HTML of the page get rendered on the postback on the server when the UpdatePanel is triggered or only the portion that needs to be updated?

# January 23, 2007 8:53 PM

Bertrand Le Roy said:

Yes, that's the point of UpdatePanel.

# January 23, 2007 8:59 PM

Emrah GOZCU said:

Congratulations!!!

You've done a nice work...

# January 24, 2007 2:08 AM

Steve Ringo said:

I think what Paul meant was does it ALL get "rendered" on the server, and only the HTML that has changed get sent to the UpdatePanel. In other words does it do a "full postback"? As far as I know, yes.

# January 24, 2007 2:23 AM

Chucky said:

All I can say is.. Wow.

This looks great. A step toward melting the gap between web and desktop. Great work. Keep it up!

# January 24, 2007 7:37 AM

rajbk said:

Congratulations!!

Raj

# January 24, 2007 9:50 AM

Manuel said:

I've been an ASP developer since the times of Windows NT 4.0 and this is the most exciting breakthroug in the product since that time. Congratulations for  job well done !!

# January 24, 2007 10:41 AM

bernard said:

hi,

i would love to see your demo video-streams... but the quality is so bad that someone can actually not watch them...

thanks b.

# January 24, 2007 10:44 AM

Jason Wilson said:

Question about the new controls in the RTM.  I removed the RC1 and installed the RTM but did not get the new controls (new calender, masked input, etc).  I looked around for a DLL to add the controls manually, but didn't find one that added anything.  What am I missing?

jason

# January 24, 2007 12:16 PM

Jason Wilson said:

nevermind...I didn't realize that the toolkit was updated as well.  I dl'd the new one and re-installed the dll.  Got the new controls and after cleaning up my webconfig's everything is working

# January 24, 2007 12:28 PM

Aron said:

What is the difference between the "penultimate" release

announced <a href="http://weblogs.asp.net/scottgu/archive/2006/12/15/asp-net-ajax-1-0-release-candidate-now-available.aspx">here</a>:

and this release?

# January 24, 2007 12:40 PM

Bertrand Le Roy said:

Steve: yes, the page lifecycle is almost the same as during a postback. Render is being called on all controls but only those in the updated panels get their HTML sent to the client.

Aron: Migration guides that explain the differences and how to adapt to them can be found on the ajax.asp.net site:

http://ajax.asp.net/documentation/default.aspx?tabid=47

# January 24, 2007 2:01 PM

Jared said:

Looks good, but the link to download isn't working.  This is a long shot, but would you want to code in a user management system so only certain users could access certain folders?

# January 24, 2007 6:26 PM

Scott Barnes said:

Very sweetly done folks ;)

Its making my job easier each day ;) hehe.

SB.

Dev Evangelist.

# January 24, 2007 10:23 PM

Bertrand Le Roy said:

Jared: I just tried the link and it's working for me. Maybe the site was down when you tried. I don't think there's a need for a specific user management system: the built-in membership system of ASP.NET should work fine with it.

# January 24, 2007 10:31 PM

Eric Nace said:

Congrats Scott!  I've been following ATLAS closely (nice videos BTW) and made the commitment to use it on one of our largest projects here in AK!  Great product!

Continued success to you and the team!

# January 25, 2007 4:19 AM

Rob said:

Are there any good resource sites yet? Ie, with lots of newbie examples?

I wanna populate some drop downs based on selections, whilst I've tried to use the toolkit, it fails to build properly and generates errors in VS2005, and the CascadingDropDown example whilst it does populate, I am unable to tell what it'll do if you move away from the page and back again - I personally need the values still there and the appropriate ones selected when a user clicks back...

Any URL's to sites with examples would be handy, also - how come there's no newsgroup? I can only access MS groups from work, and I haven't yet found a microsoft.public.aspnet.ajax or equivalent etc?

# January 25, 2007 11:32 AM

Jb Evain said:

"programming is fun, but shipping is our job"

Great work from you and your team Bertrand, and congrats for the choice of the license!

Jb

# January 25, 2007 12:09 PM

bays said:

You shouldn't be proud, the release is buggy.

# January 25, 2007 1:44 PM

Bertrand Le Roy said:

Rob: you should try the forums on http://www.asp.net. There are also some tutorials, including video tutorials, on http://ajax.asp.net.

Bays: thanks for the constructive feedback. You can file bugs at this url:

http://connect.microsoft.com/feedback/default.aspx?SiteID=210

Alternatively, you can send me mail using the contact form of this blog and I'll look at any issue you may have or transmit it to the right person. The www.asp.net forums are also quite helpful.

# January 25, 2007 2:51 PM

Stew Meyers said:

Hello,

Is there an example of how to make a single synchronous call as opposed to the example at the top of the page which describes how to make ALL calls synchronous.  In my case, I need to pass one parameter to a server-side function, and return one back to the client (boolean).

Thanks much.

# January 26, 2007 5:02 PM

Bhaskar Jayakrishnan said:

One of the observations when using Response.Redirect(<url>, false) is that the page sent back to the browser contains 2 complete HTML blocks - 1 of the redirect (~150 bytes), and the other of the original page itself.

Adding:        

protected override void Render(HtmlTextWriter writer)

       {

           if (!Response.IsRequestBeingRedirected)

               base.Render(writer);

       }

to the page's or to the master page's code behind, resolves the issue.

Redirection being one of the very common cases, this appears to be a not-so-elegant way of doing things.

Is there a better solution ?

# January 28, 2007 12:11 AM

mike said:

u need a screwdriver to put on a faceplate?? and how come the companies who sell the faceplates dont give instructions??

# January 28, 2007 2:59 PM

Bertrand Le Roy said:

Stew: it should be fairly easy to only do the XMLHttpRequest substitution around your call and reset the default implementation when you're done. But again, is it worth the trouble, and wouldn't it be easier to just redesign for async?

# January 29, 2007 1:18 PM

Bertrand Le Roy said:

Mike: no, you don't, it's just easier with a screwdriver, it allows you to lever it out gently.

# January 29, 2007 1:20 PM

Bertrand Le Roy said:

Bhaskar: good point. You could also set-up a response filter that swallows all new output.

# January 29, 2007 1:24 PM

Jared said:

Looks like the link was down when I last tried, thanks.  I've been playing around with it a bit (mainly to get it to play with a different source directory, a networked drive) and noticed it has trouble with hidden/corrupted .jpg files (these are being created by Mac users somehow).  Also, is there any way to add in non-jpeg files (gif, tif, png, etc.)?  It seems it is limited to what the MetaDataExtractor can read.

# January 29, 2007 2:32 PM

Bertrand Le Roy said:

Jared: I think you'd have to fix those jpgs before you use them with the handler. Both corrupt jpg and non-jpg file handling are features I don't plan on adding for the moment as I have little time and more important features to implement but feel free to modify the code any way you want and implement those.

# January 29, 2007 2:55 PM

Ali Muhammad said:

Dear freinds,

I have a web application developed in vb.net. I use

Atlas Timer control to update my update panel . This application working fine on internet explorer but not envoking timer in fire fox... any buddy hving clue kindly help me

Regards

Ali.

# January 30, 2007 11:01 PM

Bertrand Le Roy said:

Ali: please contact me through the contact form of this blog.

# January 31, 2007 12:14 AM

Johhny D said:

LOL! I quit reading as soon as the Microsoft goon said "code behind" was good "separation" ... that the code should not be mixed in with the markup.

What a dumbass. XAML sucks, code behind sucks, everything MS invents sucks. I would much rather see the code thats generating my HTML right next to the other HTML - not in some other file.

These stupid idiots from Microsoft don't even realize everything they do is generating HTML and Javascript. All of .net are code generators. Put an <ASP:button on your page - and you get <input type="button spit out of the web server. Uh, thats MORE work the web server is doing, Duh. but guess what? When you use ASP:button you are typing more *** to do the same thing. And if you are going to wind up with w3c html and javascript by the time the page gets rendered, wouldn't you rather just type html and javascript in the first place? Dumb. Pure stupid dumb *** Microsoft crap.

Drag yer little gridviews on your stupid ide and see the CRAP html that comes out. 50 times more html than a php or asp page would have made.

# January 31, 2007 5:14 PM

Bertrand Le Roy said:

Right. I stopped reading as soon as the troll said "LOL".

# January 31, 2007 5:18 PM

Johnny D said:

Here, let me use Microsoft tools, and see if my site runs on apache. No? Hmmm. Now, let me use PHP and see if my site runs on Apache AND IIS - Hmmmm,

What is all this "framework" crap. Learn html, css and javascript or go home. And when you need to hit a database for content, use php because then your stuff can move to mysql, apache, mssql, oracle, websphere, IIS , whatever.

Oh, yes Mr. Microsoft. It Is SOOOOOO much better when software WON'T work anywhere.

stupid. pure stupid Microsoft baloney.  

# January 31, 2007 5:20 PM

Johnny D said:

ATLAS is idiotic too. Invented by Microsoft, of course.

XMLHttpRequest(); and "Microsoft.XMLHTTP" take 4 lines of code to use.

Who wants a freaking framework that takes and generates 100 lines of code for that?

Write your ajax with ATLAS and see if it works on apache. Better yet, try to "Use" Atlas web services from your site on Apache. But guess what? You can hit any web page on any server invented by anyone anywhere if you DON'T use ATLAS.

# January 31, 2007 5:30 PM

Bertrand Le Roy said:

Can you please go away? Atlas *does* run on apache and on PHP.

# January 31, 2007 5:32 PM

JOhnny D said:

Address the point about using a framework that requires 100 lines of code to do what you can do in javascript with 4 lines of code. ok.

# January 31, 2007 5:44 PM

Bertrand Le Roy said:

No, you explain how you can do in 4 lines of code everything that Atlas can do.

Anyway, if you don't like it, just don't use it. Lots like it and use it. Simple as that.

# January 31, 2007 5:49 PM

PohEe,com said:

Good article. Hopefully Microsoft will fix this ASAP. Let's wait together

# January 31, 2007 8:45 PM

João Maia said:

I've been using it in my project since BETA2 till RTM and it it's great...

Almost perfect :) if this didn't mess up with my characters when I'm using

<globalization requestEncoding="iso-8859-1" responseEncoding="iso-8859-1" culture="pt-PT" uiCulture="pt-PT"/> on my web config... but well apart from this, it really kicks ass!

# February 2, 2007 10:04 AM

Alex said:

Hm, applying this workaround confuses me a bit, because somehow, if i begin to add global path to script manager, i need to collect all scripts into one folder, which i do not want to do.

Best way is to have just core framework script modified, it looks like .net2 then wants every single script "pathed" as well... why it does not take the rest from default resources as usual?? I'm puzzled

many thanks if you can help,

Alex

# February 5, 2007 4:09 AM

alex.lee said:

(this is Alex again :)

Have managed to make this error gone for a while. A thing why the rest of script did not want to load was because VWD Express test server wants addresses in ~/path/path format, while IIS consumes /path/path . So this is fixed.

However, same "access denied" reappeared when autocomplete textbox (living inside frame) calls webservice to fill a list.

PS. Site has same as yours structure- parent page has frame with my [other domain] ajax site...

# February 5, 2007 4:41 AM

alex.lee said:

Bertrand, you seem to be my only hope :)

2 my previous posts are rather chaotic, so excuse me.

To summarise, not just your pointed framework script fails in iframe on IE, but Common script for toolbox as well:

[...] when autocomplete tries to place results, it uses this part of code of this script:

getLocation : function(element) {

[...]           <b>if (element.ownerDocument.parentWindow.frameElement)</b> {

[...]   }

===

Bold line already fails and i believe, what follows will fail as well.

So, my prob is how to correct script and where to specify path to consume corrected version? (similar to yours task)...

Many thanks!

# February 5, 2007 6:42 AM

Bertrand Le Roy said:

Alex: the code you posted is the *old, unpatched* code. So you either did not correctly set up your script reference or you didn't patch the file. You can drop me e-mail through the contact form if necessary.

# February 5, 2007 2:23 PM

Chris said:

I am having the same issue as Alex. Your patch corrected the issue with the inital page load, but now I get the same Access Denied message when any AjaxToolkit control is used. The AjaxToolkit has it's own getLocation definition, which eventually calls the Framework's getLocation but, is failing before it gets to the call. The AjaxToolkit getLocation is defined in Common.js.

# February 5, 2007 2:50 PM

Delay said:

Sorry for the trouble, Chris! Please see http://blogs.msdn.com/delay/archive/2007/02/05/safely-avoiding-the-access-denied-dialog-how-to-work-around-the-access-denied-cross-domain-iframe-issue-in-the-ajax-control-toolkit.aspx for details on how to make the corresponding changes to the AJAX Control Toolkit.

# February 5, 2007 7:53 PM

shashi kumar beesu said:

Hi that was a good Work arround which helped me to switch to synchronous call. but i tryed changing false to true i.e. while calling return _xmlHttp.open method i changed the third parameted from false to true, (it is this boolean value which makes the difference between synchronous calls and asynchronous calls) but when i changed it to true and executed then it threw an javascript error at this.responseBody = _xmlHttp.responseBody; saying "The data necessary to complete this operation is not yet available."  can any one help me how to get rid of this error.

And one more thing does this code work on all browsers like IE 6/7 Firefox 1.5/2.0 Mac Firefox, Opera etc?

Regards,

shashi

# February 6, 2007 6:35 AM

Bertrand Le Roy said:

Shashi, I don't get it. Why would you want to set that to true if you want synchronous? If you want async, you don't need this hack, but you need to start doing things asynchronously.

I think this code should work on all browsers although I didn't test everywhere.

# February 6, 2007 1:26 PM

Jacco said:

Although undefined is definitely not the same as null, is sometimes acts like it is.

When comparing undefined and null using the == operator the result will be true! (See the ECMA documentation)

So "if (SomeObject != null) {" will test SomeObject for null, but also for undefined. In this case exactly the intended behaviour.

Jacco

# February 7, 2007 6:48 AM

Mike said:

Nice article, but I could never get approval to implement it this way.  I hope MS can fix this soon.  I was trying to use the AjaxControlToolkit to mask some textboxes in an iframe that was embedded on a Micrsoft CRM form.  For now, I commented out the Extenders until this can be fixed.  Still, keep up the good work.

# February 7, 2007 8:00 PM

max said:

did the drive keep sticking and its easier with no faceplace like mine??

he asks wishfully

# February 9, 2007 4:58 AM

Bertrand Le Roy said:

Jacco: sure, and that's why you should always use === instead of == which is so fuzzy it's really a useless bug factory.

For more fun about undefined, read this:

http://weblogs.asp.net/bleroy/archive/2006/08/02/Define-undefined.aspx

# February 9, 2007 2:04 PM

Bertrand Le Roy said:

Mike: the next version of the toolkit will contain the fix, which may be your best best as I see you're using it.

# February 9, 2007 2:12 PM

Bertrand Le Roy said:

Max: no.

# February 9, 2007 2:13 PM

Alpesh said:

Thanks for the article. It fixed most of our x-domain issues with RTM bits.

However, under special circumstances, I still get access denied errors.

What I have is an iFrame that has a link to a Rss feed. When I click on the feed, I get an access denied error in the addHandler method here (in MicrosoftAjax.js):

if (element.addEventListener) {

       browserHandler = function(e) {

           return handler.call(element, new Sys.UI.DomEvent(e));

       }

       element.addEventListener(eventName, browserHandler, false);

This happens only when the link is trying to open a Rss feed. Any ideas why this would happen?

# February 9, 2007 7:12 PM

Bertrand Le Roy said:

Alpesh: If you're trying to set-up an event for an element that is in a different window/frame, there is a known issue with that. Please contact me to check if that's the same problem you're hitting and how to work around it. You can use the contact form to drop me e-mail.

# February 9, 2007 7:18 PM

Yes, You can redirect.................... said:

Dear All,

if you are using ATLAS you can face the problem of session after redirecting the page. session's value gets null. You can solve this problem by using follow instructions.

1- Just maintain another session like a test session on the form load of the page from where you are redirecting the page.

for example:

---------------------------------------

page_load event()

{

if(!Page.IsPostback)

{

Session["TempSession"]="";

}

---------------------------------------

After doing this you can make use of sessions easily.

but remember on form load only because this is not included in atlas controls.

}

if any doubt you can catch me at 'dear.saxena@orkut.com' or 'saxena-saurabh@hotmail.com'

Thanks & Regards

Saurabh Saxena

# February 12, 2007 4:48 AM

Jason said:

If you're getting the "User control source files must have a .ascx file extension." error and you have framework 2.0 installed, then you probably have the virtual directory configured to use framework 1.1.  On my machine 1.1 is default and I have to set it to 2.0 explicitly in IIS.

# February 12, 2007 3:32 PM

Vincent said:

Bertrand: i downloaded the albumhandler.zip (2.0 and 2.1) and extract the files into the image folder... when i run it, i got the following message:  

Parser Error Message: Type 'AlbumHandler' does not inherit from 'System.Web.UI.UserControl'.

Source Error:

Line 2:  <%@ Register Src="~/album.ashx" TagPrefix="photo" TagName="album" %>

Do you have any idea what causes the problem?

# February 13, 2007 11:32 PM

Thomas Coombs said:

The following error occurs when hitting links, selecting tabs on this page.  Which we determined to be a cross domain scripting issue within an iFrame.

Access is Denied

We applied the fix found above and added the “Systems.Web.Extensions” folder to our solution

Amended the appropriate JS files as per the fix

Added a ScriptPath attribute to the ScriptManager Tag to point to the relevant location

<asp:ScriptManager ID="ajaxManager" runat="server" EnablePartialRendering="true" ScriptPath="~/JavaScript/AjaxExtensions" />

Retested the page and checked the appropriate script links were all pointing to the correct and newly added path.

This tested succussfully.

However, as a result of applying this fix we encountered a new problem.  On loading the display.aspx page, the following Javascript error occurs:

Expected ';'

var $create=Sys.Component.create=function(h,f,d,c,g){var a=g?new h(g):new h,b=Sys.Application,i=b.get_isCreatingComponents();

Followed by a further error Object expected

var $create=Sys.Component.create=function(h,f,d,c,g){var a=g?new h(g):new h,

This error is occuring in the MicrosoftAjax.js file we added and modified as described above.

As a further result…  Also on this page we use a <asp:UpdatePanel> which is associated to a <asp:timer> control which handles our Polling facility to check responses we receive on a given interval.  This no longer functions, we assume the two events are linked.    

Can anyone help me?

# February 14, 2007 9:08 AM

Benny/Norway said:

I've got the same problem, but the fix didn't help me. Because I was using frameborder="no" in my iframe.

I got the NaN exception.

The only fix ==> frameborder="0"

# February 14, 2007 9:59 AM

Bertrand Le Roy said:

You probably don't have ASP.NET 2.0 installed, or it's not active on that application.

# February 14, 2007 1:29 PM

Bertrand Le Roy said:

Thomas: I think you didn't apply the patch properly. What you replace in the release version includes the switch, but you must not replace the case Safari.

Benny: frameborder="no" is illegal XHTML. Please use "0". This is actually a different problem (which doesn't cause "access denied") so it's not surprising that the patch would not fix it.

# February 14, 2007 1:35 PM

Thomas Coombs said:

Thanks very  much for your prompt response Bertrand.

I've checked the release version of the file, but the "case Sys.Browser.Safari" does still exist.

Sorry.

# February 15, 2007 3:45 AM

Bertrand Le Roy said:

Thomas, please contact me through the contact form of this blog. I'll look at your file.

# February 15, 2007 1:53 PM

Darren said:

Does anyone have the full file working.  I am getting a Sys is undefined when using the Atlas toolkit

# February 15, 2007 5:40 PM

Carl said:

I am getting 'Type' is undefined on the first line of ScriptResource.axd.  Does this mean I misconfigured something and the js files are not being used?

# February 22, 2007 4:46 PM

Bertrand Le Roy said:

Carl: you probably made a mistake when patching the file, which created a syntax error, or you did not put the MicrosoftAjax.js and MicrosoftAjax.debug.js files at the right place.

The fact that you're seeing scriptresource.axd does not mean that the js file is not being used: if you just replaced the MicrosoftAjax.js reference, all other scripts will still use scriptresource.axd. What you want to check is if MicrosoftAjax(.debug).js is being queried and if the script tag in the html source as seen from the browser has its src attribute set to the right url.

# February 22, 2007 5:23 PM

Carl said:

I placed the entire folder System.Web.Extension in my sight then added a ScriptPath Property to the directory all the way down to the js files.  I also tried using the <asp:ScriptReference > from above.  Both result in the same issue.

I also receive the error prior to trying to path the files and after.

I just downloaded fiddler and I will try to see if I can see the debug file being accessed.

I also cleared all browser cache and cleaned my project.

# February 22, 2007 5:38 PM

Carl said:

Actually, I need more sleep and a spell checker built into the IDE.  Everything is now working all is well.  Fiddler is a great tool and showed me the 404 error when tryin to access MicrosoftAjax.debug.js.  there fore I verified the path in the script manager and realized I had added an 's' to a word.  Thanks for everything!

# February 22, 2007 5:46 PM

Steve said:

All those comments in javascript will bloat the size of the js files won't they?

# March 4, 2007 3:18 PM

Bertrand Le Roy said:

Steve: sure, that's why we include them only in the debug version of the scripts. In release mode, there are no comments, no parameter validation, and the script is crunched (as few spaces as possible, no newlines, local variables are renamed to be shorter).

But in debug mode, the focus is on ease of programming and debugging and we don't watch size that much.

# March 5, 2007 12:27 AM

Herr Ziffer said:

This is an absolutely awesome feature.  Javascript is definitely the poor stepchild of the programming world, which is probably why it has taken this long for anyone to devote the resources to doing Javascript intellisense.

It is also my understanding that there was some debate about whether to include this feature or not, and how much demand there actually was for it.  There's alot!

And while it may devalue the hard-earned skills of the expert javascript writers, somewhat, it is a great boon to the rest of us.

# March 5, 2007 9:05 AM

Darren said:

Has this now been fixed with the 3/2 release?

# March 5, 2007 10:55 AM

EB said:

I was having this problem in ASP.NET and I did two things to fix it (just to be safe):

1) used the second "false" parameter in Response.Redirect

2) since as you explained, the problem is only if the session hasn't been started on a page prior to the one that does the redirect, I set a dummy session variable when the user first arrives at the login page, BEFORE they've submitted the form.

Either one or both of these seems to have done the trick.  Thanks Bertrand!

# March 5, 2007 11:00 AM

Bertrand Le Roy said:

Darren: what we released last week was an Orcas CTP that doesn't contain any Ajax bits, so I suppose not. It will be fixed in the first Orcas release that contains Ajax bits, which should be beta 1 as far as I know.

# March 5, 2007 3:05 PM

Stephen Oesterreicher said:

Is what your doing is making AJAX work even if the browser has JavaScript turned off?  It looks like it is not going as well as you had hoped.  Does that mean that your idea is not going to make it out here in the real world?

# March 7, 2007 2:09 PM

Bertrand Le Roy said:

Stephen: yes, potentially, unobtrusively adding events like described here enable you to build a web page that could work without JavaScript. It requires some care but it absolutely can be done and it is the direction more and more people are taking. But to be perfectly clear, it doesn't "make Ajax work" if JavaScript is off, it makes the page work reasonably if it's off. By definition, Ajax only works with JavaScript on.

I don't understand your question though. What idea are you referring to? What is not going as well as I had hoped?

# March 7, 2007 2:22 PM

Amy said:

Love it! "I was a nerd wannabe" I slightly disagree with that remark!

# March 8, 2007 4:27 AM

SurferGirl said:

I have been reading this blog and have a problem that looks at first like a good fit for multiple synchronous calls.

I need  to multiple web services, modal dialogs with in one function call.

When the user selects a button a message is shown that the current action is processing please wait..

The function is very complex and requires that the  information is gatherd and proccessed in a synchronous workflow.

With in the function I need to be able get information form multiple web methods and modal dialogs (user input).

So, how would I achive this type of functionality when using Ajax ansynchronous Call Backs.

Also, the function is started in the following way result = window.setTimeout("StartProcess(processId)",500);

I'm open for suggestions

# March 8, 2007 2:29 PM

boa sovann said:

i am also having such this problem in my web application and trying to find the solutions. but i really get strange! when try to login with the correct username and password, the session variable always null but if i enter the wrong username or password at the first time and try to enter the correct username and password again, it works correctly. so why it is happend?

# March 12, 2007 11:44 PM

Fedor said:

When can we expect ASP.NET Ajax update with this fix?

# March 13, 2007 5:47 AM

Bertrand Le Roy said:

SurferGirl: setTimeout doesn't return the result of calling your function, it returns a cookie that identifies the asynchronous operation. If your timeout handler needs to return information, it should do so into some globally accessible state variable. Furthermore, you should never pass a string into setTimeout. Use a function reference instead (build a callback if necessary to remember the parameter, using Function.createCallback if you're using ASP.NET Ajax).

There is nothing in your scenario that requires synchronous calls. Only your workflow state needs to be updated after each call. That doesn't mean that you need to freeze the whole browser. Just freeze/disable the UI that affects your workflow during the calls.

# March 13, 2007 1:35 PM

Bertrand Le Roy said:

Boa: if login fails, there is no redirection, so the session cookie gets set correctly. This is expected. Follow the indications in this post and you should be fine.

# March 13, 2007 1:55 PM

Bertrand Le Roy said:

Fedor: see above comment. The next release (Orcas beta) will have the fix.

# March 13, 2007 1:56 PM

Ron said:

Stupid question.  I bought the original version months ago.  How do I get the final version for free?  I went to My Account on the O'Reilly site and it still shows the old version under Electronic Media.  I downloaded again just to check, and sure enough, it's the old version.  I added the new version to my cart to see if a re-purchase would be smart enough to price out at $0.00 but no go.  I can't figure out how to do it.

Thanks

# March 14, 2007 4:39 PM

Bertrand Le Roy said:

Ron: I'm asking O'Reilly. I'll post their answer here.

# March 14, 2007 6:46 PM

Dean Harding said:

Wouldn't just giving your account explicit read/write access to the folder do the same thing? Then you wouldn't need to run explorer as an administrator!

# March 14, 2007 8:27 PM

Bertrand Le Roy said:

Dean: that's a good point, but it doesn't do exactly the same thing.

If you just give permissions, it means that any process that runs under your identity can do whatever it wants on the folder. If you just run the explorer as admin, then only that explorer process has the rights.

In other words, giving permissions basically disables UAC on that folder (permanently), whereas running as admin disables UAC for this process (temporarily).

# March 14, 2007 8:40 PM

Dean Harding said:

Yes, but running explorer as an administrator also means all your explorer extensions and so on are running as administrator.

I guess it just depends on where you think the threats are coming from :-)

# March 14, 2007 9:24 PM

Bertrand Le Roy said:

Yes, you're absolutely right, but giving rights on the folder presents the same risks as far as shell extensions are concerned.

If you have shell extensions that you're unsure about, I guess it's just better to leave UAC on, not give additional permissions and not run as admin...

Ultimately, I see people disabling UAC as a whole and while it would be best to leave it on and bear with the alerts, such tricks can help in that it's better to have it partially on (and know the risks) than have it completely off.

As always, the best protection is skeptical computing.

# March 14, 2007 9:34 PM

Ron Ifferte said:

Try downloading it again. I just re-downloaded the PDF and it's stamped March 13, 2007.

# March 14, 2007 9:47 PM

rbuckton said:

There are times where I wish there was a way to "pre-authorize" certain applications for UAC.  I always run Visual Studio elevated and the prompt seems a bit cumbersome in those cases.  I think you should be able to authorize certain applications as approved without the need to accept a UAC prompt.  You could define the trusted startup parameters for the application (e.g. what are the valid commad line options that can be supplied).  Pre-authorized applications would then just need some type of bubble tip after launch that appears above the icon in the taskbar, or differentiate the window with slightly different window chrome (say a red or orangeish cast to the aero glass style) for applications running elevated.

Beyond that I am a big fan of UAC. Vista makes large-scale operations affecting a protected folder efficient by determining up front everything that will need elevation when beginning a copy, move, delete, etc. operation.  It's the one-by-one changes that become cumbersome.  

One of the more difficult to understand features of UAC is attempting to write a file to a protected location by an application that doesnt understand UAC.  Instead of denying the operation, a special folder structure under your profile folders that matches the protected directory structure is created for those files.  Vista needs a way to track and merge these changes easily after the fact, rather than having to do it manually.

# March 14, 2007 10:03 PM

David Taylor said:

Bertrand, like you I have left UAC enabled for the last few months of running Vista.

However I am not that worried if many technical people turn it off as they know how to fix their machine if it gets trashed.  

What I care about is that my mother, father and other non-technical people leave it on.  We should remember that 95% of people are not very technical, and if that 95% have UAC enabled Vista is a huge win.

# March 14, 2007 10:08 PM

Dean Harding said:

> Yes, you're absolutely right, but giving rights on the folder presents the

> same risks as far as shell extensions are concerned.

Except that they WOULDN'T have those rights on every OTHER folder marked Admin-only (System32, Program Files, etc).

I guess it depends on how "valuable" your InetPub folder is compared to those other folders. Either way, I think there are risks doing it both ways... but that's the nature of security; you've got to take risks in the interest of actually being able to DO stuff :)

# March 14, 2007 11:13 PM

Speednet said:

rbuckton, your comments are right on target!

I have been thinking exactly the same thing.  What malware is going to try and run the VS2005 IDE?

UAC desperately needs fine-tuning controls, which an advanced user can manipulate.  It can be changed to work exactly like a learning firewall, giving the user the ability to remember a rule or ask every time.  Wouldn't that be the best approach?

# March 15, 2007 1:49 AM

TomTom said:

Thanks Bertrand just purchased a copy of it.

# March 15, 2007 3:34 AM

Bertrand Le Roy said:

Dean: you're absolutely right, so for a dev machine, the inetpub folder may be dependable and just giving access may be acceptable but on a production server, well, in this case just leave everything on I suppose.

# March 15, 2007 3:38 AM

Remy said:

Got a copy too, looking forward to read it. Hope it gives you some motivation to write some more great posts.

# March 15, 2007 5:33 AM

John Osborn, O'Reilly Media, Inc. said:

We're looking into the problem and hope to have an answer today. It may be a timing issue (the new version was posted yesterday), so it would be worth trying to download it again.

John Osborn

Senior Editor

O'Reilly Media

# March 15, 2007 7:03 AM

Ron said:

Thanks Betrand.  About one hour after my original post I received an email from O'Reilly stating that the updated document was ready for download.  Sure enough the new version is available now.  It looks like O'Reilly was slightly behind your blog entry but all is good now.

# March 15, 2007 8:30 AM

Kevin Dente said:

Are there any improvements in the Javascript debugger in Orcas that make this sort of thing unnecessary? Or is that just the way it is?

# March 15, 2007 5:04 PM

Bertrand Le Roy said:

Kevin: that's just the way it is. JavaScript functions don't know what they've been assigned to. You could even point several different variables to the same function reference (actually, it happens all the time with prototype functions that are referenced by instances). The debugger has no way of knowing what you consider to be the relevant assignment. All it has is the global name that was given to the function when it was declared, and that's exactly what we're leveraging here.

# March 15, 2007 5:10 PM

Scott said:

Does the ASP.NET Ajax team plan to release the "compression" tool they use to create the release script from the debug script?

# March 15, 2007 5:45 PM

Steven Berkovitz said:

Are you saying that Safari will not run scripts with the function body inline or that it simply won't show the stack?

# March 15, 2007 6:10 PM

Bertrand Le Roy said:

Scott: that's good feedback, we're getting that question a lot. We're thinking about it, but it takes some time. Thanks.

# March 15, 2007 6:12 PM

Bertrand Le Roy said:

Steven: Safari refuses to parse "baz: function Foo$Bar$baz()" if it's inside an object literal declaration like the prototype declaration. IIRC, it's considered a syntax error.

# March 15, 2007 6:15 PM

Curious George said:

Kinda off topic...

Is it not the case that functions prefaces with "_" are by convention private methods? I could be completely off here, but if so, how can we use "Function._validateParams(...);" in our own client class libraries code to validate arguments as they come into our methods?

Thx!!

# March 16, 2007 12:09 PM

Bertrand Le Roy said:

George: yes, it is private/internal, but you wouldn't be the only one to use it. You have to know that being private, there is a small chance that it could change in the future. So, at your own risk...

# March 16, 2007 1:52 PM

Mike Mattix said:

Thanks,

It worked like a charm.  Our problem was running AJAX applications in Page Viewer Web Parts under Sharepoint (WSS V3.0).  In case anyone else is having the same issue.  The PopupControl Extender would not fire and display the Calendar.  It would (of course) stand-along but not in the Page Viewer Web Part.

Thanks again,

Mike Mattix

# March 16, 2007 2:12 PM

kevindente said:

Perhaps this bit of guidance could be added to the AJAX documentation at some point.

# March 16, 2007 3:15 PM

Curious George said:

Thx!

Is there a public function that is available for validating parameters? If not, was it left off b/c the method's signature might change in the future and you guys didn't want to risk a breaking change? It seems that it's a very valuable feature that JavaScript lacks (being argument agnostic) and would compliment the framework nicely.

# March 16, 2007 4:33 PM

Shaun Newman said:

Great News.  I for one am happy that you goy's are all maintaining an open and collaberative attitude.  This is a side of Microsoft I like. Keep up the great work and I look forward to some interesting and innovative vibes in the Ajax world going forward.

# March 21, 2007 4:35 AM

Luis Abreu said:

cool! and keep up the good work.

# March 21, 2007 4:07 PM

Peter said:

I bought the booklet today and on page 17 it's still using the atlas tag instead of asp... no biggie...

# March 21, 2007 6:52 PM

Kris said:

Hi - I have a Safari subscription, but this document does not show up there.

# March 22, 2007 11:09 PM

Tyler said:

Off topic, but my 360 tray won't stop opening. Even after I turn it off. The tray will close, then open, then turn off, leaving the tray open. I recently had my 360 repaired for an internal problem, so I don't know if they might've hit something to cause more problems. Let me know if you have any tips.

# March 23, 2007 12:31 AM

Jai said:

I have had a requirement for this when aspnet process permissions need to be tested one at a time with the user informed of progress (as is quite possible one of them will time out and the user needs to know where it got stuck).

Anyway you can't do using Orlin's method as this is the way I was trying at first. You get stuck in a recursive loop as it seems the clientCallback method specified in GetCallbackEventReference() must return before the WebForm_DoCallback() method can be successfully called again (ie you can't call it from within the clientside event handler the receives the result).

# March 23, 2007 6:35 AM

Bertrand Le Roy said:

Kris: I'm asking my editor. What happens when you follow that link: http://safari.oreilly.com/0596527470 (found from the PDF page)?

# March 23, 2007 7:50 AM

Bertrand Le Roy said:

Tyler: sure, I have a tip... Contact support :)

# March 23, 2007 7:53 AM

Bertrand Le Roy said:

Jai: use setTimeout to queue the next request.

# March 23, 2007 7:56 AM

Morten said:

Hey Bertrand

...you wouldn't happen to have an updated version of this that runs on MS Ajax v1.0 ?

I tried updating the code but I keep into issues (mostly JS related).

# March 23, 2007 12:56 PM

Kori Francis said:

Can you do up a small sample of how this $ method should be used for debug scripts and not for production scripts?

# March 23, 2007 8:07 PM

Stefan Dobrev said:

The features definitely rocks.

Can you reveal more secrets about the "elegant solution" that is implemented.

# March 24, 2007 2:39 AM

Rem said:

Hi Betrand,

Searching for an answer this weird is hard, even with google on our side. I'm not sure if my problem is along the same line, however, this is what's happening:

I store some login information in my session as well. Now for some reason -this behaviour started all of a sudden with a minor update not touching any of the login stuff- if I refresh a lot, and print the session variables, it SOMETIMES takes the data from a different session.

Any ideas where this might come from, or better yet, how to prevent it?

Thanks in advance,

Rem.

# March 26, 2007 11:19 AM

Bertrand Le Roy said:

Morten: I'll try to do that in the following days. I'll post when I'm done.

# March 26, 2007 1:16 PM

Bertrand Le Roy said:

Kori: typically, you'd have the following release code for the above example:

Foo.Bar=function(){Foo.Bar.initializeBase(this);}Foo.Bar.prototype={baz:function(){/*Do something*/}}Foo.Bar.registerClass('Foo.Bar');

In other words, the $ names are compeltely absent from the release scripts. Does this help?

# March 26, 2007 1:24 PM

Bertrand Le Roy said:

Stefan: it's a combination of partial script execution, inferring types from the context and taking hints from doc comments. Does this help?

# March 26, 2007 1:30 PM

Bertrand Le Roy said:

Rem: it's hard to say but I'd bet for a caching issue. If the project is under source control and you know when this started to happen, try to determine which changes are likely to have done that and look in particular for changes in the caching policies of those pages.

# March 26, 2007 1:33 PM

Keith Martin said:

With HTTPS, I've found that on IE6 it seems that error pages generated by the browser are treated as insecure, so anything that causes an error in the src of the iframe will cause the secure/insecure mix alert.

The only thing I've found that works for me is to put a src that points to a valid html page on the server. any of the javascript options, or pointing to a page that does not exist, causes the secure/insecure alert.

# March 27, 2007 2:19 AM

Rem said:

Bertrand (correctly this time): The changes were very small and I can't think of anything that has any correlation to caching or sessions.

I haven't been able to find anybody describing this behaviour in my searches. Personally, I'm starting to think it's beyond the application, but that's something wrong with IIS. Sessionstate is set InProc for this.

If you would happen to know a place where I could find people who have or had this problem, that would be appreciated!

Thanks again,

Rem.

# March 27, 2007 5:15 AM

Bertrand Le Roy said:

Keith: even "j avascript:'<html></html>'"? (remove the space, I added it so the blog engine doesn't remove it)

# March 27, 2007 1:54 PM

Bertrand Le Roy said:

Rem: if it was caused at the same time as a code change, I'd try to rule that out first. Can you revert those changes and see if it still reproes?

If all else fails, I'd advise you to contact support.

# March 27, 2007 1:58 PM

dcstarr said:

how do u take off the faceplate

# March 27, 2007 8:58 PM

dcstarr said:

the screwdriver trick didn't work meanies

# March 27, 2007 9:05 PM

Bertrand Le Roy said:

Well, I don't know what to tell you, it was pretty easy for me. Maybe you should contact support.

# March 27, 2007 9:13 PM

Rem said:

We tried that just now and the old code doesn't show the behaviour, so it must be in the code somewhere. 5 of us have been staring ourselves blind on it with no result.

Wish I could find something that may give a suggestion what causes sessions to swap. Only thing I've found is multiple worker processes, but that's not the case here.

Errors are fine, we can fix those. No errors and weird behaviour, that's a whole different story. Perhaps I should have my wife (who doesn't code) look at it...

# March 28, 2007 4:36 AM

Donna Leathers said:

Is there a way to implement background imagery with this method? Tried BackImage with no success. Ideas? Thanks!

# March 30, 2007 3:33 PM

C. Lung said:

The problem I've found with Safari is that I don't get the updates after a given period - they remove your purchase after a certain time.  I bought this PDF when it first came out but since that time Safari has automatically removed it from my account.  So basically unless I purchase it again I can't get the updated version of it.

# March 30, 2007 5:19 PM

C. Lung said:

Turns out I'm wrong.  You cannot get the update from Safari but if you go into the O'Reilly account part you can get the PDF there still.  It seems like it makes more sense to keep it on the Safari part, but...

# March 30, 2007 5:24 PM

Bertrand Le Roy said:

Well, I can talk to my editor if you want but it would probably be more efficient to contact the O'Reilly customer service directly.

# March 30, 2007 5:26 PM

Bertrand Le Roy said:

Donna: what BackImage are you referring to? If you want different background images for each menu item, I think you're out of luck, sorry.

# March 30, 2007 5:39 PM

Ta said:

The message works great except when I put <UpdatePanel> around it, then it does not work.

Do you know why?

# April 2, 2007 1:18 PM

Bertrand Le Roy said:

Ta: yes, this is a known problem. It currently doesn't work inside UpdatePanel.

# April 2, 2007 2:01 PM

Loraine said:

Thanks for this Bertrand, very useful article - problem sorted:-)

# April 5, 2007 3:22 PM

PeterG said:

Are you still planning to do a post about Class events or can you point me at a good resource?

# April 7, 2007 12:03 PM

Bertrand Le Roy said:

Peter: yes, absolutely. I'll try to get that done next week.

# April 7, 2007 1:51 PM

David said:

Hello Bertrand,

I need to build a custom wizard in code at the page load from database records of what fields to include for wizard number 43 etc. I have done it by having a base page that has a default wizard on it, that I pass to serverside classes to build the steps and fields in the page initialise event. This work fine but reverts to the base wizard as soon as the page posts back when I click "next"(duh). How do I maintain the custom wizard and any entered data through postbacks? The answer may be beyond me, but I haven't got a clue how to go about it.  

Thanks

# April 10, 2007 10:07 PM

Bertrand Le Roy said:

David: It's hard to debug your code without seeing it but apparently you're not recreating the controls in their current state on each postback, or maybe you're recreating the controls but with the wrong ids. There are many things that can go wrong, but I'd start by reading this:

http://weblogs.asp.net/infinitiesloop/archive/2006/08/25/TRULY-Understanding-Dynamic-Controls-_2800_Part-1_2900_.aspx

# April 11, 2007 1:31 AM

Aleksey Fomichenko said:

Great article! This really helps.

What I used to do before reading this post is:

var self = this;

CallWebServiceMethod(function(results) { self.OnComplete(results); });

# April 11, 2007 2:51 AM

Muhammad Mosa said:

Well, I built an AJAX Control, it is a simple Custom ComboBox. if acctually uses javascript extensions provided by ASP.NET AJAX Framwork to show and hide and select items from a simle list control "<select>". this control is working fine with UpdatePanel as it rais post back and also . I tried to use it withing Telerik Ajax Panel, and with Telerik Ajax Manager. I'me not sure if you used them before. With Telerik Ajax Manager displays a Javascript error and with Ajax Panel it is not updating panel content as well as stops to response to javascript events e.g, click on text box to show the list box etc...

Do you have any idea about that!?

# April 11, 2007 11:40 AM

Bertrand Le Roy said:

Muhammad: you'll have to ask Telerik...

# April 11, 2007 11:50 AM

Sean Kinsey said:

This is also usefull when calling webservices with a callback handler. By using a delegate the callback will be executed in the same context as the function calling the webservice, something that is extremely usefull when calling webservices from within custom objects.

# April 11, 2007 12:36 PM

Mike said:

Hey it's really great!!

Is it possible to scan only a certain folder? Because right now it scans everything in my website ehhe

# April 12, 2007 3:38 PM

Bertrand Le Roy said:

Mike: just put the handler in the folder you want to scan.

# April 12, 2007 3:51 PM

dcstarr said:

guitar hero 2 for xbox 360 OWNS

# April 13, 2007 5:32 PM

Neeraj said:

I am not able to use this code please help

# April 16, 2007 1:46 AM

Bertrand Le Roy said:

Neeraj: you're going to have to give more details. First check that the web site you're trying to use it on has ASP.NET 2.0.

# April 16, 2007 12:27 PM

Valentin said:

Hey Bertrand,

I was able to generate the XML file comments out of my ASP.NET Ajax classes using the MS Ajax 1.0.

But now I'm not able to find a tool that can generate a help file out of the xml file. All the tools like NDoc, Sandcastle and XDocument requires the DLL to be present with the xml file (which ofcourse is not possible because the XML is generated out of the JS files).

Do you have any idea how to proceed with this problem.

Thanks in advance!

# April 20, 2007 3:41 AM

adam said:

wow this screw driver trick really works

i now have a new (chrome) face plate thx heaps

# April 23, 2007 8:34 PM

Bertrand Le Roy said:

Valentin: I have a tool ready for SandCastle. I'm fixing the last details with the SandCastle team and will be publishing it very shortly.

# April 23, 2007 8:55 PM

Wallym said:

Awesome, thanks Bertrand.

# April 23, 2007 10:25 PM

Anand Raman said:

# April 24, 2007 12:59 AM

Darren Kopp said:

For those of us who can't find it at all... you most likely have to go to control panel > programs and features then on the left side select "Turn Windows Features On or Off".

Then, when the list loads, click the checkbox that has "Tablet PC Optional Components" and that will install the snip tool.

If you still can't get it, then you don't have home, home premium, business, or ultimate version of vista.

# April 24, 2007 2:31 PM

Philip Colmer said:

I can't get the instructions to snip a menu to work. I press CTRL+PrtSc and the snip window opens but it isn't clear what to do next in order to get the menu to be captured - it has disappeared!

# April 25, 2007 8:34 AM

Emad Ibrahim said:

That's a nice feature and free.  If you want a more powerful screen capturing, use OneNote.  Check out http://emad.blogstogo.com/2007/04/25/blogging-and-screen-clippings/

# April 25, 2007 9:21 AM

dmurillo said:

You can also try this for really nice Aero Glass on your screenshots!

http://www.windowclippings.com/

Kenny has done a nice job

dm

# April 25, 2007 11:21 AM

Leo said:

When I use this fix, I get 'Sys' is undefined & also 'Type' is undefined when I run the app with debug="false". Using debug="true" works with no problem.

I am using the latest Ajax release 1.0.

Any suggestions?

# April 25, 2007 11:45 AM

Bertrand Le Roy said:

Leo: you probably introduced a syntax error when you patched the file. Please double check your patched file. You can also look at all error messages, you probably have a syntax error message before the undefined message. That will give you the line number of the syntax error.

# April 25, 2007 1:06 PM

Fabio Serra said:

Why don't use jsdoc?

(http://jsdoc.sourceforge.net/)

It is more compact and it is used by a lot of Javascript library like Yhaoo UI (http://developer.yahoo.com/yui/) or in the Firefox javascript source code.

Today, the most popular Javascript IDE as JSEclipse and Aptana provide intellisense using jsdoc and the inline comments syntax.

# April 25, 2007 1:20 PM

Bertrand Le Roy said:

Fabio: for several reasons. First, JSDoc comments are not accessible at runtime. Second, they're missing many features that we need. And most of all, xml doc comments exist in .NET since its inception. .NET developers are very much used to them and how they work. There are also many, many tools that already work with xml doc comments (more about this in future posts) and that will work unmodified with this convention.

# April 25, 2007 1:31 PM

Josh Stodola said:

Just break the damn keyboard on your desk like I do.

# April 25, 2007 3:43 PM

Rick Strahl said:

That's better than Ctrl-PrtScn but it's no SnagIt <s>... Particularily what's really missing is the ability to select child windows inside of a larger window...

If you use SnagIt and Live Writer together I wrote a SnagIt screen capture plug in that make the process fully automatic (ie. no dumping to file and then manually importing the image into Writer). http://www.west-wind.com/tools/snagitlivewriterplugin.asp

# April 25, 2007 7:18 PM

Bertrand Le Roy said:

Sure, Rick, absolutely. I knew you were going to say that :)

Feel free to post a link to SnagIt and your Live Writer plug-in.

# April 25, 2007 7:23 PM

David Jourand said:

Congratulations ! Even if I can't see the video on my Linux desktop...

See you soon in Paris ?

# April 26, 2007 2:49 AM

pluginbaby said:

This is so funny for the book !!

Also noticed that you are mentionned in that great article from the MSDN magazine may issue : "Create Advanced Web Applications With Object-Oriented Techniques".

http://msdn.microsoft.com/msdnmag/issues/07/05/JavaScript/default.aspx

# April 26, 2007 10:27 AM

Chris said:

Frenchy Power!

I really like ASP.net Ajax. it really rocks, and is very easy to start with.

# April 26, 2007 4:57 PM

Tim said:

I can't get the menu capturing to work either.  I follow the directions but no option to see the captured menu in  the edit view. Any Help?

# April 27, 2007 1:50 PM

Bertrand Le Roy said:

mmh. Actually no, I can't get it to work either.

# April 27, 2007 1:56 PM

Nathan said:

Did the orcas release fix it?  Have the 'ajax bits' been released yet?

http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx

# April 27, 2007 11:53 PM

Bertrand Le Roy said:

Yes.

# April 28, 2007 12:13 AM

Nis Wilson Nissen said:

Come on :)

Don't insult your own and your readers intelligence by posting stuff like this.

I gather that you were asked to do this to help your company in trash talking a competitor. A very questionable PR strategy that your company successfully deploys.

Lots of animals are killed every minute of support human life. These animals are killed in any number of ways. I am not saying it is OK, but most of us (non-vegetarians) supports an industry, who's not exactly famous for protecting animal rights, every time we shop at the supermarket.

And from the "I don't understand"-department, why do Americans keep electing presidents that destabilize poor parts of the world? Perhaps there more valid issues to report on?

Anyway, keep up the otherwise excellent work!

Cheers,

Nis

# April 29, 2007 6:24 AM

Aaron said:

The comments are the kicker, No one seems to care, or think its a big deal.

# April 29, 2007 11:24 AM

f3arthis00 said:

that was freaking morbid. whoever does it i am sending my jedi knights to do what what he did. remember people isaac newton law ' action - reaction '

jedi knight go and take care of all of them. thats your order jedi's  seacrh and destroy mission. sam tactics then areb 51 the bsatards. use my new waeapon if you want. its called photonic thruster. go guys have fun remember we are immortals andn they are not. LOL because we are sons of gods.

# April 29, 2007 6:48 PM

Daily_Mail_Is_For_Your_Boring_Uncle said:

Fact: 99% of people who would play God of War thought that looked like a cool party. Excellent PR.

# April 29, 2007 7:32 PM

Bertrand Le Roy said:

4th commenter: I guess I'm in the 1% who *would* play God of War II and still think this was sick and undecypherable PR.

f3arthis00: I have no idea what you're talking about :)

Aaron: sure, it's probably not a big deal, but I still don't get it.

Nis: where to begin? First, I'll tell you what's insulting: you insinuating that anybody tells me what to write in my blog. I don't even work in the Xbox division. Plus, I'm not "trash talking" anyone. I've heard quite some trash talking in my life. This is not it. By a very, very large margin.

A few things you should know about me before you make baseless assumptions.

* I'm not currently a vegetarian. I've been one between 0 and 25, but not for ideological reasons. I now eat my meat rare and I know very well what's going on in slaughterhouses but I still wouldn't organize a party in one.

* I'm not even american. It so happens that we would possibly share a lot of idea on American foreign policy. Talk about off-topic. But if I follow your reasoning, should we stop talking about anything else because it's a more important topic?

* I choose the subjects of my blog posts (nobody, at Microsoft or elsewhere, tells me what to write or not to write). Did I say that already?

* There are quite a few things I like about Sony's products and I even think some of their business strategy is pretty smart (which is an opinion you won't find in a lot of places lately) and I've talked about it on this blog before. Their PR? Really don't get any of it: the commercials are *sometimes* kinda cool, but most of the times I just don't see how they are PS3 related.

But, hey, thanks for reading me.

# April 30, 2007 1:55 AM

Electronic Screw said:

Bertrand Le Roy: First, I'll tell you what's insulting: you insinuating that anybody tells me what to write in my blog.

I aint bothered on what or what not you write in your blog. Atleast should have not popped up on the MS Communities bar of ASP.NET

Thanks

# April 30, 2007 3:55 AM

Bertrand Le Roy said:

Electronic screw: I'm not responsible for who chooses to include my RSS feeds into theirs. I've already asked several times to Telligent (who manage the ASP.NET site) that they subscribe to the right feed for the posts that are relevant to ASP.NET, i.e. http://weblogs.asp.net/bleroy/rss.aspx?Tags=ASP.NET&AndTags=1 but apparently they still haven't made the change. I apologize for the inconvenience and will ask (again) that this is fixed.

Thanks for reporting this.

# April 30, 2007 4:21 AM

Jeremy said:

Here's what bothers me...Nobody has pointed out the cutie wearing a painted on bikini top that proudly shows off her goodies.  Animal rights or not, you all missed the bigger picture.

# April 30, 2007 9:28 AM

Bill Ramirez said:

They should've used gringo soldiers killing Iraki children to keep up with the depraved barbaric environment.

# April 30, 2007 10:01 AM

lordabdul said:

Oh my God, the french accent, please, no moooore!!!

Bon, la prochaine fois que je te croise, va falloir que je demande encore un autre autographe alors.

# April 30, 2007 11:05 AM

Ollie said:

I have programmed in PHP and currently program in ASP.NET.  The way I see it is that if you are using SQL Server as your database then ASP is the way to go and if you are using MySQL or Oracle then PHP is a better solution.  I have found that using ASP.NET was designed with SQL Server in mind and often I will run into problems using Oracle with ASP.NET.  ASP has lots of pre-made objects that are quick to implement as long as you want exactly what is on the one example on Microsoft's website. With PHP you are writing all the objects yourself from scratch and can take more time to write, but you are in total control of the outcome.  PHP does not change radically every year so your code has a longer lifecycle.  My pereference is PHP, but it is not up to me so I program in ASP.NET.

# April 30, 2007 5:36 PM

Bertrand Le Roy said:

Well, not really, Oracle should work just fine. There are also providers for MySQL. You can also be in totoal control of the rendering in ASP.NET if that's what you want (the PHP model can more or less be compared to the Render phase of ASP.NET).

I also think that your final statement is unfair as ASP.NET has not changed radically since its inception and has always been backwards compatible (it's even compatible with classic ASP). On the other hand, PHP5 has never been widely adopted because it's considered too big of a change from PHP4, leading its creators to continue to evolve both versions, and even worse, component and application vendors to maintain versions for both engines.

# April 30, 2007 6:18 PM

Daniel said:

I can get the album to work great if I put it in the root of my site, but if I put it in one directory then it loads all the links, but no thumbnails....

Any ideas?

Thanks in advance!

# May 2, 2007 5:37 PM

Bertrand Le Roy said:

Daniel, please file a bug on GotDotNet.

# May 3, 2007 1:32 AM

Pynner said:

Interesting ideas here. I always thought the "Machine World" and the "Real World" were two different places. I imagined the Matrix as a section of a huge network that was partitioned off to seperate the humans from the programs. The train station is the only link accross the partition. As for the "real world" I always thought was just that. The fact that Neo could control objects with his mind and see while he was blind I thought was the writers trying to open the audience's minds into metaphysical philosophies. And to alos point out that in a story where computer programs are Gods, even God can't know everything. Or perhaps God himself is watching over the whole war and is helping Neo resolve everything for the fate of Earth.

# May 4, 2007 1:07 PM

Bertrand Le Roy said:

Pynner: I don't know about that, I guess the authors are the only ones who really know what they had in mind, but I don't remember seeing any references to God. But the HD-DVDs are out at the end of the month. Perfect excuse to re-watch the trilogy.

# May 4, 2007 2:01 PM

Rick Strahl said:

Man tough crowd <s>...

# May 4, 2007 6:35 PM

Jeffrey Becker said:

may I suggest a paramSet / overload tag for methods?  I've often written functions (especially constructors) in js which do /very/ different things depending on not only the number but type and order of parameters which are passed into a function.  In these cases it's even MORE important to have good documentation because they're often implemented by looking at the arguments array rather than arguments declared in the function definition.  A Fabio Serra mentioned jsdoc, which I dont feel really gets the job done mostly because I cant readily declare how I've overloaded my functions.

# May 7, 2007 9:06 PM

Bertrand Le Roy said:

Jeffrey: that's an interesting suggestion that I'll relay over to the Visual Studio team for a future version. It's not a pattern we're pushing because just looking at the parameters collection is an expensive operation. We prefer to encourage optional parameters because they perform better and are a lot easier to implement. But I can see why people do overloads in JavaScript and I'll definitely relay the suggestion.

# May 7, 2007 9:17 PM

Henry Cordes said:

This only works for <compilation debug="true" /> in web.config.

If I try debug="false" I get the following error:

'Sys' is undefined, 'Type' is undefined.

Can you give me any help?

# May 9, 2007 2:24 AM

Bertrand Le Roy said:

Henry: that indicates a syntax error probably happened before. You probably made a mistake when you patched the release version of the file.

# May 9, 2007 12:54 PM

Sebastian said:

I can't seem to avoid this behaviour by using:

protected void btn_Submit_Click(object sender, EventArgs e)

   {

       Session["Branchevereniging"]    = ddl_Branche.Text;

       //SNIP

       Response.Redirect("Offerte.aspx", false);

   }

I'm fairly new to (asp).NET so that might have something to do with it, anyway I could solve this?

# May 10, 2007 11:17 AM

dom said:

How do u take current faceplates off....and put new ones on???????

# May 10, 2007 12:31 PM

Bertrand Le Roy said:

Dom: please read through the previous comments, your answer is there.

# May 10, 2007 1:48 PM

Bertrand Le Roy said:

Sebastian: I wasn't able to reproduce a problem with that code. Feel free to send me your repro.

# May 10, 2007 7:06 PM

Speednet said:

In VB.NET and C# I commonly use the <remarks /> comment tag to document some other development notes about the method/property that do not fit into the <summary /> or other tags, and which I would consider to be "sub-comments".

So, I have two requests:

1. Can you please formally add support for the <remarks /> comment tag in JS?

2. I wish there was a small "more" link at the bottom of intellisense prompts, which would give the developer real-time access to the <remarks /> info.

Thanks,

Todd

# May 11, 2007 11:00 AM

Bertrand Le Roy said:

Speednet: not for the moment but I'll keep that in mind. If you include those tags today, the worst that can happen is that they will get ignored by the tools. Thanks for the suggestion.

# May 11, 2007 2:35 PM

Daniel Booth said:

Daniel, I had the same trouble getting the album to work on a directory other than root as well, but I was able to figure out what was causing the problem. Though it has been a few weeks I believe you can solve it by specifying the HandlerUrl on the control. I am pretty sure that is what I found. I don't know that it is really a bug, but it should be noted in the instructions at least. The best structure I've found is to have a Subfolder as the root of your photoalbum. Put the ashx & the display page (aspx) in this folder, and create subfolders under that for each of your "albums".
# May 16, 2007 2:13 PM

Daniel Booth said:

I love this album control. It allows me to just let my wife drop pictures out on our site, without having to change any code (good for me). My goals, as I find time, are 3 fold. 1: figure out how to change the styles to suite my site. 2: Keep the thumbnail creation and thumbnail views, but change the preview behavior to use Lightbox 2 (link below if you are interested). 3: Add comments to the pictures IF they exist. thinking of using the windows comments if I can figure out how, otherwise I may use an XML file with key pairs. Basically, just a simple way for my wife to put up comments for pictures she drops on the server. http://www.huddletogether.com/projects/lightbox2/ Anyone who has already done any of these three things please let me know. danieljb@hotmail.(dontspamme).com
# May 16, 2007 2:23 PM

Atlas and more said:

When building Ajax applications, you basically deal with two kinds of events. First, there are DOM events

# May 16, 2007 8:20 PM

Atlas and more said:

... for anything else than aiming and frantically moving up and down. In other words, slow movements

# May 17, 2007 3:00 AM

megaxl said:

well you know that when you have a problem, have solutions too, is only time to fix accuracy or detections problems, give some time to the wii, only have 6 months, many titles out in the launch, and tiger woods are the first in the wii.
# May 17, 2007 7:31 AM

Ron said:

Bertrand, How is the event subscription model implemented internally? Is it done using closures? Thanks.
# May 17, 2007 9:59 AM

Ryan Williams said:

I didn't realize that you can use a pageLoad() and pageUnload() handler that is automatically called by the framework. Neat.
# May 17, 2007 8:33 PM

Bertrand Le Roy said:

Ron: not sure what you mean. Can you be more specific?

# May 18, 2007 12:45 AM

Pete said:

Where to get this now as i cant find it on the got dot net site ?
# May 18, 2007 11:20 AM

Bertrand Le Roy said:

On GotDotNet, but the project has been obsoleted now that ASP.NET Futures have a similar, but much more complete feature.

# May 18, 2007 2:08 PM

Collin Yeadon said:

Kevin R Hurst:  You've probably solved your problem between June '06 and May '07 but since I stumbled upon this page just now...

The script is very simple, the only way it wouldn't work is if you give it the wrong coordinates.  If you use javascript to grab the values from a menu for instance make sure that you are getting the absolute top and left and not just the coordinates within whatever parent container it's in.  It really does nothing but toggle so you can have it in the hide and show script of the menu and it would work fine..  Again, that is just an ugly solution as a last resort and of course it can be improved upon in many ways but why bother?  IE6 will be gone within the next couple years..

# May 21, 2007 7:33 PM

DEEPAK GUPTA said:

NICE ONE ITS HELPS ME AND MY PROBLEM IS RESOLVED BUT AFTER INCLUDING JS FILE, I START GETTING AN ERROR -- 'SYS IS UNDEFINED'
# May 22, 2007 5:58 AM

Bertrand Le Roy said:

Deepak: no need to shout. That indicates a syntax error. You probably made a mistake when you patched the file.

# May 22, 2007 1:50 PM

ScottGu's Blog said:

One of the things I'm going to try and start doing is to do a weekly post of useful links on .NET related

# May 22, 2007 2:20 PM

BusinessRx Reading List said:

One of the things I'm going to try and start doing is a weekly blog post of useful/interesting links

# May 22, 2007 2:51 PM

ASP.NET said:

One of the things I'm going to try and start doing is a weekly blog post of useful/interesting links

# May 22, 2007 3:04 PM

Jesse said:

This is great stuff! Keep it coming! I was wondering if I could use this with an end handler to change the size of divs on a page after the event fired. I am having some issues in firefox with sizing divs with all this dynamic changing going on. If you have an example of this I would really appreciate it! I have been trying to get it to work but with no success thus far
# May 22, 2007 6:03 PM

Atlas and more said:

In part 1 , I showed how to subscribe to events exposed by JavaScript classes built on Microsoft Ajax

# May 22, 2007 9:11 PM

May 22nd Links: ASP.NET, Visual Studio, Silverlight, WPF and .NET « Gurusoft said:

Pingback from  May 22nd Links: ASP.NET, Visual Studio, Silverlight, WPF and .NET  &laquo; Gurusoft

# May 22, 2007 10:01 PM

Links 22 de Mayo: ASP.NET, Visual Studio, Silverlight, WPF y .NET « Thinking in .NET said:

Pingback from  Links 22 de Mayo: ASP.NET, Visual Studio, Silverlight, WPF y .NET &laquo; Thinking in .NET

# May 23, 2007 5:29 AM

Josh said:

I think the Wii is a piece of garbage.
# May 23, 2007 5:07 PM

dcstarr said:

Where i live its really hot (80-90 degrees) and my xbox has been overheating every time i play it (2 side lights on xbox flash). What shud i do; i already tried moving it and putting a fan next to it. WHAT SHUD I DO? HELP!!!!!!! ps: I live in CALIFORINA where its blazing hot.
# May 23, 2007 11:27 PM

Vincent said:

Hey, this is a great control! I have a question though: I have a subdirectory 'photos', it contains the ashx and aspx files as well as the directories containing the photos I'd like to display on my site. On my localhost everything works perfectly, but after I uploaded everything to my webspace (after compiling of course) I can see only the links, no thumbnails or pictures (only those little red crosses). When I try to visit a permanent link to one of the albums I get a Server Error ("invalid path - not in the handler scope"). Any ideas on how to fix this? Thanks in advance!
# May 24, 2007 10:03 AM

Vincent said:

Found the solution: the disk caching was the problem (I didn't have writing rights).
# May 24, 2007 10:40 AM

Bertrand Le Roy said:

dcstarr: call support (1-800-4MY-XBOX) or go to www.xbox.com/.../support

# May 24, 2007 1:31 PM

GoonDocks said:

I have over 10 years of web programming experience and have built nearly 100 web sites on multiple platforms. I started with shell CGI scripts, then went to Perl, then to ASP, then to PHP, then back to Perl, then to Java, and now to C#/ASP.NET. I learned "the hard way" and I'm glad I did. I handled my own HTML, form validation, user state saving, template systems, code separation, etc, etc. I also had to manage some of these projects as they grew from something small to something really big. I have also inherited many projects. ASP.NET was hard for me to learn because I was used to doing everything manually. Concepts like events, application life cycles, or server-side form objects were foreign to me. However, I now have 3 years of solid ASP.NET experience under my belt and have launched and maintained some huge projects. Once upon a time I loved PHP. I honestly cannot imagine going back though. It looks terribly hacky by comparison. I cannot imagine anyone using PHP for a "new" large scale web application. Period. For small web sites or for learning the ropes PHP has something to offer. PHP is great for writing little "web scripts". When you are ready to develop web applications however, there are better solutions, methods and concepts available. I truly enjoyed the article and also appreciate the debate on the subject.
# May 24, 2007 3:54 PM

Rexiology@MSDN said:

As I mentioned in my post couple days ago that I am doing some web application performance evaluation

# May 25, 2007 7:55 AM

Rexiology::Work said:

crosspost from http://blogs.msdn.com/rextang As I mentioned in my post couple days ago that I am doing

# May 25, 2007 7:57 AM

Dodger_ said:

Actually, the Wiimote's accelerometers are *extremely* sensitive. Just because you have played two third-party, rushed-to-market golf games does not mean it is the controller's or even the console's fault. The publishers wanted to get their games out for the console to sell more copies, the Wiimote is an entirely new device and requires new skill sets to develop for. Wait for the developer's understanding to mature, pick up Tiger Woods 2009 and it will be a completely different experience.
# May 29, 2007 10:41 AM

Martin Smith said:

1 legitimate use I believe would be for custom validator client functions.

I've just written one that checks if an email address for a new user is already in use and disallows form submission if it is.

The problem I had is that args.IsValid needs to be set in the validator js function meaning that it needed to be synchronous.

# May 29, 2007 12:14 PM

Bertrand Le Roy said:

Martin: how does that make it legitimate to block the whole browser UI? Just disable the relevant part of the UI during the callback, make isvalid false, and when the callback returns, re-enable the UI, then set isvalid to true if that's what the callback returned, and call ValidatorUpdateIsValid.

# May 29, 2007 2:39 PM

Martin Smith said:

But that doesn't work as they will never be able to submit the form!

The onsubmit will call the validator function and if args.IsValid is set to false it won't hang around waiting for the asynch function to complete it will cancel form submission.

# May 30, 2007 5:26 AM

Bertrand Le Roy said:

Martin: I'll try to put something together and make a blog post with it. Thanks.

# May 30, 2007 1:00 PM

Marc Mezzacca said:

Thanks for this patch Bertrand. Is Microsoft going to include this in future releases (hopefully???). A couple notes that were confusing to me: 1) Some people getting the 'Sys' error may point pointing the entire script manager to the directory. They shouldn't... The exact code should look similiar to: 2) For ASP.NET AJAS Toolkit users, they must use this patch and the one for the ASP.NET AJAX Toolkit
# May 30, 2007 3:42 PM

Bertrand Le Roy said:

Marc: the fix is already in the Orcas Beta and will ship with all future versions.

# May 30, 2007 3:55 PM

tongdoudpj said:

One of the things I'm going to try and start doing is a weekly blog post of useful/interesting links on .NET related topics that I've found on the web.

# May 30, 2007 9:59 PM

Yendi said:

Bertrand, First of all, thank you for this article. I'm getting also Sys and Type undefined. I've rechecked my patch and it's fine. I've already patched the AJAX Toolkit also. Could you please look at: www.nortia.com.mx and tell me if you see the error. Any help would be appreciated. THANKS!!
# May 31, 2007 12:44 PM

Yendi said:

Oh, something I forgot.. My locale is ES-MX. Perhaps this is where I'm missing something??

# May 31, 2007 12:48 PM

Bertrand Le Roy said:

Yendi: there doesn't seem to be a site there. Can you check the spelling of the url?

# May 31, 2007 12:52 PM

Jeremy said:

I am so with you on this. My iPaq 1930h is not supported even within Windows XP with Media Player 11. We need to find a registry entry for this. Sheesh.
# May 31, 2007 1:07 PM

Yendi said:

# May 31, 2007 1:08 PM

Neil said:

thanks for the post - menu's now look great
# May 31, 2007 6:26 PM

Gann said:

Can you please tell me, i have put this changes in two files in my solution explorer at script manager i have to point this reference to the new file path, how can i give that, it is in my local, but iam deploying at the remote system.
# May 31, 2007 8:33 PM

Atanu said:

Bertrand, thanks for this patch. However you are not clear at one point in the posting above - which is why you are seeing folks leaving comments about getting these errors with debug="false": 'Sys' is undefined, 'Type' is undefined Bertrand writes: Look for "switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:" and replace everything between that and "case Sys.Browser.Safari:" with the following: ... followed by code Unfortunately in that code he repeats this: switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer: whereas what he probably meant to say was: Look for "switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:" and replace THAT AND EVERYTHING UPTO "case Sys.Browser.Safari:" In case it isn't obvious, you need to ensure that switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer: is not repeated again - which is what will happen if you follow his directions to the letter. In that case, you will get these errors with debug="false": 'Sys' is undefined, 'Type' is undefined
# May 31, 2007 10:30 PM

Kevin Daly said:

I have the same problem with my Harrier - as far as I'm concerned this is frankly incompetent software design, since WMP11 should either fail silently and pretend the device isn't there, or the prompt should be something that can be disabled as a configuration option. It is *common* not to be able to upgrade the version of Media Player on devices, so having this permanent nag is just stupid and pointlessly annoying.
# June 1, 2007 5:03 AM

hnr said:

I left a comment here a few weeks ago, but it hasn't been activated yet, so I'll submit it again: I've a div with a semitransparent background, which has the width and the height of the browser window, so it's shown all over the website. Well, there are also a few select boxes. Without the iframe they show through the div, of course. Now I've put a transparent iframe with the properties you recommended in your posting (alpha filter etc.) over the whole site. However, the select boxes don't show through the div any more - that's pretty good. But they aren't visible any more, more precisely: I can't see them among the semitransparent div. Hope you've got any advice, thanks
# June 1, 2007 12:10 PM

Bertrand Le Roy said:

hnr: I'm afraid this is the best you'll get. On the bright side, IE7 is here now and it's just a matter of time that this bug becomes just one of the great memories we'll keep from IE6...

# June 1, 2007 12:33 PM

Bertrand Le Roy said:

Yendi: thanks for the feedback, there's indeed a problem if you enable localization. See the updated known issues at the end of the post for a workaround.

Gann: I'm sorry, but could you please rephrase your question? I'm not sure I'm following you. Did you deploy the script files on the remote system?

Atanu: thanks for the detective work, I should have seen that one. I updated the post.

# June 1, 2007 12:53 PM

Faisal said:

Hi Bertrand, I have observed a piculiar thing. I did everything you said like copying the System.Web.Extensions folder found into my js folder and then pointing ScriptPath to that folder as inside the .aspx page EXCEPT doing the patch. And I found the error "access is denied" is gone without using the patch! However, there appeared two new erros as Line: 116, Error: 'Sys' is undefined and Line: 211, Error: 'Sys' is undefined Fact is if I implement the patch as you said, the situation remains same. Please help.
# June 4, 2007 3:36 AM

David Miranda said:

Hello, I have sometrouble patching the files. i added the external script files downloaded here in the same foldder of my project, i point ScriptPath of the ScriptManager to "~/scripts/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js", i patched the files as you explained and i get 2 errors of sys is undefined. I restore the original files downloaded and i get the same error. In my config the debug is set to false. Any ideas?
# June 4, 2007 11:23 AM

David Miranda said:

never mind i've found my error, thanks it works great.
# June 4, 2007 12:23 PM

Bertrand Le Roy said:

Faisal, you're not getting the access denied error because it fails before it even reaches it. The error you're getting is probably caused by a syntax error introduced by your incorrectly patching the file. Please double-check.

# June 4, 2007 1:30 PM

Joel Rumerman said:

Hey Bertrand, Hope all is well. I've used this technique before for web services as Sean mentioned above and for attaching events to external objects (i.e. the page request manager). Thx for confirming that this was the correct way to maintain context with the current object. What else can this technique do for us (the advanced topics you hinted at)? I'd love a follow up post on this topic. Thx, Joel
# June 4, 2007 5:22 PM

Josh Stodola said:

I freaking hate Vista. What a disaster. Do you know how hard it is to buy a new PC without Vista (aside from building the entire machine yourslef)?!
# June 5, 2007 12:52 PM

Bertrand Le Roy said:

Josh: well, I absolutely love Vista and would never go back to XP, which is why this is so annoying to me. And I don't see it as that different from XP (if you ask me it's a little too evolutionary to my taste and not revolutionary enough), so I have difficulty seeing what would justify "hate" that wouldn't equally apply to XP.

# June 5, 2007 1:48 PM

SK said:

Hi David, " Hello, I have sometrouble patching the files. i added the external script files downloaded here in the same foldder of my project, i point ScriptPath of the ScriptManager to "~/scripts/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js", i patched the files as you explained and i get 2 errors of sys is undefined. I restore the original files downloaded and i get the same error. In my config the debug is set to false. Any ideas? " i am alos getting same errors. Could you let me know where to fix? Thanks.
# June 5, 2007 2:23 PM

Bertrand Le Roy said:

SK: double-check that you properly patched the files, look at the source code of the page from the browser, check the url of the script tag points to the place where the script files are located.

# June 5, 2007 2:46 PM

SK said:

I made it work by copying all ajaxtoolkit control js files to the same path of script files and renaming them "AjaxControlToolkit.Common.xxxx". This is not elegant but it worked.
# June 5, 2007 3:24 PM

InfinitiesLoop said:

"Google broke teh Interwebs!!!" Best quote evar
# June 6, 2007 5:19 AM

Nic said:

I'm not awesome enough to convert this to VB. Is there potential for that?
# June 6, 2007 4:39 PM

timmEH said:

Does anyone know how to achieve a similar result, without absolute positioning? I've got exactly the same problem, but using flow-layout. Suggestions? Cheers, tIMaJEHRHghml
# June 7, 2007 2:17 AM

sudhir said:

hello Mr. Bertrand Le Roy I had faced the problem, in which the menu-bar-list(writen in java script) items, were displayed behind the dropdownlist(asp.net). I had used iframe as an list element which solved my UI problem. thaks, your idea is realy amazing
# June 7, 2007 3:58 AM

Amit Solanki said:

I tried with iframe and div. But both dynamjcally by putting innerHtml. But in my case div object is hidden by iframe even if I set z-index of div more than iframe. I use IE 6. Is there any other solution?
# June 7, 2007 10:48 AM

Mike said:

I get on the web to search out ASP versus PHP. I am a small business owner and need to ensure a new contracted developer is not going to sail me down a golden fleece job highway to hell. I developed my own site using FrontPage as a handy tool. I knew nothing about development save my experiences as a browser. I don't like flash, I hate being told to upload crap to view a website, and I know many of my clients can't do so, because some guy in IT limits their ability to download any programs. - Sorry, I ranted a bit... I started with a 20 page site - no school, no training, just a XP with FrontPage and a desire to update a dinosaur launch years ago by a sloppy but expensive and slow developer. I then spun out a new division website with 40 pages, better graphics, more java script and more savvy. Now I'm redeveloping the original site and expanding to over 250 pages of content, I work almost exclusively in HTML Code and use free Java Scripts to emulate Flash crap, and have learned optimal optimization tricks by paying my dues, paying attention to those more learned, and in my free time I run a 8M Industrial Manufacturing Corporation. Now, I'm sick of the bugs in FrontPage forms. I can't keep them on-line (they just go south now and then for no reason) (save MS profit margins and apathy?) and as a business owner I need results, not problems. So a seemingly qualified developer I've screened says "lets move your forms over to ASP (yes, I'm hoping from what I've read so far, he means ASP.NET). But then, my ISP guy says "oh no, you'd be better off to use PHP". So here I am, trying to find out the key differences between the two. The advantages and disadvantages, nothing more or less. "Just the facts madam" as the guy on Dragnet used to say. But what can I say, all I get is a bunch of politically motivated, selfish and trivial crap, very little serious knowledge, and while it's 10:53 PM, I've got to be up at 5:00 AM to run my business. No wonder I don't usually take bogs seriously. They are full of comments from lonely desperate people with no real life, sense of duty or purpose, who just like to rant on and on and on and on, like the bunny on TV. Frustrated…
# June 8, 2007 12:16 AM

Bertrand Le Roy said:

TimmEH: it's the iFrame that must be absolutely positioned to be at the same place as the div, but there's no constraint on the positioning of the div itself.

Amit: creating the elements dynamically doesn't make a difference. That's what we're doing in several of our controls. There must be something else that's different from the code presented here.

# June 8, 2007 12:29 AM

Bertrand Le Roy said:

Mike: I understand your frustration. Here's what I would advise. If you're not the one who's going to develop and maintain the scripts, try to choose people over technology. Find people you trust and let them use whatever they prefer. On the other hand if you're the one doing the work, you should make your own opinion by installing the technologies you're considering and try them out on simple things. The quality of the documentation and support should be one of your top criteria.

# June 8, 2007 12:37 AM

Calios said:

Nice work :) One quick suggestion: You didnt make use of the -Orientation- EXIF info in order to rotate images automatically if needed. Most of the newer cameras have a sensor to check if the cam is held horizontally or not.
# June 8, 2007 8:26 PM

Bertrand Le Roy said:

Calios: thanks for the suggestion, that's a really good point.

# June 8, 2007 9:31 PM

Calios said:

Found a little bug/annoyance - im posting it here since gotdotnet will phase out in a few days(19th of June 2k7). in CreateFolderImage you didnt fill in the BackGround - thus using any other background than black will look wierd :-O I added this to fix it: g.FillRectangle(new SolidBrush(BackGround), 0, 0, size, size); Right after the stacked Graphcis has been declared (was line 477 of the .ashx file for me - v 2.1 of the handler) :-)
# June 8, 2007 9:33 PM

Bertrand Le Roy said:

Calios: thanks for the fix.

# June 8, 2007 9:41 PM

Judge said:

How about using this in Windows Home Server? Possible? How To? etc. Pretty Please? LOL Thanks.
# June 9, 2007 4:14 PM

Bertrand Le Roy said:

Judge: I've thought the exact same thing ever since I learned about Home Server. Unfortunately, I don't own one so I can't try it. However, from what I know I don't see what could prevent it from working. If anyone wants to try, I'd love to know how it goes...

# June 10, 2007 2:48 AM

TheOfficeMaven said:

Thanks to Andrew Grant (and of course Bertrand Le Roy and Dimitry Robsman as well) this actually works great with the Windows Home Server (WHS). Andrew has written a stellar add-in for WHS that allows you to easily make this album handler work with WHS. Here's a how-to write-up that Andrew did for us all: http://www.andrewgrant.org/2007/06/09/how-to-create-a-windows-home-server-photo-album-in-minutes.html And here's the link to his WHS add-in that makes it all possible: http://www.andrewgrant.org/whiist/ -- MIKE
# June 10, 2007 1:00 PM

Cyril DURAND said:

Hi João, the bug you speak about is also reported here : http://forums.asp.net/p/1020399/1747778.aspx#1747778 And I done a dirty fix here : http://blogs.codes-sources.com/cyril/archive/2007/06/10/bug-updatepanel-et-encoding-iso-non-utf-8.aspx
# June 10, 2007 4:45 PM

Atlas and more said:

I was super-excited to learn that Andrew Grant was able to run the Photo Handler unmodified on Windows

# June 11, 2007 2:08 AM

Bertrand Le Roy said:

Thanks Mike! This rocks!

# June 11, 2007 2:19 AM

drashty said:

i do have problem of loosing session but its not after or before redirecting.What i am doing is set sessions when any user logs in and after that in change password page i ask for username password,new password and confirm password and i have put client side validation of required field all fields and compare validator for new and confirm password after submitting form for the first time if a user with given username and password doesnt exist then if gives username or password is invalid but when u retype everything and submit i found that all sessions are cleared.What could be the possible reason.Help me.Can revert back on drashty2004@yahoo.com
# June 11, 2007 3:49 AM

Granville Barnett June 2007 said:

Pingback from  Granville Barnett June 2007

# June 11, 2007 6:01 AM

Henk said:

This album works really nice. I got it up and running (on WHS CTP) using Andrew Grants WHS AddIn in a matter of minutes. The only thing I would like to see added is a button to exit the album and return to the previous page. The "back" button from the browser works fine, however this will not be obvious for all users. THANKS!!
# June 11, 2007 7:37 PM

foobar said:

Safari 2 was a piece of junk.  I don't expect much better from Safari 3.

It took a herculean effort from the Mozilla group to release Firefox, and contrary to the anti-IE crowd it's still buggy as hell.

It will take an equally mighty effort from the WebKit to just stamp out the horrible bugs from their product.  I wonder if that OSS movement has it in them, or if they'll just get bored and do something else with their time.

# June 12, 2007 12:31 AM

Sebastian said:

One thing which was not mentioned exactly but what is quite logical from now on is that Safari 3 will be also available for Tiger. Even if not with all the eye candy included in the final Leopard.
# June 12, 2007 1:05 AM

Matt said:

> This way, you'll catch most Safari regressions

> earlier, and that's only goodness.

Totally agree with you there, it will be worth it in the long run.

# June 12, 2007 1:50 AM

Maciej Stachowiak said:

If you're seeing regressions in the beta, please report them, with test cases, to . Better now than when the final ships. We've done our best to fix the AJAX history bugs we knew about, if there are more we'd love to know.
# June 12, 2007 5:17 AM

Philip the Duck said:

You say "why can't they respect the conventions of the host OS?"... Have you tried asking MS's own Office 2007 team this?! I realise many new Windows GUI features debut in Office (from the original combobox in Word 2.0, which appeared *later* in Win3.0 to the cool new ribbon UI, which I'm sure will find its way into Windows soon), but simple things like colour scheme / theme should really take the OS conventions & user preferences into consideration, shouldn't they? If I came out with an application that didn't work or look like any other Windows app I'd be crucified for not following the Windows Style Guide, yet the Office 2007 team seems to have thrown the WSG out the window! Anyway, I agree that Safari for Windows has got to be a good thing. Good on them!
# June 12, 2007 6:09 AM

Guy Sherman said:

I'm quite glad its out on windows, now all the developers whose excuse for not testing their sites in safari was that they didn't have access to a mac can make their sites work (Which, by the way, is not hard)!
# June 12, 2007 6:34 AM

Scott Williams said:

I tried it on a .net app here and about half of the functionality was there. I the tried it on a classic app that one of my clients is still using and I couldn't even get passed the login screen. With a large base of people used to using IE, I don't see it getting widespread acceptance without some major changes.
# June 12, 2007 7:05 AM

Shaun Newman said:

quote: "oh man, yet another browser to test in", erm... any developer worth his salt and ready to build cross browser would have already included testing for all the major browsers including Safari surely? As it is a standards compliant browser (like Firefox for the main part) anyone developing to the standards would have won half the battle. It's IE that is the weak point in all this as it follows it's own damn standards :0)
# June 12, 2007 8:31 AM

Tim said:

This is a good thing ONLY if Safari for Mac vs Windows work the same way. What a nightmare if we have to test for Safari on Windows & Mac. From looking under the hood, Safari on Windows does identify itself differently then on a Mac which scares me to start.
# June 12, 2007 9:36 AM

Links: ASP.NET, Visual Studio, Silverlight, WPF y .NET « Alexander Jim??nez said:

Pingback from  Links: ASP.NET, Visual Studio, Silverlight, WPF y .NET &laquo; Alexander Jim??nez

# June 12, 2007 11:31 AM

Brennan Stehling said:

I tried out Safari on WinXP yesterday and while some of it may be faster I did not like that it did not mix in well with the native Windows applications. It seems contrary to the Apple mindset. They should produce an interface which is consistent with the platform. Every application that goes to MacOS X is encouraged to follow their UI guidelines. They should at least do the same with Safari on Windows. I realize Quicktime and iTunes also have the unusual brushed metal look along with other inconsistent look and feel differences but I think people treat media players as the kinds of applications that can break out of the normal constraints. Beyond that I find the brushed metal interfaces to be sluggish. I also do not like having to resize the window with only the do-hicky lower right side. Regular windows apps let me adjust the window from any side but that is not true with Safari. I hope they make it conform more to the WinXP and Vista experience. Things feel better when they are consistent.
# June 12, 2007 1:03 PM

IceMan said:

It's a "could-not-care-less"-thing. Safari will not have a marketshare over 2% on Windows.
# June 12, 2007 1:22 PM

Bertrand Le Roy said:

Maciej: thanks for the response. As I've said in the post, I did already report any bug I found. I know what it's like to ship software and hope I'm not being too harsh. I'd love to hear how you see history management in the new version. It certainly wasn't obvious from my initial experimentation yesterday and I'm glad to read you have a story, I would just love to know it. Feel free to drop me e-mail through the contact form of this blog.

Philip the duck: No I haven't. I thought that the Mac Office integration was pretty good but apparently I'm wrong. If it's that bad, I won't defend it but that doesn't make the Safari integration good.

Shaun: first, Safari 3 on Windows is a different browser, and one more that you'll have to test on. It's a different platform and it's a different version number. It's also very, very different from Safari 2. Mostly for good, but definitely different. You *will* have to test on both, so that's one more.

Second, the view that writing to the standards gets you halfway there is in my opinion very naive because this "second half" is by far the most complex and difficult. And it's the one that will break with a new browser and that will require additional testing. So short term, new browser => more work. But it's ok, that's part of the job and as I thought was clear from the post, I really think long term it's a good thing.

Third, I'm not defending IE. I do report bugs to them too.

Tim: so far so good in our own short experience. They seem to be very consistent. Safari 3 for Windows actually identified in our browser API as Safari with version 522 (IIRC) with no modification. It's actually a good thing that they would show the platform in the browser string if you *need* to differentiate them. You will have to do some testing on the Mac still, but as a less frequent routine which will probably very rarely report problems.

# June 12, 2007 2:29 PM

Steve said:

It's a great thing.

I think MS should get out of the browser business, they murk it up too much

# June 12, 2007 8:08 PM

Haywire said:

This thing is outstanding. I love it. Now, having said that, I am having one small issue. I have a folder called Pictures where the web files reside. I have dirs 2002, 2003, 2004, and in those dirs 01, 02, 03. I can get into the year folder to see my months folder, but when I click on the link for the month folder nothing happens. What is the level of folders this can handle. Root + 1? Root + inf?
# June 12, 2007 8:40 PM

Bertrand Le Roy said:

There shouldn't be a limit on the folder depth. Can you package a repro into a small zip file and send it to me at bleroy at microsoft dot com?

# June 12, 2007 9:09 PM

Kearns said:

Somehow it just won't install on my XP upgraded to Vista Professional machine. Complains something related to VBScripting based on the error it gets
# June 12, 2007 10:24 PM

Bertrand Le Roy said:

Kearns: you should report it to Apple. Bugs can be filed at http://www.webkit.org.

# June 13, 2007 12:08 AM

Lionel Richie said:

It does annoy me a little that Apple decided to use Aqua-style UI widgets, but I suppose the benefit is consistency between OSes -not just in the appearance of the application, but also in the appearance of sites the application displays. A large percentage of the site rendering errors I see when using my Mac are due to a windows-based developer having no idea how buttons, drop down lists etc work on other OSes.
# June 13, 2007 2:22 AM

Mark Perrin said:

I thing this is terrible news, I use OSX Tiger and to be honest i went with OSX because it just works better for me. I do not understand why apple is even bothering porting safari to windows, they should leave it with OSX. If a windows user wants safari, buy a mac you cheapo. I believe that the windows version should be a lower spec than the OSX version and the same with Itunes otherwise whats the point. Apple should make their own versions for their platform and customers the better version. Windows is crap. full stop! Id rather the Apple developers dedicate their time to Apple, why bother with Microsh1t.
# June 13, 2007 4:38 AM

Mac User said:

Bad Bad Bad !! Aple should stop wasting their time with windows. They should use their installed base with the ipod to force people onto osx. Leave itunes where it is on windows and only move it forward on the mac. It will still work just not as well as on the mac, thats the way it should be, isnt this obvious (its an Aplle product, it should work best on Apple hardware). Safari is just another case of Apple giving up one of its assets, however small. Whats next? iLife?
# June 13, 2007 4:41 AM

Infinities Loop said:

I've seen this problem a few times now, from a few different developers... including myself. I figure
# June 13, 2007 5:26 AM

Paul said:

Also it is not just Vista. It is specifically Media Player 11 and above. I have this loaded in XP Pro SP2 and get the exact same thing with my iPAQ H5450. The only hope would be to upgrade to the latest version of mobile windows but that is not supported on this version of the ipaq
# June 13, 2007 10:12 AM

Bertrand Le Roy said:

Mark and Mac User: way to go, guys, let's "force people onto osx", even if they don't want to. You're showing a superb example of "thinking different". Congratulations.

# June 13, 2007 11:17 AM

InfinitiesLoop said:

Mac: Hi I'm a Mac.
PC: And I'm a PC.
Safari: *standing in the middle* And I'm Safari.
PC: Thanks Mac for letting me borrow Safari.
Mac: Oh no problem PC, I hope you like him!
Mac: *whispers to Safari* Remember, wait until he's asleep...
PC: I think we'll get along famously!

# June 13, 2007 2:31 PM

RichB said:

>total lack of error feedback Have you got the Safari Debug menu turned on? You can enable it on both the Mac and Windows versions (balk at the XML schema on Windows while you do it...). Alternatively, use Adobe AIR's webbrowser sample for some Firebug-esque debugging tools.
# June 13, 2007 3:17 PM

Bertrand Le Roy said:

Rich: I'd love to. I know how to enable it on the Mac but not on the PC. I was unable to find that info on Apple's web site. Can you explain, please?

# June 13, 2007 3:29 PM

M. Keith Warren said:

I totally agree, if you read the analysis from Paul Thurott on this you will see he thinks of things the same way, it is all about tapping into the market of developers who use windows.
# June 13, 2007 5:26 PM

Luis Abreu said:

Even though many are saying that it's fast, I'm saying that it sucks...i'm still waiting to see links rendered correctly (90% of the sites i tried opening on it just don't render correctly and i'm not talking about css positions and stuff like that; i'm talking about not seeing on the pages...)
# June 13, 2007 5:41 PM

Shawn Burke said:

Betrand, re the debug issue, see my blog, there's instructions there. http://blogs.msdn.com/sburke/archive/2007/06/11/apple-releases-safari-for-windows.aspx I'm fascinated by how much discussion this is generating. It's a browser, people. At the end of the day having it on Windows will only have the effect of helping web developers make sure their sites work on Safari so that Mac users have a browser out of the box that works more reliably either via fixing the sites or pushing fixes into the browser. That's fine with me.
# June 13, 2007 7:53 PM

Aaron said:

I agree.  Its all about the iPhone and the windows developers.

# June 13, 2007 8:05 PM

stefano said:

hi, thank you for your fix. I still have this problem. I have a datagrid with a template column with a small image within. When the user hover it a balloon appears (similar to that of google maps) displaying some data. Before your fix there was no way to show it within a iframe. Thanks to your fix now the balloon displays, but it seem that it ignores offset values, do you have any idea? Stefano
# June 14, 2007 8:55 AM

n4cer said:

I agree as well, but all Apple needed to keep the same for emulation is the rendering engine. They didn't need to bring the window chrome with it, or if they did, it should be embedded in a standard window. As it is currently, it destroys consistency with the basic windowing conventions and creates more interaction issues (e.g., multi-monitor/maximize bugs) for them as they try and make it mimic the behavior of standard Windows applications.
# June 14, 2007 10:03 AM

Luis Abreu said:

yeah, i too believe that is the case.
# June 14, 2007 1:29 PM

Bertrand Le Roy said:

No, offset values on what?

# June 14, 2007 1:38 PM

Patrick Long's Blog said:

First things first I am using a technique that I learnt from Bertrand Le Roy's blog. I take no credit
# June 14, 2007 3:34 PM

margiex said:

拷贝C:\ProgramFiles\MicrosoftASP.NET\ASP.NET2.0AJAXExtensions\v1.0.61025\目录下的MicrosoftAjaxLibrary...

# June 15, 2007 4:06 AM

Chase Saunders said:

This is exactly how we're using it. Since Safari has in the past required a subscription to Mac OS updates we literally had to borrow an up-to-date Mac at the end of projects for testing to avoid constantly buying OS upgrades. With Safari having been released for the PC we can now do proper browser testing, and I can't think of any other reason to use it.
# June 15, 2007 1:32 PM

Mac Rumors Kicks Around the Yellow Box « Quod Ero Spero said:

Pingback from  Mac Rumors Kicks Around the Yellow Box &laquo; Quod Ero Spero

# June 15, 2007 3:25 PM

herval said:

It HAS to be because of that. Safari is HORRIBLE even on the mac, I don't think windows users buy it's design...
# June 15, 2007 4:16 PM

Danno Ferrin said:

No conspiracy theory necessary. Safari is a derivitive of Konquerer, the KDE browser, which was coded in C, so it makes sense that the core areas are coded in C as well, only the widget linkages may require Obj-C, and since it is a windows binding only the widget portions would require heavy re-work.
# June 15, 2007 10:50 PM

Craig Francis said:

Sorry, but why can't they build a new UI? The one they have at the moment works fine, why start again, and make it look like a boring Windows app? Its not as if IE7, Office or Media Player etc are keeping a consistent look - they are all going for the custom UI. And for end users, this gives them another browser to choose from... which can only be a good thing... especially since FireFox market share has stopped growing so rapidly (which is a shame)... but Safari has another source of converts, the users of iTunes. If the market share for IE can drop below the 50% mark, then Microsoft might start doing some real work on that browser... which is basically still using the same engine as the 5 year old IE6!
# June 16, 2007 7:29 AM

stefano said:

Sorry, I missed to say the most important thing!! The balloon is actually a HoverMenuExtender, I was talkin about OffsetX and OffsetY properties of this extender. After your fix now the extender display, but it's centered above the control it extends and the offset values are ignored.
# June 16, 2007 6:38 PM

Russ said:

Bertrand, Kudos to you and all who contributed to this fine tool! Very easy to use and gives a great aesthetic look for a simple Photo Album. I do have a one question. I cant seem to get the stacked photos folder icon to work. I was hoping you could clarify "Stacked photos folder icons (uses default.jpg if it exists)".
# June 16, 2007 11:43 PM

DIego said:

Maybe it's the beginning of more Apple apps being ported to Windows. iLife? There may be a core in Safari which could be used by other applications.
# June 17, 2007 7:13 AM

bjm said:

I disagree. Safari, for one thing, renders text in a way that makes it much easier to read (for me). So I think I'm gonna start using it as soon as its final version is released. And, of course, from now on, my apps will support the Safari browser! MS guys better off think of supporting the "canvas" element in IE. (And, yeah, I do know that'll never happen :)
# June 17, 2007 7:26 AM

Bertrand Le Roy said:

Stefano: you should probably ask this question to the toolkit team.

# June 18, 2007 12:20 AM

Bertrand Le Roy said:

Russ: how exactly does it not work? What I meant was that if you have a photo named default.jpg, the handler will use it as the top of the stack. Other photos will be randomly selected. If you don't have a default.jpg, it takes a random photo for the top of the stack. Does that help?

# June 18, 2007 12:24 AM

stefano said:

I will, but I think this problem is releted with this article, since if I see the page outside the iframe the behavior of the extender is perfect. Sorry if I bother you once again!

# June 18, 2007 3:58 AM

Russ said:

Thanks for explaining it.  At least now i know that is not causing the issue. See the following link for my use of the Photo Album:

www.stjohnfire.com/.../Album.aspx

The album works great, but it does not show the stacked effect of the images in the album.  Not sure why this is happening.

# June 18, 2007 9:04 AM

Shane Shepherd said:

<blockquote>Since Safari has in the past required a subscription to Mac OS updates...</blockquote>

How long ago was this?  I've been using Apple Computers for 6 years now and this has never been the case.

# June 18, 2007 9:43 AM

Bertrand Le Roy said:

Stefano: it is related to the iframe, but the patch here only deals with the security issue. It may end up being a problem somewhere in Microsoft Ajax, but you should start by asking the toolkit team as this happens with one of their extenders.

# June 18, 2007 4:06 PM

Bertrand Le Roy said:

Russ: can you look for the UpFolderStackHeight setting in the handler and check that it's not set to 1?

# June 18, 2007 4:21 PM

Bertrand Le Roy said:

Shane: as far as I know, this is the first time a major version of Safari is available separately from an OS upgrade. We had to upgrade our Macs to OSX 10.4 in order to get 2.0.4.

# June 18, 2007 4:23 PM

Russ said:

UpFolderStackHeight  = 3

# June 18, 2007 8:42 PM

Bertrand Le Roy said:

Russ: then I have no idea, sorry. Never seen that happen.

# June 19, 2007 12:37 AM

Greg said:

This has to be the reason ... I have several PC's in the house ... no Macs. I can't say I care enough about Safari support enough to go out of my way to make sure it's ok. I'm not what you'd call a web dev who walks the edge of browser support. I learned my lesson years ago regarding that.

Maybe if I'm in CompUSA I'll pull up some of my sites for the hell of it. But if I had a Mac I would check it.

I have enough on my hands making sure things work in IE6 , 7 and Firefox.

So why did I download Safari and try to install it twice seeing the first time botched because Apple rushed this beta?

Easy ... I now have an easy way to make sure my sites look and work OK in Safari. So why not?

It's not uncommon to hear (though less and less) ... "works in IE and Firefox" ... but Safari is left out. So I too think this is a move by Apple to elevate the user experience for the MAC crowd by increasing the # of sites that are designed on a PC and look and work just as good on a Mac as they do on a PC.

Your theory makes total sense.

# June 19, 2007 12:56 PM

Greg said:

BTW - I'm using JQuery and Thickbox and my iFrame's called into the DOM work without a hitch. jquery.com/.../thickbox

# June 19, 2007 1:03 PM

Russ said:

I found the problem and fixed it. Since the color of my background is not black, i had made the modification suggested by Calios:

"Calios said:  

Found a little bug/annoyance - im posting it here since gotdotnet will phase out in a few days(19th of June 2k7). in CreateFolderImage you didnt fill in the BackGround - thus using any other background than black will look wierd :-O I added this to fix it: g.FillRectangle(new SolidBrush(BackGround), 0, 0, size, size); Right after the stacked Graphcis has been declared (was line 477 of the .ashx file for me - v 2.1 of the handler) :-)

# June 8, 2007 9:33 PM"

In troubleshooting deeper, i realized that i had placed this line of code in the wrong place.  it all works fantastic now.

Thanks again,

Russ

# June 20, 2007 10:06 AM

Warren said:

i was trying to download the code to intrigate into my home server and i keep getting the following message

The GotDotNet site is being phased out

  Microsoft will be phasing out most features of the GotDotNet site by Summer 2007.

  GotDotNet Workspaces and Private Workspaces have been phased out        More about the GotDotNet phase-out

Contact the GotDotNet Support Team

is the code still available for download and if so where can i get it?

# June 21, 2007 12:31 AM

Bertrand Le Roy said:

Yes, hold on, I'm migrating to Codeplex. The new address will be: www.codeplex.com/PhotoHandler

# June 21, 2007 1:26 AM

Atlas and more said:

Last night, I uploaded the source code and release package for version 2.0 of the photo handler . I'll

# June 21, 2007 1:29 AM

Atlas and more said:

I just finished migrating my PhotoHandler workspace from GotDotNet to CodePlex. I have got to say that

# June 21, 2007 3:31 AM

Shane said:

Thanks for this great info. I wanted to pass along a tip I learned while applying this patch. After applying the patch and trying to run the app I was also getting the 'Sys' and 'Type' undefined errors that I saw other people getting. It took a long time to track down, but what I found was that our Sys Admins had deployed a tool called URLScan onto every desktop to prevent users from going to potentially malicious websites. Well, that tool also has a setting that prevents URLs with periods in their address. We figured this out based on using Fiddler and identifying that we were getting a 404 error when trying to load the patched Ajax files. The URLScan tool was preventing us from loading that file. Anyways, I hope that helps someone out there.

# June 21, 2007 10:53 AM

jbush7777 said:

Couple of comments:

I have a different problem with numlock.  Some of the older VMS editors used that key (called the GOLD key) extensively in editing.  I plan to rework my editing options (I don't use that editor much any more, but occasionally it is useful) to make the keyboard / into the gold key instead, since the numlock key always toggles numlock, in addition to passing the escape sequence into the Alpha.

There is a nice freeware  utility I use (printkey) which  I have configured so that when I hit printscreen (alone) it is possible to drag-select a rectangular portion of the screen to import into printkey.  It can then be copied to clipboard, printed , saved as a gif, and modified (e.g. interchange black and white).  Very useful.

# June 21, 2007 11:04 AM

Bertrand Le Roy said:

Shane: urls with periods in the address? That's radical. Most of the web must be filtered out by this?

# June 21, 2007 9:05 PM

ScottGu's Blog said:

One of the features that web developers will really like with VS 2008 is its built-in support for JavaScript

# June 22, 2007 1:57 AM

BusinessRx Reading List said:

One of the features that web developers will really like with VS 2008 is its built-in support for JavaScript

# June 22, 2007 2:08 AM

ASP.NET said:

One of the features that web developers will really like with VS 2008 is its built-in support for JavaScript

# June 22, 2007 2:24 AM

Michael Douglas said:

It's all about Apple/Mac's...

You know they, oops It's simple to turn off UAC, tend to, oops It's simple to turn off UAC, beat their chest about trivial issues with MS.

Funny though that they have now exceeded MS for the number of issues with their OS in 1 month timeframe.

# June 22, 2007 11:10 AM

Intellisense en JavaScript con VS 2008 « Thinking in .NET said:

Pingback from  Intellisense en JavaScript con VS 2008 &laquo; Thinking in .NET

# June 22, 2007 1:16 PM

Soven Shrivastav said:

VS 2008 JavaScript Intellisense

# June 23, 2007 12:16 AM

Anke said:

Hello,

I like your Photo Album handler 2.0 very much, but I've a problem.

Ich can't publish the website.

Here is the errormessage (sorry - it's in german):

"Für die Erweiterung .ashx ist kein Buildanbieter registriert. Sie können einen im <compilation><buildProviders>-Abschnitt in machine.config oder web.config registrieren. Stellen Sie sicher, dass das BuildProviderAppliesToAttribute-Attribut den Wert Web oder All enthält.

I:\xxx\AlbumHandler2_1_\Default.aspx"

Could you help me please?

bye Anke

# June 23, 2007 12:38 PM

Bertrand Le Roy said:

Anke: you should talk to your hoster. Apparently they disabled the build provider for ashx.

# June 24, 2007 2:06 AM

Anke said:

But I can't publish the website on my own Desktop PC. It runs only with the cassini, ans if I like to publish the Website, I get an Buil-Error.

I've try to add the Build-Handler to the project (in the web.config) but it dosn't works.

I have an other Project width a Http-Handler an this project I can publish. I works width Asp.Net since some years, but I havn't wrote a Http-Handler sometimes. I don't know, that I can makew :(

I have try to publish the Project at an other PC, but I have the same Error-Message :(

ciao Anke

# June 24, 2007 3:02 PM

Bertrand Le Roy said:

Anke: please check that the directory where you dropped the handler and bin folder is a web application configured for ASP.NET 2.0. It should work just fine out of the box.

# June 24, 2007 4:13 PM

一个小泡 said:

VS 2008 JavaScript Intellisense

# June 24, 2007 8:05 PM

mark perrin said:

safari 3 after a few weeks sucks on both platforms, ive gone back to safari 2.0 on OSX and windows is welcome to this buggy load of crap.  Lets hope apple have laced the windows version with bugs on purpose to show those windows users just how buggy they can make vista.  LOL its like the secret poisoned pill disguised as a browser but laced with cyanide.

# June 25, 2007 4:12 AM

Anke said:

Sorry, but I think you don't understand me. I can copy the files at my Server (It's my own Server an I can take the settings self) - this go. But i can't publish the Website (Project --> Publish Website). Then I get the error.

I like to publish my website, because I don't like to have the CS-Files at the Server. I could publish my total Website-Project ans then I could copy the Photo-Handler later to the published Sites. But this is not that I want.

I use the MyWebPagesStarterKit - it's also from codeplex.com (www.codeplex.com/.../ProjectReleases.aspx). Where are Http-Handler inserted too. But this Project I can publish without problems.

Doo you understand the problem?

ciao Anke

# June 25, 2007 11:39 AM

Bertrand Le Roy said:

Anke: I'm sorry, but no, I don't.

# June 25, 2007 1:08 PM

Anke said:

So, I hav made a screenshot. I have Open your Project width Visual Studio 2005. When I try to publish the project. But I get only the error which you can see in the picture in the bottom.

picasaweb.google.com/.../photo

I hav found an other german person, which has the same problem. See: www.mycsharp.de/.../thread.php (sorry, it's in german)

ciao Anke

# June 25, 2007 1:36 PM

Bertrand Le Roy said:

Anke: the problem is that I'm unable to reproduce your problem. I could do something if you gave me the exact, very precise steps of everything you did from downloading the handler to setting up the web site and running it. Please also include what OS you're using.

We can continue this discussion through e-mail (bleroy at microsoft dot com) or even better, you can file a bug on CodePlex.

# June 25, 2007 1:45 PM

Ted said:

I tried the app and I got an error. Is there a limit to the numbers of pictures that you can have in an album?

Thanks,

Ted

Here is what the error said:

Request timed out.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Request timed out.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:

[HttpException (0x80004005): Request timed out.]

# June 26, 2007 5:35 PM

Bertrand Le Roy said:

Ted: not in principle. How many pictures are we talking about? Did you try with the same settings but just a few images?

# June 26, 2007 5:41 PM

Ted said:

I was trying it with our holiday pictures , so there was about 1650 pictures. I dropped about half of them out of the folder and it is working now, but I don't know if it was the excessive number of pictures or that fact that there was a few MOV files in that folder that I forgot were there.

BTW, you mentioned about the settings, where do I go to find out how to change the settings and what the options are?

Thanks,

Ted

# June 27, 2007 10:40 AM

Bertrand Le Roy said:

Ted: the mov will not be a problem, they will just get ignored. 1650 is certainly a lot of pictures, and your users would probably thank you for splitting those into several folders ;)

I've never stress-tested it with that many pictures but in theory the album should only be slow on the first hit as it's generating thumbnails for all your pictures. You can try making the timeout longer in web.config and see if that's the case. Otherwise, just split, and maybe file a bug on the Codeplex site.

# June 27, 2007 1:59 PM

Ajaa said:

Hi

I was wondering about one thing.

I added the scriptpath and this is ok.

but why do I need to modify the

MicrosoftAjax.debug.js and MicrosoftAjax.js files?

Why havent this been fixed in the files from the download location?

When I did the abouve I still get an error when trying to use ajaxToolkit. Do you have any idea as to why?

When making these changes do I need to modify any references to the ajaxtoolkit?

Help is appreciated

# June 27, 2007 2:09 PM

Bertrand Le Roy said:

Ajaa: the files in the download location are the exact same files that are embedded in the dll. We're not servicing one and not the other. That's why we're presenting this as a patch for the people who need it until it is integrated into the main build (which it is in the Orcas betas). See this as a way to get the fix earlier.

About the toolkit issues, please read UPDATE 2 in the post. You can also contact the toolkit folks through the CodePlex site or the forums.

# June 27, 2007 2:30 PM

Atlas and more said:

ScriptDoc is a tool that extracts documentation from JavaScript files and packages it into XML files

# June 27, 2007 7:30 PM

The format for JavaScript doc comments - Atlas and more said:

Pingback from  The format for JavaScript doc comments - Atlas and more

# June 27, 2007 7:40 PM

Atlas and more said:

When I was talking at the Journées Académiques last week, someone in the audience asked me about documentation

# June 27, 2007 7:48 PM

Robin Debreuil said:

Great job, I was involved in a similar thing recently at Aptana, so I am painfully aware of how hard that is. So much screwed up JS in the world : ).

It seems you guys really nailed it though, kudo's!

# June 27, 2007 9:43 PM

Sandcastle said:

In April I blogged about Bertrand Leroy 's, cool document extraction tool (ScriprDoc 1.0) that will generate

# June 28, 2007 3:06 AM

ahnan said:

Great works! Thank you Roy!

# June 28, 2007 3:25 AM

Peter Goddard said:

For background image try setting a custom attribute to reflect the css class for the menu item and set the background in a stylesheet.

# June 28, 2007 3:36 AM

Arnt Henning said:

Hi

Thanks!!! The patch worked great!!

I just wanted to give some tips of problems I had.

When I first tried to

- setting a general ScriptPath on the ScriptManager

this produced the Sys error that people talk about here...

But when I changed this to

<atlas:ScriptManager ID="ScriptManager1" runat="server"  >

<Scripts>

<atlas:ScriptReference

   Name="MicrosoftAjax.js" ScriptMode="Auto"

Path="~/AJAXWA/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js"/>

</Scripts>

</atlas:ScriptManager>

Everything worked great.

It runs with no errors :)

Thanks alot

# June 28, 2007 3:50 AM

University Update-AJAX-ScriptDoc 1.0 available said:

Pingback from  University Update-AJAX-ScriptDoc 1.0 available

# June 28, 2007 3:51 AM

Arnt Henning said:

I just wanted to mention another problem I had. Although applying the patch worked I got problems when using the ajaxToolkit (latest release).

I got an error that ajaxToolkit could not be found.

To solve this I added the ajaxToolkit dll's in same folder as

MicrosoftAjax.js and MicrosoftAjax.debug.js

and renamed them to

AjaxControlToolkit.Common.Common.js

AjaxControlToolkit.Common.DateTime.js

AjaxControlToolkit.Common.Input.js

AjaxControlToolkit.Common.Threading.js

(as you can see I added the prefix 'AjaxControlToolkit.Common.')

This is mentioned earlier here but I just thought I can repeat it just in case!

Now everything works for me :) Ive got a updatepanel and the AjaxToolkit Rating control and theire 100% up and running!

Thanks alot for this patch!

# June 28, 2007 4:08 AM

Morten said:

I think there might be something wrong with the version numbers in your web.config. They are referring to v2.0 of System.Web.Extensions, which as far as I know isn't public available?

# June 28, 2007 12:40 PM

Bertrand Le Roy said:

Morten: you're right, thanks for pointing that out, I'll fix that later today but you should be able to change that reference to 1.0 without any trouble.

# June 28, 2007 2:10 PM

Bertrand Le Roy said:

Peter: the problem is that there isn't an individual css class for each menu item, so this will work for a category of items, but not for different backgrounds for each item.

# June 28, 2007 2:22 PM

Caterwomtious said:

Hi Bertrand

Like some others, my first thought was "this sounds great, but why not jsDoc?" You make a good argument for using XML instead, but it would still be useful to add jsDoc support even if it is for a subset of the functionality.

Why? Because there's a huge body of JsDoc-documented code out there that VS.net could interpret straight away, without needing to run any conversion tools. That's a big win.

# June 29, 2007 4:28 PM

Bertrand Le Roy said:

Caterwomtious: I agree, and I've passed this suggestion along to the right team for a future version (a while ago :) ).

# June 29, 2007 4:50 PM

Madia Thomas said:

Why don't you guys just provide us with the modified file?

# July 3, 2007 9:57 AM

Bertrand Le Roy said:

Madia: because this bug doesn't meet the servicing bar. This is fixed in the Orcas beta release, which has been available for a few months now.

# July 3, 2007 4:47 PM

Atlas and more said:

I just migrated my ObjectHierarchicalDataSource and CompositeHierarchicalDataSource projects from GotDotNet

# July 3, 2007 9:13 PM

Huobazi said:

Great works! It is very useful!

# July 4, 2007 3:24 AM

DEEPAK GUPTA said:

Hello Friends

i have added  

   <Scripts>

       <ajax:ScriptReference Name="MicrosoftAjax.js" ScriptMode="Auto" Path="~/Scripts/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js" />

   </Scripts>

inside my ScriptManager and even update the patch for MicrosoftAjax.js and MicrosoftAJAX.debug.js files. But even then am getting JavaScript Error - Sys is undefined..

Please help me.. I am not getting where i am doing wrong.

Any help is greatly appreciated..

Bye

Deepak Gupta

(www.broadwayinfotech.com.au)

# July 4, 2007 10:07 AM

boob said:

GAY

# July 4, 2007 11:33 AM

ScottGu's Blog said:

I've fallen behind on my weekly link-listing series - apologies for the delay. ASP.NET ASP.NET RSSToolkit

# July 4, 2007 3:47 PM

Bertrand Le Roy said:

Deepak: if you look at the generated source from the browser, you can see what address was generated (look for the <script> tag). Adjust your path so that the generated url coincides with where the script really is.

# July 4, 2007 5:12 PM

Richard said:

Hi, when you mention downloading code from

renaud91.free.fr/MetaDataExtractor  

it might be worth mentioning to download the

MetaDataExtractorAssembly222d.zip file

MetaDataExtractorAssembly230g.zip doesn't work.

# July 5, 2007 7:20 AM

Public Sector Developer Weblog said:

I found out about these ASP.NET controls by way of Bertrand LeRoy . "These data sources enable Menu and

# July 5, 2007 3:37 PM

Noticias externas said:

I found out about these ASP.NET controls by way of Bertrand LeRoy . &quot;These data sources enable Menu

# July 5, 2007 3:47 PM

Dinesh Gupta said:

How to remove this created IFRAME

if (document.all)

{

divNode.insertAdjacentHTML("afterEnd", '<IFRAME style="position: absolute;z-index:4;" src="javascript:false;" frameBorder="0" scrolling="no" id="' + sTableID + '_hvrShm" />');

var iframeShim = document.getElementById(sTableID + "_hvrShm");

iframeShim.style.top = hoverDiv.style.top;

iframeShim.style.left = iframeShim.style.left

iframeShim.style.width = hoverDiv.offsetWidth;

iframeShim.style.height = hoverDiv.offsetHeight;

}

# July 5, 2007 7:08 PM

Bertrand Le Roy said:

Dinesh: doesn't removeChild work?

# July 5, 2007 7:12 PM

Ludovic said:

I agree on almost all points, especially 5 and, OMG, 6 (aaargh!). However, I disagree about mini-games. I think mini-games are a very good concept that can lead players to specialization in a layered gameplay structure, for example. Sure, it can be done badly, but that doesn't mean it's inherently wrong.

I'd like to add:

8. Dead ends with deep backtracking: you're missing the Amulet Of Khrak to continue the story, but you need to reload a game from last month to be able to go get it. And since complex stories with branching and all are delicate to write without falling into this, game designer tend to write mostly linear storylines (well, it's called a storyLINE, isn't it?), where failure is not an option, and you have to retry until you succeed (remember Wing Commander, compared to X-Wing/Tie-Fighter?)

9. Poor immersion: this might be a bit of a personal taste here, but when I'm playing a 20 or more hours game, I'm expecting to feel immersed in its world and athmosphere and all. If I just want to have fun, I play Guitar Hero or Zuma for 5 minutes (or 5 hours). "Actual" games (as in: games with "long" gameplay) should be more immersive.

# July 5, 2007 8:03 PM

InfinitiesLoop said:

Crackdown = sinner with load times if you ask me.

Gears of War with its contextual 'points of interest' feature I thought was a nice touch which takes it out of the sinner category for camera angle in my opinion. FPS with bad camera control = uhh, a recent metal gear comes to mind.

And in defense of Crackdown it seems like it only 'check points' when something worth saving happens. It's automatic and it doesn't disrupt gameplay at all, which is great considering long load times.

One thing that I hate about crackdown... the damn advisor. Advisors are so common they need their own category in your list. Crackdown's advisor is an idiot -- most of the time what he says has nothing to do with anything, and he repeats himself all the time. I'll be trotting down the street for a few minutes and he'll bust out with "I can see my house from here!". huh? And yeah, after beating all the missions I pretty got it that agility orbs increase agility.

# July 5, 2007 9:54 PM

BulletBait's Blog said:

This article about bad points in game design is kind of interesting... Source: weblogs.asp.net/.../seven-deadly-sins-of-game-design.aspx

# July 6, 2007 2:29 AM

Kevin said:

Good post. I especially agree with point 5. PGR3 was another sinner on that point, if memory serves.

One thing that drives me mad is when two games where you're doing exactly the same things (e.g. GRAW2 and Rainbox Six Vegas) which are written by the same people have different controls. Reload in GRAW2 is "A", reload in Rainbox Six is "X", and in a firefight you can guarantee I'll hit the wrong one... As far as I'm concerned, "A" should always be used for the thing you're doing most often - at least in my case that's where my thumb naturally goes.

# July 6, 2007 6:21 AM

Bas Bakker said:

Your photohandler works great in Internet Explorer.

In Firefox, however, it shows the pictures (and directories) all in one column.

Any idea how to fix this?

Thanks!

Bas

# July 7, 2007 11:10 PM

dotnetuncle said:

Check out this link for more...

www.dotnetuncle.com/.../71_page_life_cycle.aspx

# July 8, 2007 6:10 AM

Atanas Korchev said:

In his recent post Bertrand Le Roy announced that he migrated his ObjectHierarchicalDataSource and CompositeHierarchicalDataSource...

# July 9, 2007 11:29 AM

Bertrand Le Roy said:

Bas: did you make any changes to the style sheet? I just checked and it displays fine in Firefox, Opera, Safari and IE.

# July 9, 2007 1:03 PM

Fabien said:

@ Ludovic:

Regarding mini-games: I tend to agree that if they're done right, mini-games should "blend" into the rest of the gameplay and "layer" it. One could argue that if a mini-game achieves this level of integration with the rest of the gameplay, it ceases to be a mini-game entirely :)

The point here is that most developers create mini-games that resemble gamaplay "warts" instead of taking the time and effort to interweave them seamlessly into the rest of the actions defining the gameplay.

# July 9, 2007 3:43 PM

AdmiralGanja said:

No sample up and running?

# July 10, 2007 8:21 AM

Copter said:

I would like friends and family to add comments to my pictures that will become part of properties.  How is the best way to make this happen?  THANKS

# July 10, 2007 10:33 AM

DEEPAK GUPTA said:

Hi Bertrand

Yes you are right..

The path that ScriptManager is taking is

<script src="/Scripts/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.debug.js/System.Web.Extensions/1.0.61025.0/MicrosoftAjaxWebForms.debug.js" type="text/javascript">

</script>

where Scripts is my Virtual Directory But i am really geeting confused why it is again searching "System.Web.Extensions/1.0.61025.0/MicrosoftAjaxWebForms.debug.js" inside MicrosoftAjax.debug.js..

One more thing

I have added Scriptpath in ScriptManager instead adding ScriptReference..Is the Problem...

Thanx for the time...

# July 10, 2007 12:15 PM

Bill Wolfe said:

I did the same thing that EB did from March 5, 2007 and it worked great.

# July 10, 2007 12:22 PM

Bertrand Le Roy said:

AdmiralGanja: sorry, no.

# July 10, 2007 1:42 PM

Bertrand Le Roy said:

Copter: the handler does not support comments currently. One thing you could do is use it as a control and embed it into a web site that has comments.

It's one of the features I'd like to have, but it won't be added anytime soon. Sorry.

# July 10, 2007 1:44 PM

网际飞狐 said:

# July 11, 2007 2:51 AM

DEEPAK GUPTA said:

Hi Bertran

Thanx for the time..

I have checked the path in the Source code..The path is correct..But still am getting an error "sys is undefined.." Can u tell me some other reason for that..

# July 11, 2007 9:32 AM

Bertrand Le Roy said:

Deepak: well, if the path is correct and you've checked that the file actually gets downloaded (for example using Firebug or Fiddler), you probably introduced a syntax error while patching the file. Does it reproduce in debug and release modes?

# July 11, 2007 1:09 PM

Paul Realist said:

Here I had thought Einstein's discovery of the theory of relativity, or Jonas Salk's development of a polio vaccine were absolutely brilliant.  I was wrong.  Creating this presentation by spending a gazillion hours making seperate slides out of every word, capturing frame after frame on internet web sites, making the audience dizzy and bored after a couple minutes, that is truly brilliant.  I had to stop watching after less than half of it was over, it was just too good to handle.  Thank you, marketing geniuses, for pointing this mind blowing presentation.  God Bless PowerPoint!

# July 11, 2007 4:17 PM

Bertrand Le Roy said:

Hey Paul, thanks for calling me a marketing genius, but now I'm all depressed. If everything has to be judged against the theory of Relativity or the polio vaccine, pretty much everything becomes meaningless and futile.

# July 11, 2007 4:31 PM

Nathan Rose said:

Any plans for a SqlHierarchicalDataSource?

I've been toying around with a treeview custom control that would use a SqlDataSource, provided you give it a Parent/Child relationship (otherwise it would just be a list).  I also toyed around with making a hierarchical data source that inherited from SqlDataSource, but gave up after a few days.

# July 11, 2007 4:33 PM

Bertrand Le Roy said:

Nathan: why not use regular SqlDataSources with the CompositeHierarchicalDataSource?

# July 11, 2007 4:37 PM

Robin Debreuil said:

my 2:

1) Games that have no 'game' elements, like strategy, teaming up and backstabbing, knowing when you've been had, rewarding alternate approaches, thinking etc. Think of all the things that are fun in a card game, where a lot of games today are like the card game 'war', with better graphics. Clicking over and over until you win or lose.

2) Games where the controls and 'special moves' are so numerous and rewarding that the person who has spent the most time in the manual wins. C&C type games have almost all went this way, they used to be fun, but now it isn't very different than work (learn some arcane thing, repeat over and over until 5pm - then again I'm a programmer, so maybe I'm the only one that sees it that way).

# July 11, 2007 5:32 PM

Pretz said:

hmmm maybe but if the nex safari for windows results like this one.....  the most probably is that anyone use it because the program have a lot of problems.

# July 12, 2007 12:08 AM

Kalpesh said:

Hi,

I shoed alert msg but after pressing button my aspx page get expired.how to solve this pblm

# July 13, 2007 1:01 AM

Bertrand Le Roy said:

Kalpesh, what do you mean "expired"?

# July 13, 2007 11:16 AM

DEEPAK GUPTA said:

Hi Loy

I have checked the path of the Script..

That is correct i think so..I have installed firebug and the path that it shows is...

<script src="/Scripts/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.debug.js" type="text/javascript">

</script>

where Scripts is the Virtual Path Folder of the project...

Now what else should i check...

# July 15, 2007 3:30 AM

DEEPAK GUPTA said:

Hi Loy

I am heartly Sorry to you and Heartly Thanx for the time..

Atlast i got my stupid mistake..Error is resolved..

Actually i have patched the release version file but not debug one..

Thats why i always get an error

Thanx a lot

Thanx once again

Bye

# July 16, 2007 1:37 AM

Neil Kilbride said:

Love the photohandler control, thansk Bertrand :)

I added some functionality to omit unwanted directories being displayed, as I couldn't see any where in the existing code on where you did this. You can see how I did it here : neilkilbride.blogspot.com/.../net-photo-gallery-control-photohandler.html

# July 16, 2007 4:17 AM

Neil Kilbride said:

The photohandler control is great - thanks Bertrand :)

One key point to note is to make sure you get version V2.2.2d (not the latest version) of the MetaDataExtractor - otherwise you'll get a 'The type or namespace name 'Directory' does not exist in the namespace 'com.drew.metadata' (are you missing an assembly reference?)' error.

I needed to specify some directories I wanted to omit from the control (and couldn't see anywhere I could do this with the current control) so I added a few lines of code, which I blogged about here: neilkilbride.blogspot.com/.../net-photo-gallery-control-photohandler.html

# July 16, 2007 4:28 AM

DEEPAK GUPTA said:

Hi Bertrand Le Roy

I have check in both modes - Release and Debug Mode..The Error "Sys is undefined" comes in both the mode..

Even i have patched my js files 2-3 times but nothing work for me..If you say, Could i send u the patch files by mail...

One more thing i am using FreeTextBox Control(version 3.16) on the same aspx page..Would it be creaitng any problem..

Pls help me..Its really look bad when a popup displays on the Client Screen with the message "Sys is undefined".

Thanx for the help and time in advance..

Bye

# July 16, 2007 6:52 AM

Naveen said:

Hi,

I'm Using the following code..

Session("Test") = Value

Response.redirect("PageName.aspx",false)

The redirection and loading of the second pae fgoes on fine but the Session Vatiable value is lost before the timeout.

I'm using global.asax file to set the Session .Timeout to 240 and alternatively specifying the same in web.config.

Would like to know what's wrong....

Thanks and Regards,

Naveen

P.S : I'm using Master Page in the application and checking the Session values in page load.

# July 16, 2007 7:43 AM

Bertrand Le Roy said:

Naveen: you must be doing something else than that, because just that code you're showing works fine. You can send me your repro at bleroy at microsoft dot com.

# July 16, 2007 1:55 PM

Bertrand Le Roy said:

Deepak: did you check in Firebug that the script do actually get loaded?

# July 16, 2007 1:57 PM

DEEPAK GUPTA said:

Hi Loy

Yes, i check in firebug and the path is correct.

The path that shows is

<script src="/Scripts/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.debug.js" type="text/javascript"></script>

Where Scripts is the folder where all Scripts resides..

Thanx for your time Loy..

I know am annoying you but am not getting at all whats going wrong..

Bye

# July 17, 2007 12:26 AM

Max C said:

I had exactly the same symptoms as Deepak and just fixed it.  If like me you're testing within an iframe then the request to get the script file can be unauthenticated even though you're logged in (because the hosting page's cookies are not accessible to the iframe'ed page).  So if the script files are in a location that requires a logged-in user then you'll be able to download them by manually pasting the URL into the address bar but the iframe'ed page still won't be able to load them.  Just need to change web.config appropriately to fix it.

Having wasted an afternoon on this I just need to let off some steam by saying Microsoft is bonkers beyond belief to leave poor Bertrand helping thousands of developers patching a bug that affects everybody (because every site gets put in an iframe by someone).

Thank you, I feel better now.

# July 17, 2007 2:52 AM

t3knomanser said:

Is there any reason to not just use closures? This seems like a pretty uninteresting method. Closures do this, and a bunch more. Is there something I'm not seeing?

# July 17, 2007 9:17 AM

Bertrand Le Roy said:

t3knomanser: yes, what you're not seeing is that this is implemented using closures. If you're confortable with using closures directly, that's fine but you need to be careful as you may inadvertently attach more context than you need and even create hard to find memory leaks in IE. The methods presented here are more convenient, they hide a concept that is difficult or unknown to many developers who are new to JavaScript, and they only capture in the closure what little context *you* decide is useful.

# July 17, 2007 2:00 PM

Bertrand Le Roy said:

Deepak: I'm not asking if the path is ok, but if it effectively loads. You can check that in Firebug by expanding the entry in the net tab.

Max: the issue doesn't affect many users as you need to use iframes *and* have your iframe be in a different domain. That is not that common and it is a lot less trouble to offer out of band advice than to release a full service patch. The problem is also fixed in all recent releases of Ajax.

# July 17, 2007 2:10 PM

Dave said:

I too am having the problem with subdirectories.  I have everything in year folders and then month then activity.  I can click all the way thru but the last folder I cannot view anything inside it.  I get thumbnails but cannot get into the folders.  any ideas?

Dave P

# July 17, 2007 6:09 PM

Mark said:

Great, works well!

Is it possible to put spaces between the icon and the text?

# July 18, 2007 5:39 AM

Bertrand Le Roy said:

Dave: if you can zip a sample site (not too heavy please) and send it to bleroy at microsoft dot com, I can have a look.

# July 18, 2007 2:29 PM

Bertrand Le Roy said:

Mark: you should be able to do that with CSS. For example if the CSS class for your menu item is "foo", styling "foo img" with some right padding should do the trick.

# July 18, 2007 2:31 PM

Mark said:

How can I set a cssclass for an image?

The only classes I can set at the moment are:

<StaticMenuStyle />

<StaticMenuItemStyle CssClass="menuRootPanelItem" />

<statichoverstyle CssClass="menuRootPanelItem_Hover" />

<StaticSelectedStyle />                           <DynamicMenuStyle CssClass="menuRootPanelItem_Expanded" />

<DynamicMenuItemStyle CssClass="menuPanelItem" />

<DynamicHoverStyle CssClass="menuPanelItem_Hover" />

<DynamicSelectedStyle />

# July 19, 2007 3:35 AM

Mark said:

The following code worked but it's not the most practical.

<siteMapNode url="site.aspx" title="&amp;nbsp;&amp;nbsp;&amp;nbsp;Site" ... />

# July 19, 2007 6:56 AM

Jon said:

Ok, riddle me this if you please.  I am building an ASP.NET (VB) site using Master Pages.  The Masterpage is simply to have a common header.  In the content for the page in question, I have a two column table.  The left column has a treeview with a list of objects.  Each object has properties...each with potentially a different value.  The right column is a dynamically created table that in each row has either a label, dropdownlist, or a checkbox.  My postback code rebuilds this table and populates the values appropriate to the object selected in the treeview.

My problem is that if I click from one object to another on the treeview, data is not updated on the table...even though I show in a logger (listbox) that I'm attempting to set the values.

I toyed with the loadcomplete routine and changes made to the objects in the right column stick.  But the function that "rebuilds" the table during postback does not.

Your help would be greatly appreciated.

Jon

# July 19, 2007 10:06 AM

Bertrand Le Roy said:

Mark: you do it in the style sheet. Your MenuItemStyle points to menuRootPanelItem, but you can define a ".menuRootPanelItem img" style in your stylesheet which will only affect images that are inside an element with class menuRootPanelItem. Does that make sense?

# July 19, 2007 12:15 PM

Bertrand Le Roy said:

Jon: it's hard to say from just this description and without seeing the code. Are you handling the selected node changed event from the treeview to change what's in the table?

# July 19, 2007 12:21 PM

coolestCompany said:

the solution was very helpful n awesome .

It saved me .

thnx a lot

# July 20, 2007 6:33 AM

Mark said:

Thanks, I understand how css works but it doesn't seem to recognise "img" for any cssClass even if I put ".img" or "imgUrl" or ".imgUrl".

Do I need to define "img" somewhere?

# July 20, 2007 11:12 AM

Bertrand Le Roy said:

Mark: I just checked, and it works great. In the stylesheet, I have:

.item img {padding-right: 50px;}

and the item style is <StaticMenuItemStyle CssClass="Item"/>

# July 20, 2007 2:10 PM

lance said:

How would I access a Treeview node so that I could set individual css classes based on .sitemap attributes? For example:

<siteMapNode title="Our Services" url="~/Services/Default.aspx" description="Our Services" cssclass="gnav"></siteMapNode>

public void OnTreeViewDataBound(object sender, MenuEventArgs args) {

   ??????????????

}

# July 20, 2007 4:02 PM

Bertrand Le Roy said:

Lance: you can't, sorry.

# July 20, 2007 4:43 PM

callback asp.net 2.0 « Private: .NET + OO concept said:

Pingback from  callback asp.net 2.0 &laquo; Private: .NET + OO concept

# July 23, 2007 12:44 AM

Matt G said:

If your getting the Sys and Type error. try this:

Set ScriptMode="auto" and in the compliation tag of web.config remove the debug attribute

or change  ScriptMode attribute to ScriptMode="Release".

In debug mode your script tag will alter the path to find a debug js file.

# July 23, 2007 4:02 PM

Bertrand Le Roy said:

Matt: if you followed the post's indication, you should have installed all files from the library, which include both the debug and release versions.

# July 24, 2007 1:40 AM

Sona said:

Hi

Thanks for making this tool available.

I have a small problem though. I am able to see the different folders display as groups of thumbnails. But when I click on it. It doesnt take to the album.

I really liked this implementation.

www.stjohnfire.com/.../Album.aspx

BTW: I am using Win XP Professional

Thanks,

Sona

# July 24, 2007 10:49 AM

Steve said:

Exactly the same problem here chaps.....

using an XDA2....

Agree with the "not a vista" prob... also running XP pro with sp2.. definitly a Media 11 prob...

Slap Happy programming.... should be allowed to disable it..!!!   BAH..!!!!!

# July 24, 2007 2:21 PM

Bertrand Le Roy said:

Sona: not sure I'm following you, it seems to work fine on your site.

# July 25, 2007 12:43 AM

Ziro said:

Hi. I need help. Please. I have a web app using frames. in the top frame I have a link to a ajax page which opens in a bottom frame. This ajax page loads data to a gridview.

I downloaded,copied and patched the files of ajax inside a folder called scripts. Example: c:\MiAppPath\scripts\System.Web.Extensions\1.0.61025.0\MicrosoftAjax.js

I'm sure I patched the scripts correctly. But I got an error Sys is undefined.

Bertrand, Please could you helpme?

I checked the source code in Internet Explorer, search for script tag and I found this:

<script src="scripts/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js" type="text/javascript">

</script>

In the lines below i have seen that the path appears twice. Is this normal?

Thanks.

# July 25, 2007 10:44 AM

Bertrand Le Roy said:

Ziro: you probably included too much in the script path. Apparently in your case it should just be "scripts".

# July 25, 2007 12:20 PM

Shawnee said:

this so stupid because it did NOT HELP ME AT ALL! [deleted about a thousand exclamation marks]

LEARN HOW TO WRITE! [and here too]

# July 26, 2007 1:53 AM

Suraj said:

How can I generate msgbox with three buttons Yes/No/Cancle when a user is updating his record.

# July 26, 2007 2:21 AM

Mark said:

No worries, I've got it working now.

I wasn't setting an img class for both StaticMenuItemStyle AND DynamicMenuItemStyle as they use different cssClasses.

Thanks for your help.

# July 26, 2007 8:35 AM

Bertrand Le Roy said:

Suraj: the gridview example in the post is almost what you're looking for, except for the cammand name and the buttons, right?

# July 26, 2007 5:24 PM

Vladimiro said:

This solution is mutch more simple!

forums.asp.net/.../1546323.aspx

:p

# July 27, 2007 10:46 AM

Nicholas said:

I suspect the reason this works goes back to windows forms. When a transparent control overlaps another control, the bottom control never gets the instruction to draw the portion underneith the transparent control so all you end up seeing is the background. The HTML is rendered to the background layer as far as winforms is concerned, so by putting a transparent IFrame control over the select or Flash control the draw instruction is prevented from being issued causing the div element underneith to appear.

# July 27, 2007 5:57 PM

ajoka@nextra.sk said:

Ok, i've got 2 problems: 1 is the MSDN documentation, 2 is the result from some test.

1) FROM MSDN:

A hash function must have the following properties:

a)If two objects of the same type represent the same value, the hash function must return the same constant value for either object.

b)For the best performance, a hash function must generate a random distribution for all input.

c)The hash function must return exactly the same value regardless of any changes that are made to the object.

Please check this, i've got a big mess in it:

a) means that if all of my member variables (even mutable ones) are the same, hash-codes must equal

b) says that hash code should remain the same for all the object lifetime.

SO HOW IT IS?

2) Ive did some tests, created an own simple class with 1 value type member. implemented gethashcode and equals by using the member. created 2 instances of the same class (with id 1, 2) - added this class to an ArrayList, then changed the id value of the instance of the first class. the result: both object remained in the list, even so that hashcode has changed for the 1st object.

SO AGAIN, there must be something that's missing.

Another stuff: in a java article i've read that hashcode should remain the same for the object lifetime (similarity to point 1.c). But when i created a byte[] array set vlues for them, then each value modification resulted in a new hashcode...

Can anyone descibe it in short and clear way what to do with equals and gethashcode - and also describe some risk factor for each special case?

thanx.

# July 28, 2007 3:17 PM

John G. said:

Ok I dumped this into a folder with three pictures and recived the following.  Do you wise ones have any suggestions for me?

Thank you in advance

John G.

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'com' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 52: using System.Web.UI.WebControls;

Line 53:

Line 54: using com.drew.metadata.exif;

Line 55: using com.drew.metadata.jpeg;

Line 56: using com.drew.metadata.iptc;

Source File: d:\hosting\jgarlie\Custom\2\album.ashx    Line: 54

# July 28, 2007 8:38 PM

Luke said:

I'm having what is probably a minor issue with the handler. I have it running on Windows Server 2003, and the index page of folder thumbnails comes up fine, but it won't do anything else. When I click on any of the folders, nothing happens. This seems like a Javascript issue as no ASP errors come up. Have tried it in several different browsers just to be sure. Anyone know of a simple fix before I start digging into the code?

# July 29, 2007 11:25 AM

Bertrand Le Roy said:

Nicholas: no, IE doesn't use any of .NET or Windows Forms.

# July 29, 2007 7:22 PM

Bertrand Le Roy said:

Luke: do you have a url where I could have a look at that?

# July 29, 2007 7:23 PM

Bertrand Le Roy said:

John: you forgot to drop the meta data extractor dll into the applicaiton's bin folder.

# July 29, 2007 7:25 PM

Bertrand Le Roy said:

Vladimiro: err, it is a simpler solution, but to a completely different problem so I'm not sure what you mean here...

# July 29, 2007 7:33 PM

Bertrand Le Roy said:

Ajoka: those rules really apply to value types and similar entities. All your examples are pure reference types for which equality and hash codes are associated to the reference, not to the state, and should not be overridden under normal circumstances.

# July 29, 2007 7:44 PM

Alberto said:

In order to apply the patch, I am attempting to download the Microsoft Ajax Library (ajax.asp.net/.../default.aspx), and I get a 197 KB file, "MicrosoftAjaxLibrary.zip". When attempting to open it either under Vista or XP, I get "The compressed (zipped) folder ... is invalid". WinZip gives a similar error indicating that "it does not appear to be a valid archive".

It looks like the zip file at ajax.asp.net somehow got corrupted. Is there any other location where I can find the needed files?

# July 30, 2007 5:03 AM

Numabilis,Numabilis said:

Beaucoup de blogueurs influents m'insupportent de plus en plus. Entre les sujets repris de blog en blog sans apporter la moindre information, les interviews croisées entre blogueurs influents, les billets type &laquo; 10 astuces pour faire parler de,Beaucoup

# July 30, 2007 2:01 PM

Bertrand Le Roy said:

Alberto, you're right. I've sent mail so that this gets fixed.

# July 31, 2007 2:23 AM

Axeman said:

Ok first and foremost thank you for this awesome app!

Now I've been trying to get this to work but to no avail. The issue I'm having is that it is scanning all my folders. I only need it to scan one specific folder and all subfolders under it. When I move the .ashx file and page to the folder that I want to show (meaning the main folder or first folder that should display) all I get are X's for all the images. Any ideas?

Also, for those interested in changing the background color and aren't necessarily using a "named" color they can substitute the

Color BackGround = Color.Black

for

Color BackGround = ColorTranslator.FromHtml("#XXXXXX")

Where the X's stand for the Hex code of the color.

Any help for my issue described above would be great!!!

# July 31, 2007 8:55 PM

Bertrand Le Roy said:

Axeman: you can try to see what the response was using Firebug or Fiddler for those images. I'd guess a trust level mismatch with your configuration. We can also continue this conversation offline (bleroy at microsoft dot com)

# August 1, 2007 2:12 AM

Rafal said:

how can the google Sitemap be done with Futures? It seems it only suppoorts Windows Live. It also talks only about searching your site, not sitemap...

Does anybody has source code of this?

# August 1, 2007 3:14 AM

Bertrand Le Roy said:

Rafal: I confirm that the site map stuff is now in Futures.

quickstarts.asp.net/.../searchsitemaps.aspx

# August 2, 2007 3:19 AM

Abhishek said:

Hello everybody,

  I have used iframe shim to show div on top of select box. but I have found a strange problem, if you scroll in IE6, select box comes on top of iframe/div and as soon as you stop scrolling, again select box hides behind iframe.

I have checked lots of examples over net but didn't find anyone discussing this issue and it is reproducible for every iframe shim example.

I have a report page with lots of select boxes in one column and other column has a floating div. floating div when expanded should come on top of select box. everything looks okay until you scroll, but during the time you scroll, select box flickers and comes over iframe.

please suggest me.

thanks.

# August 2, 2007 10:39 AM

Steve Bird said:

I have a custom validator and I want to do an ajax call to the server and perform some validation using server side scripting. In my case the script is not known at build time.

I need to set args.IsValid before the client side validation returns. I was doing this via a synchronous ajax call.

How could I achieve this with a async ajax call?

# August 3, 2007 9:29 AM

Steve Bird said:

Just noticed that Martin Smith has asked the same question :)

# August 3, 2007 9:51 AM

Brandon said:

My wiimote isn`t working and I put more than 1 pair of new batteries in. What`s wrong?

# August 3, 2007 12:23 PM

Gerald said:

Has the link been fixed yet?

# August 3, 2007 4:33 PM

Bertrand Le Roy said:

Gerald: I've reported the problem. It should have been fixed by now but hasn't for some reason. I've reported it again a few minutes ago and it's being investigated (it doesn't reproduce consistently). Sorry about that and thanks for your patience.

# August 5, 2007 2:20 AM

Bertrand Le Roy said:

Brandon: I have a feeling Nintendo's support would be much better qualified than I to answer this...

# August 5, 2007 2:22 AM

Kalyan said:

<td width="34%" height="24" >

<select id="Supra" name="Supra" class="bx2" onchange="commonupdate(this)">

 <option> </option>

 <option value="Vesicular">Vesi</option>

     <option value="Amphoric">Amp</option>

     <option value="Bronchial">Bron</option>

     <option value="Cavernous">Cav</option>

     <option value="Tubular">Tub</option>

  <option value ="Bronc"> Bronchovascular</option>    

   </select>

    </td>

I have like this in my xsl sheet,when i select a div onmouseover is overlapping with these select boxes,can any one suggest how to avoid overlapping a div from select boxes for internet explorer any version if possible,required for IE6..amarindia108@yahoo.co.in

Thanks...

# August 5, 2007 6:04 AM

Bertrand Le Roy said:

Kalyan: Err, not to be rude, but the only thing I can suggest is that you read the post...

# August 5, 2007 9:29 AM

Prasad said:

hi  bleroy,

       thats a wonderful article... its still not working...the code is given below

Session.Add("registrationinformation", userinfo)          Response.Redirect("0.0.0.0/abac.aspx", False)

the above code runs in a iframe tag and its not working ...as you have said the session data is being lost even though i said in the same way.Can u suggest me how can i resolve it?

it worked fine in local address but on production server it fails when i give ipaddress for redirecting to the next page in registration?

thanks for your support

# August 6, 2007 10:49 AM

Bertrand Le Roy said:

Prasad: what's this 0.0.0.0 in your code? Redirecting with a fully-qualified address is probably the problem here. If it's identified by the browser as the same domain, you only needed a relative address and if it's not, it's rightfully not serving the same cookies. In other words I would expect this to fail.

# August 7, 2007 2:36 AM

Prasad said:

hi bertrand

     thanks for the reply,

-----> for security reasons i have changed the ip address and the page name else they are fine.All pages are in the same domain and in the same folder .

-------> Here i am loading full application in an iframe .do you think that can cause issues because without iframe everything works just fine?  

---->In FIREFOX it works even inside iframe & not in IE .

But when i enable cookies from all sites in my IE then my application works again.(my application is currently not certified so is IE may be prohibiting something ????)Can u make me clear about this strange behavior?

----->Can u please suggest me the solution to redirect page in a iframe when i use cookies like in login or registration .

---> i am using asp.net1.1

thanks in advance..

# August 7, 2007 9:43 AM

Bertrand Le Roy said:

Prasad: again, I think it's because you're fully-qualifying the domain. Can you try with relative addresses instead of always specifying the domain as part of the url?

# August 7, 2007 5:55 PM

cnblogs.com said:

作者: Truly 日期:2007.8.5 首先我们要遵循JavaScript注释规范,详见 ScriptDoc 和 weblogs.asp.net/.../2007

# August 8, 2007 4:56 AM

Kevin said:

Thanks Bertrand, seems to work ok.

So if we update to Orcas or update to the newest version of Ajax when it comes out, should this issue be fixed? Thanks.

# August 8, 2007 9:01 AM

Prasad said:

i tried intially using relative addresess it failed so tried the below it works fine

Server.Transfer("~/default.aspx");

but once i am logged on when i try again to click on a link made from anchor tag with link like "userdata.aspx" then i lose session data and get redirected to the login  page due to loss of session data due to a bug in IE

"Session variables are lost if you use FRAMESET in Internet Explorer 6" and link is shown below

support.microsoft.com/.../en-us

so i am planning to create privacy policy for my website hoping  then my application works fine .

thanks for help once again..

# August 8, 2007 9:04 AM

Steve Bird said:

I think i have managed to get my custom validation to work asynchronously, using the logic i found in ajaxaspects.blogspot.com/.../customvalidation-ajax-control-sample.html (CustomValidation AJAX Control Sample).

This sets the isvalid to true (not false as described above) if the user tabs away from the question. If the ajaxed question is the only question to fail validation and a next page button is clicked the page will post back to server, but since i re-apply the custom validation server side this is not a problem as a validation error message is still displayed.

So the Client-Side ASP.NET AJAX Validator triggers in most situations but a post back is performed (even thou valdiation fails) if the form is submitted. In this case an error is still displayed due to server side validation.

# August 8, 2007 9:37 AM

Bertrand Le Roy said:

Yes.

# August 8, 2007 3:11 PM

Bertrand Le Roy said:

Prasad: that's what I meant. Your code above seemed to imply that you had used the whole absolute thing with protocol, domain name, etc. This KB article seems to explain it, yes.

# August 8, 2007 3:13 PM

Beau said:

Great app!!!

Is there a way to pass a different stylesheet to the handler, or have it use a different background.  I have the app within a container on my home page and I would like to have it use a differnet background.  It keeps using the background image of the main page and I can't figure out how to change it.

thanks

# August 8, 2007 5:06 PM

Manoj said:

Great work!!! I want to definitely give it a try to integrate in my new Dating website! But before i start using the source code; is it permissible to use this code without any infringement of policies?

# August 8, 2007 10:15 PM

Truly said:

I modified sandcastle, then I generate a CHM for MicrosoftAjax.js, and I still working on it.

you can see the shots of the CHM from here:

www.cnblogs.com/.../849856.html

# August 9, 2007 11:15 AM

throwspoop said:

Great blog entry - good job of relating this to a well known and recognized eventing pattern. It helps my understanding of how the AJAX developers intended the framework to be used (and some ideas of how to extend some of the core components.)

One question regarding >> I also omitted the code that rewires the timeout for the next tick.

What did you mean by this? In my testing the event fires  at every interval and the folowing code seems to "rewire it":

>>this._pollCookie = window.setTimeout(this._pollDelegate, this._interval);

Thanks,

Jeff

# August 9, 2007 12:53 PM

Maria Kneipple said:

Thank you for this information. I've been going crazy trying to figure it out. I was wondering if you could guide me a bit on it, though.

I copied the external script files from the Ajax Library under MPSL to a folder in my website called Scripts. I tried to add the path to the ScriptReference (first to ~/Scripts/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js and then to MicrosoftAjax.debug.js when the first didn't work), but I kept getting the sys undefined error. I then added it to the ScriptPath property of the ScriptManager as "~/Scripts" and it works, including fixing the access denied error. But when I try to load a page with toolkit controls, I get the message "AjaxControlToolkit is undefined".

How can I get them both to work? Thank you!

# August 9, 2007 2:09 PM

jim said:

did you try to recalibrate?     press the little button in that controller port area on the wii  then the little button in the wiimotes battery thingamigig  and presto you have a working mote   hopefuly

# August 9, 2007 2:33 PM

Maria Kneipple said:

I figured it out. The ScriptReference path is relative, so once I removed the tilde, it worked. Thank you!

# August 9, 2007 2:50 PM

John G. said:

Ok I got everything to run fine on my local machine.  When I publish to my site hosted by Godaddy.com I get a problem with the following code.  Apparantly they are not giving me rights to the temporary asp.net folder this is using.  Thanks in advance for your assistance.

Static IMagehelper()

{

..

..

_imageCacheDir = Path.Combine(HttpRuntime.CodegenDir, "Album");

                   Directory.CreateDirectory(_imageCacheDir);

This  is the error:

Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

# August 9, 2007 10:48 PM

Bertrand Le Roy said:

Beau: the stylesheet is inside the handler. It's very easy to change.

Manoj: the license is MS-PL. See www.codeplex.com/.../License.aspx

John: there's a setting in the handler for the cache location. Disk only works if you have a high enough trust level. Memory and none works everywhere.

# August 10, 2007 1:44 AM

Bertrand Le Roy said:

Jeff: I omitted it from the code in the blog post, not in the full source code.

# August 10, 2007 1:49 AM

vent said:

I know this is not a new issue, but is there anyway to get into the contents of the frame whose contents seems to be from a different domain?  When i did ie.show_frames, the frame i want to access said permission denied.  I already tried to set Browser to the lowest security ( allowing cross domain access, put domain in whitelist, etc) no luck here.

This is not a problem when I tried in Firefox using FireWatir though. I have made some <a href="www.aftermarketperformanceparts.com/.../a> this on internet - I was able to change the domain for the page hosting the frame - however when I try to access the page within the frame I get "Access Denied " error.

# August 10, 2007 5:06 AM

MrVent said:

Man, your comments are really fast... It changes everytime I'm gonna refresh it..

# August 10, 2007 5:13 AM

IgorV said:

"Feel free to modify what you want. I'll also add the possibility to add the Google-specific information directly in the site map file."

--

Where is the source? Links are broken on all sites that reference "Bertrand Le Roy's" handler. Futures have very poor documentation on this subject, I wasnt ablet o make it work.

# August 10, 2007 10:24 AM

John said:

Where can I get the ASP.NET Alerts control since the gotdotnet site has been phased out?

# August 10, 2007 4:57 PM

John G. said:

ok I found it and changed it to memory and all is well.

Thank you

# August 10, 2007 8:48 PM

Shawn Burke said:

Awesome post Bertrand.

Bad friendly AI.  I love games that make me feel like it's not the whole world against me - Call of Duty 2 had some fantastic sequences that acheived this.

It's always incredibly frustrating when the bad guys are smart and are great shots, but your AI 'team mates' are stuck in the corner or running in circles, or worse, blocking you from getting to cover or in a door or whatever.

I'll pile on; Guitar Hero suffers none of these problems either. :)

# August 10, 2007 9:18 PM

Bertrand Le Roy said:

MrVent: browsers preventing script from accessing other frames that are in different domains is a very fundamental security feature, one of the things web security is built on. You may find some vendor-specific workarounds but there are also better solutions that rely on message-based communication between frames using url fragments. Microsoft Research has produced a technique called subspaces, and there's also some work being done around that in OpenAjax.

# August 11, 2007 3:10 AM

Bertrand Le Roy said:

John: I'm in the process of moving it to http://www.codeplex.com/alerts.

# August 11, 2007 3:12 AM

Bertrand Le Roy said:

Igor: the documentation is way better than what was available for this version (i.e. this blog post), see previous comment for a link.

I can make the source code for this old project available here but I really encourage everyone to use the Futures version.

# August 11, 2007 3:19 AM

Atteint de Javascriptite aiguë [Cyril DURAND] said:

Voici la réponse au Quizz JavaScript - gestionnaire d'evenements et boucles . Pour rappel la question

# August 12, 2007 10:55 AM

Atanas Korchev said:

Hi Bertrand!

Do you have any plans for the CompositeHierarchicalDataSource to support the LinqDataSource control from ASP.NET 3.5? Right now the CompositeHierarchicalDataSource control seems the only chance to get hierarchical support for the LinqDataSource control.

# August 13, 2007 4:13 AM

Bertrand Le Roy said:

Atanas: not for the moment but that's a good suggestion.

# August 13, 2007 5:07 AM

Snt said:

I have a question in the article its said that when we have a client call back the click event of a normal button with postback wont work... how can i fixed that problem i want to have some objects with client call back and some others with postbacks

# August 13, 2007 2:47 PM

Atteint de Javascriptite aiguë [Cyril DURAND] said:

Voici les réponses au Quizz JavaScript : objet et abonnement d'événement Le problème était encore à cause

# August 13, 2007 7:46 PM

Bertrand Le Roy said:

Snt: I don't know where you got this idea. There is no reason why postbacks wouldn't work normally even "when we have a client callback", although I'm not sure what you mean by that.

# August 14, 2007 1:22 AM

rabidrobot said:

The snipping tool is not installed by default with some Ultimate installations (maybe others?).  To enable it, go to Control Panel, select Uninstall Program then 'Turn Windows Features on or off'.  Once there enable the Tablet-PC Optional Components and click OK.

I actually had to do this twice, with a reboot in between, but it is working now.

# August 14, 2007 3:24 PM

Dee said:

Awesome....exactly what I was looking for.

# August 14, 2007 4:03 PM

Gregor Suttie said:

Oh i cant have anyone dissing gears of war - it just doesnt come out of my xbox disc tray end of - online its the best game out there by a long long way.

# August 15, 2007 9:54 AM

kaynin said:

dude its being painted

# August 16, 2007 3:41 PM

Bertrand Le Roy said:

Gregor: Gears is without a doubt a fantastic game. We both finished it at least once. It may be that it's so great that makes its few flaws so infuriating. It got so near to being perfect... You'll notice that most of the games we cite are actually very good games.

# August 16, 2007 4:40 PM

I’m CaLendarW Blog » Blog Archive » ASP.NET Event Validation said:

Pingback from  I&#8217;m CaLendarW Blog  &raquo; Blog Archive   &raquo; ASP.NET Event Validation

# August 20, 2007 11:37 AM

preishuber said:

why photoshop and not expression design?

you know ? "eat your own dog foot".

# August 21, 2007 1:55 AM

Bertrand Le Roy said:

Oh, good question. "Microsoft Expression Design is a professional illustration and graphic design tool". Expression Design is actually closer to Illustrator than to Photoshop if I'm not mistaken. Plus, I've owned a Photoshop license for years, way before Expression Design existed. I typically use LightRoom for my photo workflow and Photoshop for more complex editing.

# August 21, 2007 2:08 AM

Fabien said:

Joli modele :)

# August 21, 2007 2:49 AM

David Cumps said:

I think the image fits the title very well :)

I don't know if your previous skin was fixed width or not, but going to fixed width for a technical blog isn't something I'm a big fan off, have a look at some of your posts, with content being cut off due to this:

weblogs.asp.net/.../semicolon-expected.aspx

(link cut off)

weblogs.asp.net/.../how-to-work-around-the-quot-access-denied-quot-cross-domain-frame-issue-in-asp-net-ajax-1-0.aspx

(image cut off)

Go fluid width! ;) Also much nicer for the eyes in my opinion (take a look at mine for a full width example), I find it calming when there's more space

But, your opinion might differ of course :)

# August 21, 2007 3:11 AM

Donny said:

A really cool photo plus your wife has done a great job carving that pumpkin! Great work!

# August 21, 2007 3:21 AM

Bertrand Le Roy said:

David: it's a good point for the image. On the other hand, I think a small width helps keeping the site easily readable and comfortable. I like the layout of your blog too but what I'm not a big fan of is horizontal (and even vertical) scrollbars on code samples...

# August 21, 2007 3:28 AM

Florian said:

C'est fun et ça change !! C'est vrai que ça fait du bien ! Joli travail M'sieur. En revanche j'en aurai peut-être profité pour modifier le fond et les couleurs de textes.

J'aime bien le titre aussi :-)

# August 21, 2007 3:37 AM

David Jourand said:

Nice design, very nice title ;-)

# August 21, 2007 4:31 AM

Cyrille said:

Great work but i think you have to add a link to the homepage behind the title of your blog.

# August 21, 2007 7:32 AM

Garbin said:

Very nice :)

# August 21, 2007 7:51 AM

John Lam said:

Love the title. I still don't have the guts to change the title of my blog to: 00000000-0000-0000-C000-000000000046 :)

The only downside of the title is:

a) I (and a lot of other people) tend to name feeds in their blog reader based on the name of the author

b) Various search engines really prioritize keywords that shows up in <title> tags ...

# August 21, 2007 12:36 PM

A reader said:

How about posting some content?  Those of us that just subscribe to your RSS feed could care less what you did in Photoshop.

# August 21, 2007 12:58 PM

InfinitiesLoop said:

Haha I love it... I was thinking a while ago, Bertrand needs to change the name of his Blog. It's not called Atlas anymore, afterall :)

Now I'm jealous of your non-standard header...

# August 21, 2007 1:24 PM

IntelliDesign said:

Oh man... it's so cool that I forgot what the old title was already ;) And yes... the banner goes pretty well with the title.

# August 21, 2007 1:33 PM

Bertrand Le Roy said:

Cyrille: done, thanks for the feedback.

John: good points about the title, but the previous one had the same problems and I'm still fairly easy to find in search engines. For your a) point, I would tend to agree, and I usually rename such blogs in my RSS reader, but the temptation of this title was just too great to resist, so I'll do with the drawbacks. So that's what happened to "less is better" then, eh?

A reader: you're absolutely right, and I apologize. I've been on a parental leave for a month, which explains the lack of content these last few weeks. Contents will be back soon.

# August 21, 2007 1:49 PM

Kirti Deshpande said:

We are not evil Bertrand =). It is all fair in love, war and business. The carved pumpkin is awesome.

# August 21, 2007 2:17 PM

George said:

Any reason why this would work on one IIS server, but not work when moved to a different IIS server?

I'm using iframes and after a login I set a session variable and then refresh the page using Response.Redirect("~/Default.aspx", False)

This works ok on the first server, but when I tried to move the web site to another server, the login is unsuccessful (it seems that it's not setting the session variable or the session variable is being lost after redirect).  Is there an IIS setting somewhere that might control this?

Thanks

# August 21, 2007 3:50 PM

Bertrand Le Roy said:

George: there's probably a difference in config between the two. Are these the same versions of IIS, both fully updated?

# August 21, 2007 4:20 PM

Count Gamula said:

Gears of War is a pile of Llama crap sauteed in camel urine...PS - Halo called and would like it's match making system back...

# August 21, 2007 4:34 PM

George said:

Same versions of IIS (5.1) and I've looked at the settings in IIS Admin and they're the same. Is there any other way to refresh the page without creating a new session?

Using Server.Transfer("~/Default.aspx") refreshes the Default.aspx page and recognizes that the session variable has been set, however the iframe contained in Default.aspx (which may or may not have refreshed as well, I can't tell) doesn't recognize that the session variable has been set.

Thanks again.

# August 21, 2007 5:12 PM

A reader said:

Didn't realize you were on leave, my mistake.  Looking forward to new content!

# August 21, 2007 6:01 PM

Bertrand Le Roy said:

What about web.config? Can you try to reproduce the problem without the iframe?

# August 21, 2007 6:30 PM

Tomas said:

Very intriguing. I like it. Congrats on a new family addition.

# August 21, 2007 10:14 PM

Kelly White said:

If you currently don&#39;t read Betrand Le Roy&#39;s blog then you need to start. I started reading it

# August 22, 2007 12:09 AM

allan said:

Hi, where can I get the source code so I can modify it on .Net 1.1? I works fine on .Net 2.0, but I want to add this feature to my old project. Thanks a lot!

# August 22, 2007 10:20 AM

George said:

web.config is equivalent across the two machines. and yes, without the iframe, the problem still exists on the one machine.

something i forgot to mention is that when viewed in firefox, the site works from both machines. it's only when viewed using IE that the site doesn't work when served from one of the machines.

this article (support.microsoft.com/.../en-us) lead me to believe it was some sort of IE security setting, but I tried the resolutions listed in the article and was unsuccessful.

# August 22, 2007 10:49 AM

George said:

Hate to bug you again but I just realized something about the two servers that might be important. The one that works is on a different domain than the one that doesn't work. Could there be some sort of group policy being applied on one of the domains that is setting security on IE that interferes with sessions/cookies?

# August 22, 2007 11:57 AM

Luis Abreu said:

cool...i like it :)

# August 22, 2007 11:58 AM

Robert Macnair said:

I get this error...

Error 1 The type or namespace name 'Directory' does not exist in the namespace 'com.drew.metadata' (are you missing an assembly reference?) C:\Users\Rob\Documents\Visual Studio 2005\WebSites\PhotoAlbum\album.ashx 58 45 C:\...\PhotoAlbum\

sorry im new to all of this and am probably being really stupid. Ive put the DLL into the Bin folder and the other errors went ragarding this reference, but this one has stayed

Thanks!

# August 22, 2007 1:14 PM

Bertrand Le Roy said:

Allan: I haven't had time to migrate the source code yet, but I will in the following days. Sorry about the delay.

# August 22, 2007 2:49 PM

Bertrand Le Roy said:

George: At this point I would contact support. I'm sorry I don't have any better insight for the moment.

# August 22, 2007 2:50 PM

Bertrand Le Roy said:

Robert: that's weird. Are you sure you included the same version of the dll that came with the release file? Just unzipping the release in a web app should works out of the box. Does it or did you do something different from that?

# August 22, 2007 2:53 PM

Robert Macnair said:

D'Oh i was being an idiot...

I went to the link, clicked on the 'Source' tab and downloaded that. it only came with a samples folder etc and was wondering was was going on.

I must be needing sleep!

Thanks for the help Betrand

# August 22, 2007 6:58 PM

Terri Morton said:

Regardless of the new name, my feed reader will forever know you as "More Atlas stuff". :-)

I like it.  Much better than mine.

# August 22, 2007 11:54 PM

Ludovic said:

"Tales from the Evil Empire".... What, you're working for Apple now? :)

# August 23, 2007 2:20 AM

Robin Debreuil said:

Totally love it. Awesome job on the pumpkin too.. It is perfect Evil Empire - smiling like all customer focused companies - because it enjoys squeezing blood through your eyes ; ).

# August 23, 2007 6:56 PM

BIG DOE said:

I have an intranet site, and all i did was dumped the files that I downloaded into a folder in the intranet site.  Is that sufficient?

I get this error:

Parser Error Message: The file '/Intranet/album.ashx' does not exist.

Although the file is obviously there.  Is there something i have to do with the dll?

thank you.

# August 24, 2007 4:45 PM

Bertrand Le Roy said:

Big Doe: the dll just needs to be in the bin folder. If you downloaded the release file and uncompressed it into a folder that's configured as a web application, it should work directly.

# August 24, 2007 4:56 PM

John Williams said:

Used this to get a an Ajax enabled page working through a PageViewer web part. It worked like a charm and really saved my hide.

Thanks.

# August 24, 2007 7:06 PM

vidya said:

Found the Alert source code still not migrated to codeplex,when can i expect it?

# August 24, 2007 11:56 PM

Bertrand Le Roy said:

Vidya: it's in now. Thanks for your patience.

# August 25, 2007 1:30 AM

» ASP.NET Alerts available with source code on CodePlex said:

Pingback from  &raquo; ASP.NET Alerts available with source code on CodePlex

# August 25, 2007 2:52 AM

Steve Worthington said:

Hi there,

Informative blog and good examples thanks.

I hear what you are saying about using the Futures release and I have implemented using the Dynamic provider.

However I can find little documentation apart from the Quick starts. All of which seem to depend on a web.sitemap file being in existence, when really I want to create that on demand too.

So I have gone back to a custom handler for the google sitemap. Keen to hear if you know of any links to other implementations of the Dynamic provider.

Cheers,

Steve

# August 26, 2007 2:16 AM

Aaron said:

First off, thanks for sharing your time and effort -- a much needed control.

I've downloaded and run the sample Alert.aspx page and am noticing that it displays all button configurations in IE fine, but in firefox the only thing I can get rendering is "OK / Cancel" or just "OK" regardless if buttons="AbortRetryIgnore", it renders as ok / cancel. Is this just a browser limitation and so to be totally browser compatible I'll have to assume that users are only seeing 2 buttons which might only say "OK / Cancel"?

Not a terrible thing, but a developers is always concerned with the lowest common denominator. Thanks!

# August 26, 2007 11:28 AM

Christopher Steen said:

Link Listing - August 26, 2007

# August 26, 2007 12:08 PM

BIG DOE said:

Hi, sorry for my ignorance on this subject, but do I need to configure it as a web application on the web.config file?  I have created a application pool called "photoalbum" in IIS 6, although Im not sure its necessary.

If this is to be done on the web.config file, where on the file do I configure it?  thank you so much for everything!

# August 27, 2007 10:49 AM

BIG DOE said:

Thanks for everything, i figured it out.  It was not hard at all actually.  I placed the dll in the bin folder and make sure of the path of the ashx file on the default.aspx file, and viola!  thanks for everythign all, this is awesome!

# August 27, 2007 11:12 AM

BIG DOE said:

Sorry for being such a nusance, but how do I control it so that when you go to for example: album/default.aspx, the folder view only shows folders inside of the album folder, and not the folders of the entire web directory?

Right now, the bin folder is in the intranet/bin folder so everything under intranet is being shown in the folder view. Thank you so much.

# August 27, 2007 11:34 AM

hyphapy said:

最近在使用Asp.NetAjax1.0的框架,遇到了在不同域名下抛出

# August 27, 2007 11:56 AM

Bosker seth said:

select box is display over the div. How to overcom that

# August 27, 2007 12:27 PM

Bertrand Le Roy said:

Steve: the Futures implementation can use any site map provider. Read this to learn how to implement your own:

msdn2.microsoft.com/.../system.web.sitemapprovider.aspx

# August 27, 2007 1:57 PM

Bertrand Le Roy said:

Aaron: The control currently uses IE's modal dialog feature, which is not in Firefox. That's why the control downgrades to regular text alerts in this case. Ideally, the control would use a simulation of modal dialog such as the one in the ASP.NET Ajax Control Toolkit but I didn't have time to go that far.

# August 27, 2007 2:00 PM

Bertrand Le Roy said:

Big Doe: just put the handler in the folder where you have the photos (don't move anything else, just the ashx. If you're using the handler as a control (and apparently you are), there is a bunch of properties on it, in particular HandlerUrl and Path, which should enable you to do that.

# August 27, 2007 2:10 PM

Bertrand Le Roy said:

Bosker: please read the post before posting a comment. Not to be rude but that's exactly what it is about.

# August 27, 2007 2:11 PM

Rama Krishna Vavilala said:

Thanks Bertrand!

We are truly honored that you and Scott wrote the foreword for us.

# August 27, 2007 4:36 PM

» ASP.NET Ajax in action available said:

Pingback from  &raquo; ASP.NET Ajax in action available

# August 27, 2007 5:13 PM

Madtown said:

I am very excited to find this program and it does exactly what I need to show photos of our work to customers (and especially potential customers!). My only problem is that it is displaying all of our directories (ie Admin, Secured, etc) on the main page. How can I restrict it to only look for pics in specific folders such as "WorkPics"? I wish I knew as much as you guys!

# August 27, 2007 11:00 PM

Marc said:

Very good patching!

App now works smoothly

# August 28, 2007 3:46 AM

George said:

Finally got it to work.

First I had to add this line to the web.config file right under the <system.web> tag:

<sessionState cookieless="true" timeout="20"></sessionState>

Then I changed my Response.Redirect calls to this:

Page.Response.Redirect(Page.Request.Url.AbsolutePath(), True)

Maybe someone out there has the same problem and can try this workaround to solve it.

# August 28, 2007 11:22 AM

Bertrand Le Roy said:

Madtown: see above comments. Big doe had almost the  same question.

# August 28, 2007 1:13 PM

BIG DOE said:

A quick question:

I want to have some one click on a link that will take them to one of the folders in the album, is there a way to reference it?  Through a href like ...default.aspx?folder="vacationfolders"

Thank you, and sorry if these questions are juvenile, I am very new to this.

thx again.

# August 28, 2007 1:54 PM

Bertrand Le Roy said:

Big Doe: take a look at the Permalink property on the control. If you're using it as a handler and not as a control, just copy the url.

# August 28, 2007 2:00 PM

BIG DOE said:

Thanks for the reply, but where can i get the url of the specific folder?

right now I have the link set to:

intranet/album/default.aspx?"albummode=preview&albumpath=vacation"

This is the right syntax?

vacation is the name of the folder.

I cannot get this to work, please help!  =(

# August 28, 2007 2:26 PM

Bertrand Le Roy said:

Why the quotes? I suppose it should work without them. The PermaLink property should just give you the right url iirc.

# August 28, 2007 2:29 PM

BIG DOE said:

thanks again, I hate to be pestering you with stupid questions, but how do you use the permalink property to give me the right url?  =(

I guess this will help many other novices as well.

# August 28, 2007 2:38 PM

Bertrand Le Roy said:

You set the NavigateUrl of a hyperlink control to its value for example.

# August 28, 2007 2:53 PM

BIG DOE said:

IM sorry, i am about to give up.  Where in this area do I set it?

<body>

   <form id="form1" runat="server">

       <photo:album runat="server" ID="Album1" />

   </form>

</body>

# August 28, 2007 3:07 PM

Bertrand Le Roy said:

From memory and in C#:

<photo:album runat="server" id="Album1"/>

<asp:hyperlink runat="server" id="Permalink" Text="Permalink"/>

<script runat="server">

protected override void OnInit(EventArgs e) {

 base.OnInit(e);

 Permalink.NavigateUrl = Album1.PermaLink;

}

</script>

# August 28, 2007 3:12 PM

Chocolim said:

Anything is better than IE

# August 28, 2007 3:27 PM

Sashidhar said:

I am completely new to DotNet..can anyone give me exact flow of asp.net page?

# August 29, 2007 6:49 AM

sunil Kumar said:

Creating Confirm box in ASP.Net Page

Step 1:  

Create an input hidden htmlcontrol:

<input type=”hidden” name=”hdnValue”>

hdnValue control will store the Boolean value from confirm box and we ca easily get this value in Page load method.

Step 2.    

Create a script in aspx.cs file like:

String myscript=@”< script language=”javacsript”>

Function myconfirmation ()

{if (confirm(“Do you want to delete ?”))

{

document.forms[0].elements[“”hdnValue””].value=””true””;

 Document.forms [0].submit ();

}

}

myconfirmation ();

</script>”;

Step 3:

Call this script  where you want to get confirmation box

RegisterStartupScript ("myscript", myscript);

Step 4:

Page_load method get the boolen value

if (Request ["hdnValue"]! =null && Request ["hdnValue"].Length>0)

{ //do something if confirmation is yes

}

# August 29, 2007 1:30 PM

Shauheen said:

Thanks, It fixed the problem! Hope that MS would release some official patch as well, I assume there are plenty more to be fixed!

# August 29, 2007 2:49 PM

Bertrand Le Roy said:

Shauheen: it's already patched in all recent versions of ASP.NET Atlas.

# August 29, 2007 5:15 PM

Bertrand Le Roy said:

Sashidhar: that's exactly what the diagram is. For more details, please consult MSDN:

msdn2.microsoft.com/.../ms178472.aspx

# August 29, 2007 5:17 PM

Madtown said:

I am able to run the .ashx fine, but when I try to run the template page it gives me the Image-not-found signs where the photos should be. Once you navigate to the actual photos to enlarge them they appear ok. suggestions? I moved the .ashx to the /images directory but left all the other files in the main directory.

# August 29, 2007 10:18 PM

Arnout Symoens said:

Bertrand,

this is great ! Saved my project !

Regarding your last comment, that it's already patched, I'm not sure.

It still didn't work today :)

But your patch solved it ! Thanks !!!!

Arnout Symoens

# August 30, 2007 10:15 AM

Bertrand Le Roy said:

What I mean by "all recent version", I mean everything that shipped from Orcas Beta 1, but that doesn't include 1.0 even though it can still be downloaded. Version 1.0 remains unpatched and will remain that way.

# August 30, 2007 11:07 AM

Bertrand Le Roy said:

Madtown: This happens when you don't have sufficient priviledges to write thumbnails to the temporary directory. You can check that by trying to browse directly to the url of one of the thumbnails and check the error message.

The workaround is usually to set the application to high trust, or if you can't, switch the caching mode in the handler's configuration from disk to memory or none.

# August 30, 2007 11:17 AM

Ikeer Savage said:

Bertrand,

 Thank you very much. The patch worked like a charm.

# August 30, 2007 12:52 PM

Tales from the Evil Empire said:

Yes. This being out of the way, let me explain why (just in case you haven't read one of the million

# August 30, 2007 6:06 PM

Seven deadly sins of game design - Tales from the Evil Empire said:

Pingback from  Seven deadly sins of game design - Tales from the Evil Empire

# August 30, 2007 6:57 PM

Collin said:

Talked me into checking it out.

# August 30, 2007 8:17 PM

Gregor Suttie said:

I concur captain in everything you say - its a joyous thing to play Bioshock.

( if you take back your criticisms of Gears Of War we may be back on an even keel <g>)

G

# August 31, 2007 8:11 AM

Some Guy said:

You forgot #8: SecureROM.  This allows me to warez the game.  Developers, include that garbage in your game, just gives us "users" a green light to warez it!

# August 31, 2007 10:29 AM

Bertrand Le Roy said:

Gregor: I loved Gears, but it does have a few flaws, like its checkpoints and unskippable cut-scenes right after the checkpoints (it's so simple to put them *before the checkpoint* (or allow us to save anywhere)).

Some guy: while I agree that some protection systems on PC range from annoying (activations for example) to unacceptable (when they are rootki-like), they are just one more reason for me to play on 360 and never on the PC. Furthermore, there is no rootkit in Bioshock PC. The security system may be annoying and may restrict reselling options but it doesn't justify piracy. I think you're just making excuses for being a thief.

# August 31, 2007 1:30 PM

InfinitiesLoop said:

A worthwhile ENDING should be on the list if you ask me. All that work, I expect a fanfare of a cut scene at the end with some huge cliffhanger for the next game. The ending of Gears was... not that. Final Fantasy games are the goto games for great endings if you ask me.

Don't tell me you already finished Bioshock?

I haven't even purcahsed it yet... definitely next on my list though.

# August 31, 2007 1:36 PM

Bertrand Le Roy said:

Dave: no, I'm not quite done yet but I've seen enough of the game to make an opinion, and my friend Fabien finished it last night. The end of Gears was ok. Just ok.

Go buy Bioshock now, you've got three days to play it full-time. Seriously, you'll thank me.

# August 31, 2007 1:47 PM

RichardC said:

Hi Bertrand,

Bioshock is now available in France. But do you run it under XBox 360 or PC?

Under PC, rumors says that you must have a really, really fast computer.

# September 1, 2007 3:18 AM

ddbEntertainment said:

Insanely irritating. I have an iPaq 2215 and like you I don't want it to sync with the damn PPC. I just want that damn message to go away!

# September 1, 2007 7:19 PM

OpenSource Connections » Blog Archive » Javascript Intellisense, Documentation, & Visual Studio 2008 (Orcas) said:

Pingback from  OpenSource Connections  &raquo; Blog Archive   &raquo; Javascript Intellisense, Documentation, &#038; Visual Studio 2008 (Orcas)

# September 2, 2007 2:38 PM

Hiran Karunananda said:

i used "BLOCKED SCRIPT'&lt;html&gt;&lt;/html&gt" to fix my div overlapping with iframe in https. when i checked with my local machine iis it works perfectly wihout giving any 'non secure items' alert. but when i save file into my test server alert will popup. so i like to know if any configuration change needs to fix this issue or any other thing??

please some body have an idea would be really appreciated.

# September 3, 2007 9:07 AM

anothr user said:

One new subscriber from Anothr Alerts

# September 3, 2007 10:58 PM

Dave Parslow said:

Very memorable title!  Your title is much better than the other blogs mentioned.  By the way, interesting is that 1 Infinite Loop is Apple Computer's corporate address.  I would agree that your blog could be a bit wider, although 100% width might not be the best.  Do you have your blog on an analytics engine to examine your audiences' browser settings for width?

# September 3, 2007 11:11 PM

Collin said:

OK, I checked it out.  I have plenty of opinions.  So far the game play is great.  It's lacking the frustration factor for sure.

Gears of War was just too darn easy and seemed way to short.. But then maybe I was just too into it to let up till I was done with it.  Either way the cut scenes were no where near as bad or frustrating as they are in COD3.

Bioshock does have plenty of redeeming factors and is certainly on my top list of single player games.  Gears is also up there.  COD3 is the better multi-player game with Gears sucking ass and losing big points for 3rd person view which is NOT EVER good for multi-player.  Bioshock has no multi-player (that I am aware of) which is a shame but they beat out the competition for playability while stoned and or drunk.

Perfect game design is a long way off and while I agree Bioshock is terrific game design I worry that it's because we have been so used to poor game design .  It's to the point where so much attention is given to the look that they forget the feel.

I will give Bioshock big time props for how much they packed into the game without overloading us too much.  Nothing is worse than taking a winning game like Ghost Recon and turning it into a pile of crap with GRAW.  

I love Bioshock's story line also.. that is just a great idea of a submerged city.  I can't wait to see where the story is going to lead me.

Is it just me or did they steal a bit of the beel of this game from Fallout 2?  That is an old game that has a post-apocalyptic feel and very similar 50's style advertisements and such..  very different games but similar feel.

# September 4, 2007 12:02 AM

Gregor Suttie said:

Bioshock is just such a great game - Arcadia with the Lost style violin music is quite scary and when the kid on dead guys jumped up I literally jumped off my seat - that'll teach me not to play it up at a high volume.

The visuals in the games are getter better and better. Setting your foe on fire then shot gunning them, setting a swarm of bees on them and then clubbing them with a spanner is just great fun.

# September 4, 2007 10:05 AM

Bertrand Le Roy said:

Richard: I run it on Xbox.

Collin: the ads do look very much like the Fallout ones, yes.

# September 4, 2007 3:50 PM

Bertrand Le Roy said:

Hiran: your message doesn't make it clear if you included both quotes around the html tags (I don't see the second one). The idea here is to use the javascript protocol and return a literal string that contains emtpy html.

# September 4, 2007 3:53 PM

Bertrand Le Roy said:

Dave: thanks for the kind comments. Good point about analytics, I should definitely do that. When I find time. :/

# September 4, 2007 6:07 PM

Marcelo - UruIT .NET Outsourcing said:

Hi, I would like to know if this control works with AJAX.NET inside an AJAX Update Panel.

Do you know of any workaround to my problem? I was injecting literals to the page with the JS code, but it doesn't work with Updates Panels :(

Thanks in advance,

Marcelo

# September 5, 2007 8:51 AM

Bertrand Le Roy said:

Marcelo: no, this control was developed way before UpdatePanel and doesn't currently work with it (though I would gladly accept a contribution to the project that makes it work).

You can read this to learn more about how to make controls work well with UpdatePanel:

weblogs.asp.net/.../What_2700_s-up-with-UpdatePanels-and-how-come-nothing-works_3F00_-Or_3A00_-A-brief-explanation-of-how-UpdatePanel-works-by-the-guy-who-wrote-the-feature.-_2800_Long_21002900_.aspx

and

weblogs.asp.net/.../HOWTO_3A00_-Write-controls-compatible-with-UpdatePanel-without-linking-to-the-ASP.NET-AJAX-DLL.aspx

# September 5, 2007 12:17 PM

Morten said:

Is there a way to document the parameters a handler function should take for events? I want to specify that for instance the first argument will be the sender object of some type, and the second will be the event argument that is an object with a couple of named fields.

Let's say this is how I fire my event:

 var handler = this.get_events().getHandler('valueChanged');

 if(handler) handler(this,{"oldValue":3,"newValue":7});

...it would be great if I could document what types the two arguments are, and what fields the second argument contains.

# September 5, 2007 1:14 PM

Bertrand Le Roy said:

Morten: Yes, I agree. Thanks for the suggestion.

# September 5, 2007 1:28 PM

DROCK said:

I just resolved the 'sys' undefined error by removing ALL line breaks from microsoftajax.js.  The file as downloaded from Microsoft has 2 line breaks in it.  I'll never get those days back..

# September 5, 2007 7:30 PM

Bertrand Le Roy said:

What???

# September 5, 2007 7:42 PM

IanC said:

I tried the onenote suggestion but I get a completely white screen. If I capture the area (in white) where I want, I get a nice bacl capture. (Using Vista Ultimate on a 3 screen system with dual NVIDIA cards). Wouldn't mind so much if the snipping tool doesn't tell me that it's "not working just now".

# September 6, 2007 9:01 AM

Gregor Suttie said:

The one ommission from perfect game design in my opinion is online multiplayer - my xbox live friends have been asking me lately what is bioshock like, I tell them its fabulous and the first and only question that they really wanna know is - "can you play it against others?" - for me this is what makes a game more complete - playing Gears for example online throws up a different type of animal every single time you play it - even playing against the the same friends every night Gears is still fantastic.

Imagine playing Bioshock online with the ability to take each other on with plasmids and download new maps and potentially different tasks to take on.

Gears as a 1 player game does have a few minor annoyances but online its da bomb and will continue to be number 1 game on xbox live for a while (until halo 3 of course).

# September 7, 2007 3:45 AM

Bertrand Le Roy said:

Gregor, I disagree. I think it's doing what it does perfectly. That doesn't mean that you couldn't add to it and make it even better but the online component for example is something that would be great for some people (me I couldn't care less, I don't have fun with competitive multiplayer) but not having it doesn't make the solo campaign (what it is) worse. What I'm trying to say is that the point of the article was to determine if and how Bioshock does what it does badly, well or perfectly. Perfect doesn't mean it can't be improved or added to :) It means that nothing gets in the way of the fun.

If you asked me, what I would add to Bioshock first would be cooperative multiplayer.

# September 7, 2007 1:11 PM

Bertrand Le Roy said:

Oh, and Gregor, my friend Fabien who is very much into competitive multiplayer games doesn't quite agree with you on multiplayer Gears, which he rarely plays. He seems to prefer Rainbow Six Vegas. Did you check this one out?

# September 7, 2007 1:13 PM

Peja K said:

How do I know if I'm running AJAX Beta 1?

# September 7, 2007 6:01 PM

Bertrand Le Roy said:

Peja: look in add/remove programs

# September 7, 2007 6:14 PM

Sean said:

Please consider implementing the following:

Most ajax History solutions run into problems if the user hits refresh (all history entries are lost).  

Another major headache is that the programmer has to write a lot of code to reproduce the page state of each page.

A way to fix all these problems (including ones mentioned in your article) is to have your Ajax History Control create a virtual cache of each Ajax page on the server during postback.  

This accomplish many things.  First - the programmer would not have to write code to reproduce page state when the Back Button is hit.  Second - if the user hits Refresh - and you cached history entries - you simply have the client browser rebuild the history entries.

Just a thought.

# September 7, 2007 6:38 PM

buzz said:

Αν θεωρείς κακό μπελά την ιστορία της έκτης, oh boy/girl, you 're so naive. Σε web developers απευθύνεται αλλά αφορά όποιον αναρωτιέται "Μα πόσο άχρηστοι είναι που δεν δουλεύει με όλους τους browser".

# September 8, 2007 5:43 AM

Jason Haley said:

# September 8, 2007 10:05 AM

4 Links Today (2007-09-08) said:

Pingback from  4 Links Today (2007-09-08)

# September 8, 2007 11:20 AM

Dave said:

I have an iPaq rz1715 and get the same message.

# September 8, 2007 7:14 PM

Tales from the Evil Empire said:

The guitar Harmonix chose for the Xbox 360 version of Guitar Hero II is not exactly my favorite guitar

# September 10, 2007 1:31 AM

Flash said:

There's already been several history tools developed for Adobe Flash which has historically had exactly the same problems as AJAX.

# September 10, 2007 5:36 AM

evalotta said:

Thanks very much for your article. It was really helpful to fix the problem. Keep up the good work :)

# September 10, 2007 10:19 AM

Firefox said:

Great post on managing across several browsers....

# September 11, 2007 12:39 AM

Steve said:

Wow, looks like quite a hack.

The trouble with these approaches are that when browser updates come out it could break an entire application built with this history.

Seems there could be a better solution.  I'd look at it from an IIS perspective not a client browser perspective.

Utilize what is least likely to change.

# September 11, 2007 9:01 AM

Bertrand Le Roy said:

Steve: you're absolutely right those techniques are hacky and are commonly broken by new browsers (Opera 9.23 and Safari for Windows proved it recently as the article points out. On the other hand, vendors are now aware of how Ajax applications rely on url hashes to manage history and are less likely to break them in the future. Also, Ajax in general relies on a lot of browser hacks and it's perfectly ok as a developer or an organization to say that it's not suitable or too risky for a particular project.

But if you can afford to take that risk, here's how it's done.

I'm not sure what you mean by "look at it from an IIS perspective".

# September 11, 2007 1:33 PM

Rick Strahl said:

Dude - you have WAY too much time on your hands.

Then again I remember doing something like this to a real flying V at some point, he he...

# September 11, 2007 4:10 PM

Bertrand Le Roy said:

Rick, I totally disagree with you. I need *a lot* more time...

# September 11, 2007 4:14 PM

Steve said:

I didn't mean to be condescending - thanks for the follow up response.  It is an interesting topic.

# September 11, 2007 7:29 PM

Bertrand Le Roy said:

Steve: I didn't think you were, don't worry.

# September 11, 2007 7:34 PM

Eric Lippert said:

Do you always give out awards without telling the recipients?

:-)

Glad you like it.

# September 13, 2007 3:58 PM

Michel Baladi said:

Works like a charm - thanks!!

# September 13, 2007 4:29 PM

Ajax Girl » Blog Archive » How to build a cross-browser history management system said:

Pingback from  Ajax Girl  &raquo; Blog Archive   &raquo; How to build a cross-browser history management system

# September 14, 2007 8:41 AM

Dylan Schiemann » Blog Archive » browser history: a pot meets kettle story said:

Pingback from  Dylan Schiemann  &raquo; Blog Archive   &raquo; browser history: a pot meets kettle story

# September 14, 2007 12:40 PM

Javascript News » Blog Archive » How to build a cross-browser history management system said:

Pingback from  Javascript News  &raquo; Blog Archive   &raquo; How to build a cross-browser history management system

# September 14, 2007 3:03 PM

napyfab:blog» Blog Archive » links for 2007-09-14 said:

Pingback from  napyfab:blog&raquo; Blog Archive &raquo; links for 2007-09-14

# September 14, 2007 7:40 PM

Deficiencias en algunos exploradores - Incubaweb 2.0 Bit??cora del Software, Web 2.0, Beta, Windows, Linux, Mac OS X, Open Source, .... said:

Pingback from  Deficiencias en algunos exploradores - Incubaweb 2.0 Bit??cora del Software, Web 2.0, Beta, Windows, Linux, Mac OS X, Open Source, ....

# September 15, 2007 12:49 PM

Weekend Links - Windows & PHP, Vista-Style CSS Toolbar, Facebook Applications, CSS/DOM File Inputs, Browser History | BluDice Blog :: PHP, MySQL, CSS, Javascript, MooTools, and Everything Else said:

Pingback from  Weekend Links - Windows &#038; PHP, Vista-Style CSS Toolbar, Facebook Applications, CSS/DOM File Inputs, Browser History  | BluDice Blog :: PHP, MySQL, CSS, Javascript, MooTools, and Everything Else

# September 15, 2007 2:10 PM

Neil Jenkins said:

A couple of weeks ago I needed a history manager for a photo gallery I was working on and finding no satisfactory solutions I did a bit of research myself. I came to more or less the same conclusions as you did but I did find a solution for Opera. Simply define a global callback function (I called mine $justForOpera) and inject the following image into the document (hidden with appropriate CSS) with the following magic src: "javascript:location.href='javascript:$justForOpera();';". This will fire every time the back/forward button is pressed: works like a charm.

I have a working History Manager with full compatibility with IE6+, Firefox 1.5+, Opera 9+ and Safari 2. It's based on the mootools library but it should still be fairly easy to understand. photogallery.neilj.fastmail.fm/revision5js/HistoryManager.js">photogallery.neilj.fastmail.fm/.../HistoryManager.js. You can demo it at photogallery.neilj.fastmail.fm/revision5

I hope this helps!

# September 15, 2007 7:08 PM

David Cumps » String Concatenation vs Memory Allocation said:

Pingback from  David Cumps  &raquo; String Concatenation vs Memory Allocation

# September 16, 2007 1:34 PM

CumpsD said:

I've done some tests as well, on the memory usage of various string concatenation methods, might be a useful addition to your research: blog.cumps.be/string-concatenation-vs-memory-allocation

# September 16, 2007 1:52 PM

Julien Lecomte said:

Using about:blank or that "magic" url simply does NOT work. The first state does not get stored! The ONLY way I know to make this work FULLY on IE is to use an IFrame in the markup (do not create it dynamically) and point it to a real file on the server. After that, you can do some document.write. Also, the YUI history library works perfectly well on Safari 2. Look at the source code to figure out how it's done.

Cheers!

# September 16, 2007 3:57 PM

  links for 2007-09-17 by The Third Part said:

Pingback from  &nbsp; links for 2007-09-17&nbsp;by&nbsp;The Third Part

# September 17, 2007 4:20 AM

Anonymous said:

When is support for v1.0.61025 of the extensions going to be available.  Check out Codeplex and please respond to inquiries!!

# September 17, 2007 11:52 AM

Bertrand Le Roy said:

Julien, thanks for the comment. You are absolutely right, on the first request, the frame needs to point to an existing file on the server, the magical url doesn't quite work at this point (it does later). Just to be clear, our history manager *does* work on Safari 2 and the article explains how. It's Safari 3 beta for Windows that currently has a problem.

Updating the post to take your comment into account...

# September 17, 2007 1:06 PM

Bertrand Le Roy said:

Neil: thanks for the trick. It does work. I'll update the article, but I probably won't integrate that into the product as the bug seems to be fixed in Oera 9.5.

# September 17, 2007 1:52 PM

Dave said:

I don't know about going forwards but going backwards I can vouch for the fact that for IE 5.5 I was better off leaving it off. We had a lot of weird script engine issues that were only happening in code where we had the attribute - took it out and magically the problem was solved.

# September 17, 2007 5:04 PM

Venk said:

im getting sys.undefined only in firefox and not in ie can u help me out with this

# September 18, 2007 2:48 AM

GH said:

I have been coding in Script since IE3 and I never saw problems with IE5.5 by including a type OR language attribute - I'd suggest any issues Dave encountered might be to do with use of non-standardised (i.e. non W3C compliant) script.  I used XML DOM, DHTML, XSLT, etc with IE5.5 and never once had a problem by including type="text/javascript" in the tag.

Although use of the language attribute is somewhat deprecated, given the number of browsers that are still out there which support different combinations, I still think it's good practice to at least include a type attribute in script tags, and I will continue to do so - after all, what if, for example, someone disables javascript but has VBScript enabled - if that's possible - oh dear - big hole in Mr Crockford's plan perhaps?

# September 18, 2007 7:01 AM

Yves said:

@Dave : The futur of the internet is not based on IE 5.5 -_-

# September 18, 2007 7:28 AM

BIG DOE said:

Thanks for all your help.

One more question. =)

What part of the code would you have to change in order to make it so that if you click on the thumbnail, a new window pops up with the photo?

Thank you so much in advance, this is an awesome tool.

# September 18, 2007 9:45 AM

Brett said:

It doesn't appear in my limited testing, that IE supports either application/javascript or application/ecmascript.

This page appears to confirm:

www.robinlionheart.com/.../scripts

I'll probably just use text/javascript for now.

# September 18, 2007 11:25 AM

Bertrand Le Roy said:

Brett, you're right, I'm an idiot and I've updated the post.

# September 18, 2007 12:49 PM

Bertrand Le Roy said:

Venk: you probably introduced a syntax error while patching the file. Please double-check.

# September 18, 2007 2:24 PM

Bertrand Le Roy said:

Big Doe: look for the GenerateFolderPage method. Then look for the loop over images that's in there. In there, you can see code that renders the A tag. Add a target attribute in there and use "_blank" as the value. That should work. If you want more control over the size and appearance of the new window, you may want to use an onclick instead and some basic window.open javascript.

# September 18, 2007 2:32 PM

Douglas Crockford said:

You can violate RFC 4329 or you can violate XHTML 1.0 or you can fail on some browsers. You must choose one. I find it is best to ignore XHTML because it isn't going to happen anyway. We are stuck with HTML.

# September 18, 2007 4:01 PM

Scott said:

"in the future browsers won't support other scripting languages"

On one hand, I understand why we want to think about what future browsers will/won't support. A lack of that kind of thinking got us, the web developer community, into a mess 5-7 years ago.

But there's lot of things, plugins and what not, that browsers might not support in the future. Should we ignore all of those things now? No.

The biggest problem I had with Crockfords statement is that he didn't present any negative effects of using the "type" attribute. He didn't have an example of something breaking or not working because the tag had a "type" declared. I don't see any reason to not use the type attribute.

# September 18, 2007 4:29 PM

BIG DOE said:

Thanks Betrand Le Roy:

This is what I have:

writer.RenderBeginTag(HtmlTextWriterTag.A);

writer.AddAttribute(HtmlTextWriterAttribute.Target, "_blank", true);

The second line should create a new window when the user clicks on the thumbnail, no?  I saved the ashx file and it still showing in the same window. Anything I am doing wrong?

Thank you so much!

# September 18, 2007 4:36 PM

Bertrand Le Roy said:

Douglas: all that's true, but not everyone may have the luxury of ignoring XHTML. Many administrations have this as a requirement. Also, even if some browsers *cough* IE *cough* don't support XHTML, it's still very useful in situations where you need the markup to be a dialect of XML for whatever reason.

For me, violating RFC 4329 is by far the least of those three evils: (almost) no one can afford to fail on IE, many people can't afford to ignore XHTML and there is no big disadvantage in violating RFC 4329.

Just trying to present people with the options and what they imply.

Thanks for the comment!

# September 18, 2007 5:36 PM

Bertrand Le Roy said:

The attribute has to be written *before* the tag.

# September 18, 2007 5:39 PM

Shanmuganathan said:

Hi,

       I hav a situation that i need to open a file in specific program... For example i have a Text file(Notepad) and Onclicking,it must get opened in Notepad... How do i do that in ASP.Net using C#..

and also i need to download multiple file in ASP.Net... If u have any articles or codes regarding this send to me...

Im expecting ur reply...

Regards,

Shanmuganathan

# September 19, 2007 5:35 AM

BIG DOE said:

Worked Perfectly!  THanks alot!  Our entire office is going to love this, I'll make sure the wonderful person(s) behind this awesome program be known.

# September 19, 2007 8:45 AM

Milan Negovan said:

Bertrand, why does iframe have to be static? I've managed to dynamically insert one into DOM and point it to an existing file (!) just fine (it was a centered AJAX progress indicator, not a history control, though).

I documented my struggle here: aspnetresources.com/.../always_set_iframe_source.aspx

# September 19, 2007 10:23 AM

Bertrand Le Roy said:

Shanmuganathan: you're terribly off-topic ;)

Please send me mail using the contact form on this blog and I'll give you an answer offline.

# September 19, 2007 1:47 PM

Bertrand Le Roy said:

Milan: it's fairly easy to build an iframe dynamically, even without a physical page to point at (just use the magical url). But you can't use it for history management. Sorry about the misunderstanding.

# September 19, 2007 1:50 PM

InfinitiesLoop said:

You should do this to a controller :)

# September 20, 2007 12:40 AM

Bertrand Le Roy said:

Ah, Dave, you must be reading my mind...

# September 20, 2007 1:09 PM

steve johnson said:

Here's one more, when you know the variable

exists, but the value is undefined.

if (undefined != var)

# September 20, 2007 2:33 PM

おぎわら@.NET道場 Blog(わんくま編) said:

[Tips][記事リンク](ASP.NET)ブラウザの履歴管理

# September 21, 2007 1:22 AM

おぎわら@.NET道場 Blog(わんくま編) said:

[Tips][記事リンク](ASP.NET)ブラウザ種類別の履歴管理表

# September 21, 2007 1:30 AM

PKINTAL said:

How to create aspx pages Dynamically?

# September 21, 2007 6:50 AM

Ernie Malagrida - at Ernest.Malagrida@eot.state.ma.us said:

Hi,

I am looking to do the following:

I have a gridview and each row has a checkbox.

If the user does not check at least one checkbox,

I want to display an alert message that at least

one box must be checked.

Any help would be appreciated.

Thanks,

Ernie

# September 21, 2007 9:55 AM

Bertrand Le Roy said:

PKINTAL: this is off-topic. Please send me mail through the contact form of this blog and I'll give you an answer offline.

# September 21, 2007 12:33 PM

Bertrand Le Roy said:

Ernie: I don't think you can do that without writing some specific client-side script except if you're willing to do that during a postback, in which case you can look through your checkbox controls and call show on the alert from the server side if necessary.

# September 21, 2007 12:42 PM

Techy News Blog » OpenAjax InteropFest 1.0: Microsoft's entry said:

Pingback from  Techy News Blog &raquo; OpenAjax InteropFest 1.0: Microsoft&#39;s entry

# September 21, 2007 5:04 PM

Microsoft News Aggregator » OpenAjax InteropFest 1.0: Microsoft's entry said:

Pingback from  Microsoft News Aggregator &raquo; OpenAjax InteropFest 1.0: Microsoft&#39;s entry

# September 22, 2007 1:07 AM

OpenAjax InteropFest 1.0: Microsoft's entry : Celebrity News Corner said:

Pingback from  OpenAjax InteropFest 1.0: Microsoft&#39;s entry : Celebrity News Corner

# September 22, 2007 3:32 AM

Brad Abrams said:

Recently Bertrand posted OpenAjax InteropFest 1.0: Microsoft's entry . The OpenAjax's InteropFest 's

# September 23, 2007 10:11 PM

MSDN Blog Postings » Microsoft Passes the OpenAjax InteropFest Test said:

Pingback from  MSDN Blog Postings  &raquo; Microsoft Passes the OpenAjax InteropFest Test

# September 23, 2007 11:23 PM

Noticias externas said:

Recently Bertrand posted OpenAjax InteropFest 1.0: Microsoft&#39;s entry . The OpenAjax&#39;s InteropFest

# September 24, 2007 1:26 AM

Brian Otten said:

I've implemented the Ajax patch and so far so good. But I'm pretty sure that the fix has not been implemented in the AjaxControlToolkit.

I've just downloaded the 9/20/2007 build and I'm still getting the 'Access denied' error when viewing my app within a Sharepoint PageViewer web part. I'm about to grab the source code and do the changes manually and rebuild.

Can anyone else confirm that the current AjaxControlToolkit still has the issue? I can't find squat about it on the CodePlex Issue Tracker.

# September 24, 2007 3:36 AM

Scott Barnes said:

heh, i love the title dude as I at times often wonder if *some* folks online think we do actually belong to the evil empire...well now i can point those to this blog ;P

-

Scott.

# September 24, 2007 6:04 AM

Bertrand Le Roy said:

Microsoft joins several other companies and open-source projects in meeting OpenAjax guidelines.

Microsoft has passed the OpenAjax Alliance's suite of interoperability tests to prove that its software can interoperate with other parts of the OpenAjax ecosystem.

# September 24, 2007 1:39 PM

Kirti Deshpande said:

Is this the Toolkit issue you are looking for? www.codeplex.com/.../View.aspx It was fixed as far as I can see in changelist # 17775. But it seems like people are still seeing it though: www.codeplex.com/.../View.aspx. We will look into the problem.

Thanks,

Kirti

# September 24, 2007 1:50 PM

Joe Chung said:

It's JSON-like syntactically but not as flexible as JSON.  You can neatly nest JSON within JSON, for instance.  Nesting object-initialized anonymous types, on the other hand, sounds like it could get pretty messy, syntactically speaking.

For a IDictionary<string, string> parameter, JSON is overkill, but it's a nice substitute for XML, especially in Web browsers where XML support is spotty and inconsistent *cough* where's E4X, IE? *cough*.

I'm just waiting for some standards body to come along and ruin the party for us all by coming up with some JSON-Schema specification. ;)

# September 24, 2007 8:08 PM

Missing Features » Solving the Top AJAX Usability Problem: The Back Button said:

Pingback from  Missing Features &raquo; Solving the Top AJAX Usability Problem: The Back Button

# September 25, 2007 12:52 PM

Infinities Loop said:

This question comes up from time to time , to time . If you understand how redirects work, then you also

# September 25, 2007 2:02 PM

Kari said:

I'm also looking for a solution to the problem posted above by Abhishek.  I have a Div that appears on top of some selects.  They are all hidden fine by the iframe (which I have inside the div) but as soon as you scroll the page the selects show through, and stay there. Unfortunately I have to support IE5.5 and 6.  Any ideas?? (other than the ugly method of hiding each one of the selects)

# September 25, 2007 2:07 PM

Ali Khalid said:

Thanks. This solution helped me a lot.

# September 26, 2007 3:39 AM

Techy News Blog » Getting AJAX defined… said:

Pingback from  Techy News Blog &raquo; Getting AJAX defined&#8230;

# September 26, 2007 4:54 AM

MSDN Blog Postings » Getting AJAX defined... said:

Pingback from  MSDN Blog Postings  &raquo; Getting AJAX defined...

# September 26, 2007 5:25 AM

voip » Getting AJAX defined... said:

Pingback from  voip &raquo; Getting AJAX defined...

# September 26, 2007 11:40 AM

Fine Art » The format for JavaScript doc comments - Tales from the Evil Empire said:

Pingback from  Fine Art &raquo; The format for JavaScript doc comments - Tales from the Evil Empire

# September 26, 2007 11:54 AM

Christian Toivola said:

Are you referring to parameter currying? similar to passing in a hash (more or less)?

# September 26, 2007 12:46 PM

BlackIsle Forever said:

Bioshock is too far away from perfect game design.

Hacking by using water-pipe combinations and also steam powered machine guns which can identify friendly and foe  are far too imaginative. They tried to create a world but could not keep it consistent.

Many things Bioshock claims to have innovated, especially A.I behavior, is already existent in many games. The mini helicopter guardians (i name them like that) are obviously inspired from the manhacks of half life 2.

It has many faults.

Also I always think that the most important sin of modern game design is the "story(fiction)" and the enviroment. Look at fallout it has pages of story behind it (before the game) and the game is based on that (even though you encounter the total story or not).    

# September 26, 2007 3:16 PM

Bertrand Le Roy said:

Christian: not quite currying, but passing a hash, yes.

# September 27, 2007 12:32 AM

Bertrand Le Roy said:

BF: "far too imaginative"? Since when is being imaginative a flaw? I don't think it's inconsistent. Unlikely maybe, but it's a game, it doesn't have to be likely to be immersive. Underwater skyscraper city? Not very believable from the start but *who cares*?

Not innovative? No, it's not (except for the checkpoint system). I don't think they claimed to have invented new AI behavior or the hovering thingies. I'd go so far as saying that if you've played System Shock or Deux Ex, you've pretty much already played Bioshock. But that's not the point. The point is that Bioshock delivers brilliantly and does what it does perfectly. It's no revolution, but it resets the standard to which future shooters will be evaluated.

What are those faults that you allude to?

I'm not following your point on story and environment. Do you mean the story and environment in Bioshock leave to be desired? That would be funny.

# September 27, 2007 12:42 AM

.net DEvHammer said:

Via Christopher Steen : Microsoft Passes the OpenAjax InteropFest Test Recently Bertrand posted OpenAjax

# September 27, 2007 10:42 AM

Dev Girl said:

I'm having the same problem as madtown.  I put the ashx file in the folder with the images i want to display and i have changed the handler's configuration from disk to memory and none.  It still doesn't show the pictures until i click the last one.

Otherwise this is a really cool program.  Thanks :)

# September 27, 2007 2:35 PM

Bertrand Le Roy said:

Dev Girl: please contact me through the contact form of this blog, and I'll have a look.

# September 27, 2007 3:21 PM

nkrick said:

I am using the photo handler on Whiist and am having a problem loading the "medium" sized images.  All of the thumbnails generated fine.  When I click on many of the thumbnails though, I do not get a medium size image and the next picture link does not load either.  All that is on the screen is the "back to folder view" link and "previous picture" link.  I have noticed that the pictures that do not load medium sized images are ones that have been modified and saved in Picasa (but not all images saved from Picasa have this problem).  Does this not work with certain compression levels?  or is there another problem?

# September 27, 2007 3:27 PM

Bertrand Le Roy said:

NKrick: I don't know of any such problems but I'd love to have a look at one of those images and try to figure it out.

Please send me the url using the contact form.

# September 27, 2007 3:34 PM

Dev Girl said:

Actually I just figured it out.  Thanks for the quick response. It looks great!!

# September 27, 2007 3:40 PM

Nick said:

I have tried everything with this problem - still no good. It really seems to be to do with IE and cookies - which is frustrating. Have a look at my post in ASP.NET forums - lots of detail on my problem.

forums.asp.net/.../1931020.aspx

I'd love some help...

thanks,

Nick

# September 27, 2007 11:20 PM

Phil Fostini said:

Just a quick question. I have 70 pictures in the share folder but only 22 show up on the web page. Am I missing something? I am using Windows Home Server RC1. My page is the above URL. I also posed this question on Andrew Grant's site.

I like how easy it is to use.

# September 27, 2007 11:52 PM

Bertrand Le Roy said:

Are all 70 photos .jpg files?

# September 28, 2007 2:14 AM

Phil Fostini said:

Actually 18 are jpeg and the balance is bitmap. Is that where I have gone wrong? The bitmaps are 1,800 - 2000 KB and the jpegs are 130 - 200 kb.

# September 28, 2007 9:37 AM

Bertrand Le Roy said:

Phil: yes, the handler only takes jpg files.

# September 28, 2007 12:03 PM

The ServerSide Interoperability Blog » Sample of Ajax interop said:

Pingback from  The ServerSide Interoperability Blog &raquo; Sample of Ajax interop

# September 28, 2007 4:08 PM

Phil Fostini said:

Thanks, I converted all to Jpeg and they all show up now

# September 29, 2007 11:06 AM

Programming said:

Recently Bertrand posted OpenAjax InteropFest 1.0: Microsoft&#39;s entry . The OpenAjax&#39;s InteropFest

# September 29, 2007 7:39 PM

josh said:

actually the print screen key is used to copy the image currently seen on the monitor so you can paste it in a word document or e-mail.  because you go writing articles maybe you should figure out how to fully use the keyboard.

# September 30, 2007 6:28 PM

Bertrand Le Roy said:

<g>, thanks Josh! Maybe because you go writing comments you should figure out how to read a post.

# October 1, 2007 2:02 AM

Morten said:

I've created a set of webcontrols that registers scripts (both at runtime and designtime), and these scripts also reference other scripts using the <reference assembly.../> tags.

When I add the webcontrol to the page, I would think that the scripts also gets included in the page so I get intellisense on them, but apparently not.

I might be doing something wrong, but if not, I'd like to see this kind of support in Orcas too.

# October 1, 2007 3:55 PM

Bertrand Le Roy said:

Morten: you can get Intellisense on those files by including an explicit script reference to the page.

# October 1, 2007 3:57 PM

Gaidar Magdanurov said:

Коллеги Брэд и Бертранд написали о возможности использования Microsoft Ajax для работы с сообщениями OpenAjax.

# October 2, 2007 9:58 AM

Noticias externas said:

Коллеги Брэд и Бертранд написали о возможности использования Microsoft Ajax для работы с сообщениями

# October 2, 2007 10:16 AM

I don't get the weird imagecrack to work said:

I've been trying to fix Opera support with this timer method for a long time now. I've noticed that timing only stops when the hash or adress changes. I think it would be prefereble to run the timer in a seperate page in a third iFrame on the page where the URL doesn't change. Reaching the timer is probably a little tricky, but for someone who can code well it's no problem i think. I have no idea if this works, but it seams logical enough to me..

# October 2, 2007 4:04 PM

Stève said:

Thank for this, scanpst did the job for my OST this morning

# October 2, 2007 11:45 PM

Robin Debreuil said:

wow, that is big news!

# October 3, 2007 1:34 PM

Martin Bennedik said:

This is great news. I remember the source code was shipped with the good old MFC. There was even a book "MFC Internals" which was a guide line to the MFC source code. Very good if something doesn't work as expected.

# October 3, 2007 2:15 PM

nikunj said:

I need .NET framework sample code

# October 4, 2007 12:48 AM

Runi Thomsen said:

Thank you - you just saved my day :-)

Worked great!

# October 4, 2007 9:17 AM

Max said:

I have the same problem with simple ASP, but I solved with a strange and unexplicable solution: I simply call the sessionId on top of page, with no precise function:

i simply write

SessionIdNumber=Session.SessionId

and all the following session values are not lost

?!?

# October 4, 2007 12:29 PM

M Anderson said:

A little more explaintion of the fix for black background on thumbnails please tried

Found a little bug/annoyance - im posting it here since gotdotnet will phase out in a few days(19th of June 2k7). in CreateFolderImage you didnt fill in the BackGround - thus using any other background than black will look wierd :-O I added this to fix it: g.FillRectangle(new SolidBrush(BackGround), 0, 0, size, size); Right after the stacked Graphcis has been declared (was line 477 of the .ashx file for me - v 2.1 of the handler) :-)

but did not change anything

# October 4, 2007 7:26 PM

h1pchek said:

Kari,

put a onresize sniffer in there:

window.onresize = moveWindow; //move popup if resized

var popDialogueDiv = document.getElementById('popDialogueShadow'); //positioned content div

function moveWindow() { //check to see if popup is showing before moving

   if (popDialogueDiv != null && popDialogueDiv.style.display == 'block') {

       findPos(hrefLocation);

       }  

}

i then coded the findPos function to move the iframe/contetnDiv.  you still get a flicker of the select boxes showing through, but it isn't as bad b/c of IE's quick redrawing.

# October 5, 2007 11:03 AM

Bertrand Le Roy said:

M Anderson: thanks, but this is a known issue (and the project moved to Codeplex long ago):

www.codeplex.com/.../View.aspx

# October 5, 2007 1:06 PM

wojtek said:

Bertrand,

Thanks for your work, but it wold be nice if you could break this article into parts and post updates in separate posts instead of cramming everything into this post and changing it around, it's hard to read and hard to follow.

I also believe "current state" should be a summary of how to make it work, sort of an abstract or outcome of your search - now it's just a reference to the article, which like I said is pretty hard to follow (I read the original, now I have to keep coming back to read again and again).

I wouldn't mind an edit that says click here for follow up, then the rest posted in new articles.

Cheers

Wojtek

# October 7, 2007 11:27 AM

jigar said:

So what is the best way to reject scripts in input? anyone please...

# October 7, 2007 8:46 PM

Bertrand Le Roy said:

Well, I prefer to have all the information in a single place. Thanks for the comment.

# October 8, 2007 12:50 AM

Bertrand Le Roy said:

Jigar: do you mean in an html input tag? Then use an asp:textbox, or just html-encode the value when rendering it.

If you mean in input data in general, the trick is to always use a technique that makes it impossible in the current context to inject code. That means parameters  in SQL instead of concatenation, HTML-encoding when rendering HTML, etc. Finally, validate input through a white list.

# October 8, 2007 12:55 AM

danilm said:

Hi, I have the same problems with

"using com.drew.metadata.exif" error.

I've downloaded latest album files (AlbumHandler2_1), extracted to wwwroot.

May I have to do anything else in IIS? (winxp)

thanks

# October 8, 2007 3:09 AM

Bertrand Le Roy said:

Danilm: I'll give you the same answer I gave to other users who had the same problem and which you can read above... You probably forgot to copy the dll into the bin directory.

# October 8, 2007 3:13 AM

danilm said:

I'm sorry but I have copied the dll into the bin directory and it doesn't work

is the right version: 2.2.2.41745?

I've downloaded AlbumHandler2_1 that contains all the files and folders

thanks

# October 8, 2007 4:57 AM

Bertrand Le Roy said:

Is the bin directory directly below the IIS application folder?

# October 8, 2007 12:35 PM

alejo699 said:

I must agree, Bioshock is as close to perfect a game as I have seen.  If one looks hard enough one can nitpick some flaws, but why would one want to?  To prove one's world-weariness, perhaps, or to demonstrate one's own inability to enjoy life?  I don't know.

As for BlackIsle's comment, yes, it's true:  Steam-powered guns are not likely to have IFF.  However, if you examine any game's "reality" quotient, you'll find it coming up short.  The bottom line is, if a game requires a single player to kill hundreds or thousands of foes it is NOT realistic.

Yes, Bioshock borrows from other games, including its own predecessor, just as most games do.  The difference is that Bioshock took many disparate ideas and created a more immersive world than any of the others have.  - And yes, I am including Half Life 2 in that, even though I love it dearly.

# October 9, 2007 7:58 PM

H Nguyen said:

Congrat!

Keep up the good work.

# October 9, 2007 10:39 PM

Angelina Fernandes said:

I tried using the onresize event ..it failed to work with me. so instead i captured the onscroll event. works  perfect now. let me know if anyone foresees the code failing.

angie

# October 10, 2007 4:23 AM

sebax said:

man, you really do not belive yourself, pls stop wasting your time...

# October 10, 2007 7:31 AM

Brad Abrams said:

Almost a year ago Microsoft joins the OpenAjax Alliance , then a month ago, Microsoft Passes the OpenAjax

# October 10, 2007 11:45 PM

Noticias externas said:

Almost a year ago Microsoft joins the OpenAjax Alliance , then a month ago, Microsoft Passes the OpenAjax

# October 11, 2007 12:12 AM

varma said:

can anyone tell me whr i can find abt noise generated from tidal plants...any link or smthing...

# October 11, 2007 1:12 AM

Dmitry said:

Another solution to the problem when you scroll the page with DIV above SELECT boxes:

simply make onScroll handler, that changes something in the page, for example, add a hidden div:

<div id="dummyDiv" style="display:none;"></div>

add onScroll handler:

function fixIe6Scroll(){

document.getElementById("dummyDiv").innerHTML="something";

}

document.body.onscroll=fixIe6Scroll;

the SELECT boxes still flicker, but it's not a big deal.

Hope it helps.

# October 11, 2007 2:22 AM

MSDN Blog Postings » Microsoft Joins the OpenAjax steering committee said:

Pingback from  MSDN Blog Postings  &raquo; Microsoft Joins the OpenAjax steering committee

# October 11, 2007 2:23 AM

HG said:

Thanks Bertrand for your article, but in my case the fix simply doesn't work. I've tried to call Redirect with false, set a dummy session variable and nothing. I'm really at a loss here.

I have a Login page, from which the user goes to a main admin page (default.aspx), which has 2 buttons, one that opens an Orders page, the other one an Artists page.

Here is some of my code:

In Login:

   protected void Page_Load(object sender, EventArgs e) {

       if (!IsPostBack) {

           string previousPageCode = Request.QueryString["p"];

           switch (previousPageCode) {

               case "o":

                   adminLogin.DestinationPageUrl = "~/admin/Orders.aspx";

                   break;

               case "a":

                   adminLogin.DestinationPageUrl = "~/admin/Artists.aspx";

                   break;

               default:

                   adminLogin.DestinationPageUrl = "~/admin/Default.aspx";

                   break;

           }

       }

   }

   protected void adminLogin_Authenticate(object sender, AuthenticateEventArgs e) {

       Admin adminUser = new Admin(adminLogin.UserName, adminLogin.Password);

       if (adminUser.IsAuthenticated) {

           e.Authenticated = true;

           Session["theAdminUser"] = adminUser;

       }

   }

In default.aspx:

   protected void Page_Load(object sender, EventArgs e) {

       Admin adminUser = Session["theAdminUser"] as Admin;

       if (adminUser == null || !adminUser.IsAuthenticated) {

           Response.Redirect("Login.aspx", false);

       }

   }

   protected void btnOrders_Click(object sender, EventArgs e) {

       Response.Redirect("Orders.aspx", false);

   }

   protected void btnArtists_Click(object sender, EventArgs e) {

       Response.Redirect("Artists.aspx", false);

   }

   protected void btnLogOut_Click(object sender, EventArgs e) {

       Session.Remove("theAdminUser");

       Response.Redirect("Login.aspx");

   }

And in Artists.aspx (Orders.aspx is similar):

   protected void Page_Load(object sender, EventArgs e) {

       Admin adminUser = Session["theAdminUser"] as Admin;

       if (adminUser == null || !adminUser.IsAuthenticated) {

           Response.Redirect("Login.aspx?p=a", false);

       }

       lblErrMsg.Text = "";

       if (!IsPostBack) {

           //...

       }

   }

   protected void btnAdmin_Click(object sender, EventArgs e) {

       Response.Redirect("Default.aspx", false);

   }

   protected void btnLogOut_Click(object sender, EventArgs e) {

       Session.Remove("theAdminUser");

       Response.Redirect("Login.aspx");

   }

# October 11, 2007 11:36 PM

Giumi said:

It works but I get a strange javascript error: Unspecified error.

Can anyone help me? Thank you!

# October 12, 2007 8:11 AM

Bertrand Le Roy said:

HG, we should take that offline. Please contact me through the contact form of this blog.

My question would be why you don't use Forms authentication instead of rolling out your own that has hard-coded pages and that is unlikely to be easily maintanable in the long run?

# October 12, 2007 2:21 PM

Gabe Misura said:

How about we do what so many business people ask: Get rid of the back button? heh.

We write web_apps_, in non-webapps, are there usually back buttons? Is there still a need to have the back button?

I still use it, so I'm sure it would be very hard to break everyone's habit of using/needing it.

# October 14, 2007 1:58 AM

Bertrand Le Roy said:

Gabe: the problem is that you can't get rid of it, so you might as well make it do something useful.

# October 15, 2007 1:42 PM

Atteint de Javascriptite aiguë [Cyril DURAND] said:

En JavaScript, il y a 2 grandes façons de faire une classe : le mode prototype et le mode closure . Méthode

# October 16, 2007 8:48 AM

Revenge said:

Yup same thing her on XP2SP2 with an iPaq 2215. I do sync, but not in WMP, just Outlook. No way to get rid of the message while device is docked. I hate MS sometimes.

# October 16, 2007 11:44 PM

John said:

I have read through the post and all of the comments numerous times.  I am very confident I have patched MicrosoftAjax.js and MicrosoftAjax.debug.js correctly.  No typos or anything.

I have the 10920 release of the toolkit, so it has the similar bug removed there as well.

I have followed the steps to apply the fix exactly, using the ScriptReference technique.  But I still get 'Sys' and 'Type' errors as others have noted when I run the application locally from Visual Studio 2005.  Whenever I do that my app always loads and gives these errors when I use the CalendarExtender control.  It doesn't matter if I am running in debug or not.

However, if I publish to my test server, things run fine there.  My test server does not have AJAX Extensions installed.  I'm a publishing them in my /bin directory along with the AjaxControlToolkit and also the System.Web.Extensions folder with the patched .js scripts.

# October 18, 2007 5:30 PM

Bertrand Le Roy said:

John: you should check with a tool such as Firebug, Fiddler or Nikhil's browser helper if the script files are actually downloaded. I'm suspecting that you have a path inconsistency between what you specified in the script reference and the physical location of the file.

# October 18, 2007 5:51 PM

Morten said:

I especially like how IE handles stack overflow. *POP!* and IE is gone...

Stack overflow is actually a faster way of closing down IE than clicking the close button :-)

# October 18, 2007 6:25 PM

Bertrand Le Roy said:

Errr, Morten, which version of IE are you using? I'm getting the error message in a dialog and it doesn't crash.

# October 18, 2007 6:39 PM

John said:

Thanks, Bertrand.

Fiddler showed that I was receiving a 403 error when trying to pull the MicrosoftAjax.js file from my /bin/System.Web.Extensions/1.0.61025.0 directory.  Made perfect sense once I saw it.  The internal web server in Visual Studio 2005 is apparently blocking that folder, but on my test server I can get to the file.  In order to avoid the problem altogether, I moved MicrosoftAjax.js and MicrosoftAjax.debug.js to a new folder in my project named /Scripts and updated my script reference appropriately.  Everything works just fine now, both locally and on the test server.

Regards,

John

# October 18, 2007 7:59 PM

Erjan said:

I prefer using elementID_EventName. It is close to the C#/VB convention and makes it more understandable for people viewing my client-side code that are not used to code javascript.

Cheers,

Erjan

# October 19, 2007 1:01 AM

prashant jalasutram said:

Roy,

Good catch point learnt today.Thanks for sharing.

Thanks

Prashant

prashantjalasutram.blogspot.com

# October 19, 2007 8:38 AM

alexandru savu said:

Good point with this overflow by wrong name.

PS: you need to do something with the code layout.

I had to copy the code into notepad2 to see what the onclick event was.

# October 22, 2007 5:51 AM

Bertrand Le Roy said:

Alexandru: what's wrong with the code layout? I viewed the post under IE7, Firefox, Opera and Safari w/o a problem.

# October 22, 2007 1:52 PM

Robert said:

Please use Session.Add(name as string, value as string)

Make sure you don't clear any sessions and strictly declare your variables to session if you are doing so.

Hope that helps!

# October 23, 2007 4:53 PM

Matthias Reichenbach said:

Just downloaded your test files. It works great on IE7 but for some reason in firefox 2.0.0.8 it gets into a infinit loop of reloads.

Did not found any reason for that. Gonna keep looking at it, just wanted to let you know

# October 24, 2007 2:20 PM

alyssa cimacowski said:

you're all freaks . i can't believe you think that tidal power plants are effecting the earth's rotation!

let me make this clear YOU ARE ALL ......LOSERS & STUPID UNEDICATEDFREAKS

# October 24, 2007 3:21 PM

Bertrand Le Roy said:

Alyssa: sure, with a PhD in physics, I'm clearly not educated enough to understand those problems :) The part about being a freak is correct though.

# October 24, 2007 3:41 PM

Jral said:

What I would like to know is:

Is this only a problem if adding something to Session for the first time?

That is, if i simply update a variable in Session and perform a Redirect on the next line, is my application still open to potential problems????

# October 25, 2007 10:48 AM

Ghaj said:

I am having the same issue in ASP classic, is there a similar work around I can apply?  Any help would be greatly appreciated, I am pulling my hair out :(

# October 25, 2007 7:58 PM

Bertrand Le Roy said:

Ghaj: what do you mean "the same issue"? Do you mean you're getting an access denied error or that you're using MicrosoftAjax with classic ASP?

If it's just an access denied error that's unrelated to Microsoft Ajax, you probably have some javascript that's trying to get at an object in another frame that's pointed to a different domain.

# October 25, 2007 8:06 PM

Ghaj said:

Thanks Bertrand you are right it is javascript trying to get another object in a different frame, do you know of anything I can do to make it load properly in my frame without giving me the access denied error?

# October 26, 2007 10:54 AM

Bertrand Le Roy said:

Ghaj: it's an essential security measure that browsers don't allow you to script windows that came from a different domain. Your options are to get those pages to be in the same domain or use a cross-frame communication technique such as Subspace but that's fairly complex and only allows limited, message-based communication.

# October 26, 2007 3:27 PM

Programming said:

Almost a year ago Microsoft joins the OpenAjax Alliance , then a month ago, Microsoft Passes the OpenAjax

# October 27, 2007 12:00 AM

Nathanael Boehm - UI/UX designer & developer, Canberra said:

Pingback from  Nathanael Boehm - UI/UX designer &amp; developer, Canberra

# October 27, 2007 8:49 AM

A Real Beginner said:

I am a newbie at this stuff, trying to learn along the way, and struggling. I run Windows XP SP-2 and have set up IIS for my testing server. I have installed PHP5 and MySQL, which was a nightmare to get working because of poor documentation. Want help? You have to register on some forum, submit your problem and sift through the scanty replies from people who don't bother to read your questions properly. So, after three weeks of struggle I finally get IIS/PHP/MySql running properly. Two weeks further on I can actually get some data from a database onto the webpage, but it looks awful and I am struggling to learn how to format it.

At the suggestion of a colleague I get myself Visual Studio 2005 and install it, with no problems, in a few minutes. It comes with the MSDN library, so I also have excellent local, step-by-step, help.

In about 15 minutes I create a MS Access database with a table containing the data I need.

In Visual Studio I create an ASPX webpage which reads the data I want from the Access database, nicely formatted just as I want it. This takes me about 45 minutes because I have to consult the help files a few times.

So, PHP = 5 weeks to get nothing, while

ASP.NET = less than 2 hours to get what I want.

For newbies, its a no-brainer.

# October 27, 2007 5:22 PM

Ricardo Kawano said:

Thanks a lot man, this solution worked fine on my website.

# October 28, 2007 7:44 PM

matt said:

that is quite obtrusive!  try the jquery way

# October 31, 2007 2:30 PM

Bertrand Le Roy said:

Matt, you're not paying attention. In ASP.NET Ajax, you attach events using Sys.UI.DomEvent.addHandler or $addHandler. This topic of this post is not how you should attach DOM events though. It's how when throwing together some quick test code (and in test code, I personally feel free to use obtrusive event handlers as I'm the only one who should care and it's way quicker to set-up, but feel free to do however you prefer), you can shoot yourself in the foot and spend some time figuring out what's happening.

# October 31, 2007 2:39 PM

Trynyti said:

Awesome App Bertrand!  I love how easy it is to use just the .ashx page!  Now of course I have a question...

My file structure is such:

<Root>/Family/Photos/album.ashx

<Root>/Family/Photos/default.aspx

<Root>/Family/Photos/2007/<photos>

I had to change the CacheLocation to CacheLocation.Memory because of my host.

When I run just the album.ashx it works perfectly, all the images display, only the 2007 and sub-directories show and navigation works fine.  

When I try and run the default.aspx (which I modified the original to have the src="album.ashx" instead of src="~/album.ashx") I see all directories from the root (minus hidden/protected ones) and only the red X image, no images anywhere, even in the 2007 and subs, but if I click "Details" it does show the EXIF details of the photo.  The navigation still works fine, and when I get to the point where the tool tip would normally read "Click to view picture at full resolution", if I click that it opens a new browser and shows the photo as expected.

Two Questions:

1. Any idea why it doesn't show any of the photos when being called from the Default.aspx but works fine in the album.ashx?

2. How do I make it so it only scans sub-directories from it's location when being called from the default.aspx file?

Thanks for the awesome utility!

# November 1, 2007 3:45 AM

Qwerty said:

I just got told that the SysRq-key in kombination with Alt and a letter key is used i Linux OS to make some qiuck commands

# November 1, 2007 8:41 AM

Bertrand Le Roy said:

Trinity: I think that may be a bug. Please file it on the CodePlex site.

The control will always limit what photos it displays to the directory where the handler is (not the page) and subdirectories.

# November 1, 2007 12:48 PM

Muthukumar said:

I have a question. we are using client call back in our application. its calling serverside event in mozilla and ie but safari does not call server side event. can you help me how to fix this

# November 2, 2007 2:17 AM

Bertrand Le Roy said:

I'm pretty sure Safari should work. Can you contact me through the contact form and send me a simple repro?

# November 2, 2007 1:28 PM

kxs said:

I have to say that this blog has quite a history.  

I have a few questions:

Now in 2007, where can I find performace statistics for PHP in comparisson to ASP.NET?  

Do you have any new information on the pros and cons of ASP.NET and PHP 5?

Thanks

# November 4, 2007 12:50 AM

Shouvik Basu said:

That was excellent, no more large libraries, great insight what actually happens. worked in IE7 Firefox 2.0.0.9 no problems as a user. i used it in my project customized a lot.

in my project I've made similar libraries for separate browsers. they all have merged beautifully

still working to merge opera and safari in my project THanks

# November 4, 2007 12:18 PM

Bob Vilaraiso said:

I downloaded your test files, and tested them locally on my Windows 2000 computer with IE6 and Firefox 2.0.0.1 (I don't have a local web server, so I ran them directly from my local folder). Here are the results of my testing. It worked perfectly in IE6, but I'm having that same "infinite loop" problem in Firefox that Matthias Reichenbach mentioned above. Here is what that problem looks like: from the first moment you try to open the page and continuing permanently, the page keeps spontaneously reloading about once every second (without any user activity).

# November 5, 2007 6:32 PM

Bertrand Le Roy said:

Matthias and Bob: each test file illustrates how to make it work for a particular browser. A file that's intended for IE is not supposed to work in Firefox, and vice-versa. The files provided here are not in the business of providing a cross-browser history library but to explain how to build one. If you're looking for a full solution, those techniques are used in the next release of ASP.NET Ajax and in the latest RSH library (which is of course totally independant from Microsoft).

# November 5, 2007 6:39 PM

HPC said:

Mark Perrin said:  

I thing this is terrible news, I use OSX Tiger and to be honest i went with OSX because it just works better for me. I do not understand why apple is even bothering porting safari to windows, they should leave it with OSX. If a windows user wants safari, buy a mac you cheapo. I believe that the windows version should be a lower spec than the OSX version and the same with Itunes otherwise whats the point. Apple should make their own versions for their platform and customers the better version. Windows is crap. full stop! Id rather the Apple developers dedicate their time to Apple, why bother with Microsh1t.

Aww. the proud Mac user feels a bit less special now..boohoo

You're the typical stuck up Mac user which makes me never ever consider a Mac. And yes I CAN afford one.

Apple makes good money from PC users dumbass so they'e customers as well.

# November 5, 2007 7:44 PM

BIG DOE said:

Hi all, anyone know a way to skip the preview and go to the full resolution when cliking on the thumbnail and also to a new window?

thanks!

# November 6, 2007 9:03 AM

Bertrand Le Roy said:

Big Doe: in generateFolderPage, there is a loop over images. You can change the rendering from there so that the link's href is pointing to image.Url instead of image.Link. You also want to add a target attribute with the value "_blank" to open in a new window.

# November 6, 2007 1:05 PM

Your Websites, Our Passion! said:

It should be no surprise that JScript Documentation Comments power much of what you see in JScript IntelliSense

# November 6, 2007 2:35 PM

Noticias externas said:

It should be no surprise that JScript Documentation Comments power much of what you see in JScript IntelliSense

# November 6, 2007 3:00 PM

Jacky_xu said:

摘要

本期共有8篇文章: Refactor!forASP.NETBeta发布

如何解决ASP.NETAjax1.0中跨域名frame访问时出现的accessdenied问题...

# November 6, 2007 10:56 PM

sanka said:

yep its very good

# November 8, 2007 3:46 AM

Joe said:

I don't think I could give it a perfect score.  Its so good I didnt want it to end, but it did.  And way too soon.

Hopefully we'll see some bonus levels or something for it really soon.

# November 8, 2007 9:15 AM

Dave said:

> "It seems like we're the only ones to actually care about not colliding with existing aliases from competing frameworks, and we don't even get some credit for that?"

Actually, jQuery does a very good job of preventing namespace collisions; it only uses "jQuery" in the global namespace and you can tell it to not use "$" if someone else is using it.

docs.jquery.com/Using_jQuery_with_Other_Libraries

# November 9, 2007 10:08 AM

Bertrand Le Roy said:

Dave: If I'm not mistaken, that jQuery feature appeared after that comment was written. It is true that jQuery does an excellent job at keeping to its namespace, as does Dojo.

# November 9, 2007 2:23 PM

Dave said:

It was awesome, but it ended way to quickly. I wish there were more levels.

# November 11, 2007 2:13 AM

Bertrand Le Roy said:

Don't we all?

# November 11, 2007 2:27 AM

Rich said:

Has anyone got a good example of the Futures implementation?

Documentation is a little scarce to say the least!

# November 13, 2007 7:05 AM

Darksaint said:

Hi. This Photo Handler really rocks. Thanks for providing it.

I see it is already mentioned in the comment from Anke. When I run my project on my localhost everything works very fine, but as soon as I try to Build --> Publish Web Site, then I get an error

"There is no build provider registered for the extension '.ashx'. You can register one in the <compilation><buildProviders> section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'."

I'm using VS2008 Beta - it can off course be something with that. However the project im using is in 2.0 not 3.5

I have tried to add a buildProvider as explained, but I cannot see how I can add the attribute that is mentioned.

Did you manage to find a solution with Anke or did you stop researching. Thanks in advance

Regards

Darksaint

# November 14, 2007 9:32 AM

Ev said:

Is there a limit to the amount of js that can be commented?  I'm getting a strange error when the .js file with comments is over 256K.  I've tried splitting into two files and same result:

"Error updating JScript IntelliSense: JScript IntelliSense has been disabled for referenced scripts. A referenced script may have caused a stack overflow. Reopen this file to reenable IntelliSense."

# November 14, 2007 11:22 AM

Bertrand Le Roy said:

Darksaint: please verify that the IIS application is configured to use 2.0.

# November 14, 2007 2:05 PM

Bertrand Le Roy said:

Ev: not that I know of, but send me mail through the contact form of this blog and I'll get you the right contacts to debug that issue.

# November 14, 2007 2:14 PM

Rob said:

This solution works great with SELECTs, but it does not appear to work with APPLETs.  I was under the impression that as long as the iframe was last to be rendered in the document, it would appear over other windowed elements.  Isn't an applet a windowed element???

# November 14, 2007 2:59 PM

David Fauber said:

I agree with your take.  Its something that'll be nice to have as a first class feature of the language.  (this is actually one of the few ES4 things I'm looking forward to having)  Its  nowhere near a big enough deal for me to want a ES3 workaround, though.

# November 14, 2007 3:02 PM

Bertrand Le Roy said:

Rob: so you're the guy still using applets ;) Seriously, I think Java applets are just running in an ActiveX control so I'm just as confused as you are.

# November 14, 2007 3:13 PM

Bo Breiting said:

This sounds like an all too familiar road to me. JavaScript has suffered a long history of hacks and personal interpretations that has lead to clouded standards and unstable solutions causing more and more developers to turn away from client side development and towards server side solutions for stability. Now with the dawn of web2.0 clients are growing feature rich again and once again the focus is on client side scripting which has finaly lead to some at least half decent environments with IntelliSense making client side development and debugging easier. The last thing we need now are more individual problem solving and hacks.

# November 14, 2007 3:43 PM

Rob said:

I use a charting software applet in my web applications for advanced web chart features.  This is a 3rd party tool that is very effective.  Is there something that you have against using applets?  Regardless, if my understanding is correct, my navigation menus using this blog's principle should appear over the applet, but they do not.  Any ideas?

# November 14, 2007 4:09 PM

Bertrand Le Roy said:

Rob: I was just kidding. Sorry, I have no clue why Applets would behave any differently.

# November 14, 2007 4:13 PM

AndrewSeven said:

I don't feel any need for hacked-in* overloading, but I do think its a good thing to be adding to the next version.

# November 14, 2007 4:34 PM

Joe Chung said:

I am a big fan of IntelliSense but not at the expense of a programming language's expressiveness.

I wonder if there would be a way for currying to support overloading methods by arity.

Maybe use pattern matching like in F# to support overloading methods by arity and parameter datatype.

# November 14, 2007 5:14 PM

Darksaint said:

Bertrand: Yes the IIS application is configured for 2.0 - it's on windows vista - so it's IIS 7.0 but I don't think that should be an issue.

It's pretty strange as soon as I exclude the ashx file from the project then I can publish/compile the projet but when I include it and try again - then I get the error message that i mentioned before, incredible frustrating *hehe*

# November 14, 2007 6:14 PM

Bertrand Le Roy said:

Oh, right, I see. The build/publish thing doesn't work and probably never will because we have both a control and a handler in the same file and, well, weird things happen. So in the end, you don't build this from VS, you just drop it on your server and ASP.NET will do the compilation. Makes sense?

# November 14, 2007 7:37 PM

Darksaint said:

Bertrand: Yes it makes sense - actually i did just leave out the page that uses the ashx file when I compile and then I manually upload the page afterwards - that works - I was just puzzeled about the error message and it could be there was some nifty solution to that. Anyways thanks for good support and a kickass handler :)

# November 14, 2007 7:50 PM

Sean Kinsey said:

Here is a simple solution that supports multiple signatures differentiated by types, and it has a low overhead as well..

# November 15, 2007 2:06 AM

Chris Newton said:

Hi,

I have applied the fix as specified above, and have gone down the ScriptRefernce route as I am using the toolkit. I am running the latest patched version of the AjaxControlToolkit, and this is fine. I am receiving the following error on page load:

Sys.ArguementTypeException: Object of type 'Sys._Application' cannot be converted to type 'Sys._Application'.

Parameter name: instance

And the is being raised by the following line in MicrosoftAjax.debug.js:

if (!this.isInstanceOfType(instance)) throw Error.argumentType('instance', Object.getType(instance), this);

Any ideas as to why this error is being thrown and how I can correct the problem?

Many Thanx,

Chris

# November 15, 2007 5:57 AM

Bertrand Le Roy said:

Chris: this typically indicates that a reference to an object in one frame has been passed somehow to the other frame. The system gets confused because the two application types in the two frames are actually different objects.

I'm suspecting that you're somehow passing complex objects across frames here. If that's the case, try passing plain JavaScript data objects instead (such as {foo: "bar", baz: 42}).

If this doesn't help, let's take that offline and send me mail through the contact form of the blog.

# November 15, 2007 12:24 PM

Void said:

It didnt end too quickly at all. It was the perfect length. If it were any longer i would not have picked it up for a second go. It had the right amount of depth to it. Think of the old school games you used to play. (minus RPGs) This game brought old school mind set to new school tech. Orange Box brought new life to video games.

# November 16, 2007 9:25 AM

napyfab:blog» Blog Archive » links for 2007-11-17 said:

Pingback from  napyfab:blog&raquo; Blog Archive &raquo; links for 2007-11-17

# November 17, 2007 6:28 PM

Crile Carvey said:

Thanks for your informative article.

Just wondering if VS 2008 / 3.5 obviates the need for this patch? You mentioned: "I expect this is the fix that will be in the next service release" Has this happened yet?

Thanks

# November 19, 2007 11:07 AM

Jay Kimble said:

I was reading this post by Bertrand Le Roy . And in many respects I agree with Bertrand and also with

# November 19, 2007 12:39 PM

Bertrand Le Roy said:

Crile: yes, the fix is in 3.5 already.

# November 19, 2007 2:23 PM

chetana said:

hi, its a great tool!! But could you please suggest way to add text/caption to the pictues?

Secondly, can we add a fileUpload control there to upload the pictues on the default.aspx?

Thanks,

Chetana

# November 20, 2007 11:57 AM

Bertrand Le Roy said:

Chetana: Sure, if you're using the control in templating mode, the image objects have a Caption property that you can add to the template.

Adding a file upload control should be no problem at all provided you're careful about authorizations.

# November 20, 2007 2:20 PM

C.Anandan said:

we can create serverside msgbox like

page.RegisterClientScriptBlock("KeyValue","MessageString")

KeyValue : Give any name to message box

MessageString : Write down message what do you       want to Display  

# November 21, 2007 7:23 AM

Bertrand Le Roy said:

C: you forgot the alert(' and '); around the message string and the key is not the name of the message box, it's a name that you use on the server side to be sure not to register the same thing twice.

# November 21, 2007 2:05 PM

barbora said:

few days ago we had some sort of sonic bang in our area,could feel it even inside a house,it happend twice in interval of about 30-40mins,but there was no other noise before or after,which made me think it can not be a supersonic airoplane?anyone have an idea what else this could be???

# November 21, 2007 6:13 PM

Bertrand Le Roy said:

Yup, with a supersonic bang, there should be noise after, as you are inside the cone. On the other hand, that noise is always considerably weaker than the bang itself, as the boundary of the cone packs most of the energy so it may be that there was noise afterwards but you didn't notice. Those could have been plain explosions too. Did you check the local news?

# November 21, 2007 8:07 PM

laila said:

Does anyone know where the num key is that is used for visual studio along with "-" to collapse all tree. I have an hp pavilion laptop and I can't figure out how to do it!

# November 23, 2007 5:39 PM

cab said:

weird error..

<!-- Web.Config Configuration File -->

<configuration>

   <system.web>

       <customErrors mode="Off"/>

   </system.web>

</configuration>

and

<!-- Web.Config Configuration File -->

<configuration>

   <system.web>

       <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>

   </system.web>

</configuration>

Any Ideas ?

# November 25, 2007 5:48 PM

mike said:

But what about the JavaScript version number?

Isn't there contradictory syntax between JS 1.0 and 1.2 for example -- equality operators? strict typing? -- and it's the version number in the script tag is the only way to switch between the modes?

Is JavaScript syntax now frozen in 1996 -- you can only use JS v.1.0? Or do modern browsers inherently use a later JS version -- so your current code will break in older browsers?

# November 25, 2007 7:09 PM

Bertrand Le Roy said:

Mike: unfortunately there isn't much for JS version mangement. Prettt much everyone is targetting EcmaScript 3 at this point (which all modern browsers implement), but there's still a debate going on on how this is going to work in the future. This is going to have to be solved before the next version of EcmaScript is out, whatever that is.

Currently, There are differences between browsers (bugs and additional features). For bugs, people just work around them, sometimes with ugly browser detection code, and for additional features, people either don't use them or use capability detection (checking if a method exists before using it).

But differences between implementations of the EcmaScript are nothing when compared with the nightmare that is DOM quirks anyway.

# November 26, 2007 12:18 PM

Paul said:

Hi,a many thanks for this control...but can you tell me how if in a gridview there is a commandfield for delete operation(I mean something like this <asp:CommandField ShowDeleteButton="true" />), I can use your control? I cannot go for an item template & declare an alertbox there(The commandfield delete button is configured with an objectdatasource)....Also the Gridview is declared inside an update panel...thanks in advance....

# November 27, 2007 5:11 AM

Flying alone said:

The following items are covered XSLT JavaScript SQL CSS/XHTML Managed code (?) Tools &amp; resources

# November 28, 2007 3:05 AM

Dougal said:

Dude you just don't know how to code in a dynamic language if you think == is an error. pfft.

# November 28, 2007 12:15 PM

Bertrand Le Roy said:

Cab: what's the error?

# November 28, 2007 2:42 PM

Bertrand Le Roy said:

Paul: you'll have to template instead of using a commandfield and specify the delete command name on the template's delete confirmbutton, like in the blog post's example. I'm not sure how using an ObjectDataSource changes anything. On the other hand, the curent version of this control doesn't work with UpdatePanel.

# November 28, 2007 6:01 PM

Matt Heere (mattheere@hotmail.com) said:

Subject is sort of self explanitory.  I got this to work no problem locally in VS.NET 2005.  Put everything up on my hosted site (DiscountASP.net hosting) and get no images.  No error messages - just no images.

Tried it with all 3 flavors of caching.  No change.  I verified that I'm running framework 2.0.

Not sure where to look next....

# November 28, 2007 9:09 PM

Bertrand Le Roy said:

Matt, you probably didn't set the HandlerUrl and/or Path properties on the control (see above comments).

# November 28, 2007 9:37 PM

Matt Heere (mattheere@hotmail.com) said:

Doh! Yes, a handler makes it work much better...

Doesn't seem to matter what I set for path though, I end up getting a server error:

Value cannot be null.

Parameter name: value

Line 1563: if (path != _requestDir && !path.StartsWith(_requestPathPrefix)) {

If I leave it blank I get images for everything except the folder navigation

# November 28, 2007 11:20 PM

Bertrand Le Roy said:

Matt: I'm suspecting that you have a .jpg file in that directory that is not a valid jpeg.

# November 29, 2007 12:51 AM

Estéfano said:

Hi

You try set backgroud-color, because this property is not set the controls under div can be accessed.

# November 29, 2007 7:49 PM

Julien Couvreur said:

Can you confirm that the Guitar Hero II or III works with Rock Band?

From reading the GH and RB forums, it sounded like the RB guitar would work on GH, but not the other way around.

# November 29, 2007 8:50 PM

Bertrand Le Roy said:

Julien: the GH controllers work fine in Rock Band, but the Rock Band guitar does not work in Guitar Hero.

# November 29, 2007 9:05 PM

Flying alone said:

The following items are covered XSLT JavaScript SQL CSS/XHTML Managed code (?) Tools &amp; resources

# November 30, 2007 3:27 AM

Dave said:

Darn, by the titleof this post, I thought you were going to show us how to build a USB or blue tooth device from scratch.

# November 30, 2007 7:24 AM

IKnowNothing said:

The Guitar Hero II and Guitar Hero III guitars both work with Rock Band...but the Rock Band controller does not work with either Guitar Hero Games. I have all three games and Bertrand is absolutely correct in his statement.

The Rock Band guitar doesn't work with the GH games because of the extra fret buttons and effects switch.

# November 30, 2007 9:08 AM

Umer Farooq Butt said:

Why the hell you don't make things work properly the first way? I spent 1 whole day just to find the problem. I was stupid to have used your library the first place.

# November 30, 2007 11:32 AM

Bertrand Le Roy said:

Dave: sorry, now that you mention it it could give that impression :)

IKnowNothing: I don't know if it's because of the additional buttons but the behavior of that guitar in both GH titles is super weird: everything works fine in the menus, but from the moment you start a song, the buttons seem to be mapped differently (orange is red, etc.) and the green stays pressed all the time. I'd be more inclined to a more paranoid interpretation which is that Activision sends a command to the guitar when you start a song to remap the buttons. I think it's more likely to be Activision locking you into their own peripherals than MTV not making it right. This is kind of confirmed by the legal mumbo jumbo at the beginning of the game that prohibits the use of GH games with controllers not sold by Activision. Lame in both cases.

# November 30, 2007 12:55 PM

Bertrand Le Roy said:

Umer: now it works properly out of the box as the fix is in .NET 3.5. This was a bug that was found after the product shipped. These things happen, unfortunately. We thought it was better to provide a workaround than nothing. I'm sorry you had to spend a day on that.

# November 30, 2007 12:57 PM

Matt said:

Mostly working at this point.  Thanks for all the speedy replies!

Two things, I still can't get the path paramter working.  Do you have an example for the syntax for this bugger?

Also, should this work for photos stored in a virtual directory?  Ultimately I'd love to just point the web server at a NAS device with the photo content.

# November 30, 2007 1:40 PM

Bertrand Le Roy said:

Matt, do you *need* to change the path?

I don't know if it would work with a directory that's on your network. Don't see why not. File a bug on the CodePlex site if it doesn't.

# November 30, 2007 6:00 PM

Matt said:

Not 100% sure is I need to change the path or not.  I need to keep the album.ashx file somewhere other than where the pics are.

This is part of the strategy to use a network share to house the images.  I'll have read only access to the image share, and no ability to execute code that resides there.

The album.ashx file will need to live in a physical folder on my web server, and the photo store will be a virtual directory as a sub folder of this real folder.

Either way, the album.ashx code doesn't see to recognize a UNC connected virtual directory.  I'll list it on Codeplex.

# November 30, 2007 9:01 PM

Skowronek said:

I spent 10 seconds on Google and found this article. Thanks for the heads up.

# December 1, 2007 10:33 AM

Keli said:

Hello all,

I've tried it and it works ! Thanks a lot

# December 3, 2007 10:55 AM

Bertrand Le Roy said:

Thanks, Matt.

# December 3, 2007 1:22 PM

Jacky_xu said:

摘要

这周末不休息,差点忘了这件事……本期共有7篇文章: JavaScript文档注释的格式

VisualStudioOrcas中对JavaScript智能感知的支持

在ASP....

# December 3, 2007 11:51 PM

Nicholas Smith said:

Hi, i have been using this control to navigate to a second page.  (which happens to be an excel spreadsheet) using response.redirect withing the choice method, the problem i have is when i clich the 'back' browser button the dialog box created stays on the screen. How can i get rid of it and stop it displaying ? i have tried various methods of making it not visible on pre_load init etc.

PS. This is a great little tool !

# December 4, 2007 7:20 AM

Bertrand Le Roy said:

Nicholas: this may be caused by client-side caching. Did you check if the server gets hit at all by attaching a debugger?

# December 4, 2007 1:13 PM

Christian Nickel said:

Hi,

Thanks to everyone discussing this issue, I wanted to share my solution to this. I took Collin's example and changed it to automatically do the work of hiding the select elements behind a certain object. I also took some code from DOCJSLIB, from this page: www.webreference.com/.../image.html

Heres my solution:

<script language="javascript" type="text/javascript">

function toggleSelect(obj){

var appVer = navigator.appVersion.toLowerCase();

var iePos = appVer.indexOf('msie');

if (iePos !=-1) {

var is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));

var is_major = parseInt(is_minor);

}

if (navigator.appName.substring(0,9) == "Microsoft")

{ // Check if IE version is 6 or older

if (is_major <= 6) {

var selx,sely,selw,selh,i, objx, objy, objh, objw, visibility

var sel=document.getElementsByTagName("SELECT")

var hidden = false;

for(i=0;i<sel.length;i++){

selx=docjslib_getRealLeft(sel[i]);

sely=docjslib_getRealTop(sel[i]);

selw=sel[i].offsetWidth;

selh=sel[i].offsetHeight;

selxoff=(selx + selw);

selyoff=(sely + selh);

objx=docjslib_getRealLeft(obj);

objy=docjslib_getRealTop(obj);

objw=obj.offsetWidth;

objh=obj.offsetHeight;

if((objx < selx) && (selx < (objx + objw)) && (objy < sely) && (sely < (objy + objh))){

if(sel[i].style.visibility!="hidden"){

sel[i].style.visibility="hidden";

}else{

sel[i].style.visibility="visible";

}

}else if((objx < selxoff) && (selxoff < (objx + objw)) && (objy < selyoff) && (selyoff < (objy + objh))) {

if(sel[i].style.visibility!="hidden"){

sel[i].style.visibility="hidden";

}else{

sel[i].style.visibility="visible";

}

}else{

if(sel[i].style.visibility=="hidden"){

sel[i].style.visibility="visible";

}

}

visibility = sel[i].style.visibility;

}

}

}

}

//gets the X position of the element in question

function docjslib_getRealLeft(imgElem) {

xPos = eval(imgElem).offsetLeft;

tempEl = eval(imgElem).offsetParent;

  while (tempEl != null) {

  xPos += tempEl.offsetLeft;

  tempEl = tempEl.offsetParent;

  }

return xPos;

}

//gets the Y position of the element in question

function docjslib_getRealTop(imgElem) {

yPos = eval(imgElem).offsetTop;

tempEl = eval(imgElem).offsetParent;

while (tempEl != null) {

  yPos += tempEl.offsetTop;

  tempEl = tempEl.offsetParent;

  }

return yPos;

}

</script>

# December 4, 2007 2:24 PM

Jacques PHILIP said:

Hello Bertrand,

I wrote a little utility a while back to make thumbnails of transparent images, I don't know if the framework 3.5 supports this directly now, but it has been useful for me:

www.c-sharpcorner.com/.../MakingThumbnailsOfTransparentImages.aspx

If it is a any use, feel free to use it.

# December 5, 2007 10:17 PM

Kjell-Åke Andersson said:

Have you checked if Paint.Net generates thumbnails with similar quality as Photoshop? If it does, then you you probably could get the algotrithm from there since the code for it is open source. Otherwise you probably could get it from Gimp.

# December 6, 2007 2:20 AM

Wesley said:

Nice article. Definately clears some things. I'll use High(or photoshop) for my thumbnails.

# December 6, 2007 4:16 AM

web design melbourne said:

thanks allot. I almost moved my wmv content to the place where it does not come in a way of website css menu. Now I do not need to worry about that issue and can place windows medial player content on top left side div on my website

# December 6, 2007 5:40 AM

Tony said:

Just an FYI, thank you for posting the screenshot of your file location.  We had a problem here where Outlook wouldn't even open, so we couldn't right click on anything to see where the Personal Folders were stored.  I found your site after a few searches and was happy to see the path highlighted so we had an idea.  Thank you

# December 6, 2007 9:19 AM

Andrew Vasylevskyy said:

Hi, I'm trying to load into IFrame application that uses ASP.NET Ajax and have the issue described in this post. But I can't fix it thru the proposed solution because I can't access applications ScriptManager. Application is compiled and I've no access to the source code.

Is there any other approach to replace JavaScript files than accessing ScriptManger to fix this issue? (maybe thru pathching ScriptReference.axd handler)

Thanks in advance!

# December 6, 2007 9:27 AM

Greg said:

I've suggested that better imaging codecs be put into .NET as well as adding support for mainstream image formats (jbig2 especially as an improvement over tiff G4).

Microsoft should have some of these already implemented in its professional photo editor package.

Consider using photoshop, gimp or imagemagick to compare the thumbnails to each other.  Also consider using an image optimizer to see how well the thumbnails compress (optipng for png images and jpegtran for jpegs).

I'd also like to see a JAI like set of operators in .NET (JAI - Java Advanced Imaging).

# December 6, 2007 11:03 AM

Bertrand Le Roy said:

Andrew: I think your only other options are:

1. to ask your hoster to upgrade to .NET 3.5

2. to replace the whole function that we're patching here. You'd do that by including an additional file that contains a redefinition of the function that will overwrite the one in the resource.

Makes sense?

# December 6, 2007 12:48 PM

Lionel said:

Wikipedia suggests that Lanczos resampling (en.wikipedia.org/.../Lanczos_resampling) gives very good results.

@Kjell-Åke Andersson:

I believe that Paint.NET uses the methods provided by the .Net framework, so it would be HQ Bicubic or supersampling by default.

# December 6, 2007 1:51 PM

Morten said:

"Another thing I want to test is how much jpeg compression levels affected my automatic thumbnails"

For these sort of tests, you shouldn't be doing any kind of lossy compression. That will just give you too many variables.

# December 6, 2007 6:12 PM

Bertrand Le Roy said:

My point exactly, Morten, although the differences between the compressed versions are still very visible. But there are only 24 hours a day and those will have to wait a bit.

# December 6, 2007 6:23 PM

Don Irwin said:

Great post Bertrand.  Know of any way to change the image on hover?  Say a grayscale image until the user hovers over an icon and then diplay the same image in color.

# December 6, 2007 9:21 PM

Andrew Vasylevskyy said:

Thanks Bertrand!

The 2nd option works fine for me. I've got access to the master pages, so I've just included script block with overriding whole funtion into the master page. And it works fine now.

# December 7, 2007 5:33 AM

PriyaS said:

Thanks for the informative Redirect/Session related discussion going on.

I have a similar issue (not exactly). I'm working on migrating a classic ASP shopping cart app to .NET. On one particular condition we need to redirect the user to the old ASP site to grab the details. The redirect logic works flawlessly on all pages except the home/default page. I mean the logic works on my local host but does not work when moved to a Server. Any clue as to what I may be doing incorrectly?

Thanks in advance.

# December 7, 2007 1:14 PM

Bertrand Le Roy said:

Priya: if you provide more details on how it fails, we might be able to tell what's going on. Feel free to send me mail through the contact form.

# December 7, 2007 1:41 PM

Brad Abrams said:

Ok, ok, it took us a little longer than we expected, but we finally got the ASP.NET 3.5 Extension Preview

# December 9, 2007 10:29 PM

Noticias externas said:

Ok, ok, it took us a little longer than we expected, but we finally got the ASP.NET 3.5 Extension Preview

# December 9, 2007 10:48 PM

MSDN Blog Postings » The Wait is Over: ASP.NET 3.5 Extensions Preview Posted said:

Pingback from  MSDN Blog Postings  &raquo; The Wait is Over: ASP.NET 3.5 Extensions Preview Posted

# December 9, 2007 10:50 PM

Tonio's developper .NET Blog said:

La ASP.NET 3.5 Extensions Preview est disponible sur le site asp.net. Téléchargez-la vite. Consultez

# December 10, 2007 9:18 AM

Lionel said:

Actually, you can get nearly the same result as Photoshop's "Bicubic sharper" using Paint.NET.  Here is the method:

1. Apply a Gaussian blur (with radius 2)

2. Resize using Best Quality/Supersampling (to 134x100 pixels)

3. Apply a "Sharpen" effect (with radius 2).

The Gaussian blur avoids moiré patterns, and the final sharpening increases the _apparent_ sharpness of the image (see en.wikipedia.org/.../Unsharp_masking for how it works).  Both would be rather easy to implement in a standalone assembly.

The visual effect is nice, but the is some cheating involved: even if it looks nicer, the blur+sharpening actually further degrades the image.

As for Lanczos resampling and other high order methods, it looks like they are much more suited to encreasing the resolution of the image.  For making small thumbnails, it looks like very little is gained.

# December 10, 2007 12:04 PM

Bertrand Le Roy said:

Lionel, that is very good info. Thanks a lot.

# December 10, 2007 2:27 PM

Roi said:

ok, i agree with most of the issues of why you should keep the jax async but then im getting this scenario : we are using autocompleteextender to select from a list of some 10k employees, upon selection, or onchange we need to validate that the value represents has a match in the list (even if the user typed the entire name - no hidden value)

to add complexity - this is done inside a 3rd party grid control which have an onbeforeupdate event in which we are hooking in the validation.

(a similar scenario is when a user types somthing in the autocomplete and then clicks the save(submit) button.)

now, when validation fails it must cancel the update event, and that is not possible if its async.

i would love to keep it async but i dont see any alternative besides shooting myself in the leg (and it will hurt oouch...)

any thoughts ?

# December 11, 2007 2:45 AM

Bertrand Le Roy said:

Roi: that is actually a fairly typical scenario that works well with async. Just disable the relevant pieces of UI during the callback.

# December 11, 2007 3:24 AM

Rick Brewster said:

Paint.NET uses its own code for resampling. There are issues with the underlying GDI+ library when trying to use some of System.Drawing's interpolation modes. It quite often makes the border pixels slightly transparent. Or it makes things blurry like you documented here.

# December 11, 2007 8:27 PM

Bertrand Le Roy said:

Rick: thanks for the info! Cheers!

# December 11, 2007 8:59 PM

John said:

I had applied the this fix months ago on a Framework 2 site with the ASP.Net Ajax 1.0.  Now, when the site was upgraded to 3.5 and my script manager was pointing to manual copies of the scripts I got the error "ASP.NET Ajax client-side framework failed to load"... I've had to remove the script manager pointing to those scripts and am in the process now of testing to make sure this bug is fixed with IFrames with 3.5 like some here have posted, I'm crossing my fingers it is!  :)

# December 13, 2007 5:09 PM

Will said:

Your my hero, thanks for writing this.

# December 13, 2007 8:58 PM

Store __VIEWSTATE in session said:

There is a little trick:) about keeping the viewstate in session (server side). It's not what they (the guys from microsoft) intended us to do so, but it works like a charm. You should've been already intrested. www.eggheadcafe.com/.../20040613.asp

# December 14, 2007 9:01 AM

Bertrand Le Roy said:

Sorry to disappoint you but it was very much the idea when "we (the guys from Microsoft)" decided to expose extensibility mechanisms for ViewState. We've even used it ourselves to put ViewState in session by default on some mobile browsers. ;)

# December 14, 2007 1:30 PM

Jim Baltika said:

WebSite.WebCameraInfo.prototype = {

   ZoomLevel: 11,

....

Hi guys. Does any have any ideas how to comment prototype getter like this?

# December 15, 2007 1:03 PM

Bertrand Le Roy said:

Jim: that's not technically a getter, but you can document it from the constructor using a field tag.

# December 17, 2007 4:30 PM

Rick Strahl said:

Ah, but they'd want it PREINSTALLED! Make Opera the DEFAULT Browser, non?

Good one...

# December 21, 2007 2:26 AM

Luis Abreu said:

lol...btw, opera is free now (and i believe that in the past you only had to pay to remove the publicity banners, though i could be wrong as always :) )

# December 21, 2007 3:54 PM

Bertrand Le Roy said:

Luis, you're right, it's free now except maybe for the Wii version which was only free in the beta phase. I also paused on that part of the joke.

# December 21, 2007 6:26 PM

Mart said:

All the stuff provided by you, specially the links, are very helpful and interesting. They really helped me a lot.

Keep it up...

# December 26, 2007 1:59 AM

Thomas said:

can someone please post a code sample on how to do this resizing using the Paint.net api, I downloaded the source code and it's an abyss of functions that are not documented and don't even bother posting on their forum so far they've been less than helpful.

I'd truly appreciate it.

thanks

# December 26, 2007 7:09 PM

c10se said:

hi,

I have applied this fix to my web application. how ever I still got 'Sys' is undefined, 'Type' is undefined Errors. I have two questions,

1. how do i compile the MicrosoftAjax.js, what whould i do?

2. does the main web application need to add this fix as well? the main web application is Net 1.1 and the web application inside the frame is Net 2.0. does that cuz the problem?

thank you.

# December 27, 2007 12:39 AM

Bertrand Le Roy said:

1. You don't have to compile it. Just follow the instructions very carefully and you'll be fine. Also look at the answers I already made to other people with the same difficulties, there are a few possible causes for that.

2. No.

# December 27, 2007 11:10 PM

Anthony Peterson said:

I have validation code (related to tolerances which are specified in my database) on the server side which I wanted to use with this alert code. I was able to add in the DLL as a reference to my project and Intelisense detected the reference and what was in it, but when I went to build for the first time after adding some alert code in, I got an error in VS 2005.

"Assembly Generation Failed: Alert does not have a strong name."

In my code I was constructing an alert by the second method you mentioned (in C# code rather than ASP tags)

# December 31, 2007 7:46 AM

Bertrand Le Roy said:

I don't know. Maybe in order to reference the alert controls from a signed assembly, you need them to be in a signed assembly. You should probably try to compile the alert code into a signed assembly and reference that.

# December 31, 2007 8:03 PM

Christopher Steen said:

Link Listing - January 4, 2008

# January 5, 2008 12:57 AM

zahi said:

the video is very small.

how can i enlarge it with good resolution?

# January 5, 2008 1:02 PM

Bertrand Le Roy said:

Zahi: there is a link right under the embedded video that leads to the same video in a larger size.

# January 5, 2008 3:44 PM

tha monkey said:

i gonna buy rockband when it comes out here in sweden.. its just so damn expensive, i hope i can buy drum and microphone and the game only.. cus i got gh3 and gh2.

# January 8, 2008 1:50 PM

The ASPx Blog said:

First the disclaimers/warnings. The following uses preview technology. It requires VS2008 and the ASP

# January 9, 2008 4:14 AM

jaci said:

who takes these tests? they r lame i already kno that i am sooo not a nerd...

# January 9, 2008 12:47 PM

Victor Vogelpoel said:

Just to inform you of issues in the MetaData library:

I could see every image album folder in the initial page, but when I click an album image, nothing would happen.

I found that the metadata library was unable to open my images and thus 'freeze' your application. My images are shot with a Canon 350D and Canon 40D; the MetaData library with your application is outdated (2.2.2, current version: 2.3.0g) and unable to open these photos.

As someone else already pointed out, replacing the outdated library with the newest will result in .NET binding errors.

When I disabled the Metadata parts in the ASHX, I was able to browse the directories successfully.

# January 9, 2008 4:21 PM

Bertrand Le Roy said:

Thanks for the report. Please file a bug on CodePlex.

# January 9, 2008 4:26 PM

cxspan said:

Freakin' sweet! (Peter Griffin voice)

This is just what I needed to figure out how to *remove* Menu items programmatically.  I couldn't just remove them from my sitemap b/c I still wanted them to show up in the breadcrumbs (don't ask).  I added a "hideOnMenu" property to the sitemapnodes I wanted hidden and set it to true.

Then, in the MenuItemDataBound event I added the following:

MenuItem parent = e.Item.Parent;

string hideOnMenu = ((SiteMapNode)e.Item.DataItem)["hideOnMenu"];

       if (hideOnMenu != null)

       {

           if (bool.Parse(hideOnMenu))

           {

               parent.ChildItems.Remove(e.Item);

           }

       }

I don't know if this is the best solution, but it's working great for me!!

# January 11, 2008 3:34 PM

cxspan said:

errr... slight modification to work with top-level menu items:

string hideOnMenu = ((SiteMapNode)e.Item.DataItem)["hideOnMenu"];

       if (hideOnMenu != null && bool.Parse(hideOnMenu))

       {

               MenuItem parent = e.Item.Parent;

               if (parent != null) parent.ChildItems.Remove(e.Item);

               else (sender as Menu).Items.Remove(e.Item);

       }

# January 11, 2008 3:51 PM

Pedro Torres said:

Hi,

I am trying to costumize the application, although I am not being able to change the backgroudn color for the upfolder and thunbnailfolder icons... I want my background to be white and for those its in black... any one can help?

# January 12, 2008 10:32 PM

Bertrand Le Roy said:

Pedro: there are config entries in the handler as wel as forum posts and bugs on the CodePlex site that should get you started.

# January 13, 2008 8:13 PM

pankaj said:

do u have any working example of a form using div layer and overlapping a select box.

# January 14, 2008 7:12 AM

ASP.NET AJAX Forum Posts said:

ok, I think I&#39;ve gone a little askew somewhere along the lines here. First I installed ASP.Net ajax

# January 15, 2008 10:48 AM

Julien Couvreur said:

Probably because there's been a lot of buzz around functional languages ;-)

Here's another pointer which you may find interesting: blogs.msdn.com/.../132646.aspx

# January 16, 2008 8:40 PM

Bertrand Le Roy said:

Yes, Julien, you're absolutely right.

# January 16, 2008 8:47 PM

Fabio Pavani said:

Congratulations!

It works very well at first attempt.

Thanks a lot!

# January 17, 2008 10:17 AM

Granville Barnett said:

I have used F# for a while having used Haskell prior to that and the simplicity of concurrent programming is a joy and one that imperative languages like C# etc will want to emulate in the future given the fact that processors are scaling out in terms of cores.

I guess we will have to wait and see but I would bet that the next version of C# will introduce more abstract language constructs - LINQ was the tip of the iceberg.

# January 17, 2008 1:29 PM

rascunho » Blog Archive » links for 2008-01-17 said:

Pingback from  rascunho  &raquo; Blog Archive   &raquo; links for 2008-01-17

# January 17, 2008 3:27 PM

lee576 said:

译给自己看

# January 17, 2008 10:18 PM

Guido said:

Hi, nice post. only one thing:

if (SomeObject)

works fine on Firefox, but IE (6.0 at least) will raise a javascript error on the client. To prevent this, you can check for 'undefined' and 'unkown' using typeof(var):

if (typeof(SomeObject)!="undefined" && typeof(SomeObject)!="unknown" && SomeObject)

# January 18, 2008 10:54 AM

Bertrand Le Roy said:

Guido: right, there is the assumption here that the variable was declared.

# January 18, 2008 1:27 PM

Josh Stodola said:

>> It would be great if this could become the consensus across the industry. <<

I have been saying this about numerous Javascript inconsistensies for over 7 years. In that time span, I have yet to see a single consensus. The language is extremely desperate for standardization. It's about time somebody in authority puts their foot down! It seems that without a leader, it's going no where (and fast).

# January 18, 2008 4:20 PM

Bertrand Le Roy said:

Well, Josh, this is a little different in the sense that JSON (not directly talking about JavaScript date literals here) is in the hands of a few individuals, not a standards comittee so it may actually be achievable.

# January 18, 2008 4:24 PM

Joe Chung said:

One reason to escape slashes in JavaScript is that some browsers don't handle HTML close tags, e.g., </p>, well in JavaScript so you would use <\/p> instead.

# January 18, 2008 4:40 PM

Alex Osipov said:

For me, what gets confusing is DateTime serialization in regards to time zones.  .NET in general is not consistent when dealing with DateTime and time zones, so would love to see a more standard approach not just for Atlas but .NET in general.  An attribute allowing me to use local time on the client would be very helpful at times.  

# January 18, 2008 4:48 PM

Bertrand Le Roy said:

Thanks joe, that explains it.

Alex, do you have a specific example of such an inconsistency?

# January 18, 2008 4:50 PM

Kris Zyp said:

Bertrand, clever trick, and good job making it go with eval. However, I would still be hestitant to move away from the date serialization used by Crockford's library and ES4. I think your suggestion of defining a property as a date in a schema(JSON Schema or otherwise) outside of the actual data in order to explicitly declare dates, is a better technique, because the standard serialization/parsing libaries can still be used.

# January 18, 2008 5:30 PM

Bertrand Le Roy said:

I'll try to lure Doug to this post and get his thoughts. Good thing is that on the parser side, we can support several approaches. Again, Doug's convention will have false positives so most parsers will probably not do the special casing by default.

# January 18, 2008 5:36 PM

Nikhil Kothari said:

Actually, I should have updated my main post (a year ago I guess) but as discussed in the comments, there is a way to use the @ syntax without false positives.

Your post called my attention to it, and I updated it now. :-)

# January 18, 2008 10:54 PM

Rick Strahl said:

The question is who do we have to bribe to make *some* sort of standard for date literals :-}. This is a pretty big stumbling block in universal JSON usage, although the solution you came up with MS AJAX with the \/Date()\/ seems like a good way to go - it  works and is relatively easy to implement. I posted some additional thoughts and some code to that effect here a while back when we discussed this last month:

www.west-wind.com/.../214731.aspx

# January 19, 2008 8:01 AM

Michael Yeaney said:

I've worked around these problems in the past by using JSON to *only* transport formatted data - in other words, no reliance on the client browser native types at all for numbers and dates.  While it sounds a little odd, most of the enterprise products i've worked on supported the notion of a configurable timezone and/or culture, which makes the browsers cultural settings worthless.  So for dates and numbers, we do *all* formatting on the server (after setting the current thread culture code and format options as per the app config), and just ship the "ready for display" data to the browser.

IMO, until we can *force* the browser to use different time zone and number format options, it's pointless to do manipulation on the browser (and a *lot* more code to support - we tried it) - the .NET framework has most of these features built in (except for explicit DST support), so why not leverage them?

Any thoughts???

# January 19, 2008 12:31 PM

Gordon said:

How about a plastic  Bathtub

# January 19, 2008 9:19 PM

MarcelDevG said:

Nice one!

It's fascinating to observe the childrens view of the world.

# January 20, 2008 11:14 AM

Florian said:

AH AH Excellent :-)

# January 21, 2008 5:45 AM

Eilon said:

Some languages out there already have Date literals - which ones are they? Why don't more languages have Date literals?

And for that matter, what are some other primitive types that lack literal support in languages?

# January 21, 2008 1:41 PM

rascunho » Blog Archive » links for 2008-01-21 said:

Pingback from  rascunho  &raquo; Blog Archive   &raquo; links for 2008-01-21

# January 21, 2008 3:24 PM

Wöchentliche Rundablage: .NET 3.5, WPF, LINQ, Tests, System.AddIn, SubSonic, Sandcastle | Code-Inside Blog said:

Pingback from  W&ouml;chentliche Rundablage: .NET 3.5, WPF, LINQ, Tests, System.AddIn, SubSonic, Sandcastle | Code-Inside Blog

# January 21, 2008 3:41 PM

Wöchentliche Rundablage: .NET 3.5, WPF, LINQ, Tests, System.AddIn, SubSonic, Sandcastle | Code-Inside Blog said:

Pingback from  W&ouml;chentliche Rundablage: .NET 3.5, WPF, LINQ, Tests, System.AddIn, SubSonic, Sandcastle | Code-Inside Blog

# January 21, 2008 3:48 PM

Mike D said:

Is there a way to have handler pull images from a certain directory?

Example file structure:

Bin

App_Data

images

---->Folder 1

---->Folder 2

---->Folder 3

defualt.aspx

ablum.ashx

# January 23, 2008 5:29 AM

StillRockin said:

You keep saying to disable only "the relevant pieces of UI".  What if the business case is that the whole UI should be disabled?  I just don't get it--it seems to me that there may legitimately be some situations in which a synchronous call from a web app MIGHT be justified, such as some kind of dynamic security check in a highly-secured, high-speed network intranet-only app in which the request will almost always complete very quickly and almost never fail.  Or something.  Maybe I'm just too old for this stuff any more :)  In any case, I just tend to shy away from pronuncements like "never do this".  Of course I recognize you have in fact given us the way to do it--thanks BLR.  (Now I can go to work armed and dangerous :)

# January 23, 2008 9:20 AM

Bertrand Le Roy said:

StillRocking: you're right to shy away from "never" sentences. I would usually agree with you and tell users to adopt the pattern that most suits their needs.

But here unfortunately, there is a fundamental flaw in the implementation of XHR that makes any synchronous call a potential usability problem. Most users have no idea what to do with a frozen browser other than hitting the reset button. That's not something you want your users to have to do, even if that's "almost never". Any web application (even an intranet) is dependant on things you don't and will never control. What you can do is provide an intelligible fallback in those cases so why shouldn't you?

I don't see how the case you mention justifies synchronous any more than any other that's been mentioned before. In that case like in all others, the user friendly choice seems to disable the UI (partially or fully), give the user some feedback about what's going on and have error and timeout callbacks (which you can't have with synchronous) just in case.

# January 23, 2008 1:11 PM

Bertrand Le Roy said:

Mike: why don't you put the handler in the images folder?

# January 23, 2008 1:12 PM

Sonu Kapoor said:

Great to have you on board Bertrand.

Actually registration is not required to read the article. Its only required if you want to vote or leave a comment ;)

# January 23, 2008 1:32 PM

Mark Wisecarver said:

This is 2 funny.

My 5 year old daughter asked me if Moma is the only black person in our family...

I explained to her that Moma is Brazilian, dark skinned.

Kids keep this stuff simple and harmless, as it should be. ;-)

# January 23, 2008 4:21 PM

Haissam Abdul Malak said:

Welcome to Dot net slackers :D

# January 23, 2008 5:32 PM

kazimanzurrashid said:

Welcome to the Club of Slackers.

# January 23, 2008 5:45 PM

StillRockin said:

Ah--Now it's a little clearer.  The last sentence in your 1:11 PM post de-obfuscated the matter a bit for me.  So to summarize for my scenario--we use asynch methodology, but disable the UI by, perhaps, showing a modal "Authenticating request blah blah" popup dialog window (which might only display for a split second normally, but maybe program it to stay displayed for at least 1-2 seconds for user-friendliness (rather than just seeing the screen mysteriously flash for a split second)), and implement the error/timeout etc. callback routines to ensure robustness...  That does make sense.  Kewl.

# January 23, 2008 9:12 PM

Simone Busoli said:

Welcome from me too ;) Great to have you on the boat!

# January 24, 2008 5:56 AM

Diamsorn said:

That is great

Enjoy your daughters childhood, it goes way to fast.  

# January 25, 2008 12:12 PM

Debbie said:

When I go to you the target option, to zoom in on the hole, only the dang hand shows up...but no ring to adjust.  Only got the ring to show up once since I had the game?!!

# January 25, 2008 1:39 PM

Dave said:

As one who's company blocks users from upgrading from IE6 to IE7 because we don't want to pay to upgrade existing internal apps - this is great news.

Wish they would have thought of it sooner.

# January 25, 2008 5:11 PM

Michael Arick said:

This is such a great hack.  Here's my version of it in code:

MenuBar.showIFrameHack = function(obj) {

 //Hack to add an iframe under the menu which should hide the selects:

 var iframeShim = document.getElementById(obj.id + "_hvrShm");

 if (iframeShim != null) {

   iframeShim.style.visibility = 'visible';

 } else {

   obj.insertAdjacentHTML("afterEnd",

          '<IFRAME style="position:absolute;z-index:4;"'+

          ' src="javascript:false;" frameBorder="0" scrolling="no"' +

          ' id="' + obj.id + '_hvrShm" />');

   var iframeShim = document.getElementById(obj.id + "_hvrShm");

       iframeShim.style.top = obj.style.top;

       iframeShim.style.left = obj.style.left

       iframeShim.style.width = obj.offsetWidth;

       iframeShim.style.height = obj.offsetHeight;

 }

}

MenuBar.hideIFrameHack = function(obj) {

 //find and remove the iframe:

 var iframeShim = document.getElementById(obj.id + "_hvrShm");

 if (iframeShim != null) {

   iframeShim.style.visibility = 'hidden';

 }

}

# January 25, 2008 6:10 PM

Kearns said:

I don't get it. Why have all of those different modes? It should just do the new standards mode and if old stuff breaks then yell at the crappy Web Devs/Designers that made your code. I was never caugh unawares, and I've coded pages for years that didn't break under IE7...

# January 25, 2008 7:12 PM

Dflying Chen said:

摘要好久没写了,不为自己找借口,不管怎样,还是要继续捡起来。本期共有9篇文章:C#中的不可变类型使用System.Drawing生成缩略图时应采用什么样的InterpolationMode...

# January 27, 2008 4:54 AM

Andrei Rinea said:

Zend doesn't even publish the price for the platform, just a blank "contact sales" link. Lame!

# January 27, 2008 6:53 AM

ttoomm said:

Bertrand-

You should not have blown M Anderson off like that.  He/She is reporting a different issue (October 4, 2007 7:26 PM.)

1. Calios'  June 8, 2007 fix for the background of the stacked  Folder Immages works just fine.  So it is no longer a "known issue" but rather a fixed issue.

2. What M Anderson is reporting is a peculiarity that I do not fully understand but can discribe.  If you make the change Calios describes, the thumbnails don't change until you change the folder names.  The thumbnails are stored in the application's temporary folder, background and all.  They do not change just becuase you say you wnat them to look different.  You have to do something to cause them to re-write.

# January 27, 2008 12:45 PM

Jay Kimble said:

Bertrand Le Roy had a post over the weekend (actually Friday, but I missed it) about the new IE8 meta

# January 28, 2008 10:52 AM

Bertrand Le Roy said:

ttomm: right, and this is a known issue too. If you want to regenerate the thumbnails, for the moment, you need to physically delete them or somehow restart the appdomain (touching web.config should do the trick). The original issue is not fixed in the sense that the fix is not yet in the current release, so it's a "known fix" rather than a "fixed".

# January 28, 2008 2:35 PM

Erik said:

Is the Field tag still part of JS intellisense?  I can't find any documentation on it anywhere.

# January 28, 2008 8:26 PM

Bertrand Le Roy said:

It should be.

# January 29, 2008 1:27 PM

alex grach said:

what if the scriptmanager is in a masterpage and the wizard is in a contentpalceholder in a page that uses the masterpage. i have been having an issue with this situation. i am using ScriptManager.GetCurrent(this) in the page to get the scriptmanager in the masterpage and set the properties to enable it to support history, but when i click the back button to go all the way back to the first step of the wizard it thinks there is still one more step backwards and if i click back it throws an event validation error. how can i fix this.

# January 29, 2008 2:44 PM

Bertrand Le Roy said:

Yes, Alex, I saw your other post on the DNS article. Please send me your code (bleroy at microsoft) and I'll look at it.

# January 29, 2008 6:51 PM

4 ASP.NET AJAX JavaScript UI methods you should learn | Encosia said:

Pingback from  4 ASP.NET AJAX JavaScript UI methods you should learn | Encosia

# January 29, 2008 9:27 PM

dentria said:

Working Around cross domain frame issue (ASP.NET Ajax 1.0)

# January 29, 2008 10:09 PM

Marcus said:

Why don't you just implement the Mootools framework - it's much more lightweight, fast, and simpler to implement.  No point reinventing the wheel again!

# January 30, 2008 1:51 AM

Sebastian Werner said:

Interesting that from time to time people are trying to resolve the same issues. We have had the fun with this "location" detection some months ago. qooxdoo already uses the getBoundingClientRect() for Firefox 3. It has still some differences to the Microsoft implementation but is definitely a lot faster than the original way. qooxdoo is LGPL/EPL. I always think that it is a good idea to work together on these tasks. As you have mentioned the topic is quite complex. qooxdoo for example has special support for different box-models even using the CSS box-sizing property. Does your code do the same. Do you have any interest in sharing your source? You can find our implementation here:

qooxdoo.svn.sourceforge.net/.../Location.js

The API is available here:

demo.qooxdoo.org/.../apiviewer

# January 30, 2008 2:39 AM

ste202 said:

awesome guitar

# January 30, 2008 2:49 AM

Richard Rose said:

Excellent piece of code!

Your example of setting the text on the dialog didn't wotk, but I nested a label inside the <ms: Alert> tags:

<asp:Label ID=DisplayText runat=server Text="Change this progamatically before calling the show method"></asp:Label>

This way I can calculate the impact of the users actions, and tell him before he hits the button.

Works perfectly!

Many thanks.

# January 30, 2008 7:23 AM

Bertrand Le Roy said:

Marcus: I get a lot of comments from people who are not using ASP.NET Ajax asking me why we didn't just integrate <paste your favorite framework here>. I don't deny that it's an interesting question, but there actually are pretty good answers. First, users of ASP.NET have been asking us to do it. Second, Microsoft Ajax, while not requiring ASP.NET, has unparallelled integration with it, which our users appreciate immensely. Third, building our own enables us to control the design and steer it to promote interoperability with other products and answer specific requirements from our partners and customers. Finally, it's very difficult legally for us to integrate external products (although we've done it in the past and may do it again in the future), especially if their license is anything like GPL.

In the end, our decision seems to have been the right one as one year after shipping, our library is already used by 73% of ASP.NET developers (i.e. our customers), whether they develop Ajax applications or not.

# January 30, 2008 12:46 PM

Bertrand Le Roy said:

Sebastian: thanks for the comment. I completely agree with the sharing and stuff. This kind of hacking is no fun at all and I don't wish anyone to have to go through it. Hence the experience sharing and the blog post. So yes, take what you want from this post and use it if you find anything you didn't already know and feel free to share any information I may have missed and I will add it to the post and credit you for it.

As for the code sharing, it may be a little trickier. On my side, there is no chance that the legal department here would even let me glance at something with a license that ends with GPL. The other way around might work, as we're under MS-PL:

msdn2.microsoft.com/.../bb944808.aspx

One thing that may be interesting to talk about would be to share our test suites. That may help achieve consistency, correctness, and would help other developers to debug their code.

Drop me a mail at bleroy at youknowwho if you want to chat.

# January 30, 2008 12:56 PM

Marcos Lavin said:

Hello,

i'm tryng to change the color from the thumbnails to white and i cant find where do i chenge!

ive change this part and works only for the preview images not for thumbnails (next and preview images):

       private static readonly Color BackGround = Color.White;

thanks for the help!

# January 30, 2008 2:25 PM

Bertrand Le Roy said:

# January 30, 2008 3:36 PM

cmroanirgo said:

I applaud the commitment M$ has made to cross-browser compatibility and this article is a great example on the lengths you guys are going to to make our lives (the developers) easier. It is a shame that other parts of M$ are still mired in the 'One platform' mindset.

Where's the tip jar?

On the note of multiple toolkits performing the same tasks...I agree with everyone: It would be nice if everyone was working on the one codebase, but I also understand that M$ would also need to have (some of) it's codebase dictated by commercial concerns (eg. from ASP.NET).

Alas, these two philosophies are on other sides of a river.

Let's hope that one day M$ will allow 3rd parties to develop their AJAX code.

(WTL went down a similar avenue, hopefully for the world's benefit).

# January 30, 2008 7:11 PM

Chris said:

this is sweet man.

i really like it.

im getting rock band in 2 weeks

then im gonna paint this and use it as a bass.

thanks for the greatpics and everything.

# January 30, 2008 9:43 PM

ThomasH said:

Bertrand, your test scenario sounds very interesting. We worked at similar things using Selenium. Could you elaborate on how you implemented the above strategy? E.g. which tool/platform did you use? Or how did you automatically detect pixel discrepancies in the screenshots?

# January 31, 2008 3:37 AM

Bertrand Le Roy said:

Thomas: the way the test suite works is that we have an ASP.NET page that runs locally (as in on the same machine as the server), displays an element with the wanted constraints, call getLocation on it, positions another element absolutely with the coordinates we got from getLocation, then the page's script sends a request to the server, which launches the application that takes a screenshot and analyses the image to detect differences in coordinates and log them.

This way, the test suite runs on any browser, you just go to that page and it starts.

# January 31, 2008 2:45 PM

Brennan’s Blog » Blog Archive » Intellisense for jQuery in Visual Studio 2008 said:

Pingback from  Brennan&#8217;s Blog  &raquo; Blog Archive   &raquo; Intellisense for jQuery in Visual Studio 2008

# February 1, 2008 1:59 AM

ThomasH said:

I'm with you up to the screenshot. But are you at liberty to disclose how you do the analysis of the image?

# February 1, 2008 3:23 AM

InfinitiesLoop said:

The other interesting thing about the suite is that it generates positioning combinations automatically. It takes around I'd say... 30 minutes if I remember correctly, to run though enough combinations in a single browser.

Some issues it has are combinations that produce strange renderings where the positioned element isn't visible or only partially visible (although we do the best we can to minimize those by making everything big enough, it happens anyway), or isn't redrawn by the browser without user interaction.

I could imagine coming up with a single page that had enough of the real key scenarios (eigenpositions?) that could be the GetLocation equivalent of the acid test... :) If I recall the main pain areas across all browsers were combinations of relative and absolute positioned elements, and further when those are inside scrolled elements. So much fun...

# February 1, 2008 5:16 AM

Bertrand Le Roy said:

Dave (infinitiesloop): I like the idea of an acid test for getLocation. By the way, our simplified version of the test that runs on every checkin does include the most pathological cases and comes close to that definition. It lacks the generality of the full test but it has the advantage that because the expected coordinates for each browser are hard coded, it doesn't need the screenshot analysis so it's much easier to run.

# February 1, 2008 3:07 PM

Bertrand Le Roy said:

Thomas: the element we got getLocation from has a border of a specific color, and what we position absolutely to check the coordinates are two squares of a different color on the top left and bottom right. The analysis program scans the image for those rectangles and squares of specific colors. Does that answer your question?

# February 1, 2008 3:19 PM

Paul Anthony said:

Thats pretty cool, although I can't imagine many shared servers would make any use of it..Its a different story if you roll your own.

# February 3, 2008 7:35 AM

Joe Chung said:

Ah, the Web browser version of DLL Hell.  Sometimes I wonder if we will ever learn.

# February 3, 2008 6:57 PM

Joel said:

Hey Bertrand,

This blog entry was from a long while ago and since then it looks like Safari (3 Beta Windows) supports the inline naming of functions. I'm running a couple of tests now and seeing it perform correctly (or at least not crap out).

Of course there's always backwards compatibility to worry about...

Just an FYI.

# February 3, 2008 11:34 PM

Bertrand Le Roy said:

Joel: we still support Safari 2 and will do so at least until Safari 3 has been released in its final version and has reasonable adoption.

I'll update the post though. Thanks for the heads up.

# February 4, 2008 2:38 PM

Bertrand Le Roy said:

I'm not sure, Paul, if hosters start getting better performance and site density from IIS+PHP they might very well do the math and start migrating...

# February 4, 2008 2:42 PM

BIG DOE said:

Hi, This has been working great, but all of a sudden we get this message:

javascript:WebForm_DoCallback('Album1','p/jacksonhole/IMG_0210%20(f).jpg',photoAlbumCallback,'Album1',null,false)

after clicking on an image.

I set it a long time ago to open up in a new window with this line:

writer.AddAttribute(HtmlTextWriterAttribute.Target, "_bank", true);

In the image loop in the gerneratefolder method.

Any ideas why all of a sudden, with no changes, this will happen?

thank you!

# February 4, 2008 3:25 PM

Bertrand Le Roy said:

Where are you getting that message? Is it possible that someone disabled JavaScript on your browser?

# February 4, 2008 3:48 PM

BIG DOE said:

Oh i am sorry, the message I get is Page cannot be found.

Javascript is not disabled, i reloaded the file, and it works but as soon as i add the extra line, i get that error.  I get this message on the new window as soon as I click on an image, the line I added opens up a new window which displays the page cannot be loaded.

its the generic "Windows cannot display the webpage" message.

Does this have anything to do with permissions on the picture folders?  I change permissions on the folders where we put in the pictures so others can have access to delete and add pictures.  

Thank you

# February 4, 2008 3:57 PM

Bertrand Le Roy said:

You mean you added target="_blank" on links that do a postback? Sure, that can't work, postbacks have to happen in the same window. Using a different target is only possible on real links, not javascript ones.

# February 4, 2008 4:28 PM

A JavaScript Stack Trace in ASP.NET AJAX « See Joel Program said:

Pingback from  A JavaScript Stack Trace in ASP.NET AJAX &laquo; See Joel Program

# February 4, 2008 10:11 PM

ThomasH said:

Not quite. I was after the 'analysis' part you mention. How is this performed? Are you using a tool like ImageMagic, or something self-written? How do you detect the rectangles and squares and the deviation from the expected values?

# February 5, 2008 3:44 AM

Bertrand Le Roy said:

Something self-written. We wrote a .NET console app that grabs the screenshot and finds rectangles of a given color.

# February 5, 2008 1:00 PM

Pablo said:

The short dirty way:

add the following script at the end of your page or masterpage:

  <script type= "text/javascript">

   Sys.UI.DomElement.getLocation=function(a){if(a.self||a.nodeType===9)return new Sys.UI.Point(0,0);var b=a.getBoundingClientRect();if(!b)return new Sys.UI.Point(0,0);var c=a.document.documentElement,d=b.left-2+c.scrollLeft,e=b.top-2+c.scrollTop;try{var g=a.ownerDocument.parentWindow.frameElement||null;if(g){var f=2-(g.frameBorder||1)*2;d+=f;e+=f}}catch(h){}return new Sys.UI.Point(d,e)};

   </script>

This will overwrite the faulty script.

 NOTE FROM BLEROY: *DO NOT* use Pablo's patch. The implementation of getLocation is specific for each browser, and Pablo's fix will overwrite the implementation for all browsers with the one for IE. His fix would be more or less OK if the code is surrounded with:

if (Sys.Browser.agent === Sys.Browser.InternetExplorer) { /* code goes here */ }

# February 5, 2008 1:51 PM

Parag said:

I am a Mechanical Engineer. I required to develop a small intranet site for departmental procurement monitoring system. I used MySQL, PHP5 on XP SP2. It did not take me weeks, as "A Real Beginner" says, but just a few days time, in addition to my routine work, to get the site up and running. I am happy, my boss is happy.

I used PHP because I have found MS applications to be like fast food - good to look at & taste, but lacking value.

I know Roy will tell me to go away. Roy, I don't like your attitude, and am not returning to this site... don't bother asking me to go away.

But, before I leave, I must say that everything has its pluses and minuses.... you should be discussing that, rather than ranting against PHP. We see large websites running successfully on PHP. Learn to accomodate others' views.

# February 5, 2008 11:29 PM

Robert said:

Thanks for the post,

It is wise considering integration with a dynamic image optimizer (such as http://www.imageoptimizer.net) with the ASP.NET application. It can make a big difference and is 100% worth the effort.

Thanks

Robert

# February 6, 2008 9:23 AM

Bertrand Le Roy said:

Good for you, Parag, but the name's Bertrand, not Roy.

# February 6, 2008 12:35 PM

Matthias Bruch said:

Thanks for the blog entry. I really liked it to read about all that problems ... I always just did a loop through the dom to find out the coordinates, and "corrected" that by hardcoded values (for the browser differences) ...

But as interesting as your post was, could you explain a little bit more how that console app does the screenshots? As I saw in the comments, I'm not the only one who's interested in that ;-) ...

# February 9, 2008 6:25 AM

Bertrand Le Roy said:

Fine, seeing all the feedback I'm getting on that, I'll find a way to publish that publicly. I'll try to see if we can come up with a simplified version that would look like ACID for getLocation. Stay tuned.

(technically, grabbing the screenshot involves some .NET/pInvoke wizardry, but nothing too intense, basically to get a BitMap object from any window handle and then you're in business)

# February 9, 2008 5:55 PM

Jerz said:

Thanks for the iFrame info.  It works great in some cases. Not to confuse anything, for the newer programmers out there you can always use the ol' standby of: <img src="YourMouseOverImage.gif" onMouseOver="form1.DropdownMenu.style.width=0;" onMouseOut="form1.DropdownMenu.style.width=100;">

# February 10, 2008 12:52 AM

Wöchentliche Rundablage: ASP.NET, ASP.NET 3.5, ASP.NET MVC, Geocoding, WPF, WF, CardSpace, IIS7, LINQ, XNA… | Code-Inside Blog said:

Pingback from  W&ouml;chentliche Rundablage: ASP.NET, ASP.NET 3.5, ASP.NET MVC, Geocoding, WPF, WF, CardSpace, IIS7, LINQ, XNA&#8230; | Code-Inside Blog

# February 11, 2008 2:39 PM

Scott Hanselman's Computer Zen said:

# February 12, 2008 2:48 AM

ASPInsiders said:

Aptana has a cool Eclipse-based IDE for writing AJAX-y websites. It's got built-in support, via plugins,

# February 12, 2008 3:15 AM

Julian Fannin said:

There are commercial applications that will not only fix corrupt PST files but also undelete items and reduce the file size, in my case the problem was that my PST was over 2 GB in size. A known problem (to Microsoft). I've added the URL of the one that I got, outlookfix. It seemed to work the best out of the ones that I tried.

# February 12, 2008 5:06 AM

veni214 said:

does the "enable history" on script manager exist in asp.net 2.0??

# February 12, 2008 10:15 AM

Scott Hanselman's Computer Zen said:

# February 12, 2008 11:45 AM

Bertrand Le Roy said:

No.

# February 12, 2008 3:11 PM

dave said:

This is the first time i have seen Eric's blog. Good site.

Thanks.

# February 12, 2008 5:28 PM

Sweet said:

You guys are killin me. Why not put a few lines a code in here. Whatever you do make sure nobody can find this without spending an hour on google. Nice job

# February 12, 2008 5:38 PM

Giana sisters said:

same with my comodore64 i am sooooooo upset i cry

# February 12, 2008 5:40 PM

JS IntelliSense with Namespaces in VS 2008 at Coderoni.com said:

Pingback from  JS IntelliSense with Namespaces in VS 2008 at Coderoni.com

# February 13, 2008 12:23 AM

ButterCatZ said:

Pablo, your last post was golden. This worked in my .net 2.0 master page. I'm so glad I finally fixed this. Thank you for posting the condensed javascript.

# February 13, 2008 1:21 PM

Eric Lippert said:

Granville: though we are not of course discussing specifics at this time, you should expect that whatever we do next in the C# space will be less heavy on paradigm-shifting features for a while.

After introducing anonymous methods, generics, iterators and nullable value types in C# 2, and then query comprehensions, etc, in C# 3, we want to slow down on the massive influx of complex new language features and concentrate on more targetted improvements to the language and infrastructure.

That said, the future is big and there is a lot more we can do with this language, and yes, multi-core is going to be important.

# February 13, 2008 3:50 PM

df said:

hello

i am like hack login admin panel in asp.net web applection !

# February 14, 2008 1:59 PM

Tonya’s Teaching Blog » Blog Archive » Caps Lock? said:

Pingback from  Tonya&#8217;s Teaching Blog  &raquo; Blog Archive   &raquo; Caps Lock?

# February 14, 2008 10:18 PM

Not this time said:

I apologize in advance for this comment.  It is not directed at you in any way, you've just been caught in the crossfire.

With all the "how is this relavant", "how am I learning from this post", "this isn't what the main feed is for", why are we still seeing posts like this from anyone in the main feed?  I'm fine telling new people, hey you're back from vacation, keep it from the main feed please, but then I feel the same standard should be applied to all posts in the main feed.

It's ok to post OT if you've been around, but new people must walk-the-chalk?

IMHO, Not cool, not cool at all.

I too think we have a lot of new users and some of them may be green, but we aren't welcoming them very well.  "Do as I say, not as I do"

# February 16, 2008 3:19 AM

Mike said:

OK, so what don't you like about the Wii Play?

# February 16, 2008 9:04 AM

Brian Donahue said:

Here, here!  My theory is that Wii Play were the original test games for the Wii and they considered bundling them with the Wii, until someone(s) reminded them how stupid they were.

That said, my 5 yr old gets a kick out of some of them, so it does get some spins on our Wii. But compared to Wii Sports (let alone the better "real" games) it's really pathetic.

# February 16, 2008 9:41 AM

lfriend said:

I have to agree with you, Super Mario Galaxy is one of the best games I've played for years!  It seems easy at first as it introduces you in to the gameplay and the use of the Wii Remote, but after a few plays the difficulty level certainly goes up.

# February 16, 2008 4:24 PM

Brennan’s Blog » Blog Archive » JavaScript Browser for Visual Studio 2008 said:

Pingback from  Brennan&#8217;s Blog  &raquo; Blog Archive   &raquo; JavaScript Browser for Visual Studio 2008

# February 18, 2008 12:53 PM

Bertrand Le Roy said:

"not this time": what "main feed" are you talking about? My posts are always carefully tagged, so that organizations that choose to syndicate my contents can filter out the contents they're not interested in. It's MY responsibility to tag (and I'm doing it), and it's THEIR responsibility to select the tags that are relevant to them.

So if you see a post that you think is not relevant to whatever syndicated feed you're reading, please complain to the owner of the feed, not to the author of the post.

Mike: everything. Not being fun at all being the main complaint.

# February 18, 2008 1:26 PM

Robin Debreuil said:

I just added weblogs.asp.net/the&dark&and&mysterious&side&of&bleroy -- wow!

# February 19, 2008 3:03 AM

Matt Phipps said:

I think it just shows the weakness of clunky aggrators like DotNetSlackers that have an oversimplified approach towards the task, and then also, their overly simple audiences that don't want to do the minimal footwork necessary to get the feeds they want. Hence, I do my direct links to Rick Strahl and others.

# February 19, 2008 10:26 AM

Ronald K. said:

Bertrand,

I am subscribed to this feed: weblogs.asp.net/MainFeed.aspx with the intention of reading anything related to asp.net.

Anything you post, therefore, shows up on that feed.

Ron

# February 19, 2008 12:51 PM

lkempe said:

Welcome on board Bertrand! I am also getting this kind of frustrating comments, and I really hate that! As you are saying it is still our blog or ?

btw, your Xbox Live name is awesome!

# February 19, 2008 1:04 PM

lordabdul said:

This post is irrelevant to the feed in the sense that it's relevant to the feed. I used to like this blog because it didn't stick to the point, so please could you go back to sticking to the point of not sticking to the point? Thanks.

# February 19, 2008 7:47 PM

Luis Abreu said:

Yes, I've had that kind of problem too. I was tagging my posts with trivia but they still showed on the main weblogs.asp.net feed. Since i didn't really had any time for getting crap from anyone, I've close the asp.net blog and went back to the msmvps.com blogs where at least I can write about whatever I want!

# February 20, 2008 6:37 PM

Drew said:

This may have been addressed in an earlier comment but I wanted to clarify.

I am using an iframe under a floating div to display tooltips on a form with select boxes. The iframe is using the alpha filter for transparency in IE6, as the div has a bubble image with transparent sections. This works for most of the form, but the transparent section of the iframe overlapping the select boxes is white instead of transparent. Is this a known issue or am I overlooking something?

Thanks!

# February 21, 2008 3:10 PM

Bertrand Le Roy said:

That's known. I don't know of a workaround.

# February 21, 2008 3:54 PM

Drew said:

I was hoping that was not the case. :(

Thanks for the quick response.

# February 21, 2008 4:02 PM

LA.NET [EN] said:

[Warning: definitely not a technical post] Those 3 guys that normally read my blog (yes, I believe that

# February 21, 2008 6:09 PM

ASPInsiders said:

[Warning: definitely not a technical post] Those 3 guys that normally read my blog (yes, I believe that

# February 21, 2008 7:18 PM

Jeff said:

Awesome little app, however I have some issues with it, when I add the required files to the directory, it shows everything as it is supposed to, however when I click on an image, to see if in the center of the screen, it doesnt show at all, it only shows the 'Details', 'Previous Image' and 'Return to Folder View'.

I like this app very much, but I would LOVE for it to show the image in the center of the screen.

I'm running this on WHS (Home Server) and the client OS is Vista, with IE7.

# February 21, 2008 11:14 PM

Bertrand Le Roy said:

Jeff, please contact me  through the contact form, and I'll look into it.

# February 22, 2008 1:54 PM

Tj said:

I LOVE the windows key;

Windows Key+E-My Computer

Windows Key+R-Run

Windows Key+D-Minimize/undo minimize.

I use the windows key the most, apart from Alt+TAB and Alt+F4

But i think CAPS lock should be moved, and that "Insert" should be DESTROYED!!

I think ill just pull mine out!! =D

And if you go into control panel, and accessability options....you can make your computer beep when you turn on caps lock....then you always notice it!

# February 23, 2008 11:02 AM

Isabella said:

Well I think that is to what everyone else thinks but if it were to change the earths rotation would it have a big impact? I mean how much do we really know about Tidal Energy? because that would really help the ansmer to the question. If scientists have the proof that it will change the Earths rotation than I completely disagree with the Tidal Energy, but if they think that it will help the enviroment and keep supplying us with energy than I personaly think that we should agree, but nothing I can say or do will help prove that it can or can not. It is really not up to us... Thank you for reading this.

# February 24, 2008 11:02 AM

Marc Rubiño **Marckys** said:

Siempre oí hablar del infierno de las DLL pero cuando hablamos de desarrollos web no nos podemos olvidar

# February 24, 2008 5:27 PM

Marc Rubiño **Marckys** said:

Iframe + AjaxControlToolkit v1 + IE = Access Denied Cross Domain Siempre oí hablar del infierno de las

# February 24, 2008 5:34 PM

Brock Allen said:

In VS2008, if I use:

function Foo()

{

/// <param name='x' domElement='true'>x</param>

}

Should I get DOMElement intellisense for x? If so, it doesn't seem to be working. Same for:

/// <returns domElement='true'>

# February 25, 2008 2:17 PM

Bertrand Le Roy said:

@Brock: I don't think that's handled in 2008, no.

# February 25, 2008 2:27 PM

whatispunk said:

I'm also getting the same error as Ev.

"Error updating JScript IntelliSense: JScript IntelliSense has been disabled for referenced scripts. A referenced script may have caused a stack overflow. Reopen this file to reenable IntelliSense."

Any progress on that one? This is the only Google result for that error message.

# February 26, 2008 12:29 PM

Cathy said:

Hi Bertrand,

I want to change background color of thumbnail. I changed the following code:

private static readonly Color BackGround = Color.White;

However, the color remains blank.

Please help. Thanks.

# February 26, 2008 10:12 PM

Jeff King (msft) said:

@whatispunk: There actually is a limit to the XML Comment data per section.  This was a implementation limitation we could not work around.  I'm sorry to say that you'll just have to shorten your XML Comment data.  I'll keep this in mind to fix for our next release.  Thanks!

# February 27, 2008 1:42 AM

MuffinBottom said:

Pablo, your fix works like a champ!

# February 27, 2008 9:51 AM

Paul Mc said:

Yeah Pablo, thanks. I work for a major corp and we had a big rollout this morning when we saw that error. Thanks, it worked.

# February 27, 2008 9:55 AM

Dimitris said:

I can't simulate this and never ever had such a problem. I don't think that it is that straight forward, since I see that other people as well (Carol) don't get that error!

I used to test it:

Session.Clear();

Session["Test"] = "test";

Response.Redirect("default.aspx", true);

The session is never lost

# February 27, 2008 9:59 AM

rox19840702 said:

ASP.NET AJAX Documentation Update, Videos and Cool Articles

# February 27, 2008 11:32 AM

Bob Lindabury said:

Pablo's "dirty fix" fixes the cross-browser issue in IE when using Ajax.

However, this same script causes an error in Firefox2. I can only see the error using Firebug.

The error I see is:

a.getBoundingClientRect is not a function

If I don't have Pablo's script in the page, I do not get this error in Firfox.

My suggestion to those using this hack is to do a browser check and if the browser is Firefox, return.  If some version of IE, run the rest of the script.

# February 27, 2008 11:46 AM

Bertrand Le Roy said:

Yes, DO NOT use Pablo's fix. It is overwriting the implementation of the method for all browsers with the one that's specific to IE.

# February 27, 2008 12:45 PM

Bertrand Le Roy said:

Cathy: that's this issue:

www.codeplex.com/.../View.aspx

The bug is not fixed in the current release but the discussion on it contains a fix.

# February 27, 2008 12:55 PM

cis said:

what about:

if (!someObject)

is this true when someObject is null OR undefined, or just null?

# February 29, 2008 1:19 PM

Ramiro said:

I found a great way of doing what i need it, e leave the link so you check it out.

www.hedgerwow.com/.../css-select-free.html

# February 29, 2008 1:51 PM

Bertrand Le Roy said:

@cis: sure, !someObject will be true for undefined and null.

# February 29, 2008 1:56 PM

James Newton-King said:

I am really happy with how Json.NET 2.0 and LINQ to JSON is turning out. This release offers big improvements

# March 2, 2008 2:20 AM

Lou said:

hello, seems to be a nice album, but it's not working on my hoster. sohosted.com

I also have this problem:

The issue I'm having is that it is scanning all my folders. I only need it to scan one specific folder and all subfolders under it. When I move the .ashx file and page to the folder that I want to show (meaning the main folder or first folder that should display) all I get are X's for all the images. Any ideas?

sohosted.com is running on medium trust, changin the location of the cache to none or memory doesn't fix the problem....

somebody knows what to do?

Regards

Lou

# March 3, 2008 8:04 AM

Bertrand Le Roy said:

@Lou: it seems like you're using the user control version. If that's the case, you can try to set the HandlerUrl property to point at the ashx file, and also the Path property on non-postback requests.

# March 3, 2008 2:28 PM

Tales from the Evil Empire said:

I've said some time ago that I personally would have preferred if IE8 was in standard mode by default

# March 3, 2008 8:24 PM

Denny.NET said:

Passing a JSON object to a WCF service with jQuery

# March 3, 2008 8:55 PM

Tanjia said:

i tnink who all said these are all goat....its nothing seems me to be funny

# March 4, 2008 5:33 AM

John Doe said:

I have to say ASP is lacking in sophistication, Why would I ever want to create an array with 1001 elements when assigning a size of 1000, asp should either start with a base index of 1 or make Dim arraySize(1000) return an array of size 1000, stupid Microsoft Vogons

# March 5, 2008 1:46 PM

Bertrand Le Roy said:

@John: let's not talk about how off-topic you are and how classic ASP is a ten year old product that has long ago been replaced by ASP.NET. Instead, let me point you to some poetry:

www.cs.utexas.edu/.../EWD831.html

# March 5, 2008 2:29 PM

Max C said:

Bertrand -- just a quick note to point our that your comment below is wrong:

"Max: the issue doesn't affect many users as you need to use iframes *and* have your iframe be in a different domain. That is not that common ..."

Every public site gets put in an iframe by someone, sometime.  The developer has no control over this and definitely does not need to be using iframes themselves to be affected, as you claim.  I don't use iframes myself and am still dealing with the fallout from this over a year later.

# March 6, 2008 1:54 AM

Atanas Korchev said:

Are you aware of any issues with getLocation and the recently released beta 1 of IE8? I've checked the autocomplete extender and its dropdown seems a bit off:

www.asp.net/.../AutoComplete.aspx

# March 6, 2008 4:25 AM

Bertrand Le Roy said:

@Max: I'm sorry this affected you but that doesn't mean it affects everyone as you claim. Indeed, support does not seem to be getting that many incidents around that issue. Anyway, this is fixed in the current version of .NET (3.5).

# March 6, 2008 12:40 PM

Bertrand Le Roy said:

@Atanas: yes, we're currently doing a test pass with the IE8 beta and we know of a few problems. getLocation is one API where we have literally thousands of test cases and where new browsers are likely to break the current code because of how tied it is to browser bug workarounds.

# March 6, 2008 12:43 PM

WTF said:

Update 1, Update 2, Update 3, sends you to a new page that says there is yet another update on another page....what's the deal....this page is a collosal waste of time

# March 8, 2008 12:08 AM

Max C said:

Bertrand -- if you don't agree you might be respectful enough to explain where the hole in my logic is.  If you think for a moment, perhaps you'll realise it absolutely does mean that everyone was affected.

# March 10, 2008 5:09 AM

Bertrand Le Roy said:

@Max: I'm sorry if you felt that I've been disrespectful, that wasn't my intention. I think there's a differnece between disagreeing and being disrespectful.

I agree that *potentially*, everyone is affected, but in reality, this issue is relatively rare, as is attested by the number of support calls. I disagree that "every public site gets put in an iFrame by someone, sometime" and anywaythe person setting up the iframe should probably be the one making sure it works. Furthermore, the problem is fixed in the current version of the framework. If you would like a QFE for previous versions, please contact support but I think it unlikely to happen as there is a reasonable workaround.

# March 10, 2008 12:46 PM

Bertrand Le Roy said:

The page that the updates links to points you to another download for a completely different feature, not for sitemaps.

# March 10, 2008 12:48 PM

Benedict Sauri II said:

Wow, thanks a lot it really works!

# March 11, 2008 12:08 AM

Vijay. R said:

HI!

I first of all like to Thank You for Shsring this wonderful article with us.

My problem with this control is, I am Having Alert with YesNo buttons in My Project. Now I want to Know which button is Clicked(i.e thro Server Side Coding).

Plz Help me to Solve this issue.

Thanks and Regards

Vijay. R

# March 11, 2008 3:12 AM

Bertrand Le Roy said:

@Vijay: if you look at the alert.aspx sample page, you'll see an example of that: just handle the OnChoice event, and you'll get an AlertChoiceEventArgs parameter that gives you which button was clicked through its Result property.

# March 11, 2008 2:23 PM

Andrei Rinea said:

Something called "degradable" AJAX?

# March 11, 2008 7:24 PM

Bertrand Le Roy said:

@Andrei: yes. There are many ways you can achieve that, but UpdatePanel is an easy one.

# March 11, 2008 7:35 PM

JA said:

are you actually talking about the AJAX updatepanel or the asp.net 1.1/2.0 feature that lets you output cache a page then define control which update (can't remember the proper name for this feature)???

# March 11, 2008 9:02 PM

Bertrand Le Roy said:

@JA: UpdatePanel (as should be clear from the first sentence in the post ;)

# March 11, 2008 9:04 PM

Nathanael Jones said:

jQuery does a good job at it with the offset() method. I really like the way jQuery is chainable and how properties are implemented.

Seriously study jQuery! I've found it to be the best, easiest, and least intrusive.

# March 11, 2008 10:37 PM

Dave said:

I don't know that the SEO case is a good one to make.  Other than some fancy improvement to the LinkButton, most of the controls that trigger postbacks (or partial postbacks) are going to be disregarded by search engine  spiders anyway.

That said, I do use them for progressive enhancement sometimes myself.  Usually only in scenarios where I can disable ViewState.  It's nice to know that users with JavaScript disabled or XHR not available can still submit the form and get a traditional postback with the same results.

# March 11, 2008 11:22 PM

Brennan Stehling said:

I do believe that UpdatePanel is the poor man's AJAX which is easy to implement. The reason it is not a great solution is the fact that it still pushes around the ViewState and a consequence of that is only one request can be processed at a time. You basically have to manually queue up the requests on the client-side if you know the ASP.NET AJAX client-side API well enough to do so. (Queuing is handled automatically by Telerik control, for example. MS AJAX should have made this a simple option.) Alternatively, you can use the ScriptResource attribute on web services to convert web services into JavaScript proxies that can be emitted through the ScriptManager. You can make multiple calls on these proxies which does not require ViewState and it also does not instantiate the control hierarchy on the server-side. You can even use the LoadControl method to instantiate a UserControl in a web service method and return the markup for the control. The downside is that you cannot get that markup to work in the PostBack model. You have to make a decision to live with PostBack or break out of that model. I will use both depending on the conditions, but I do lean toward the AJAX-ified web services because they are truly asynchronous and the data transfered is significantly smaller. In one case I was polling the server and the response was as small as 1 byte, versus what is typically 10k to 60k with an UpdatePanel.

# March 12, 2008 1:28 AM

Dmitriy Nagirnyak said:

Please show us ASP.NET web sites that fully support degradable AJAX with UpdatePanel. Not only first-time rendering and calculate efforts involved in it.

UpdatePanel doesn't introduce degradable AJAX, it only allows you to render first-page.

If you say it will be indexed properly by search-engines, you are probably wrong.

Think about AJAX-paged grid with list of products.

First page will probably be indexed, but not all others.

So what's a point?

Only humans can do all properly.

With MVC (ASP.NET MVC, or MonoRail) it is much easier to implement fully AJX degradable site (using ViewComponent (MonoRail) or UserControl).

I don't say UpdatePanel is evil (thou I often think about it). It is very productive way even if it is just against the AJAX-theory. But later or earlier you'll find you need to improve performance, make page REST-full etc.

UpdatePanel is just a good idea to *workaround* AJAX non-availability in WebForms.

# March 12, 2008 1:57 AM

Danijel said:

I am still into UpdatePanel story. Maybe, I don't have demanding projects ;), who knows?

Bertrand, can you name a few authors or give a link to "true" Ajax story?

# March 12, 2008 6:03 AM

Jay Kimble said:

Bertrand Le Roy has an interesting post called " a case for partial rendering ." I started to comment

# March 12, 2008 11:32 AM

David Parslow said:

I know that the term laziness is used a lot in software development, but I like the term "avoiding waste" or productive better. It is not only perfectly ok, it is far better to use the more productive approach, combined with continuous improvement.

In this case, implementing "true" Ajax (i.e. lower level Ajax) often drives up complexity and delivery time while adding little value to the process and maybe the Ajax-enabled feature is not even useful to begin with.  While UpdatePanel, on the other hand, often provides all of the value that your customer requires (i.e. faster/more responsive interactivity, but maybe not the fastest or leanest possible), but with little effort.  If it is a business critical pipeline then the MS Ajax framework allows you to go lower level / “lean” Ajax at that point.  In short, when using UpdatePanel the “pros” far outweigh the “cons” for a wide range of applications in WebForms in my opinion.

# March 12, 2008 12:09 PM

Bertrand Le Roy said:

@Dave: sure, you shouldn't hide contents that you want indexed behind postbacks, but that doesn't make my case any weaker.

@Brennan: I think you're missing the point. I'm not arguing that UpdatePanel is the best solution in all cases and you should always use it. What I'm arguing is that there are *cases* where it makes more sense (and having ViewState can be a good thing too). As a side note, you might want to take headers and request into consideration when you make network traffic measurements: there is no such thing as a single byte request.

@Dmitriy: sure, it's not enough and using UpdatePanel is not the only thing you need to do if you want to optimize for search engines. But it does help. You cite MVC, but you can also just handle pagination with plain links. One thing that works well is to have links with an href such as "page.aspx?p=2" and an onclick such as "goToPage(2)", which enables Ajax pagination and search engine crawling at the same time.

@Danijel: there are plenty, but just to cite one, you can look at Michael Schwartz's or Dino Esposito's blogs.

# March 12, 2008 12:42 PM

me said:

I think you have to use an update panel if you want to use asp.net validation controls. I researched for days trying to find a way to use the validation controls with the web service pagemethods approach and it couldn't happen as far as I can tell. If someone knows how to use the validation controls with asp.net ajax web services then please post up how, otherwise I continue to use update panels..

# March 12, 2008 2:35 PM

Matt said:

Dimitris- Clearing the Session is not the same as the Session never existing in the first place.  An appropriate test would be along the lines of:

Session.Abandon();

Session["Test"] = "test";

Response.Redirect("default.aspx", true);

I tested the above code as a button click handler on an otherwise empty web form called test.aspx, then on page load of default.aspx I set the Text property of a Label control to the value of Session["Test"], if Session["Test"] was not null.  With your code using Session.Clear() it worked fine (default.aspx displayed "test" in the label).  With my Session.Abandon() version it mimics the issue described in the article.

For what it's worth, when we experienced this problem after a deployment it turned out to be the server name containing an underscore as mentioned in Update 2.  Accessing that machine by the IP works fine (it's an internal application so the users just updated their favorites to point to the static IP instead of the hostname on the LAN).  That will have to do until our customer's IT department sees fit to change the hostname of the server.

Thanks again for the article Bertrand, saved me from pulling my hair out.

# March 12, 2008 3:43 PM

Siderite said:

I will tell you a story about partial rendering with UpdatePanel. I was asked by our client to make a report that can have some column or row categories collapsible. Basically it was a big table with lots of data in it. I made the control, I tested it with postback, it worked, then I added an UpdatePanel and watch it display without flicker, but about two or more times slower!

I was flabbergasted. I tested it again, more thoroughly, and I noticed that the same thing did not happen so bad in FireFox. As I knew about a similar problem from before, I used a similar solution: I changed the style.display property of the div containing the updatepanel to 'none' and I changed it back to null with RegisterStartupScript. And voila! An increase of 50% in speed with some flicker :)

In other words, don't attack the UpdatePanel, when in fact it may be a browser issue. I would like an IE option to disable visual refresh for some or all elements, then reenable it...

# March 12, 2008 5:03 PM

Luis Abreu said:

hum...well, I still believe that an asp.net ajax application shoud have...several pages :) this would solve the indexing problems, right?

regarding the page refreshing, I concede that the UpdatePanel might be the best solution if you're worried with security (ex.: you're getting data from a secure web service  and calling it is really really much easy on the server side). should you use the updatepanel: well, it depends. I'd say that there's nothing wrong with it if you know what you're doing.

should you always *use* the update panel:no.

should you prefer JS code+webservices over updatepanels: the correct answer would be yes, but we all know that there are other factors that might make using the UpdatePanel a better option (ex.: if you're working with 2 more people and none of them understands why if(i = 1) is true, the panel is the way to go)...

PS: i do really admire the UpdatePanel. It's really great and it really makes partial postbacks available to everyone. I guess that I stoped liking it when MS tried selling it as the best AJAX approach and stopped developing the client side of the framework to polish the server side (ie, the UpdatePanel and friends )

# March 12, 2008 6:47 PM

Bertrand Le Roy said:

@Luis: I think you're almost completely wrong :)

Having several pages solves part of the problem, yes, but only part: each page must still have the contents included in the GET request, which a "pure Ajax" page wouldn't. On having several pages I agree with you as I'm no big fan of single page interfaces if the site is a content site. If it's a non-contents application, you probably don't care about indexing anyway.

I don't get your argument about security: information that can be accessed through an UpdatePanel is not any more secure than information that can be accessed through a web service is it? Am I missing something?

Again, I don't think you should always prefer JS and web services over UpdatePanel, for the reason I expose above, for the productivity reason, because it can actually be faster to render on the server in some cases, I could go on.

Finally, I'd like to know who in the team ever said that UpdatePanel was the best Ajax approach... And what makes you think that we stopped developing the client-side of the framework??? I'm developing it right now, at this very moment, so I'm more than a little surprised by this assertion...

# March 12, 2008 7:07 PM

Frank Wang said:

I agree the search engine part, but I am just a firm believer that client-side script is the only way to go if you want your web sites to be truly ajax'ed.

# March 12, 2008 10:48 PM

James said:

Anyone have a link to an example of a site using ASP.NET AJAX that gracefully degrades when javascript is turned off (progressive enhancement)? I'd appreciate it. Thanks.

# March 14, 2008 6:37 PM

Bertrand Le Roy said:

@James: I don't have a specific address to give you, but try to put a couple of controls and buttons inside an updatepanel and navigate to the page without JavaScript. Should work just fine.

# March 14, 2008 7:40 PM

John Doe said:

We're sorry for flaming your blog -- we're a couple of C++/Java programmers (both of which have indices that start at 0) so we weren't complaining about the indexing system, just that dim/redim(x) produced an array x+1 long, since dim/redim takes x to be the highest index of the new array rather than the new size.  Working through a site translation to ASP, unexpected quarks (every langauge has 'em) were frustrating.  Either way, it wasn't right to take it out on you.  Please forgive us.

# March 15, 2008 2:39 PM

Sridhar said:

Hi,

  Thanks for writing such a nice tool. I have tried on my website and everything works fine. However there is one photo that doesn't show the details when I use the aspx page and clicked on it. If I use the Album.ashx the same photo displays the details. To experience this behavior please go to

www.tampatennisleague.com and click on photo gallery. for now I set the url to Album.ashx to display the images. If you go to that page, you will see two photos. The first image is the one that I am having issues. If you go to www.tampatennisleague.com/.../photogallery.aspx you will see the same photo. And if you click on it, it doesn't display the details.

I am not sure what could be wrong?

Thanks,

sridhar.

# March 15, 2008 11:13 PM

Stefan Sedich said:

I have used the updatepanel in a current project and have gotten some good results. I have created a custom linkbutton that would pump out a normal link for non js users, a postback for js users, I also used the asp.net ajax history control to support full back/forward/bookmarking support with ajax.

In my case the update panel was the most logical option, as I was only doing it for a listviews paging, and product option selection. I could have gone with a webservice that rendered the html and returned that but with limited time frames wrapping everything in an updatepanel was the fastest option. But with the custom link button and a little extra code it degrades nicely if JS is turned off, I do this by making the url link use query strings and then a postback for my ajax support. So say to select a page I would use a link like site/.../catalogue.aspx, so that is what a searchengine would folow but a client with js on would do a postback.

The only issue I have at the moment is that the search screen needs JS, as it has some advanced controls on it etc. But as the whole product catalogue will still be indexed I think this is something I can live with. I will be posting links to these sites on my blog when they are live which should be by the end of the month :)

Thanks

Stefan

# March 16, 2008 9:49 AM

Bertrand Le Roy said:

That's ok, thanks for taking the time for an explanation. Sure, language quirks can be tricky. In VB.NET you can do Dim A(0 To 19) which can be more explicit and avoid that kind of headache.

# March 17, 2008 1:24 PM

Bertrand Le Roy said:

Sridhar: I have no idea. The image isn't even in the dom. Drop me e-mail at bleroy at microsoft com and we'll try to debug into it.

# March 17, 2008 1:31 PM

Construct Web » IE, the Hell That Thou Hast Wrought said:

Pingback from  Construct Web &raquo; IE, the Hell That Thou Hast Wrought

# March 18, 2008 7:51 PM

Oldschool said:

I'm not able to reproduce the "problem"

First time you load the page:

Session["dummyToKeepSessionAlive"] = "xD";

Second time you load the page:

Session["LoggedIn"] = true;

Response.Redirect("Loggedin.aspx");

Third time you load the page:

if(Session["LoggedIn"] == true)

NeverFailedMeOnce();

# March 20, 2008 6:04 PM

mike said:

One mistake you made: the update panel requires a postback in most common scenarios right? So it actually will only allow spiders to fetch the first content, not the rest (after updates of the panel).

# March 22, 2008 1:53 PM

Daryl said:

Hello,

I am trying to load this gallery on my site ( I think it looks great, and can run it locally - but once I drop it in to a test folder on my server (Windows 2003, it's a dedicated and I have it set up with 2.0) I get the following error that I am hoping you can shed some light on:

Line 1:  <%@ Page Language="C#" %>

Line 2:  <%@ Register Src="~/album.ashx" TagPrefix="photo" TagName="album" %>

Line 3:  

Line 4:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/.../xhtml1-transitional.dtd">

Source File: /test/default.aspx    Line: 2

I placed the template of my site on the .aspx files and changed the name of the Album.css to style.css - also adding the necessary info to the style sheet to make it flow along with my site.  I don't see how this would have caused a problem for me.....I'm thinking it is something else.  Help, I would love to use this template!

# March 23, 2008 5:31 PM

Bertrand Le Roy said:

@Mike: I never said otherwise. I think you missed the point, which is that on the GET request, if you do "pure Ajax" you don't get anything indexed. And if you look at Stefan's comment just above yours, he describes how you can have postback links that degrade to regular links in the absence of JavaScript, which enables search engines to follow and index them.

# March 24, 2008 3:14 PM

Bertrand Le Roy said:

@Daryl: I'm guessing the handler is not at the root of the web application on the server, and thus the server can't find it at ~/album.ashx.

# March 24, 2008 3:15 PM

K. Scott Allen said:

Given this simple Employee class: public class Employee { public int ID...

# March 25, 2008 10:24 PM

BusinessRx Reading List said:

Given this simple Employee class: public class Employee { public int ID { get ; set ; } public string

# March 25, 2008 10:27 PM

rudgr said:

Could it be that this doesn't work in IE8 beta? Thanks!

# March 27, 2008 11:12 AM

Bertrand Le Roy said:

@rudgr: can you be a little more specific? What problem are you experiencing?

# March 27, 2008 1:14 PM

Carlo Capocasa said:

Actually, you can create the Iframe dynamically... you just need to do so immediately after the body tag. Here is an altered version of HistoryIE.htm:

http://pastebin.com/feac6f97

# March 28, 2008 11:17 AM

Bertrand Le Roy said:

@Carlo: thanks, that's interesting but you still need to include that script at a specific place on the page, so you might as well include the iframe instead, it's just as simple.

# March 28, 2008 1:29 PM

.Net World said:

First the disclaimers/warnings. The following uses preview technology. It requires VS2008 and the ASP

# March 29, 2008 2:23 AM

MichaelR said:

Great Work...

All is working well in my local machine. But when I publish it on my website and click on my Gallery Menu...

It is prompting me a user name and password and not allowing me to access my gallery...It has something to do with the permission with my host...but When   I checked my rights I have drwx...

Is there something else that I need to changed in the codes...Can somebody please give me some suggestion that I can try to make it work....or If somebody encountered the same problem please let me know what to do. I already changed the Caching to Memory but still the same...

Thanks very much in advance.

MichaelR

# March 30, 2008 4:47 PM

Bertrand Le Roy said:

@Michael: I have no idea. You should check that with your hoster. Let me know what you find.

# March 30, 2008 5:11 PM

MichaelR said:

I was wrong...Memory Caching sorted it out.

But I get some links and red croses though in some of

the pictures though...Is this a bug or Is there a work around with this.

Thanks very much

# April 1, 2008 3:40 AM

Bertrand Le Roy said:

@Michael: are the broken images consistently the same images? Are they jpeg images? Is there a public url where I could have a look?

# April 1, 2008 12:50 PM

Jon said:

Has this been fixed with 3.5?

# April 1, 2008 3:24 PM

Bertrand Le Roy said:

Yes.

# April 1, 2008 3:38 PM

John said:

Hi, I downloaded the files from codeplex. I have VS 2005 installed. What I should do? What steps I need to follow?

I have album.ashx file

Then Samples directory contains

Default.aspx

Templated.aspx

and Album.css

Where should I copy these files?

What file I shoud open in VS 2005? Is their any project?

How do i assign the directory in which the images are placed?

Can some one help me? I will create a Video movie and upload in Youtume or any other location for the benefit of others.

Thanks

# April 2, 2008 1:38 AM

MichaelR said:

Hi Bertrand,

My images are in jpeg format.

(thumbnails) red crosses and link are coming out inconsistently in these series...

thummnail ok   thummnail ok  thumbnail ok    red cross  red cross  red cross link link link thumbnail ok...

I say inconsistenly, I mean sometimes when you view the gallery red crosses and links come out the other time they are fine.

url: www.aikidoclub.net

Thanks very much

# April 2, 2008 3:45 AM

Naor Rosenberg said:

If you use Dojo Toolkit's "dojo.dialog" widget to display the popup div, they do all the work for you.

Actually they use the IFrame solution.

# April 2, 2008 8:57 AM

Bertrand Le Roy said:

@Naor: err, sure, as does the ASP.NET menu, the popup control in the Ajax Control Toolkit and many, many other similar components.

# April 2, 2008 12:25 PM

Bertrand Le Roy said:

@John:

* In a web application on your web server. If you want to use just the handler, you just need bin and the ashx. If you want to use it as a control, you need the rest.

* Why do you want to open Visual Studio? If you want to open the web site in Visual Studio, just do file/open/web site and point VS to the web application

* It depends if you're using it as a control or as a handler. If it's as a handler, the images should be in the same directory. If as a control, just set the Path property.

# April 2, 2008 12:36 PM

Bertrand Le Roy said:

@Michael: we should take that offline. Please write me e-mail at bleroy at microsoft. There is a server error on these images but I'm unable to diagnose it because you have cutom errors on (which you should, this is absolutely the right setting). We should be able to sort this out via e-mail. Thanks.

# April 2, 2008 12:45 PM

Morgan said:

If you get this error message when you try to use Snipping Tool:

THE SNIPPING TOOL IS NOT WORKING ON YOUR COMPUTER RIGHT NOW. RESTART YOUR COMPUTER, AND THEN TRY AGAIN. IF THE PROBLEM PERSISTS, CONTACT YOUR SYSTEM ADMINISTRATOR.

Try running Office Diagnostics (Outlook -> Help -> Office Diagnostics).  It fixed the problem for me.

www.microsoft.com/.../default.aspx

# April 2, 2008 2:58 PM

ASP.NET Debugging said:

So after using IE8 for a while now, there are a few things that are useful for people to keep in mind.&#160;

# April 2, 2008 11:12 PM

Raghavendra said:

But unfortunately if the PST size is huge.. this tool doesnot do anything :(. My PST have moved over 1GB and now i am totally lost. I cannot do anything with this PST. As soon as i touch this PST, my machine hangs and i have to hard reboot the machine :(. Totally in a bad state

# April 2, 2008 11:43 PM

Joel Levi said:

I was alo facing the same issue with Redirection but Bertrand Le Roy's article solved it. Works fine now.

Thanks, very helpfull.

# April 3, 2008 1:56 AM

ASP.NET Debugging said:

So after using IE8 for a while now, there are a few things that are useful for people to keep in mind.&#160;

# April 3, 2008 10:11 AM

Bertrand Le Roy said:

@Raghavendra: you should contact support.

# April 3, 2008 12:50 PM

brute forced brilliance said:

It's Time for a Change -- We need Immutable Types

# April 3, 2008 1:13 PM

Jonah Dempcy said:

Nice link! Some interesting topics, good reading!

My vote for best JS blog goes to John Resig: http://www.ejohn.com

obligatory BSP: I am a contributor to a JS/CSS blog called The True Tribe (www.thetruetribe.com) ... The blog is just getting started but so far we've been posting regularly (a few posts a week) about a range of front end web dev topics, with a focus on JS.

# April 3, 2008 4:05 PM

Rob The Jedi said:

This is awesome!

# April 3, 2008 11:42 PM

Girish Singh said:

Seems pretty neat to me, I mean I always thought php was born to be with apache, I guess thats gonna change very soon

# April 4, 2008 11:20 PM

Joe Chung said:

Brendan responded to your question in his blog.  For your readers' convenience:

"Only the @shared value would be shared among script tags. The @src would be loaded only if there was no cache entry for @shared."

# April 5, 2008 1:18 AM

Philip said:

I don't see the security difference between the two plans: how do you guarantee that the hash "generated with a well-defined cryptographic hash algorithm" really matches the javascript file referenced by the src attribute? To do that, you would have to have the browser compute the hash after receiving the javascript file (and then, why are you specifying it in the html in the first place?).

The two plans are equally insecure and share the attack that you describe.

# April 5, 2008 2:51 PM

Bertrand Le Roy said:

@Joe: yes, I actually read Brendan's answer before I wrote that post, but I don't see how it answers my question. I reformulated with another comment that for some reason he chose not to publish. That's why I posted my comments on my own blog ;) The attack scenario that I describe in this post, unless I'm mistaken, is not mitigated by his answer in any way as the src value would never be hit if something is already in the cache for the shared value, which may be a malicious script.

@Philip: I think the third solution that I describe doesn't have this flaw at all. But Doug's approach is much more difficult to compromise than Brendan's: the scenario with his approach is that the cache is organized as a dictionary of hashes to scripts. When you visit a page, if there is a script with a hash attribute, the browser looks up that hash and if it finds it it uses the script. But the way the cache is being constructed is what guarantees the integrity of the hash: the first time a script is loaded, the browser computes the hash locally from the contents and uses the computed hash as the key in the dictionary. Does that clarify?

# April 5, 2008 5:52 PM

Kurisu said:

A lot of storage systems use exactly this concept i.e., storing hashes of files or chunks thereof along with the files themselves and use this to avoid transferring or sometimes even storing the same data more than once. Not surprising very similar ideas have been around for years and decades. Consider the ETag header, the Content-MD5 header or much closer RFC 2169:

www.faqs.org/.../rfc2169.html

The Gnutella network takes advantage of this RFC.

Calling cryptographic hashes too weak for this purpose borders on reality distortion field. How do these people think cryptographic signatures or SSL/TLS works? Not to mention that attacking the hashes by trying to generate evil twins is the least probable attack vector. Anyway, in this context though I'd consider it a total pain for maintenence. At the very least it would require dedicated tools to keep everything consistent during updates. Also if I was going through all this hassle I'd extend this to all files not just JavaScript. For browsers or proxies that already implement caching this would be a low-hanging fruit anyway. All they need to add is an index with the hashes for the cached files.

# April 8, 2008 12:55 PM

Bertrand Le Roy said:

@Kurisu: thanks for the pointers. I agree that crypto hash attacks are blown way out of proportion by Brendan, who tends to generate a quite powerful RDF. That he would be using a security argument to dismiss Doug's approach and propose his own approach which has a much bigger security problem is quite puzzling. And yes, Doug's post wasn't limited to script and neither should any implementation of that stuff. CSS and images would benefit from the same optimizations. To cite the post above, "all elements that have a "src" or "href" attribute".

# April 8, 2008 5:14 PM

masterMunkus said:

This is working fine on my local machine

but on the server it just shows white bg , missing images and links , I have set my server to allow the application write permission. Any thoughts

# April 8, 2008 9:08 PM

Bertrand Le Roy said:

Check that you configured the directory where the handler is as a web application.

# April 8, 2008 9:10 PM

Dom B said:

When was this version last updated ?, is it possible to list the picture in the order in which they were taken rather than there file date ?

Create tool btw

# April 9, 2008 4:25 PM

Bertrand Le Roy said:

@Dom: in June 2007.

The file date is only used as a last resort after the metadata has been searched in at least two different places so if it's not working for you, please file a bug on CodePlex and link to an image where this is not the case.

# April 9, 2008 4:34 PM

Kurisu said:

I hadn't actually read the linked articles before commenting. Now I see he even mentions base32 encoding of the hash which kinda shows where Doug got this idea from.

I think what Brendan meant is similar to DTD URIs in XML. These can be normal HTTP URLs and it's certainly useful to avoid namespace clashes. A few parsers do/did really try to fetch the DTD from such URLs if it wasn't stored locally. This can easily cause an unintended DDoS. Likewise it's only safe if you can trust DNS and the server. So signing the scripts using PKI and/or use of TLS is probably implicitly given. Anything would mean someone misunderstood cross-site scripting. If you use only signatures i.e., you trust everything signed with certain keys but no explicit hashes that means of course the script can be modified by the key owner for good or for bad.

The DDoS issue could be circumvented by using Coral: www.coralcdn.org

All in all, I believe both suggestions are actually complementary.

This article is also related and somewhat interesting:

changelog.ca/.../gnutella_does_not_need_the_x-alt_http_header

# April 9, 2008 7:13 PM

Matt said:

Response.Redirect("~/default.aspx");

...should be...

Response.Redirect("~/");

12 less keystrokes will a) prevent your URL from looking ugly/unprofessional, and b) when you upgrade your site to the next big thing and the file extensions change (remember going from asp to aspx?), the links that search engines spidered won't stop working.

# April 10, 2008 11:16 AM

PineTree said:

Everyone should take just a moment and glance at

whswebsite.googlepages.com

Two fellas started with Andrew Grant's Whiist, added a ASP.NET 2.0 Starter Kit, and mixed in Microsoft's Free Express software to produce fully functioning dynamic websites hotsed on their Windows Home Servers.

Really take a look

* Albums (two methods)

* Forum

* user Login

* Polls

* etc.

And it is easy to read and follow and ALL Free

# April 10, 2008 2:36 PM

Richard said:

Excellent article and the update section helped here with regard to maximum number of worker processes with a value above 1

# April 11, 2008 2:17 AM

Venkatesan said:

Hi,

This is simply superb. But I need to customize the alertbox.

1. Currently the alertbox can be resized by dragging it. I dont want to resize it.

2. I want to change the opacity of the page excluding alertbox like the one in ajax control toolkit modal popup.

3. I dont want the title --Webpage Dialog in the alertbox

4. I need to add some images in the alertbox.(Example: For an error message ,one image will be shown. For a normal information,some other image will be used)

Thanks,

Venkatesan  J

Prince of Pammal

# April 11, 2008 7:19 AM

Kid said:

Is possible to change the backcolor to a thumb image?

# April 11, 2008 10:00 AM

Bertrand Le Roy said:

Venkatesan: those are interesting suggestions, but this code is provided as is. Feel free to implement those if you want to, and I'll be happy to point to your modifications from here.

# April 11, 2008 5:10 PM

Bertrand Le Roy said:

# April 11, 2008 6:12 PM

Desperado said:

Where can i download this song?!

# April 13, 2008 7:53 PM

Fabien Molinet said:

Hi Bertrand,

I have done a small Javascript that corrects this SELECT bug under IE  :

www.fabien-molinet.fr/index.php

It does the trick automatically for you.

The code is released under BSD licence.

Furthermore, you'll find 3 public methods in the Javascript. I think that you'll find them usefull :)

Please give me some feedback !

Best regards,

Molinet Fabien

# April 14, 2008 3:40 AM

@Bertrand Le Roy said:

I'll try to insert the propose fix but doesn't resolve the problem!

Thanks

# April 14, 2008 4:59 AM

Mina said:

create comments by php

# April 14, 2008 11:51 AM

egainey said:

I can't figure out how to get this work! What am I missing?

1. Create Dropdownlist

2.Create iFrame

3.Create div with matcing style...

What else do I need to do...please help this is URGENT!

# April 14, 2008 5:50 PM

Fabien Molinet said:

Hi egainey,

Can you give us more information ? :)

You can mail me at : fabien.molinet[you know what]gmail.com

I'll help you.

Best regards,

Molinet Fabien

# April 15, 2008 8:13 AM

.Net World said:

Given this simple Employee class: public class Employee { public int ID { get ; set ; } public string

# April 15, 2008 1:45 PM

lansol said:

beware that if your PST file is over 2GB, this may not work.

# April 16, 2008 5:03 PM

ASP.NET Debugging said:

So I tend to describe a lot of issues here, but we had some really great conversation in our blog chat.&#160;

# April 17, 2008 8:43 PM

James said:

I was lossing session data after clicking on a new page on a web site I was building only one of the pages out of about 25 was having this issue and it was always the same page.  As soon as I copied the page on to the IIS server on my computer the problem went away.  I think that something was going wrong on the server that visual web developer 2005 was running.

# April 18, 2008 4:12 AM

Bikaram said:

Thanks This was very useful to me

# April 18, 2008 9:11 PM

julz said:

CHECK YOUR RECIEVER IS IN FRONT OF THE TV!

YOU KNOW? THE LONG BLACK RECTANGLE THING THAT RECIVES THE WII REMOTE SIGNALS?

YEAH THAT.

# April 19, 2008 11:48 PM

Mehedi said:

Nice. I learned a great thing today.

Thanx

# April 20, 2008 3:01 AM

Bertrand Le Roy said:

@julz: no need to scream. For your information, the device you are referring to is no receiver, even though Nintendo misleadingly calls it a sensor bar. Quite the opposite in fact: it contains a couple of infrared diodes. The receiver is a small IR camera in front of the wiimote. Nintendo needed that in addition to the motion detectors to get better precision, but when you're in the middle of a swing, the wiimote is pointing down, so the camera actually doesn't see the IR dots and can't help. Add to this the lack of precision of the motion detectors on fast movements and you pretty much can understand why golf games don't work on the Wii.

You might also want to check your spelling.

# April 21, 2008 12:24 PM

mike said:

Suggestion for your blog: each link for JSON is the same, I thought each link was to a relative article/source, so perhaps only link the first instance?

# April 22, 2008 4:59 PM

Jonah Dempcy said:

I posted an article about this, also discussing John Resig's version and offering an alternative. My proposed solution may fall prey to some of the same problems you mention but it offers the nifty ability to overload functions with type signatures, not just based on the number of parameters.

I think some method overloading is nice, like how jQuery or MooTools will sometimes allow you to provide the String id of an HTML object or a reference to the object itself. But, it certainly isn't a necessary feature and adding additional overhead and boilerplate code for defining functions isn't ideal. So, perhaps the solution proposed in my article is best suited for theoretical discussion rather than production use.

# April 22, 2008 6:30 PM

James said:

I common misconception is that because JavaScript includes 'Java' in it's name, it will behave like Java (or C#). I feel it is really more like C than either of those languages.

Though typing tends to default to string, which is peculiar to most languages, perhaps making it more like PHP.

# April 23, 2008 12:08 AM

Chris Pietschmann said:

Do you have an example of how to Localize the JScript Intellisense Support using the locid? If so, could you please send me an example? You can contact me through the contact form on my blog. pietschsoft.com/contact.aspx

Thanks

# April 23, 2008 10:42 PM

Nikhil Kothari said:

How common is it for script code to do different things based on the type of the exception anyway?

# April 24, 2008 2:07 AM

Bertrand Le Roy said:

@Nikhil: most people don't bother but that's a bad thing: why would catch(Exception e) be bad practice in .NET and Java but not in script?

# April 24, 2008 12:54 PM

Suman Chakrabarti said:

Yes, but in .NET it's considered a best practice to not depend on exceptions as the condition to perform a subsequent action. Most actions performed on an exception in .NET are for logging, something that's not very helpful to a user.

# April 24, 2008 3:25 PM

Bertrand Le Roy said:

@Suman: what's your point? Are you saying that it's not useful to handle exceptions??

# April 24, 2008 3:31 PM

Josh said:

Not saying I agree, but perhaps the two different hierarchies are because some are JavaScript programming language related exceptions, while others are W3C DOM. That DOM was specified independent of implementation (ECMAScript), so perhaps it had its own inheritance hierarchy etc.

# April 24, 2008 5:26 PM

Jonah Dempcy said:

Nice! I would love for browsers to adopt a shared, supported standard for Ajax, ideally something flexible like MooTools' Ajax API. Also, we need a simple way to create a push model, where the connection stays open, similar to what you can do with Flash or Dojo.bind.

Opening more concurrent connections by default is desirable from a performance standpoint, as some Ajax apps will have many simultaneous requests going on at once.

I'll have to check out their project page and find out more. Thanks for the link!

-Jonah Dempcy

www.thetruetribe.com

# April 25, 2008 9:53 PM

Jonah Dempcy said:

It certainly is unusual that DOMExceptions are not instances of Errors. But, it shouldn't really hinder your ability to do error handling all that much. I see that Opera doesn't support checking the instanceof a DOMException, but what about typeof?

I'm curious, how much error handling do you put in your code? Like, how granular do you make it?

I'm also interested in how different JavaScript libraries will either raise exceptions or swallow them. Like, Prototype will sometimes silently fail when defining a class, whereas MooTools seems to always raise exceptions. What's the rationale for this? It seems that you'd want to raise exceptions during development mode and silently catch and log the error via Ajax (but not raise the exception) in production.  Thoughts?

# April 25, 2008 10:31 PM

Nikhil Kothari said:

Actually I personally believe there are several cases where catch (Exception e) is the right thing even in .NET. I think the design guidelines are a bit extreme (I might be in the minority camp on this one)

Sometimes there are cases where code switches based on exception type, and its abusing the exception mechanism to implement control flow.

Its not black and white. There are certainly valid cases though to catch a particular exception type. In .NET there are many more app scenarios - eg. you want to distinguish file not found from something else. Script simply doesn't have that many scenarios right now, to make it interesting to distinguish at the exception type level.

In several cases, you want to figure out whats the right alternative a piece of code should do if a dependency threw an exception, and either do something alternative, or return a success/failure result. And that requires an unqualified catch block. If all code catches only specific exception types, then its likely that various exceptions will bubble to the root, where the global catch handler can only either end the app, report there was an error and resume... but it doesn't have much context to do some alternative behavior, or provide a better error report of the specific action that failed.

# April 25, 2008 10:59 PM

Bertrand Le Roy said:

@Jonah: typeof can't help you here. typeof can only return the following strings: "string", "number", "boolean", "object", "function" or "undefined".

I personally think swallowing exceptions is totally wrong in most cases. As you point out, one thing you might want to do is have your own global exception handler that doesn't expose the exceptions to the user but logs them or sends them back to the back-end. But of course that's very different from swallowing the exception, which makes it totally impossible to ever detect and correct problems.

@Nikhil: I disagree that the exception system in script would justify catching specific expetions less than in .NET. If you think about it, the number of exception that you commonly use in .NET is also relatively small, but still you don't want to catch an out of memory exception where you really expect a null ref for example. In script, there are few kinds of exceptions (about a dozen) but they are all pretty common. Plus, frameworks such as Microsoft Ajax expose and use a rich system of exceptions.

One place where it makes a lot of sense to catch specific exceptions is a unit testing system.

# April 26, 2008 1:31 AM

Wil said:

Need Help, I get the album to work when I debug but when I publish I get the following error.

Error 13 There is no build provider registered for the extension '.ashx'. You can register one in the <compilation><buildProviders> section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'. E:\Visual Studio 2005\WebSites\xxxxxx\Entertainment\Gallery.aspx 3

# April 27, 2008 3:42 PM

Bertrand Le Roy said:

@Wil: check that the server has ASP.NET 2.0 or higher installed, then check the web.config file.

# April 28, 2008 12:20 AM

Jonah Dempcy said:

Why not just rely on Google to provide the bandwidth and simply have them host all the major JS frameworks? They are already hosting plenty of code snippets on Google Code and they offer hotlinks (the link actually has the text "Hotlink/Download" so they intend for you to use it directly if you so desire).

For example, I have used Dean Edwards' IE7.js library. Normally I would concatenate it together with all the other JS as part of the build process to minimize I/O traffic, but I'm wondering if I'd be better off just hotlinking to Google Code, on the off-chance that other sites are doing the same and the download would be cached:

ie7-js.googlecode.com/.../2.0(beta)/IE7.js

For now, I will keep doing my concatenation thing because minimizing the amount of separate JS files seems to have the greatest benefit (and I doubt many people have the IE7.js file cached). But, if Google Code were to host MooTools, jQuery or Prototype I'd be all over it in a flash. I'd stop having to write build scripts that combine those files with the rest of the site JS and be able to just hotlink from Google, basking in the benefits of universal caching for popular pieces of code.

# May 7, 2008 10:49 PM

Jonah Dempcy said:

The only game worth playing on Wii Play is Tanks and it's debatable whether or not that's worth $10. Tanks is fun because it is super simple yet very challenging, just like the arcade games of yore. In fact, there even was a classic game called "Tanks" that was very similar. It's simple but the controls are responsive and aiming is intuitive with the Wiimote (just point and click).

Agreed about the rest of the games being pretty much throwaway. There were a couple quirky ones and the PONG type game wins for style/soundtrack but overall the disc is quite boring.

So what _are_ good games on Wii? I've already played Mario Galaxy, Metroid, Zelda, Smash Bros, Mario Kart ... Are there any good games for Wii that are _not_ made by Nintendo?

I've enjoyed Zack & Wiki quite a bit, although it is rather kiddie. But the puzzles are fun.

# May 7, 2008 10:57 PM

garrett said:

i have tried that i even put new batteries in and nothing seems to work but my brothers mote still works

# May 11, 2008 10:39 AM

KM Web Design Melbourne said:

I think we are findign the browsers a big hurdle for our ajax developments. we will check it out. Thanks!

# May 11, 2008 11:19 AM

VR2 said:

Could we have a static "parse" method added to all classes, in order for clients to be able to cast to type?

eg

Sys.SomeClass.parse = function(obj)

{///<returns type="Sys.SomeClass"/>

   return obj;

}

Client Code would be

function onSomeClassClick(sender, args)

{

   sender = Sys.SomeClass.parse(sender);

   args   = Sys.SomeClassEventArgs.parse(args);

   // Full JS intellisense now enabled.

}

Thanks

# May 12, 2008 9:31 AM

ScottGu's Blog said:

Earlier today we shipped a public beta of our upcoming .NET 3.5 SP1 and VS 2008 SP1 releases.&#160; These

# May 12, 2008 1:34 PM

NZEYIMANA Emery Fabrice » Invalid JSON from NET - DateTime said:

Pingback from  NZEYIMANA Emery Fabrice &raquo; Invalid JSON from NET - DateTime

# May 14, 2008 2:21 PM

Tim C said:

So you had to manually change the active step of the wizard. What state gets restored? For example, if in one of your wizard steps you had a button that when clicked updated a label's text property. Then you go forward then clicked back, will the label's text be updated or would it have its original state before the async postback from button?

# May 15, 2008 11:13 AM

VMDude said:

We just ran in this today.

In our case our application is commonly put in an IFRAME by customers and I just ran into to it myself.  Since our site has being deploying within a IFRAME for almost a year I am suprised that it just started to show up and it is only showing up on our test servers and has not shown up on our production servers as yet.  

We did do a update on the servers on Tuesday for the following:

www.microsoft.com/.../ms08-may.mspx

and I don't see what in these patches could be a contributor.   Actually I am rather confused how this    issue just popped out of no where.

I have read the "Work Around" and personally I am shocked that a fix was not rolled out on the previous version.  I am sure there a lot of customers out there that are still using VS2005 and .Net 2.0 that would have welcomed the fix rather than going into their applications to patch external 3rd party files.

I  am off to do try and apply the fix but wanted to post that we have ran into it and given the fact that in today's world more and more sites are mashing things up together and IFRAMES can be used to mash up things I do think people running into this issue is more common than not.  

# May 15, 2008 6:54 PM

Deepak V said:

i want to know the reason why CONCAT() is slower to using pipeline operator || in SQL?

does the same array concept apply to this also?

Regards,

Deepak V

# May 19, 2008 2:04 AM

Doug Winter said:

This worked great for ASP.NET 1.0 and 2.0, but now with ASP.NET 3.5, this script does not work.  Do you have an update for ASP.NET 3.5?   Thanks in advance.

# May 19, 2008 1:54 PM

Jeff Haluska said:

I am having the smae problem, able to debug, but publish....   ASP.net 2.0 is installed on my local machine, and the web config for the website had the build providers included....  Any other suggestions...

# May 21, 2008 4:17 PM

linukalex said:

hi, I am faceing mainly 2 problem with my web site.When i run my website in development server, almost everything works perfect except response.redirect().I have developed a shopping cart web site which uses a master page and lots of content pages.There is index page which also uses the master page.In my master page i wrote lots of codes to control the web site.For example i have used a datalist which has paging facility, for this i used a session to keep the table and the whenever some click events happens , i change the session values with new table.This works fine in development , i get all the changes also, but i published it i am not getting the changes when some click event fires, i am getting the first data which v assigned in the load event of the master page.Y it happenes like this, i mean locally it works fine but after publishing it shows only the data which is assigned in the load event of the page? Please help me out..

second problem is that when i click a control which is in the master page , i used the response.redirect to the index page with some querystring, i am getting a execption/error.but as i simply  give  catch execption without any other statement its not making a problem. Will it be reason for the above problem, as when a click event fires i used , response.redirect or server.transfer() with querystring to reload the index page , where it will make a check for the position (based on the querystring) & get values from db and assigns it to the session as a table....

This all works in the development fine ....

Please help me out as I am struggling bit hard on it.....

# May 24, 2008 2:32 AM

Karthik said:

Excellent Article,

Note:The Path should be relative

# May 26, 2008 2:40 AM

Hiruma said:

Hi,

I have the following errors in release mode :

var $create=Sys.Component.create=function(h,f,d,c,g){var a=g?new h(g):new h,

It appends when I have a timer in my page... as Thomas problem!!

I've checked my script and I think it's ok .

What's wrong please ?

# May 26, 2008 3:51 AM

Diego Frata said:

I'm facing the exact same problem as Hiruma...

# May 27, 2008 10:58 PM

homey said:

Nice discussion.

I am simply trying to pass some variables from asp to aspx page. If I use session, they dissappear, if I use query string, they dissapear. I don't get it.

If I manually paste the url into the browser, everything is fine, so I know my aspx page is recieving the querystring. But, when I use the response.redirect from the asp page with the params in the query string, they dissapear somehow.

ex: response.redirect("/somepage.aspx?name=value")

Any ideas?

# May 28, 2008 9:35 AM

homey said:

Got it working. nevermind.

When I feel really adventurous I will try upgrading it to the more secure session method, but for now query string will have to work.

# May 28, 2008 10:02 AM

Bertrand Le Roy said:

@Jonah: Some have expressed privacy concerns over having scripts hosted by Google (which then gets a lot of free information about people browsing your site through the referrer header). You also have to trust the central location to always be available. But yes, centralized hosting by Google and others is a step in the right direction.

I would prefer a solution such as the ones described here because there is no such reliance on a centralized location, yet the scripts get cached across sites and the load is naturally distributed.

# May 28, 2008 7:29 PM

Bertrand Le Roy said:

@Jonah: good exclusive games on Wii? I would cite pretty much the same as you. There are good third party games though: out of the top ten Wii games on Metacritic, five are third party.  It's less than on Xbox (seven) or PS3 (eight) but still not as bad as you'd think.

# May 28, 2008 7:38 PM

Bertrand Le Roy said:

@Tim: you should include in the state any information that you need to rebuild the page's state. In your example, you'd probably store the fact that the button was clicked in addition to the wizard step.

# May 28, 2008 7:41 PM

Bertrand Le Roy said:

@Hiruma: Thomas had incorrectly patched his file if I remember correctly. Please double-check.

# May 28, 2008 7:59 PM

Bertrand Le Roy said:

@Deepak: in SQL I'm sorry but I have no idea, you should try to ask on a SQL forum or to a member of that team.

# May 28, 2008 8:03 PM

Bertrand Le Roy said:

@Doug: I haven't tried that with 3.5, but I'm not really surprised and I really encourage you to try to find another way to reach your goal here. Feel free to drop me a private message on the contact form to decribe your scenario and why you think you need synchronous calls, I'll try to help.

# May 28, 2008 8:12 PM

Bertrand Le Roy said:

@Jeff: difficult to say without looking at the server. Drop me a mail through the contact form and I'll have a look.

# May 28, 2008 8:16 PM

Bertrand Le Roy said:

@linukalex: difficult to say without seeing the code. Feel free to drop me e-mail through the contact form.

# May 28, 2008 8:41 PM

George said:

From the hint to Lindsey on calculating the angle of the wake: Why is the wave_speed/duck_speed = 1/3? Thanks.

# May 30, 2008 1:06 PM

Robert Folkesson said:

Den senaste tiden har en mängd sajter blivit infekterade av en SQL Injection-attack som använder SQL

# June 2, 2008 3:50 PM

Hiruma said:

I have checked my patch and there's no difference in the  javascript file but I use the ScriptPath property of the Script manager.

In the page source code, the correct MicrosoftAjax.js file is called. I don't understand ...

# June 3, 2008 10:58 AM

Bertrand Le Roy said:

Give me the url of your page and I'll take a look.

# June 3, 2008 11:05 AM

This is an english site Please post in English or do not post at all said:

Thank,

As I recall more than half of montreal speeks English, out of respect for the members of this blog, we request that you write comments in English please.

# June 3, 2008 5:02 PM

Hiruma said:

If I replace my ScriptPath by the ScriptReference it works !

so the files downloaded are corrupted ?

# June 4, 2008 4:56 AM

Bertrand Le Roy said:

With all due respect, this is out of line for many reasons:

* The conference is being organized by a French-speaking user-group, and they explicitly asked me to do the talk in French.

* Only 10% of the population of Montreal speak only English, 87% understand French, 33% understand only French.

* I did write the title and the introduction of this blog post in English so that people who don't understand French can promptly determine that there is no relevant contents for them and that they can safely skip the post.

* This is my blog, and I'm the one who chooses what to write or not to write in it. Other sites that aggregate it must know and accept it.

* Who is "we"?

# June 4, 2008 2:25 PM

Lauren said:

I had that problem with the huge PST file. As someone else said earlier, I used OutlookFix to repair it. It allows you to split the pst file in several smaller files. It worked for me. Check it out!

# June 4, 2008 7:04 PM

衰人 said:

与当今构建的绝大多数Web应用程序所采用的开发模式相比,AJAX对Web解决方案架构师而言意味着一种模式转变。它立足于一些新的原则和规则来解释基于Web的系统的行为,并要求采用一些新的算...

# June 5, 2008 12:34 AM

Mike Ormond's Blog said:

Having talked about the pain of capturing image snapshots , someone mentioned Cropper and its plug-in

# June 6, 2008 6:46 AM

Certified Professional said:

It works like a charm...Dude your a genious.  Thanks alot.

# June 6, 2008 1:02 PM

Kras said:

The motion detection is fine, it's the games that can't use it properly.

# June 7, 2008 10:01 AM

ubgadeashish said:

Ajax creates a runtime object “Sys” and their classes, this is required by the “Scrip Manager” and AJAX controls (like watermark text etc). If we use document.write to change the page contents at the run time, then it creates every thing but do not load the sys object in the memory. If we refresh the page then SYS object is loaded and ajax works fine.

But in both the cases (i.e. before refresh and after refresh) code remains the same. We have checked this by comparing the “View Source” of both the pages.

Probable Workaround: By any means if we can create the “Sys” object and load it in the memory.

I have also tryed document.forms[0].submit(); just after the document.write(); statement, ajax controls works perfect but it gives a refresh effect which I don’t want.

# June 12, 2008 9:20 AM

Tales from the Evil Empire said:

ASP.NET Ajax 3.5 SP1 contains a new feature that enables the application developer to combine scripts

# June 12, 2008 7:31 PM

rachitp said:

Awesome control...

# June 12, 2008 10:10 PM

bryan said:

your all stupid

# June 13, 2008 9:19 AM

J Shissler said:

This is a good idea.  I am curious where the combined script is stored and if the resulting JavaScript is minified (which would be really great).   I assume that this feature could be used by a page that does not use ASP.NET Ajax as long as the developer puts a ScriptManager control and adds any application .js files that are normally included on the page, correct?

# June 13, 2008 3:41 PM

Bertrand Le Roy said:

@J: The combined script is not exactly "stored". It is being generated by a handler dynamically (and output-cached). The JavaScript is not minified by the handler, but the infrastructure allows for a release and a debug version of each script, the release version being minified using one of the many tools available. You could use that with non ASP.NET Ajax frameworks if the scriptmanager didn't always include MicrosofAjax.js (which is something we're looking at relaxing in a future release).

# June 13, 2008 4:46 PM

Andrei Rinea said:

Although it is a great idea and I'm sure it took a lot of effort to build the tool, I'm quite skeptical about the amount of performance gain obtained.

How much do you really gain from this? Bandwidth and/or lag time?

# June 13, 2008 6:46 PM

Bertrand Le Roy said:

@Andrei: you're absolutely right, the gains are most of the time quite modest, but it does add up on a high traffic site. Definitely not a feature that you need to use on each and every site, and definitely one you should use with caution.

# June 13, 2008 6:52 PM

Daniel Brünteson said:

Hi Bertrand,

What about forcing the javascript's to load after the GUI, "loadscriptsbeforeui='false'", which has an even greater effect on what you perceive as performance, does this work with that? In 3.5 w/o SP1 it's not working completely well.

# June 14, 2008 3:39 AM

Bartek said:

Hello,

I copied album.ashx and MetaDataExtractr.dll to directory with jpgs but I get this message:

"Błąd serwera w aplikacji '/PhotoHandler-6410'.

--------------------------------------------------------------------------------

Błąd kompilacji

Opis: Wystąpił błąd w czasie kompilowania zasobu wymaganego do obsłużenia tego żądania. Przejrzyj poniższe szczegółowe informacje o błędzie i zmodyfikuj odpowiednio kod źródłowy.

Komunikat o błędzie kompilatora: CS0246: Nie można znaleźć nazwy typu lub obszaru nazw 'com' (czy nie brakuje dyrektywy „using” lub odwołania do zestawu?)

Błąd źródła:

Wiersz 52: using System.Web.UI.WebControls;

Wiersz 53:

Wiersz 54: using com.drew.metadata.exif;

Wiersz 55: using com.drew.metadata.jpeg;

Wiersz 56: using com.drew.metadata.iptc;"

this line is red:

Wiersz 54: using com.drew.metadata.exif;

this: Komunikat o błędzie kompilatora: CS0246: Nie można znaleźć nazwy typu lub obszaru nazw 'com' (czy nie brakuje dyrektywy „using” lub odwołania do zestawu?)

means: compilator error message: CS026: Could not find type name or namespace 'com' (check whether "using"  is missing.

Hope You'll help me.

Greetings

# June 15, 2008 7:00 PM

J Shissler said:

Thanks for the clarification, Betrand. My thought on this was that it could provide the mechanism to logically combine scripts into a single HTTP request while still allowing one to have separate physical files for easier maintenance, debugging, optional inclusion on the pages that need them, etc.  Does output-caching allow the Expires and related HTTP headers to be set or is the resulting single file always fetched from the server cache?

# June 16, 2008 8:48 AM

Brian S said:

Hi Bertrand

I have a similar problem with ASP pages.

I am setting a session variable:

 Session("locadd") = "1"

on a page "add.asp" which gathers certain location data from input.

Upon clicking the Submit button, the following code is run:

 TheForm.action = "add_res.asp"

 TheForm.submit

In the "add_res.asp" page, the Session("locadd") is empty.  It appears to be working on the production server but not the Dev or Staging server.

Any ideas?

# June 16, 2008 1:24 PM

Bertrand Le Roy said:

@Daniel: loadscriptsbeforeui should just work. If it doesn't, it's a bug and you can send me a repro using the contact form on this blog.

@J: You can combine multiple physical script files using that feature, but we really don't recommend it as there is some server overhead related to file monitoring. What you're describing is much better handled by "building" your scripts at compile time instead of doing the combination at runtime. The feature really is for application developers who want to combine existing scripts from various components that they use in their application.

The output caching expiration is set by the handler. The resulting files are cached at all levels, including client-side. The efficient client-side caching is made possible by the fact that the combined url varies every time one of the underlying files changed.

# June 16, 2008 3:43 PM

Bertrand Le Roy said:

@Bartek: it's hard for me to understand the localized error message but I'm suspecting you didn't put the dll into the bin directory of the web application.

# June 16, 2008 3:45 PM

Bertrand Le Roy said:

@Brian: I don't know much about how this works in classic ASP. You should probably contact support on this one.

# June 16, 2008 3:47 PM

Lokas said:

Well I have started to play little bit with the ATLAS and I want to add DOM event handler to TR element.

Code works fine for IE , but in  a firefox load event is happend  , but events are not hooked to dom element ...

I'm using asp 2.0 , please give me a tip , relly dont have a clue what is going on......

function pageLoad()

{

alert('atload');

    for(var i = 0 ; i<testTable.rows.length;i++)

       $addHandler(testTable.rows(i),"click",RowClick);

}

function RowClick(e)

{

  alert(this.innerHTML);

}

# June 17, 2008 12:16 AM

Bertrand Le Roy said:

@Lokas: you need to define testTable, for example var testTable = $get("testTable");. You also need to use square brackets instead of parentheses to get the rows: testTable.rows[i].

# June 17, 2008 12:26 PM

Todd said:

One thing I see all over the place in programming circles that people mess up all the time is quotes and apostrophes.

A quote is a "

An apostrophe is a '

There is no such thing as a double quote unless it's two quotation marks back to back like ""

If we all help educate people, then perhaps they will start to understand.

# June 18, 2008 11:39 AM

Bertrand Le Roy said:

@Todd: thanks for the tip, and I apologize for my English which may sometimes be imprecise as I'm a non-native English speaker. Still, I did some research and here's the definition I found:

"quo·ta·tion mark (plural quo·ta·tion marks) noun

Definition:

punctuation identifying quotation: either of a pair of punctuation marks, either in double (" ") or single (' ') form, used around direct speech, quotations, and titles, or to give special emphasis to a word or phrase"

encarta.msn.com/.../quotation_mark.html

Still, I'll update the post to make this clearer as this definition doesn't seem to be universally adopted and yours is less ambiguous.

# June 18, 2008 12:51 PM

BFuller said:

I have this problem in classic ASP on a site that had been running fine for a few years. One day it up and errors because the session variables are cleared on redirects for seemingly no reason. This makes me think a server update of some variety is to blame since some server updates were installed around that time.

# June 18, 2008 6:35 PM

skhan said:

Expensive indeed. There are quite a few free ones out there.

# June 18, 2008 6:38 PM

ubgadeashish said:

Hello Bertrand,

It would be a great help if you can comment on my issues.

Thank you in advance

Ashish

# June 19, 2008 5:36 AM

Aurelien said:

Hello Bertrand !

Any idea of a CTP release date ??? ;)

# June 19, 2008 6:04 AM

Robert said:

Thanks for this article - I read and followed the exact sequence for patching the files for debug and release but I still continue to get "Access Denied" errors when attempting to open another web page in an iframe.  I see in "View Source" that my file is being referenced from the correct location - Is there anything else that could cause this error??  I get the error on both debug and release versions of the MicrosoftAjax.js file.  Please let me know what you think about this issue - Thanks for your help!!

# June 19, 2008 8:18 AM

Bartek said:

i checked it once again and MetaDataExtractr.dl is in this directory;/

# June 19, 2008 8:37 AM

Bertrand Le Roy said:

@ubgadeashish: The problem is that I didn't understand your comment, which seems to be unrelated to the problem described in this post. Please contact me through the contact form with a simple repro of the problem.

@Robert: Yes, this error is perfectly normal if you're trying to access the DOM in another frame that is in a different domain. That is a security restriction that is imposed by your browser.

The problem that this post solves was the appearance of this error in pages that didn't explicitly try to access another frame.

# June 19, 2008 12:38 PM

Bertrand Le Roy said:

@Aurelien: this is clearly not the place to make such an announcement, but trust me when I tell you that we're working hard to get those bits into your hands as soon as possible.

# June 19, 2008 12:40 PM

Bertrand Le Roy said:

@Bartek: is the bin directory in a directory that is configured in IIS as a web application?

# June 19, 2008 12:41 PM

Bartek said:

I assured that I put MetaDataExtractr.dll into the appropriate directory.;/

# June 19, 2008 1:57 PM

Bertrand Le Roy said:

@Bartek: I believe you. The question I was asking was on the *parent* directory of bin. Is the parent of bin configured in IIS to be a web application? We can take that offline. Please contact me using the contact link.

# June 19, 2008 2:33 PM

joe said:

yeah - this is a crap post - what about the free ones?

# June 19, 2008 7:13 PM

Bertrand Le Roy said:

@joe: ask skhan. I don't know of any free ones that would compare to that but I'd gladly point to them from this blog.

# June 19, 2008 7:18 PM

Name said:

Bertrand, did you find a conclusive study on the topic? I want to settle and argument I had at lunch today. Clearly we slow earths rotation, but I need to know if the centers of mass get closer or farther.

Thanks,

Kevin

# June 20, 2008 10:10 PM

Mike K said:

Try to open a pst in question with Outlook 2007. I was just able to open a 4GB .pst file that no other program was able to fix.

# June 20, 2008 10:20 PM

Davide said:

Very nice article: it is more and more requested to work with image re-sizing.

Thanks and regards,

Davide

# June 21, 2008 7:16 AM

mohammad Javed said:

hi i am trainee programmer in comm-it india(p) Ltd at new Delhi-110017.your articles is very helpfullto me about postback event.

# June 21, 2008 7:46 AM

Joseph Ghassan said:

nice article.

# June 21, 2008 12:16 PM

rrobbins said:

You could also generate thumbnails using the GD-Sharp .NET wrapper for the GD Library.

# June 21, 2008 5:15 PM

Andrei Rinea said:

@skhan : Tell me more about the free ones. I am interested in at least one.

# June 21, 2008 6:35 PM

Bertrand Le Roy said:

@Kevin: to move farther away from its current orbit, a satellite has to gain momentum so it would seem like as energy is dissipated, the system would move to a state of lower energy, and the Moon would get closer to the Earth. But this would be neglecting the complex interactions between the rotations of both bodies and how angular momentum transfers. While there are natural satellites that go this way (see en.wikipedia.org/.../Orbital_decay), it is not the case for our Moon, which is getting away from us at a rate of 3.8cm/year (see en.wikipedia.org/.../Tide).

# June 23, 2008 1:35 PM

david said:

my wiimote isnt working even though i adjust the "sensor" and the hand wont even show . the games are working fine though!

# June 24, 2008 3:41 PM

Lacy said:

There's a great jquery plugin that automates this.

plugins.jquery.com/.../bgiframe

# June 25, 2008 4:06 PM

Dan said:

Bertrand,

the link you highlighted from Kyle Heon no longer seems to work, I just get a page with a load of Chinese characters.

Please can you check or advise on what solution the page revealed?

Thanks

# June 27, 2008 9:48 AM

Bertrand Le Roy said:

@Dan: I updated the link. Thanks for the heads up.

# June 27, 2008 3:21 PM

orbk said:

excellent utility

# June 29, 2008 4:53 AM

Ty Johnson said:

Has anyone been able to get this into a DNN Module? Can I use this in DNN?

# June 30, 2008 10:48 AM

Bertrand Le Roy said:

@Ty: I never tried, but if you use it as a user control, I don't see why not.

# June 30, 2008 1:52 PM

Mehul Harry said:

Ha, the SEO rapper, very funny.

# July 1, 2008 1:16 AM

Radha said:

After setting session varibales, I am redirecting page. Its working on local host but its not working on server.

# July 2, 2008 2:54 PM

alex said:

sweet!!

# July 2, 2008 11:13 PM

Stif said:

Hi Bertrand

I have the following issue:

When a user visits my website for the first time and my sql server is down, I get an exception during the PreRequestHandlerExecute event (while making my connection to the database). I have a IHttpModule which adds an eventhandler for the application_error event. This eventhandler places some info on the session. In my web config I've enabled custom errors and specified a default redirect. The errorpage asp.net redirects to, gets the info from the session and displays it. But as you probably guessed, I'm losing the session info, because it's the first time the session is built. So you see, the problem is I'm not performing the redirect myself, but letting asp.net do the work. Would there be a way to overcome this problem (other than having to perform the redirect myself)?

Any help would be greatly appreciated

Grtz

Stif

# July 3, 2008 4:46 AM

Bertrand Le Roy said:

@Stif: if you've tried all the workarounds in the post and it still doesn't work, I would advise that you contact support.

# July 3, 2008 1:53 PM

krishx343 said:

Show some realtime Example of This Roadmap implementation. so, that it can be easy to analyse how it is

# July 4, 2008 7:31 AM

Oleg said:

I have a question, when trying to run ajax in facebook, I'm getting an error in javascript. When openning the javascrip error window, the error says access denied. I applied the patch that is mention above by replacing the code in MicrosoftAjax.debug.js & MicrosoftAjax.js. Now instead of getting message "access denied", I'm getting "Sys is undefined".

Somebody mention that it's beacuse the scriptmanger is not set up correctly. I have a dir in my app called javascript, I added the a folder with all of System.Web.Extensions content into it. I'm calling it using the code below, what am I doing wrong?

<asp:ScriptManager ID="ScriptManager1" runat="server"EnablePartialRendering="true">

    <Scripts>

<asp:ScriptReference Name="MicrosoftAjax.js"S criptMode="Auto" Path="../JavaScript/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js"/>

</Scripts>

   </asp:ScriptManager>

# July 5, 2008 2:29 PM

Bertrand Le Roy said:

@Oleg: check the path in the renedered HTML against the real location of the script and adjust your Path attribute accordingly.

# July 5, 2008 5:03 PM

Josh M. said:

I realize it's slightly off-topic, but one think I'd like to see in Visual Studio is code folding for JavaScript the way you can collapse tag elements in the markup or subroutines in the code-behind.  We can close a whole script block, but I'd like to just close up specific functions.

# July 7, 2008 10:34 AM

Michael Stuart said:

Thank you for publishing the roadmap.  I am very impressed with the ideas presented, especially the way to query on the client.  It seems like the items that would be most beneficial to any application immediately would be the build improvements (script combination, minifiying, etc).  I can't wait for the next release!

# July 7, 2008 4:31 PM

Mike Moore said:

Or, you could argue that both are Macs and that 1) survival of the fittest means that only Macs are left in the future, or 2) that only Macs are capable of love, which is why you don't see any PCs in the story.

# July 7, 2008 7:22 PM

Bertrand Le Roy said:

@Mike: that's an interesting way to look at it. But apparently, evil mainframes also survive (the autopilot is clearly HAL, a.k.a. IBM).

# July 7, 2008 7:30 PM

Ray said:

Dropping the album.aspx into the directory with pictures isn't working for me.  The only way it is working is to have it in the top level directory. Since I don't own the hosting provide, is there something I should tell them?  I was able to use the 1.0 version is a subdirectory, but not the 2.0 version.  Or is there a way to hard code the path to the subdirectory?

# July 7, 2008 10:05 PM

Bertrand Le Roy said:

@Rqy: I'm assuming you mean album.ashx. What really needs to be in the web app directory is the bin folder with the dll in it.

# July 8, 2008 12:30 AM

Zubair.NET! said:

hi Bertrand,

As Rick Strahl puts in his editorial for Code magazine here www.code-magazine.com/Article.aspx that jQuery and AJAX can seemlessly work together without stepping on each other, we had a nightmare working with jQuery along with ASP.NET AJAX on a project, we ended up choosing jQuery because we had more fine-grain control over some of the neat client-side tricks but having said that we'd love to use ASP.NET AJAX for some of the built-in features that are a pain in the neck to build with jQuery, kinda best of both worlds so my question is, is there really a way that they both work together ?

# July 8, 2008 1:17 AM

Bertrand Le Roy said:

@Zubair: I'd be very interested to know what didn't work well for you with jQuery and ASP.NET Ajax. Can you please drop me an e-mail at bleroy at microsoft?

# July 8, 2008 1:30 AM

Zubair.NET! said:

I don't have a particular case with me at the moment but I know we had issues and I didn't want to give up ASP.NET AJAX but my UI dev insisted on jQuery, it was a hard decision to make at the end of the day between built-in controls of ASP.NET AJAX vs more control in jQuery for some other tricks.

I'd love to see an example of both these frameworks working side by side in a project, can you put up a post with some sample ? that'll be great. Thanks

# July 8, 2008 1:54 AM

Rick Strahl said:

Bertrand - I think one issue with this is that Intellisense stops working with any subclass of ScriptManager if you have script code in the page. Something about how the page is parsed for scripts that is dependent on the exact asp:ScriptManager reference.

I had previously tried subclassing script manager and overriding the method that injects the MS Ajax code. While that worked Intellisense didn't work.

Intellisense - especially from resources is something that is quite useful and I mentioned this to Jeff and was hoping that there'd be some sort of interface or documented syntax that can be applied to allow other controls to provide Intellisense.

# July 8, 2008 3:02 AM

Lars-Erik said:

That is a very useable control. Well done!

I would prefer to have images instead of OK/Cancel-buttons. Do you see any technical problems with doing this or can I just download the source and start hacking?

# July 8, 2008 3:08 AM

Matt Brooks said:

Given that scripts from other libraries (e.g. jQuery) will not include calls to:

Sys.Application.notifyScriptLoaded();

What affects will this have at runtime? I was under the impression that it was a requirement for scripts to incude this call in order to play nice with ScriptManager - or is this ONLY a requirement when using partial loading, which you mention gets disabled by default anyway?

# July 8, 2008 3:49 AM

Ray said:

Yes, I meant album.ashx.  Sorry.  I have the Bin directory and dll in the top level app directory.  It all works when the album.ashx is in the top level directory, but when I try moving album.ashx to a subdirectory, the page that references album.asxh gets an error. I've updated the @register line to reference the subdirectory where I've moved album.ashx.  Is this a permission problem or do you have any other thoughts? Thanks.

# July 8, 2008 7:22 AM

Bertrand Le Roy said:

@Rick: true, but I think the control is still quite useful. I'll follow-up with Jeff.

@Matt: the script loaded notification really is to play nice with UpdatePanel's script loader. If your scripts are never added to the page as part of a partial update, you don't need it (but having it won't hurt if you include the full code that tests for Sys before using it).

# July 8, 2008 2:02 PM

Bertrand Le Roy said:

@Lars-Erik: that should be quite easy to achieve by hacking into the code a little. I don't think it will care if your use image inputs instead of buttons.

# July 8, 2008 2:04 PM

Bertrand Le Roy said:

@Ray: please contact me offline (bleroy at microsoft).

# July 8, 2008 2:05 PM

Bertrand Le Roy said:

@Rick: Jeff tells me this is fixed in SP1. Couldn't get it to work on SP1 Beta 1 though. Still investigating.

# July 8, 2008 3:33 PM

Ron Macers said:

forget about the pcs and macs just see iphone. microsoft sucks at everything...

# July 8, 2008 4:42 PM

Bertrand Le Roy said:

@Ron: thanks, now I see the Light.

@Mike: wait, that would mean that Apple, in the future, will become the Buy'N'Large mega-corporation that will (under the command of its charismatic leader) take over the Earth, transform it into a crapyard, eradicate all vegetal life, drive the human race into exile and transform people into boneless balls of fat. It all makes sense now. :)

# July 8, 2008 4:51 PM

Lou said:

Hi Bertrand, Please could you clarify something for me?

I am calling Response.Redirect from Application_PreRequestHandlerExecute within Global.asax.  My understanding is that as it is within Global.asax the HttpResponse.End method will not be called and the thread will not be aborted.  Would the first page be executed and sent back to the client, or would the client only receive the page to which it is being redirected (having earlier received the special header directing it to request the new page)?  This is critical as in the situation I am working with, the page originally requested is dependent on unavailable services and it is important that this code does not execute.

# July 9, 2008 8:41 AM

Bertrand Le Roy said:

@Lou: this should be easy to check by putting a breakpoint in the code you don't want to run. One thing I can tell you is that the client will never receive the first page: a redirect works by sending the browser a special header that instructs it to navigate to the new url instead of the old one. There is no contents in the first request, but that doesn't mean that the server code necessarily stops running.

# July 9, 2008 2:20 PM

Peter said:

I appreciate you looking into this, but let me raise the red flag for the record.

I would love to be able to plaster a poster on every ASP.NET team member's office "Do not hardcode! Make it generic!" The SM issue is one, hardcoding intellisense behavior is another example. There are other examples of built-in magic that just smell of hardcoding.

And another thing: Can we please stop coming out with new stuff, take a deep breath, and actually go back and try to polish some more on the things people actually use?! And how about actually going back and updating some of the "old" stuff. I know it's vague (I can come up with examples if needed), but I feel ASP.NET is getting dirty and need to be cleaned.

Rant over,

Thanks.

# July 10, 2008 12:29 AM

Bertrand Le Roy said:

@Peter: feel free to contact me at bleroy at microsoft to tell me what needs to be cleaned.

# July 10, 2008 12:40 AM

Peter said:

I've tried Telerik's SM that has this same feature and I have noticed quite a bit of improvement. The benefit is in the reduction of the chatter between the client and server. When you have more than 10 JavaScript includes and you reduce that to only a couple you will feel the difference.

It is, however, debatable how useful it is. Yes, it will make the first access much faster, but if on page 1 you load scripts A through G, and on page 2 you want A through G and M, since it's all bundled, it will have to load the whole pack one more time. not just M. I guess it depends on your scenario.

As far as compression: People please enable the built-in IIS (v 6 and 7) compression. It's there and it's quite good. You get the biggest bang for the buck just by enabling the compression (off by default in IIS6, not sure about IIS7).

# July 10, 2008 12:44 AM

Bertrand Le Roy said:

@Peter: that's why you need to profile your application, not just a page. Which is why, in turn, we didn't make the feature all automatic because it would have made more harm than good in some cases.

You're right about dynamic and static compression in IIS7, it's one of the most efficient ways to improve perf, but good perf is ultimately a combination of several things. I recommend reading "high performance web sites" by Steve Souders for a pretty comprehensive set of tricks along those lines.

# July 10, 2008 1:12 AM

Peter said:

Not exactly the same league, but it's free:

teethgrinder.co.uk/open-flash-chart

# July 10, 2008 1:26 AM

RichardD said:

The most annoying feature of the ScriptManager control is that it is completely useless without a server form.

Although it's possible to include the ScriptManager control in a page without a server form (when EnablePartialRendering is false), none of the registered scripts will be output to the page.

The control seems to rely on the ClientScriptManager class, which only outputs the registered scripts when the internal Begin/EndFormRender methods of the Page call internal methods on the ClientScriptManager class.

Since MVC views can't use server forms, this must surely be on the "TODO" list?

# July 10, 2008 2:51 PM

Bertrand Le Roy said:

@Richard: Yes :)

# July 10, 2008 3:45 PM

Pablo said:

Thanks Bertrand, I forgot that the fix was only for IE.

# July 10, 2008 7:13 PM

benizi said:

I think I'm missing something, but it might be related to Brock's question to which you replied, "@Brock: I don't think that's handled in 2008, no."

A simplified example:

/// <reference path="Stuff.js" />

var outside = new MyNamespace.Stuff();

outside.+++

Other.Thing.prototype = {

foo: function (inside) {

 /// <param name="inside" type="MyNamespace.Stuff">arg</param>

 inside.---

At the '+++', I get working Intellisense completion. At the '---', I don't. The point being that it obviously found the proper comments for the 'Stuff' class, since it works at one point in the file. Am I doing something wrong (specifying the class name improperly?)? or does VS2008 simply not do Intellisense for <param>'s?

Best,

Ben

# July 11, 2008 12:51 AM

Rick Strahl said:

@Bertrand - I'm also very interested @Richard's comment and would love to hear the ASP.NET team address this. One of the big drawbacks of MVC I see is related to the inability to address the document and inject anything into it - including scripts. Which is crucial for building reusable - well, anything really.

# July 11, 2008 4:50 AM

Bertrand Le Roy said:

@Ben: There is a number of circumstances where IntelliSense doesn't quite work yet. The one you describe and a few others. This is greatly improved in SP1, and will get even better in the next Visual Studio.

# July 11, 2008 2:31 PM

Bertrand Le Roy said:

@Rick: I think you're asking a different question here, probably a more general one. If you want, we can start an e-mail discussion with Phil about that?

# July 11, 2008 2:34 PM

Nicholas said:

Yes, thank you for posting this. I think you guys are on the right track; basically the more stuff you can do "like" jQuery (and better!) would be fine by me.

I didn't realize that ASP.Net Ajax supported templates; I had always just used jQuery's templating or JavascriptTemplates from TrimPath. I will definitely look forward to this feature getting fully developed. I'm sure you're going to run into all sort of performance gotchas across the different browsers..

Looking at the controls, "Grid" would be one of my top requests. The "Upload" control would also be great! It's so hard to roll your own.

MVC support I'm not terribly interested in, but good for that.

# July 15, 2008 9:20 AM

gt1329a said:

Here's my feedback on it (and several others' in the comments), for what it's worth:  encosia.com/.../the-future-of-aspnet-ajax

I meant to say in the post, but forgot:  The transparency you guys are providing with this is just stellar.  As a plain old guy who isn't an MVP or ASP Insider, it makes me happy to still have a glimpse at what's coming next and submit feedback on it before it's too late to matter.

Keep up the great work!

# July 15, 2008 10:58 AM

Jim diGriz said:

Max - thank you for your comment! works great :)

# July 16, 2008 11:54 AM

Kevin Dockx said:

Oh, great!  Didn't even realize these things were released, I actually stumbled upon this via the Encosia-rssfeed. :-)  

Nice read, and I absolutely love the client-data-idea.  As far as controls go, the upload-control looks like a must; as far as a grid is concerned: I'm already using Listview most of the time with some custom scripting, does the job as it should AND gives me LOTS of customization options - so I'd prefer an ajaxified implementation of the 3.5 Listview instead of the Grid.  

Anyway, looking forward to the "futures"-release, keep up the good work!

# July 16, 2008 3:28 PM

Omego2K said:

but since a Menu control doesn't understand the imageURL property, how do you get it to display the image?

# July 16, 2008 6:37 PM

Bertrand Le Roy said:

# July 16, 2008 6:43 PM

Aneesh Abraham said:

Hi , Guys.

I had the above issue with my project and tried most of the solutions provided above.

In my project user has to upload his photo during account creation. So every time there will be some changes in the root directory.

As per the info provided here:

blogs.msdn.com/.../668412.aspx

, every change in directory structure , re starts the application and the sesion vanishes.

In order to solve this issue i used the "Profile" object in ASP.net 2.0 which stored the data in a seperate SQL file.

Hope this helps some one....

# July 18, 2008 7:37 AM

Bertrand Le Roy said:

@Aneesh: it seems like you already found the solution. Letting the user write into the root directory of your application was dangerous practice anyway, and couldn't have been done without opening up the ACL on the directoy. Storing in a different place (a database, a separate directory, profile etc.) is the right thing to do.

# July 18, 2008 1:57 PM

David-Sarah Hopwood said:

In the implementations of safe subsets of JavaScript (Caja, ADsafe, etc.), it's useful to be able to distinguish exceptions that are the result of a stack overflow, out of memory, etc., from other exceptions. See code.google.com/.../detail

# July 18, 2008 3:01 PM

jgd12345 said:

I second the comment above.  A list is much better than  grid.  This will also be beneficial to the encosia.com guy in that he can put the thead and tbody tags in when others don't really need them.

# July 19, 2008 6:24 PM

Ben said:

Good point Richard.

Thanks

# July 20, 2008 1:16 AM

arunpulikkan said:

how can i get microsoft.samples.Alert?

# July 21, 2008 6:34 AM

Dominic Bundy said:

Is there any way to display the folders in date order and not alphabetically

# July 21, 2008 10:18 AM

Bertrand Le Roy said:

@arunpulikkan: follow one of the two links in the post to the CodePlex project. http://www.codeplex.com/alerts

# July 21, 2008 11:55 AM

Bertrand Le Roy said:

@Dominic: it already is in date shot order. If that's not the case for your photos, maybe they are using an exotic EXIF tag. Feel free to send me one of those at bleroy at microsoft and I'll have a look.

# July 21, 2008 11:59 AM

Aykut Ucar said:

Any plans of sample website?

# July 21, 2008 4:00 PM

Bertrand Le Roy said:

Eventually, yes, but we wanted to get the bits into your hands as early as possible.

# July 21, 2008 4:04 PM

NirvanaViper said:

Microsoft ASP.NET Ajax is Spam.

jQuery is Good.

# July 21, 2008 9:23 PM

Gratis Daghoroscoop said:

Can't wait to start playing with this!!

# July 22, 2008 3:18 AM

Mike said:

Finally! It was sooo obvious that most resources went to Silverlight for the last 1-2 years. And because I as an ASP.NET developer want to develop web sites, not Silverlight apps, I was getting really !*%$# about the lack of progress on ASP.NET Ajax.

Let's see some more controls!

# July 22, 2008 4:14 AM

Steve said:

I tried using asp.net ajax the other day for a simple call back to a web service and update content panel. I'm a pretty good javascript developer and have been using jQuery for a long time, but just thought I'd try the .Net way and see how easy it is.

I found a pretty good tutorial, but even at the end of it I had no real idea of how all the "magic" happens. .Net automatically inserted a load of rubbish into the page for me to make it all work.

I think the page was over 100k when it was downloaded and working. I did the same with one line of jQuery and the page was 47k altogether.

The only use I can see for this is for people who are clueless about javascript programming and have to use VB or C#. If that's the case, then they probably shouldn't be doinc client-side programming anyhow IMO!

# July 22, 2008 4:44 AM

Howard said:

What was the point of your comment, NirvanaViper? How on earth is MS Ajax "Spam?" It's a technology which incidentally Micrsoft pretty much pioneered, and everyone else has adopted. I don't know JQuery from a hole in the ground, but then I'm happy with my Ajax solution (which isn't MS Ajax)

Spam is tedious, irrelevant junk - pretty much like you posting. If you don't like it, go elsewhere.

# July 22, 2008 5:32 AM

Mikael Söderström said:

Will it be compatible with ASP.NET MVC?

# July 22, 2008 8:37 AM

Brian Sherwood said:

NirvanaViper, your comment is spurious and irrational. This post/article is nothing to do with jQuery.  Spam is unwanted email, which doesn't fit ASP.NET at all.  ASP.NET remains a powerful development paradigm and language used by businesses world-wide. I have supported my family for years wiht my ASP.NET development services.

The fact that you won't even use your name speaks volumes.

# July 22, 2008 9:04 AM

Daniel Balla said:

Great work mate!

Could you point me in the direction of any documentation or is that not a good question?

I was interested in any events that would be fired around the template rendering.

# July 22, 2008 9:28 AM

Brent said:

@NirvanaViper - Apparently you have no clue what spam is. For a good example, see your last comment...LMAO.

# July 22, 2008 9:34 AM

Andrey said:

I've tried DataView control, but it doesn't work.

I get error about Sys.UI.Preview.DataView is null. Do I do something wrong?

# July 22, 2008 10:56 AM

Mel Pama said:

I'm not a user of Ajax at this time, however it is seeming to me that it is becoming a replacement of ASP.NET when almost everything is using Ajax, whether it warrants it or not.  Eventually there will be no difference because it will take just as long to wait for all the Ajax updates as it was taking to update just the whole page at the same time with ASP.NET.  A litle Ajax is a good thing, there more is better???? I beg to differ.

Mel

# July 22, 2008 11:07 AM

Stuart Campbell said:

Looks promising!

@NirvanaViper: I use both ASP.NET Ajax and jQuery and they are both good. Not sure how you can class a script library as spam...but anyway.

# July 22, 2008 11:52 AM

Bertrand Le Roy said:

@Mikael: what we put in the preview is pure client-side script, so it should work just fine with MVC. Actually, the latest MVC preview has JsonResult, which should be a very good fit with the template engine.

@Daniel: this is a very early preview, and we don't have much documentation ready. Feel free to ping me for questions. The dataview control has an event that gets fired every time a template is instantiated (itemCreated), and the arguments give you access to the dataItem that's being rendered and the templateResult, which enables you to manipulate the generated DOM. Is that what you were asking for?

@Andrey: did you include the script file to the page? Did you also iclude the Ajax Library?

# July 22, 2008 2:12 PM

Jason Diamond said:

@Andrey: There's a typo in the ReadMe.txt file. The actual class name is Sys.Preview.UI.DataView.

# July 22, 2008 2:46 PM

Andrey said:

@Bertrand Le Roy: yes, I add ScriptManager on the page and add reference to script:

<asp:ScriptManager ID="scriptManager" runat="server">

           <Scripts>

               <asp:ScriptReference Path="MicrosoftAjaxTemplates.debug.js" NotifyScriptLoaded="true" />

           </Scripts>

       </asp:ScriptManager>

# July 22, 2008 4:20 PM

Bertrand Le Roy said:

@Jason: good catch, thanks. I'm updating the readme.

# July 22, 2008 5:15 PM

VR2 said:

Again, Ben, an ability to statically parse or cast to type would solve that for you.

This ability can be added by us, retrospectively, via an extensions library applied after MS Ajax is downloaded.

eg

Sys.ApplicationLoadEventArgs.cast = function(obj)

{///<returns type="Sys.ApplicationLoadEventArgs"/>

   return obj;

}

By also doing this in your own classes, your constructor could have code like this:

inside = MyNamespace.Stuff.cast(inside);

inside.---; // Intellisense is now fully enabled.

Also, the lack of "in file" intellisense can be largely overcome by structuring your code differently to the way advertised/recommended.

Firstly you need to ensure that your namespace is defined in an external file (so the namespacing code can run and create the namespace for you ready to go). I have found adding a "_namespace.js" file to contain js intellisense references as well as namespace definition works well. This file is not required to be downloaded to the client. These can also be chained from child to parent folders, for each namespace required.

Secondly, after declaring your class (function) you can get intellisense by setting your function's prototype to that of the class you intend to inherit from. This duplexing (actual inheritance/temp inheritance) can be offset by setting these lines of code together.

Thirdly, when setting out your prototype, rather than set the whole thing (and overwriting the prototype you have just faked), writing it out longhand to add each item to the prototype adds a few more keystrokes but, if done in the correct order, I've found can yield 99% working intellisense at all times.

eg

if ($methodThatAlwaysReturnsFalse())

{

   MyNamespace.Stuff.prototype = Sys.xxxx.yyyy.prototype // Fake inheritance

}

...

MyNamespace.Stuff.prototype._myVar = null;

MyNamespace.Stuff.prototype.foo = function()

{

   this._myVar; // intellisense now enabled

   this.initialize(); // inherited methods are also available.

...

}

# July 22, 2008 7:07 PM

Andrey said:

@Jason: Thanks! The error is not occurs again.

But I get only {{name}} and {{description}} titles on the page, not data from someArray.

# July 22, 2008 9:44 PM

Bertrand Le Roy said:

@Andrey: you can send me your code at bleroy at microsoft, and I'll have a look.

# July 23, 2008 12:00 AM

gt1329a said:

@Andrey: This example may help you get started with the DataView:  encosia.com/.../sneak-peak-aspnet-ajax-4-client-side-templating

There are also a couple suggestions based on my initial impressions, Bertrand.

Thanks for giving us all early access to this stuff.  It looks very promising, so far.

# July 23, 2008 9:31 AM

jgd12345 said:

Hi, good to see you're acting fast on this.  I'd like to see the client server controls.  The doc says this will be in a futures release but surely these should be quite trivual to build once the client library is built.  If this is being pushed back because it wouldn't be useful for mvc then i don't think that is fair on the majority of your user base who are using web forms.

Also i'm interested to see how the client data source controls could allow me to do paging, sorting without page refreshing.  Currently i've been using UpdatePanels (wrapped around a ListView) as alot of the alternative approaches require too much work.  However UpdatePanels don't perform too well when there is lots of data.

# July 23, 2008 10:31 AM

Bertrand Le Roy said:

@jgd12345: nothing is trivial :) and this is not being pushed back, especially not because of MVC (this stuff actually works great with MVC). The data source should be in the next release.

# July 23, 2008 2:55 PM

Drew Marsh said:

Bertand,

I love the new release, but I have one bit of commentary on the client templates so far. Right now you guys have invented a special syntax that overloads the standard comment syntax with an additional asterisk to denote that it actually is code. Instead of doing this, why not use processing instructions? It's exactly what they were intended for. For example:

<?aspnet-script

if(item.property == "Something")

{

?>

<span>Something!</span>

<?aspnet-script

}

else

{

?>

<span>Nothing :(</span>

<?aspnet-script

}

?>

This should also make the parsing experience simpler (for runtime and design time) because you can more easily detect the presence of these PIs rather than having to inspect each comment tag.

Of course the PI target name is up for debate... "aspnet-script" was just a first stab at it. :)

Cheers,

Drew

# July 23, 2008 9:08 PM

migo said:

great idea!

# July 23, 2008 10:56 PM

CareySon said:

wow..i think it's a great way.more simple and less code:-)

# July 24, 2008 12:14 AM

Bertrand Le Roy said:

@Drew: when I first read your suggestion, I thought "oh my, why didn't we think of that?". I really liked it. But then I tried it and it started falling apart. First, you'd need to escape all > characters in your script (we could maybe live with that). Second, editors such as Visual Studio have no clue what's going on and trigger IntelliSense very inadequately (that could get fixed). But what kills the idea is that the processing instruction nodes do not appear in the DOM in Firefox. Too bad. Thanks for the suggestion though.

# July 24, 2008 12:54 AM

exz said:

thanks, just what I was looking for.

# July 24, 2008 4:01 AM

Andrei Rinea said:

Great tip! Simple and effective.

# July 24, 2008 6:47 AM

Evgenij said:

Yeah. Thanx, really cool.

# July 24, 2008 6:48 AM

kamii47 said:

Wow.

Very good idea we can implement that in othere areas also like gridview e.t.c

# July 24, 2008 7:35 AM

Attila said:

#1 is wrong simply because in JavaScript, undefined == null, so your first expression if(someObject != null) will work just fine, and is actually the best expression possible for the job.

If you really-really want to distinguish undefined from null, you can use typeof(x) == "undefined" as someone suggested here (and that seems to be thought in almost all books and tutorials on JavaScript, but I much prefer this one:

function isUndefined(x)

{

   return x == null && x !== null;

}

See <constc.blogspot.com/.../undeclared-undefined-null-in-javascript.html> for some more details.

# July 24, 2008 9:54 AM

Drew Marsh said:

Well first off, I'm VERY surprised to hear that FireFox eats the PIs... that's seriously lame.

Good point about escaping the > though, that would kinda stink. The editors thing isn't really a problem, like you said the tools would just need to be upgraded to recognize the PI which shouldn't be so hard. You have to teach them how to recognize the special comment syntax anyway now, right? 'Cause if I don't get intellisense support on my JS in those blocks in VS10 I'm not gonna be happy. :P

*sigh* I just hate to see the comment stuff overloaded. I was gonna say why not just use custom tags altogether with CDATA, like maybe:

<sys:script>

<![CDATA[

if(foo > bar)

{

]]>

</sys:script>

It's a bit more verbose, but better than overloading the comments IMHO. Unfortunately IE still barfs if you don't encode the > sign in a CDATA section (BUG!), so that's out the window too. :(

Later,

Drew

# July 24, 2008 11:58 AM

Bertrand Le Roy said:

@Attila: right, thanks, I fixed the post.

# July 24, 2008 4:09 PM

Bertrand Le Roy said:

@Drew: You currently don't get IntelliSense at all in the blocks, which is way better than completely wrong and obtrusive IntelliSense, which you'd get with processing instructions.

I don't think a custom tag would work either because they would need to be allowed anywhere in the XHTML markup, which if I'm not mistaken they're not.

We also considered something along the lines of < sc ript type="application/microsoft-javascript"> but that is way too long to type and remember.

We're not super-happy about using comments but it's our best option apparently.

# July 24, 2008 4:32 PM

phanatic said:

I wrote a post about how to do Master-Datails view with the DataView. I thought I'd put in a manual trackback.

-Phani

# July 25, 2008 12:00 AM

ben said:

thanks for the javascript opera tick trick :)

# July 25, 2008 9:53 AM

Fredrik E. Nilsen said:

I'm running the photo album on my Windows Home Server but I've run into problems with a few photos. Some photos shows as thumbnails but they are not shown in full size when I click the thumbnails. It seems like they won't load at all. If the photo doesn't load, the next thumbnail will not appear. If I open the photo in an image editor and save it with a new name, it seems to work.

# July 25, 2008 10:05 AM

Steve said:

I'd prefer the AJAX in MVC to not be 'baked in by MS'.  Keep it separated - if you want to use MS Ajax, fine, but if you want to use jQuery, etc...

# July 25, 2008 11:46 PM

Steve said:

On forum , from you:

"ClientID hell is something we're also working on"

After all these years, finally.... how about this:

let the compiler check for duplicate IDs or unassigned IDs - give a warning/error.  Otherwise.... DON'T CHANGE THE ID I ASSIGN FOR A CONTROL.

If I assign an ID, I don't want ASP changing it.  If you want to assign one because I don't provide it... fine.

# July 25, 2008 11:51 PM

Bertrand Le Roy said:

@Steve: yes on both accounts.

# July 26, 2008 1:29 AM

JRumerman said:

Hi Bertrand,

I'm finally taking some time to dig into the new preview and came up with an initial question.

With declarative instantiation of controls and behaviors, how do I guarantee that the JS file that contains the client component will be available on the page? Do I assume that the declarative instantiation is used at the page level and that the script file containing my client component will be included as a ScriptReference? If I were rendering a control using Rendercontents and wanted to include a declarative instantiation approach with my component (not sure why I would want to, though), would I still need to implement IScriptControl and provide the ScriptReference in the GetScriptReferences method? Is the usage pattern for the declarative instantiation focused at the Page level vs. the Control level?

Also, on a different note, I'm getting a bit confused with the different previews. Why wasn't the ScriptReferenceProfiler included in this preview? I've got two separate previews going on to get me the latest and greatest...

# July 26, 2008 9:18 PM

Bertrand Le Roy said:

@JRumerman: The js files have to be included into the page somehow, either as a script reference or a plain script tag. If you want to create a server-side extender for your behaviors, nothing has changed here. You do it the same way as you did before. This release really is pure client-side additions that do not modify the server-side model at all.

The ScriptReferenceProfiler isn't exactly preview. It's an optional tool that will probably remain a separate download for the foreseeable future.

# July 27, 2008 1:03 AM

jao said:

cool! reminds me of those techniques from the classic asp style. =)

# July 27, 2008 9:51 PM

Brian Wagner said:

Mine problem is all on godaddy when the default.aspx hit this line of code it stops

<photo:album runat="server" ID="Album1" />

If I remove it the style sheet loads, but obviously the ablum doesn't work.

I can only get the original Album.ASHX to work. I an out of options until my contract with gofatty is up, cause I don't know what else to do.

# July 28, 2008 11:22 AM

Brian Wagner said:

Ok I got everything to run fine on my local machine.  When I publish to my site hosted by Godaddy.com I get a problem with the following code.  Apparantly they are not giving me rights to the temporary asp.net folder this is using.  Thanks in advance for your assistance.

Static IMagehelper()

{

..

..

_imageCacheDir = Path.Combine(HttpRuntime.CodegenDir, "Album");

                  Directory.CreateDirectory(_imageCacheDir);

This  is the error:

Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I saw mention earlier that changing the Caching == CacheLocation.Disk to Caching == CacheLocation.Memory in the ashx file will work for godaddy. But I have tried changing all the string to memory and I still get the same error. I gues I am unsure on how to change the handler.

# July 28, 2008 12:10 PM

rblaettler said:

Is there a way to build this into your page so that the user does not need to sign up?

It would be interesting to use this as a support tool, but most of our customers don't have a WindowsLiveID (or at least don't know what that is...)

# July 29, 2008 5:41 AM

Aurelien said:

Hello Bertrand,

I'm playing around with the Preview Release and I found a strange behavior with "Code Blocks".

Let's use a collection of objects with a "firstName"  property.

I can conditionnaly render my template with : <!--* if (firstName) { *-->.

That works if and only if ALL my objects contains this property.

If ONE or ALL of my objects missed this property, I get a javascript error. It's really strange because when I watch the anonymous template function code, I'm in the "with(__context) { with($dataItem || {}) {".

I found a way to bypass this using "$dataItem" in the "Code Block" like : <!--* if ($dataItem.firstName) { *-->

BTW, really nice work, I can't stand waiting the next release !!

# July 29, 2008 8:05 AM

Aurelien said:

Me again !!

Actually, for the "Code Blocks" issue, I found why it doesn't work.

It's the difference between NULL property value and a property typo issue.

Maybe including a try/catch block in the anonymous template code function could be a nice way to handle that kind of typo issues.

# July 29, 2008 8:21 AM

Bertrand Le Roy said:

@rblaettler: you should probably ask that question on the Live forums: forums.microsoft.com/.../default.aspx

# July 29, 2008 1:51 PM

Fabrice Marguerie said:

I used incremental search in the first version of Visual Studio for .NET, unfortunately I had to stop using it almost immediately because it doesn't search inside collapsed regions. This is a big shortcoming that makes the feature unusable in most cases.

# July 29, 2008 8:30 PM

Bertrand Le Roy said:

That's if you use regions...

# July 29, 2008 8:39 PM

Daniel said:

Duh...

# July 30, 2008 2:55 AM

Bertrand Le Roy said:

@Daniel: May seem obvious to you, but very few people know about this (I know some people in the VS team who didn't know about it...)

# July 30, 2008 1:27 PM

Al said:

I never heard of it.

But looks like its ALT-I and not CTRL-I for my configuration (vb key mapping).

# July 30, 2008 2:40 PM

Alex said:

Does anyone know how to get this working in AJAX 3.5 ??  Sometimes SJAX is a good thing, epecially when performing mathematical functions in certain order which is NOT always in the same order. Can Anyone help get this script working in MS AJAX 3.5??

# July 30, 2008 4:30 PM

Bertrand Le Roy said:

@Alex: The scenario you describe can be achieved by maintaining a simple queue of tasks.

# July 30, 2008 4:58 PM

Alex said:

Perhaps that is possible, but would require a huge amount of rewriting.  I'll pay you well for the script if you can do it!  Not kidding.

# July 30, 2008 5:07 PM

Bertrand Le Roy said:

@Alex: what are you seeing when you try it? How does it fail? Are you getting an error message?

# July 30, 2008 6:11 PM

Troy said:

Dear Bertrand,

I lost the session vaiables. Why? Below my code:

Thx.

Troy

protected void btnLogin_Click(object sender, EventArgs e)

       {

           DataProvider dp = new DataProvider();

           SqlConnection kon = new SqlConnection(dp.dbConnectionString);

           kon.Open();

           SqlDataAdapter ad = new SqlDataAdapter("Customers_ByUserName", kon);

           ad.SelectCommand.CommandType = CommandType.StoredProcedure;

           ad.SelectCommand.Parameters.Add(new SqlParameter("@username", SqlDbType.VarChar, 50));

           ad.SelectCommand.Parameters["@username"].Value = txtEmail.Text;

           SqlDataReader reader = ad.SelectCommand.ExecuteReader();

           try

           {

               if (txtEmail.Text != "" && reader.Read())

               {

                   Session["CUST_ID"] = reader["CustomerID"].ToString();

                   Session["CUST_EMAIL"] = reader["Email"].ToString();

                   Session["USERNAME"] = reader["UserName"].ToString();

                   Session["FULLNAME"] = reader["FirstName"].ToString().Trim() + " " + reader["LastName"].ToString().Trim();

                   string paswd = reader["Password"].ToString();

                   string email = reader["Email"].ToString();

                   Decrypto dc = new Decrypto();

                   string ps = dc.Decrypt(paswd);

                   if (txtPasswd.Text != ps)

                   {

                       Default.MessageBox(this, "Invalid password", "key1");

                       return;

                   }

                   else

                       FormsAuthentication.RedirectFromLoginPage(txtEmail.Text, true);

               }

               else

               {

                   reader.Close();

                   Default.MessageBox(this, "Your username have not been registered", "key1");

                   return;

               }

               reader.Close();

               //if this page called from shoppingbag page

               if (Session["CALLEDFROM_SB"] != null && Session["CUST_ID"] != null)

               {

                   //update shopping bag

                   SqlConnection con = new SqlConnection(dp.dbConnectionString);

                   con.Open();

                   string strSQL = "UPDATE ShoppingBag SET CustomerID = '" + Session["CUST_ID"].ToString() +

                       "' WHERE CustomerID='" + Session["CALLEDFROM_SB"].ToString() + "'";

                   SqlCommand cmd = new SqlCommand(strSQL, con);

                   try

                   {

                       cmd.ExecuteScalar();

                   }

                   catch

                   { }

                   finally

                   {

                       kon.Close();

                   }

                   Session.Remove("CALLEDFROM_SB");

                   Session["CALLEDFROM_SB"] = null;

                   Response.Redirect("Shopping_Bag.aspx", false);

               }

               else

                   Response.Redirect("Welcome.aspx", false);

           }

           catch (Exception ex)

           {

               Default.MessageBox(this, ex.Message + " : Failed to get data", "key1");

           }

           finally

           {

               kon.Dispose();

               kon.Close();

           }

       }

# July 31, 2008 3:20 AM

Sambo said:

The code look great!

# July 31, 2008 4:29 AM

Brian Chavez said:

Thanks, this little insight helped me solve a tough problem in ASP.NET when I was using a TypeConverter.

Regards,

Brian

# July 31, 2008 5:02 AM

Mike said:

"the engine only accepts expressions for the full attribute and within text nodes"

Why is that?

"It would be interesting to hear your comments on that, by the way..."

In this particular case, how about:

<img sys:render="if(Photo)" sys:src="{{ 'Images/' + Photo }}" alt="{{ FirstName + ' ' + LastName }}" />

# July 31, 2008 7:09 AM

beetle54 said:

A possible solution to the comment block issue:

I agree that using current solution is too verbose. Maybe we can use <%**%>. As asp.net developers, we are use to using <%#%> or <%=%>, I think by adding an additional tag like the one I suggested from before would be a good idea.

Just an idea!!

# July 31, 2008 8:43 AM

Andy said:

Great to see Templates coming the Microsoft AJAX. Javascript comments look very powerful and the XHTML syntax seems very clear. Top on my wish list would also be a Meta Data syntax/parser similar to docs.jquery.com/.../Metadata.

# July 31, 2008 8:48 AM

Alex said:

I can try again and let you know shortly.  Thanks for your help.

# July 31, 2008 11:41 AM

Nirvana said:

Microsoft ajax is spam!!!

jQuery is best!!!!!!!!

# July 31, 2008 11:43 AM

Bertrand Le Roy said:

@Mike: expressions are only the full attribute because the parsing would have gotten much more complex and slower otherwise. We weighted the benefit against the cost and decided it was not worth it.
You can already do something like what you suggest for conditional rendering by binding the display style property but that only covers one possible use of code blocks (others include looping over markup, etc.).

@beetle54: those are unfortunately not options as they would be invalid XHTML. Drew Marsh suggested something similar with processing instructions but that doesn't work either.

@Nirvana: great to have you back. Been missing you.

# July 31, 2008 1:20 PM

Bertrand Le Roy said:

@Troy: hard to say just looking at your code. Once you've checked all the possible causes described in this post and linked resources, attach a debugger and try to catch thread abort exceptions. If any happen, walk up the call stack and find the culprit. You can also use Fiddler or Firebug to monitor headers for session cookies and diagnose.

# July 31, 2008 1:27 PM

Alex said:

I put together a simple ASP.NET AJAX 3.5 sample page.  On this page is an (1)UpdatePanel (2)Textbox (3)Button (4)Label ..  When I omit the SJAX script above, it works fine.  Simply updates Label with text that I type into TextBox without a page postback.  Easy.  Not I add the SJAX script and nothing happens.  No JavaScript error. Nothing.

# July 31, 2008 2:30 PM

Bertrand Le Roy said:

@Alex: send me your repro at bleroy at microsoft and I'll have a look.

# July 31, 2008 2:44 PM

gt1329a said:

A server control might be a good way to handle the syntax complaints.

The control could have declarative syntax similar to a Repeater, ListView, or DataList, but render as a proper template for the client-side DataView.  It could accept a DataSource parameter on the server side, automatically set up something like a page method to serve that data as JSON, then (optionally) emit the corresponding set_data command on DataBind.  Something like that might go a long way toward lowering the barrier to entry, while still encouraging the more efficient client-side rendering.

Maybe even enhance the ListView to provide that functionality, depending on an EnableClientRendering flag.  Now, that would be a great feature!

# July 31, 2008 2:57 PM

Alex said:

I sent a zipped VB.NET sample project.  Thanks a ton!

# July 31, 2008 3:02 PM

Bertrand Le Roy said:

@gt1329a: yes, we are working on server integration of those features. Thanks for the feedback, this is very helpful.

# July 31, 2008 3:04 PM

Christian Hagelid said:

In order for CTRL + I to work you have to do a CTRL + F first to type the term(s) you want to search for.

Please correct me if I'm wrong

# July 31, 2008 9:10 PM

Bertrand Le Roy said:

@Christian: you're wrong :) Press CTRL+I then start typing what you're looking for. It will automatically select the first occurence and update it as you type. Once you've got the sequence you want, you can use F3 to go to other occurences of the same sequence.

# August 1, 2008 12:29 AM

Troy said:

      Hi Bertrand, I only show you the point of losing session while redirect to "Welcome.aspx". I have revised my code.

      If I debug in my local server, I am not losing this session. But after I put this on Web server, the session was loose.

      If I set IE on Privacy -> Advance -> Check Automatic....., this session is exist and run normally on IE Client.

      If I browse with IP number, I am not loosing the session, but If I browse with domain name with redirect, the session was loose.

      How do I have to fixe this problem?. Thx for your time.

      protected void btnLogin_Click(object sender, EventArgs e)

      {

          DataProvider dp = new DataProvider();

          SqlConnection kon = new SqlConnection(dp.dbConnectionString);

          kon.Open();

          SqlDataAdapter ad = new SqlDataAdapter("Customers_ByUserName", kon);

          ad.SelectCommand.CommandType = CommandType.StoredProcedure;

          ad.SelectCommand.Parameters.Add(new SqlParameter("@username", SqlDbType.VarChar, 50));

          ad.SelectCommand.Parameters["@username"].Value = txtEmail.Text;

          SqlDataReader reader = ad.SelectCommand.ExecuteReader();

          try

          {

              if (txtEmail.Text != "" && reader.Read())

              {

                  Session["CUST_ID"] = reader["CustomerID"].ToString();

                  Session["CUST_EMAIL"] = reader["Email"].ToString();

                  Session["USERNAME"] = reader["UserName"].ToString();

                  Session["FULLNAME"] = reader["FirstName"].ToString().Trim() + " " + reader["LastName"].ToString().Trim();

                  string paswd = reader["Password"].ToString();

                  string email = reader["Email"].ToString();

                  Decrypto dc = new Decrypto();

                 string ps = dc.Decrypt(paswd);

                  if (txtPasswd.Text != ps)

                  {

                      Default.MessageBox(this, "Invalid password", "key1");

                  }

                  else

{                      FormsAuthentication.RedirectFromLoginPage(txtEmail.Text, true);

                  Response.Redirect("Welcome.aspx", false);

}

              }else

                  Default.MessageBox(this, "Your username have not been registered", "key1");

              }

          }

          catch (Exception ex)

          {

          }

          finally

          {

              kon.Dispose();

              kon.Close();

          }

      }

# August 1, 2008 5:11 AM

Bertrand Le Roy said:

@Troy: it seems like you're doing everything right here. If you've checked all the references I pointed to, I would suggest you contact support at this point. Feel free to contact me at bleroy at microsoft to tell me how that goes.

# August 1, 2008 1:44 PM

Mike.Borozdin said:

Good idea indeed!

# August 2, 2008 8:35 AM

Speednet said:

Rather than trying to shoehorn a lot of syntax into compliant XHTML, why not take the whole template and put it into a special comment block that is structured like an IE conditional block?

All browsers and XHTML validators will ignore the whole thing, and you will have a solution that will stay in one context (not switching back and forth between comment blocks).  You don't have to worry about hiding the code upon initial page load.  And it could one day be supported directly by the browser, just like IE conditionals are.

For example:

<!--[template]>

<div id="peopleIKnow" class="sys-template">

   <fieldset>

       <legend>{{ FirstName }} {{ LastName }}</legend>

       <% if (Photo) { %>

       <img src="{{ 'Images/' + Photo }}" alt="{{ FirstName + ' ' + LastName }}" />

       <% } %>

   </fieldset>

</div>

<![template]-->

-Todd

# August 2, 2008 6:43 PM

Xun said:

Stumbled into this blog when I was searching for JavaScript doc comments. Great post, more so, great blog, more so, great fun cachy hippy evil banner. I did not see your trademark avatar here, but that is great too.

# August 2, 2008 9:32 PM

Bertrand Le Roy said:

@Todd: Sure, that's something we considered. Actually, quite a few template engines out there are using script tags with different types than text/javascript, which are also ignored by browsers and have pretty much the same effect as what you describe. The thing is, we don't want the markup to be ignored. Not by the browser (because we're leveraging the browser's HTML parser to our advantage), and not by HTML editors (because we want designers to be able to work on the template almost like they would on regular HTML code). Finally, people interested in validating their documents might appreciate if half the markup doesn't hide in comments.

# August 3, 2008 1:00 AM

Xun said:

It works great. Somehow, I cannot help thinking this now resembles very much the old asp way, where we interwine code and script together.

Is it so?

Can you kindly reply, sir?

# August 3, 2008 10:11 AM

Christian Hagelid said:

@Bertrand: Awesome! Very very handy now that I understand how to use it. Thanks.

# August 3, 2008 6:46 PM

Bertrand Le Roy said:

@Xun: sure, and you can do that in ASP.NET too. If you don't like that, we have declarative syntax for controls and behaviors too. I'll show that in the next post.

# August 4, 2008 1:16 AM

Xun said:

thanks for the reply. Great

Something off the topic: I happened to read somewhere there is even a "Annual Evil Empire Planning Meeting" from a tech blog, wondering if this is the same evil empire as yours.

Another thought, since Google and Microsoft are archnemesis, is the "Evil" thing some sort of counterjoke against Googles' "no evil"?

Sorry for the baseless speculation and tech irrelevance.

# August 4, 2008 8:29 AM

Bertrand Le Roy said:

@Xun: I don't know about the EE planning meeting. But then again I'm only a henchman. Let me point out that we've been evil way before Google even existed. But yes, it has to do with that, but also with the fact that many people assume that whatever we do is always with some evil master plan in mind.

# August 4, 2008 2:45 PM

Lance Fisher said:

This looks great!  I've been looking for a good JavaScript templating system.  What would be REALLY cool is if I could use the same templating system on the server as a view engine in ASP.NET MVC.  Where the server will replace the tokens.  I'd still want the JS templating system.  I'd just like to be able to parse templates on the server if I could.

# August 4, 2008 8:00 PM

kamii47 said:

Nice But missing One very important thing

That is grouping.I need a free grid like devexpress gridview where we can do filtering, grouping e.t.c

# August 6, 2008 2:30 AM

Hardy Har said:

Or just install ColdFusion 8 FFS! Dropkick!

# August 6, 2008 4:14 AM

Mike.Borozdin said:

Hmmm... this page (dotnetslackers.com/.../Default.aspx) doesn't seem to load...

# August 6, 2008 5:08 AM

Vishal said:

Thank you very much

# August 6, 2008 5:12 AM

Philip Ross said:

While I agree that asynch calls provide the "correct" user experience, there are cases when you may want to use synch calls as a hack (isn't all of web development a collection of cheap tricks now?). In particular, making asynch calls during the unload event doesn't work well in non-IE browsers. This problem is explained more in www.livelearncode.com/.../11 which linked me to this page. It saved my butt.

# August 6, 2008 6:22 AM

jgd12345 said:

How about:

{ if some-expression }

  ...

{ /if }

or

{{ if some-expression }}

  ...

{{ /if }}

# August 6, 2008 8:51 AM

Tanner Wood said:

Thanks for the info.  This is going right into my toolbox!

# August 6, 2008 10:02 AM

xxXd said:

Great! Thanks for the mention. I am proud to say, I am part of the devilish team.

# August 6, 2008 11:21 AM

gbogea said:

Cool, thanks for the tip. The open source controls are specially nice because I have the chance to dig into the code just to see new ideas from other programmers.

# August 6, 2008 3:40 PM

Bertrand Le Roy said:

@jgd12345: text nodes like those are not allowed anywhere in XHTML so that doesn't work.

# August 6, 2008 3:42 PM

inderjit said:

yesterday when i go to open my mails from microsoft outlook express it giving error *.pst file is not personal pst file.

# August 7, 2008 5:18 AM

Sonu Kapoor said:

kamii47: We already have that feature on our to-do list.

Mike: This page just lists the samples that are available for the Gridview control. There is no ajax used on that page.

Bertrand: Thanks for the posting this :)

# August 7, 2008 12:32 PM

Ted said:

You are not the only one that does not like Braid.

1. Ugly, ugly, ugly.

2. Something felt wrong but I could not put my finger on it, now that you mention the jumping, this is exactly what it was.

3. I thought it was boring.

4. I thought all the puzzles in the demo were super easy.

5. $15 should be reserved for extremely special XBLA games that are worth it.  Braid is not that.

You could get as much enjoyment out of your favorite, classic games with an emulator that supports rewind.

# August 11, 2008 10:51 AM

Fabien said:

The aesthetics of Braid is what drew me to the game from the moment I saw the first screen. That, and the music. Man, do they blend well together!

The story of Braid is not what I found interesting though. In fact, I didn't care about it at all. I was just anxious to run through Braid's world.

I didn't have any trouble with the controls, although I agree that jumps are tricky when they're long or when they involve rebounding on multiple 'Lionhead' guys to get to a high platform.

Braid's game play reminds me of a mash-up between 'Mario', 'Donkey Kong', 'Solomon's Key' and 'Prince of Persia' for the control of time. However, Braid brings a whole new dimension in the way time is controlled backward & forward to solve puzzles. I believe that has never been done before in any other game.

But Braid's brilliant ideas aren't just limited to time control: I was blown away with the 'recursive reality' of the game where assembling a puzzle image altered the game world, enabling the very completion of the puzzle image! The last time I experienced a moment like that was in 'Portal' :)

At times, it does feel like the game difficulty is not balanced or progressive enough. As you pointed it out, you'll find yourself breezing through some puzzles while others will be a struggle because new game mechanics are introduced out of the blue.

Clues are provided in the form of a one-liner during transition screens when doors are opened on a new level but that's about it. This leads to frustrating 'discovery sessions' which could have been avoid with a tutorial of sorts.

Having said this, Braid is a truly unique game on many levels and I will very likely finish it, even though I may resort to using a game guide or a YouTube video when my frustration gets too high :)

# August 11, 2008 1:35 PM

Bertrand Le Roy said:

@Fabien: the aesthetics point is clearly very subjective, but talking about the music, I had to turn it off after five minutes and G actually thanked me for it...

I agree that the idea is relatively novel in a platformer (and the idea, to be clear, is not time rewinding, it's making it the central gameplay element) but it's not the idea that I didn't like, it's its execution.

I felt there was something going on with the puzzles being part of the game but was too bored to make an effort and find out (or more accurately, it just felt like such a wart to have lame mini-puzzle-games to build -is this game for 4-year olds?- that I hoped there was something more to it). Now that you tell me, ok, it makes sense, but it doesn't save the game in my eyes.

I guess this is just not for me (but on paper, it felt so *right*). Very disappointed.

# August 11, 2008 1:51 PM

Cathrine said:

Actually the above solution is working for Firefox not in IE.Please advice us.

# August 12, 2008 6:03 AM

Bertrand Le Roy said:

@Cathrine: it was never broken on Firefox. Chances are you improperly patched the files.

# August 12, 2008 2:44 PM

Tiger said:

God fucking yes. It's so taboo to say you didn't like it. THANK YOU for taking this step. It's a terrible, low quality feeling game. Or rather it would be better if it was released years back.

And I'm not just talking about the graphics, granted I don't like the impressionist artwork (not a fan of that art movement). It's that older games did this better. Take Donkey Kong on the GB. Another puzzle platform game that keeps going and going with shit loads of levels. Braid gives us a few with no replay value.

No Braid. And would Blow kindly STFU. Has he never had attention before?

And no number of interviews are going to convince me it's worth $15. Which means don't give ANOTHER interview telling us why we should. Just announce that it will be cheaper! But before someone says I'm uncultured... I don't spend $15 on rubbish. I don't spend any amount of money on something with such low replay value.

# August 12, 2008 7:57 PM

xun said:

wow! Now I understand that you have to become part of microsoft evil team then can you have a lot of good fun and blog about it. (Of course Google people also are having good fun after making a lot of good)

Sorry never had a chance to play any xbox games, still sweating over the never ending stream of asp .net new products and terms (MVC, Silverlight, LINQ ... AJAX is already old timer). So no comments, nor complaints.

But I take your words. Will never play braids even if given the chance.

Went to your flickr. Like the photography and drawings and sketches. Very much.

Definitely evil. Meaning, definitely masterly.

# August 12, 2008 11:52 PM

anna said:

FUCK NUMLOCK! Thank you for this post.

# August 13, 2008 10:04 AM

Ryan said:

I played the demo, loved it, and bought the full game a few days later.

1. The graphics didn't bother me one way or the other, though I can see how it could annoy some people.

2. I got used to the controls after awhile, but the jumping was the same with me - I would often have to do many rewinds to accomplish just what I wanted when jumping or falling.

3. The story didn't really seem to matter until the last world (or level, or whatever). That last level really tied it all together and was great, but you only really needed to know the basic plot elements - Probably just the stuff in the first book or two.

4. The progression may be better in the full game, as the demo skips a bit. It really depends which ideas didn't jump out at you. I do remember having some trouble on a couple of puzzles that took me awhile.

5. The price held me back to start with, but I decided to go for it. I think I got my money's worth, especially as I have some friends that will end up playing it with my copy.

I'm not trying to sway you or anything, just throwing out my opinion :)

# August 13, 2008 9:00 PM

Robbie Huttenhower said:

This is going to be a nice feature.  When can we see this ship?

# August 15, 2008 8:41 AM

Bertrand Le Roy said:

@Robbie: the preview is out there (first link in the post) and you may already use that. The actual shipping vehicle is ASP.NET 4.0, and we haven't announced a date for that yet.

# August 15, 2008 2:30 PM

Dave OS said:

Hi Bertrand.

Excellent work with this photo handler. Well done. I have just one question. I would like to display a subset of the EXIF meta-data. Ie.. If I wanted to view Model, Exposure and F-Number details. Is it possible?

Thanks

Dave OS

# August 15, 2008 11:46 PM

KAGRAN22 said:

for the IFRAME SRC just use the most visited URL in the World about:blank

Doesnt require any external Content and works in IE/FF and guess everywhere else...

^_^

# August 16, 2008 12:34 PM

Tayler. said:

i am just doing this for a school project but after reading all of these comments and articles about tidal power i feel that it could have an impact on the earth. all through college we have been told that energy can not be created but transformed and transferred. so it makes sense

# August 16, 2008 10:04 PM

jonathan said:

Um yeah, i use the final version of safari, and i love it. its great.

# August 17, 2008 10:41 PM

Bertrand Le Roy said:

@Dave: sure, for the moment I'm just dumping all the available info but you could certainly modify the code to only display a subset.

# August 18, 2008 2:27 PM

Bertrand Le Roy said:

@Kagran: as the post states, "if you work with a secure site (with an https: protocol), you can't use "about:blank" as the url of the iFrame, otherwise you'll get a warning from IE saying that the page uses both secure and insecure contents."

# August 18, 2008 2:28 PM

Dave OS said:

Thanks. I've tried but to no avail. My skill set dos'nt include C# :(. Any idea where i can start?

Dave OS

# August 18, 2008 3:11 PM

Bertrand Le Roy said:

@Dave: if you go to GeneratePreviewPage, there is a double loop in there that loops over Image.Metadata. You could modify the code in there so that it continues the loop if the data is not in your predefined list. Something like if (!["OneKeyIWant", "AndAnotherOne"].Contains(data.Key)) continue;

# August 18, 2008 3:23 PM

Dave OS said:

Thanks for that Bertrand. I played around with it for a bit and got it working. Here it is below. I removed the qoutes from each side of the commas. :)

if (!"Model, Exposure Time".Contains(data.Key)) continue;

Again.... Thanks for your help.

Dave OS

# August 18, 2008 5:30 PM

JeffEsp said:

This didn't work for me until I added a cast to IDataItemContainer like so:

((IDataItemContainer)Container).DisplayIndex % 2 == 0 ? "even" : "odd"

Any ideas why?

# August 19, 2008 9:11 AM

Akshay said:

It is interesting.

# August 19, 2008 9:56 AM

Bertrand Le Roy said:

@JeffEsp: Are you using ListView or another data control?

# August 19, 2008 1:41 PM

Dan P said:

This feature is essentially identical to the search command in GNU Emacs (Ctrl+S).  I couldn't find an equivalent for searching backwards though (i.e. Ctrl+R in Emacs)...

# August 20, 2008 5:54 AM

Robin said:

Hi Fabien,

Your solution for the ie bug is excellent if the element is not draggable.

Can you suggest an idea to show select above div

while dragging?

Best regards,

Robin

# August 20, 2008 7:01 AM

Bertrand Le Roy said:

@Dan: use SHIFT+F3 once you've typed CTRL+I and your search string. It's not strictly equivalent to reverse incremental search but it comes close.

# August 20, 2008 1:56 PM

Jimmy said:

Hello,

I think this project is great.

I wonder if you had an idea for this problem, somewhat related to javascript documentation. Our company is developing software on top of Firefox. Firefox uses their version of COM, called XPCOM. They also have their version of interface definition language (IDL), called XPIDL. One creates objects in C++ that conform to an XPIDL interface; and this object becomes available in Javascript.

I haven't been able to find a good tool to generate documentation from XPIDL. Just like IDL, XPIDL has some weird stuff that doesn't belong in the docs (since the docs target javascript developers), which means that it will require a fair amount of processing. Documenting from the C++ objects as opposed to XPIDL doesn't work well, since the capitalization of functions needs to be different between C++ class and XPIDL (aargh!) Well, I guess if I can write something to process XPIDL, I can probably write something to process the C++ class and fix the capitalization...

# August 20, 2008 11:17 PM

Raj said:

The alert box works great when i run my pages in the ASP development server. But when i host it on IIS and try to access the pages, the alert box works fine except for a status bar that gets displayed inside the alert box. Any solution for this problem?

# August 21, 2008 1:50 AM

Bertrand Le Roy said:

@Jimmy: sorry, I know nothing about XPIDL.

# August 21, 2008 1:57 AM

Bertrand Le Roy said:

@Raj: Do you mean the browser's status bar? Is the browser version the same in both cases?

# August 21, 2008 2:00 AM

Raj said:

Thanks for your quick response..

Yes, Roy its the browser's status bar. The browser version is also same in both the cases.

# August 21, 2008 3:59 AM

Raj said:

Hi Roy,

This is regarding the status bar getting displayed in the alert box. I had posted my reply to your query in that post but my reply is not getting reflected there.

Actually, the browser versions are same for both and also, its the browser's status bar that is getting displayed in the alert box.

# August 21, 2008 4:23 AM

Naveen said:

Can we download Visual Studio Express completely wihout paying.

# August 21, 2008 6:16 AM

Bertrand Le Roy said:

@Raj: the comments are moderated, and this is mentioned clearly when you try to submit a comment. Re-submitting comments ten times doesn't help ;) Commenting on a different post helps even less. And my first name is Bertrand, not Roy...

# August 21, 2008 12:24 PM

Bertrand Le Roy said:

@Raj: I don't know where the difference comes from but more and more, browsers don't allow scripts to remove chrome from pop-up windows to avoid phishing attacks that mimic non-browser windows. That may be what's happening here. How much of a problem is this status bar?

# August 21, 2008 12:26 PM

Bertrand Le Roy said:

@Naveen: yes, that's kind of what I'm saying in the post. Here's the url for the latest version:

www.microsoft.com/.../details.aspx

# August 21, 2008 12:28 PM

Daniel said:

Very cool. Is this the feature described in Omars book?

# August 21, 2008 3:18 PM

Bertrand Le Roy said:

I don't know. I haven't read this one.

# August 21, 2008 3:26 PM

Mike said:

Here's my honest feedback (rant): wtf?

From February to August and Microsoft, one of the biggest software companies in the world manages to release one new ajax control that is donated to them! It's a bit sad really.

And it's proof that Microsoft in general doesn't care. I believe you personally care for this project, it's just that Microsoft sees more value in the proprietary Silverlight instead of working on an project bases on open standards.

In fact, several blogging developers have already acknowledged that they couldn't work on this project because they had to develop Silverlight controls.

Now you say the top priority is fixing bugs. Well, you go ahead and do that, while jQuery finishes the second version of their UI project, Ext gets adapted to even more platforms and YUI releases their brand new 3.0.

I want to leave you with this observation: IF the community contribution are not what you'd like, do you think that might be because of the reputation of Microsoft? After all, why help Microsoft build their 'open source' software, when they called other such projects a cancer?

You reap what you sow.

-A developer continually disappointed in the Ajax offerings by Microsoft.

# August 21, 2008 5:59 PM

Bertrand Le Roy said:

@Mike: In the period you mention, we shipped the history feature, script combining, client-side templating and client-side databinding. Next preview of the Ajax framework is next week and will add more client-side data management.

Are you saying we shouldn't fix bugs?

Actually I never said the community contribution isn't what I'd like. As a matter of facts we have quite a number of people working on new controls as I write and I'm quite happy about the quality of most of the stuff that gets contributed.

I know perceptions are hard to change and the most efficient way to do that is with action, and I recognize we haven't sent the clearest signals these last few  months but I hope our actions in the next months will show you that your perception that we only care about Silverlight is completely wrong.

# August 21, 2008 7:15 PM

Matt said:

I see there no longer a version for VS 2005. I still have a number of projects that are in ASP.NET 2.0 using VS 2005, I guess I will need to down grade the latest release to get the bug fixes.

By the way there are some typos on the codeplex page www.codeplex.com/AjaxControlToolkit/Release/ProjectReleases.aspx?ReleaseId=16488 and the samples page asp.net/ajax/ajaxcontroltoolkit/samples/ relating to VS 2005 and the release numbers

# August 21, 2008 8:48 PM

Bertrand Le Roy said:

@Matt: you can also download the source code and compile against 2.0. If there is a lot of demand, we'll add a 2.0 version.

Thanks for the heads up on the typos.

# August 21, 2008 11:20 PM

shailatlas said:

Hello Bertrand,

AJAX control toolkit is a great piece of work by community and MS. The only thing missing is some basic documentation of functions or both server and client side. If you really want AJAX control toolkit to be used as much possible, please make some documentation.

We all are in client projects and hardly get time to go and study the source code of AJAX control toolkit to find required function. Even a great tool is less useful when you do not know how to use it.

Thanks,

Shail

# August 22, 2008 3:53 AM

Paul P said:

It would be a great idea having 2.0 version too. Few servers I work with haven't 3.5 framework :(

In the meantime I'll recompile sources.

Thanks a lot!

# August 22, 2008 7:28 AM

Mike.Borozdin said:

Mike,

Although I agree with that there should be more released of Control Toolkit and moreover I wish it had more controls, I don't think Microsoft doesn't really care. They have Silverlight, but Silverlight is a bit different technology. Anyway, you can still use 3-rd party AJAX libraries.

# August 22, 2008 12:23 PM

Cyrus said:

I can't wait for the release of the Client only Ajax toolkit.  The current HTTPHandler model with tons of those script files just doesn't work for us. It really seems like you guys are spread quite thin with tasks and/or just don't have enough resources in your team as Microsoft's Ajax offerings have been few and far in between in the last two years.

# August 22, 2008 12:46 PM

Bertrand Le Roy said:

@Shail: I agree with you and we want to improve the documentation, especially for the client-side object model.

@Paul: let me know how that goes. For the moment, I've had little demand for it but I'm totally open if that's too mauch of a pain.

@Mike: that's an excellent point, and most third party Ajax libraries work great with ASP.NET. I think you should have a choice of the style of library you like best.

@Cirus: it's live, go download it now! You might also want to check out the new script combining feature in SP1. We are putting more resources into Ajax now. The team is growing an I hope you'll see tangible results of that in the following months.

# August 22, 2008 2:04 PM

89 said:

Hi, Could we have a static "parse" method added to all classes, in order for clients to be able to cast to type?

eg

Sys.SomeClass.parse = function(obj)

{///<returns type="Sys.SomeClass"/>

  return obj;

}

Client Code would be

function onSomeClassClick(sender, args)

{

  sender = Sys.SomeClass.parse(sender);

  args   = Sys.SomeClassEventArgs.parse(args);

  // Full JS intellisense now enabled.

}

Thanks

# August 22, 2008 6:07 PM

Raj said:

Its quite a bit of a problem, as we need these to validate the inputs given by the user which can happen from both client as well as server side. Now if an alert box has a status bar, it doesnt look too good.

Is there any kind of workaround for this problem?

# August 23, 2008 6:30 AM

jose said:

you should try overlord. that's evil in a funny way.

# August 23, 2008 8:08 AM

Alex said:

Most of my projects are running using vs2005, so i really wish that it still can provide update on this version too.

# August 24, 2008 11:51 AM

Bertrand Le Roy said:

@89: that's been suggested before but it requires to write code in order to support IntelliSense. Instead, we prefer to make IntelliSense work in that case with no extra code.

# August 25, 2008 2:55 PM

Bertrand Le Roy said:

@Raj: you could try to use www.asp.net/.../ConfirmButton.aspx instead.

# August 25, 2008 3:01 PM

Mike said:

You mention 4 features, of which 2 are in a preview release. I responded to THIS release.

I never said you shouldn't fix bugs, of course you should. But you should also release new features, and I have been disappointed on that front.

Also, I capitalized the word IF, because I was speculating about contributions. You indicate my speculation was wrong, but I have yet to see proof because in 6 months you have added 1 contributed control. That's not impressive. So I thought you might not get many contributions then.

Oh and thanks for saying that the lack of new stuff is perception, that's like saying I'm delusional, it's all in my head. You guys have yet to release any kind of tree or grid control after 2 years (not even an extender for the GridView). It's not perception, it's fact.

And I understand YOU are excited about Ajax and dedicated, it's just that your company is NOT. It is not perception, but simple fact, that Ajax programmers were working on Silverlight controls. Therefore, Silverlight had absolute priority for Microsoft in the last year.

# August 26, 2008 3:54 AM

Raj said:

Hi, i am not supposed to use AJAX, any other way to solve this problem other than using ajax?

# August 26, 2008 9:13 AM

mike said:

I cannot open outlook and even with the bit of file given I cannot enter it right info to get the location of the personal files.  I have Outlook 2007 and get error that says: a data file did not close properly the last time it was used and is being checked for problems.

And it never opens or works.  

I can get to the repair tool but can't find right file to enter.

Any help?

# August 26, 2008 1:13 PM

Bertrand Le Roy said:

@Mike: never said you were delusional, but not being in the company, you have to rely on external perception, which is wrong more often than right.

Microsoft is a big company with a lot of customers, some of which build rich Internet applications today using Silverlight, and some of which build standard-based web applications. We just cannot afford to only address one of those audiences.

Microsoft is more than big enough that it can work on several things at the same time. Saying that Silverlight is the absolute priority for Microsoft is absurd: I think if Microsoft could only think about one thing at a time, it would probably be Windows 7 right now, not Silverlight.

It's really quite simple actually: our customers want to build Ajax applications on top of ASP.NET, we provide them with the tools to do so, it drives adoption for ASP.NET, which in turn drives Windows Server sales.

Now you tell me about resources that left the ACT to work on Silverlight controls. Right, so two of the devs that were working on ACT now work on Silverlight. At Microsoft, like in any big company, people change jobs from time to time. Guess what? They get replaced. For example, I wasn't working on the toolkit one year ago. Would you conclude from it that now all that Microsoft cares about is the Toolkit?

# August 26, 2008 1:46 PM

Bertrand Le Roy said:

The control in the Ajax Toolkit doesn't really use Ajax, so you might be able to reuse some of the code in there although it might be quite a lot of work. I guess your options would be to live with the status bar, make your own control using techniques similar to what the Toolkit is doing or use the toolkit.

# August 26, 2008 2:22 PM

Bertrand Le Roy said:

@mike: maybe do a global search on your whole hard drive for *.pst files?

# August 26, 2008 2:23 PM

xxXd said:

It is overwhelming. The way he produces tips as if he were a balloon peddler. Need a balloon, here you go. 1, 2, ... 37. Even more overwhelming/amazing, people never get tired.

One winner up, a million losers down.

# August 26, 2008 4:36 PM

VR2 said:

The "89" comment was left by me but I did not use that name nor that URL.

I can see why you might like to have code comments solve this problem of "casting" but

#1 Is there even a doc comment syntax for doing what is being done in the above example yet?

#2 To implement and call to a cast method is not alot of (additional) code.

#3 Even in C# we need to make use of casting, not always do we know the exact type being passed in. Even then we may wish to cast down or up to various types in the inheritance chain.

#4 Sometimes one might want to cast one object into multiple seperate interfaces.

So while I appreciate your keen-ness on not adding any additional code lines, I'm not sure you could cater for these scenarios with doc comments alone?

# August 27, 2008 7:39 AM

Bertrand Le Roy said:

@VR2: we're looking at ways to enable type hint comments in the next version of Visual Studio.

# August 27, 2008 5:34 PM

Mike said:

How could we know anything that happens at Microsoft. It's all so closed, I must have asked on 10 blogs what was happening with Ajax the past year. Should we invest time in it? Where's the gridview/treeview/rich editor? Is that even coming? Should I wait or go with a different tool? Nobody answered. Everywhere I looked I saw Silverlight being discussed. I even mailed Scott Guthrie about it, usually very open, no answer, just silence...

What I express is my frustration, so perhaps we have a communication problem?

---

"Our top priority following this release is bug fixing in order to get back to a stable and low number of bugs. We also have a number of contributors working on new controls, following the priorities the community communicated us."

---

I find that frustrating, because I see the post title in my reader, and I'm seriously excited. I think, oh boy, this will be cool. The general 3.5 SP1 release had so much great new stuff, like dynamic data and entity framework, let's see what's new for Ajax. Well, 1 control and some bugfixes. Disappointing! What's next? More bugfixes and waiting for the community to do controls? Disappointing!

One reason I'm excited about ASP.NET MVC, so I don't have to wait on Microsoft for the Ajax anymore, I would just use YUI, done. Have you seen the 3.0 alpha? That's amazing!

# August 27, 2008 6:36 PM

Bertrand Le Roy said:

@Mike: did you ask here? Scott is a very busy man so I don't think it's a question of openness. There are people working on a grid and a rich text editor. There are several third-party components also (including free, open-source ones). Do you need links? ASP.NET has had an Ajax-enabled TreeView since 2.0 (and the rendering is reasonably good when using the CSS adapters).

# August 27, 2008 6:43 PM

Bertrand Le Roy said:

Oh, didn't see the second part of your comment, apologies. Again, I think you're being unfair: SP1 has script combining and browser history management, and the Ajax Preview has lots of great stuff such as the template-driven DataView and live bindings. So "what's new for Ajax" is much more than "1 control and some bugfixes".

On the toolkit front, I never said I was counting solely on the community: contributors can be internal and external, and indeed a good share of these contributors are Microsoft employees. When I'm saying that our top priority is fixing bugs, it doesn't mean we're *only* doing that, just that we think that's what's most needed today. I understand that you disagree with these priorities and your feedback is well understood. Now I have to weight that against the feedback from the rest of the community.

Finally, YUI works great on top of ASP.NET and if you like that library (or jQuery or whatever), that's perfectly fine by me. Really.

# August 27, 2008 7:21 PM

Raj said:

hmmm. not left with that much time i guess. Let me see if i can do something about it. If i get any solution, will post it here. Thanks a lot for your help.

# August 28, 2008 12:59 AM

Nariman said:

When using client callback (ICallbackEventHandler) in WebForm_DoCallback() script there is boolean parameter useAsync. In theory and as msdn says, if we pass false to this parameter call back must work synchronously. I tryed and realized that it doesn't do so(many of you I think realized that). In some blogs I saw a solution to modificate MS's WebForm_DoCallback() funtion: forums.msdn.microsoft.com/.../f4134c2e-ca04-423a-9da3-c613713a7b52

or saw solutions just like in this blog - to insert a script into head of aspx.

But if it an error of microsoft isn't there any patch o something like that that we can use?

# August 28, 2008 6:53 AM

Ryan said:

Oh dear God, thank you! :D

# August 28, 2008 1:37 PM

Bertrand Le Roy said:

@Nariman: this is by design. I answered the MSDN forum thread with a more detailed explanation. Can you please point me to the MSDN atricle where you've seen claims that this parameter would make the call synchronous? I'd like to get that corrected.

# August 28, 2008 2:46 PM

Bertrand Le Roy said:

@Ryan: you're welcome, but please, you may call me Bertrand.

# August 28, 2008 2:53 PM

Stephwn said:

Did anyone every get this to work on XP with an "Old Version" of media player (sync).  

XP Media Player doesn't work with MS Windows 2003 - same company, but Media Player works with a prioritary Sandisk device wonderfully.

MSFT simply doen't get the mobile environment or the mobile music customs!

# August 29, 2008 1:55 PM

Daniel Cazzulino said:

Have you looked at code.google.com/.../JavaScriptTemplates ?

They have an explanation why they think using a textarea to wrap the templates is the best and most flexible solution.

# September 1, 2008 1:18 AM

Bertrand Le Roy said:

@Daniel: they want the template as a string, we want it as a DOM fragment. This leads to very different constraints and ideal solutions.

# September 1, 2008 2:11 AM

mehfuzh said:

That's cool, finally IE got highlighting feature!! Though, i always miss the colorful view source in IE. Also the input box highlighting like Safari :-).

# September 1, 2008 3:06 AM

Quiet Desperation said:

I wasn't thrilled by it either. I was able to get through the first room just fine except for one puzzle piece. There's this one jump you have to time so precisely, and I could swear I did it a number of occasions, but I just could not clear the gap to the final piece. I must have sat there for 10 minutes rewinding over and over again. Meh... I like a challenge but not something with a millsecond timing window. It's just not worth it.

# September 1, 2008 6:02 PM

Khurram Shahzad said:

Hey,

Many thanks very interesting article you posted.

But I was few questions regarding the web service.

Is it the normal Web Service (.asmx) or a JSon based web service.Another thing if the Web Service fails than How these kind of situations can be manipulated.

Overall, brilliant.

Regards,

Khurram.

# September 3, 2008 5:05 AM

Mike Tavares said:

Does this control only pick up certain script references?  The reason I ask is that when using it it picked up all the Ajax Control Toolkit references and the AJAX references, but did not pick up others like scripts for the menu control, validators, and 3rd party infragistics references.  They are being loaded with my page, but not being listed out by the control.

# September 3, 2008 11:45 AM

Bertrand Le Roy said:

@Khurram: the service is a normal asmx service, *but* used in JSON mode. In ASP.NET, any web service can be very easily morphed into a JSON service by adding a [ScriptService] attribute. ASP.NET even generates an optional JavaScript proxy (that we're using here) that is accessed using the PeopleIKnow.asmx/js url (notice the /js at the end).

You can provide callbacks for failures or timeouts of the web service as additional parameters to the service call.

# September 3, 2008 12:16 PM

Bertrand Le Roy said:

@Mike: it can only pick up script references that were registered with the script manager. Older ASP.NET scripts and third party scripts not using script manager will not get picked up (but they can't be combined either). We're considering making all references go through script manager if there is one on the page for v.next, which should solve that problem and make everything combinable.

# September 3, 2008 12:20 PM

Odegaard said:

Just an idea... how about allowing for javascript expressions like this one:

<span>{Eval(Math.round({Binding Average})}</span>

It allows for some interesting binding scenarios and I've used it with great success in my own binding library.

# September 3, 2008 12:54 PM

Bertrand Le Roy said:

@Odegaard: in a one-way/one-time binding, you can do {{ Math.Round(Average) }}, but even with live bindings, you can provide a convert function (and also a convertBack function for two-way): {binding Average, convert=Math.round}.

# September 3, 2008 1:21 PM

HeartattacK said:

Changing the value in the textbox...it changes the javascript variables held in memory, right? Does the changes propagate to the server (or even the db)? I wouldn't think so. So, how are we to call our script service when a change is made? Are there any hookable event handlers that we can use that give us something like "newValues" and "oldValues" in javascript?

# September 3, 2008 9:32 PM

Bertrand Le Roy said:

Heartattack: that is of course an excellent question. There are mutation events that you can subscribe to on the JavaScript object and I'm going to cover that in the next post. To be clear, you are still using a plain JavaScript object, but we instrument it automatically when you do the binding so that it exposes change events.

In the next release, we're adding a DataSource control that handles those change notifications automatically and will be able to send them back to the server without requiring that you write any code.

# September 4, 2008 1:00 PM

Mike Tavares said:

@Bertrand:  That being said then, what exactly is the difference between using this new composite script combining versus the toolkitscriptmanager?

# September 4, 2008 4:07 PM

Bertrand Le Roy said:

@Mike: the toolkit manager can only combine resources that have been marked as combinable (which excludes MicrosoftAjax.js) and the combination is fully automatic, which in some cases results in worse performance across the site.

# September 4, 2008 5:20 PM

greystone227 said:

I absolutely loved Braid.

1. I found the visuals to be absolutely beautiful, and the music just made the experience outstanding. I understand this is very much an opinion, though.

2. Maybe I don't play enough platformers, but I didn't notice anything about the jump. Felt fine to me. Personal preference again, though.

3. I really liked the story, but it was kind of disjointed. If you listen to one of Blow's interviews though, he has a good explanation for it - since the game can be played in pretty much any order after a certain point, you have to have a story that can do the same.

But I must say, I have to completely disagree with your comment about how the story doesn't blend with the gameplay (and I find your example of a good game story to be quite funny - Portal was awesome and funny, but it didn't really have much of a story man, haha - I mean, the secret rooms with the "the cake is a lie" slogan and companion cube posters were cute and hilarious, but, you know, not really a good story). The gameplay and all of the ideas it presents are extremely symbolic of the story. I find that this is especially the case in World 2, where it is easy to see the connection. It just blends right into what you're doing, especially if you're willing to look further into it and not just breeze through the snippets (and that sounds really stuck-up and stuff, but really I'm just trying to say that this is more than you're typical video game story).

4. If you're just going off the trial to judge the difficulty curve, then yes, I would completely agree with you. The trial definitely jumps around, but only because the developer is trying to show you all the different gameplay elements - and to do that, you have  to skip around a bit. The actual game is a little different. You also have to keep in mind that each world really has it's own difficulty curve. You can't judge the whole game on one scale, because once again, you can play it in any order really. Not to mention each of the world's time mechanics are so different that saying which one is harder to master depends on the person playing.

5. It's easily worth $15. I mean, it probably took me 3 hours or so (maybe 4) to beat all of the puzzles in the game. I also beat it a second time which took me maybe another hour. It's a quarter of the price of an average game. Multiply 3 by 4 and you get 12 hours, so you're getting your average amount of gameplay for your money's worth. Not to mention the fact that Braid is really an experience - an experience that's easily worth $15.

# September 5, 2008 10:59 PM

Bertrand Le Roy said:

@greystone: see, that's the catch22... The demo may give a bad idea of the game but it was such a bad impression that I'm not going to risk paying for the whole game and still not like it (which is quite likely). So I might be passing on a gem but I'm not going to buy every game that has a bad demo because the full game might be better.

I can't let the Portal thing unanswered though. There is very little text in Portal and there might not be a lot of story, but that's not the point. The point is that the game is telling a (short) story in a very subtle way. This is not about "the cake is a lie". You seem to be confusing what's written in English with the story. Case in point, in Portal, <spoiler>you start the game believing that you're just going to be part of a fun experiment and as the game advances, you understand that something actually went horribly wrong and that Glados took over the facility and probably killed everyone.</spoiler> Nothing groundbreaking in the story itself but again that's not the point. The point is that video games are a relatively young art form and have to find their own way of telling stories. There can be a story in a painting or in a symphony, but it's not written in English. In games, the story is best told not in English but through subtle hints. Bioshock also did that well but was being more explicit than Portal. I did choose the Portal example very carefully because it was the exact example that I consider shows how storytelling in games can be done best.

# September 7, 2008 1:11 AM

John Lewicki said:

Looking good!  But!

I can't figure out the expression syntax to use of if my data item is an an array, as opposed to an object with named fields.  In other words, instead of an expression like {{Name}} I would like to use {{[0]}}.

It looks like the template compiler generates code that evaluates the expression inside of a 'with' block, which seems to break the array indexing inside the expression.  So I am currently resorting to a hack: {{ $dataItem[0] }}.

Is there/will there be an easier way to do this?

# September 8, 2008 4:26 PM

Bertrand Le Roy said:

@John: that is actually pretty uncommon, which is why we're not providing a specific syntax for that. {{ $dataItem[0] }} is actually not a hack at all but the supported way of doing that.

# September 8, 2008 4:40 PM

iron9light said:

Make it a string and use your own converter (or parser).

# September 9, 2008 2:46 AM

Bertrand Le Roy said:

@iron9light: that's assuming you know what is supposed to be dates in the data structure. That is sometimes true but not always.

# September 9, 2008 2:11 PM

Dan said:

I'm going to do the same thing soon, been thinking about it for a while. The plain white look simply doesn't give the guitar any personality...

# September 10, 2008 6:49 AM

Matt Brooks said:

Hi Bertrand,

I only just got round to digesting these two posts on client templates. I think it is a necessary feature to aid client development, which when doing anything non-trivial can quickly become overly complex. I'm not sure I'm 100% happy with the template syntax but I can't think of any improvements and it sounds like you guys have debated it a lot! The actual binding syntax looks intuitive.

I've recently completed a project that required a certain degree of client side functionality that we don't get a great deal of help with when using ASP.NET. Among that functionality was a 'right-click-context-menu' for manipulating one-or-more rows of tabular data. I used a jQuery plugin to get the context menu up and running quickly. The menu options called back to an ASP.NET web service (script service?).

The approach worked really well for us. However, if data was updated on the server and the change needed to be reflected on the UI then we were forced to round-trip the current page, to keep view state updated.

I would be interested to know how the client templates play with view state? If I was to guess I would say that with the Web Forms model there will always be the problem of keeping view state in-sync.

Perhaps I am thinking about this all wrong though. I guess a more 'Web 2.0' approach would be to render a 'web form' (aka ASP.NET page) and leverage the power of client script to render out portions of the page and communicate changes back to the server. Therefore the page state is stored on the client and NOT on the server, hence removing the need for view state (?).

I look forward to your comments.

# September 10, 2008 5:34 PM

fb said:

If you like factcheck.org you will absolutely love

http://vote-smart.org

I have yet to find a better site to find out what a politician really is about, not base on his latest sound bytes, but on his voting record, and ratings from interest groups.

# September 11, 2008 10:34 AM

Darren Kopp said:

The *best* place to get facts is fox news................................. LOL! i'm sorry, i couldn't help myself with that joke.

factcheck.org rocks.

# September 11, 2008 10:46 AM

Gabe said:

FSM = Flying Spaghetti Monster?

# September 11, 2008 2:09 PM

Bertrand Le Roy said:

@Gabe: yes, I was touched by His Noodly Appendage.

# September 11, 2008 2:39 PM

Steve said:

I pick on their records, not on the personality cult.  Reality is that most people in the US ignore the media and go by sound judgement.

I prefer to keep my money in my own wallet regardless of the websites I visit  ;)

# September 11, 2008 6:35 PM

Alec said:

Im mad my vista got the blue screen from safari fuck safari

# September 11, 2008 7:50 PM

Charlie said:

One of the saddest things is that young people go to The Daily Show not recognizing that the slanted parody they dish out is hardly news.

# September 12, 2008 9:18 AM

Bertrand Le Roy said:

@Charlie: I think you're wrong about two things. First, "young people" are not necessarily stupid and might actually understand when Jon Stewart explicitly says his show is "fake news". And second, the major news outlets today are so trapped by the laziness and sensationalism biases that the Daily Show is often and paradixically a much better source of information than any of them.

# September 12, 2008 2:00 PM

Speednet said:

I think you need to get your own facts checked.  The name "Factcheck.org" is a lie in itself, because it is a completely slanted liberal site that supports of the hard-left Barack Obama.

I will not attempt to set any points straight here, and frankly doubt that this comment will even be published on your blog, because the liberal hatred is so strong right now, and that hatred drives away any sense of logic and common sense.

It's amazing to me that people who are obviously so bright when it comes to technology are so completely without a clue when it comes to real-world events.

# September 12, 2008 9:59 PM

Charlie said:

Bertrand,

I never said they are stupid; I would say that they are ill-informed.  I have two sons in their 20's - both them tell me about how many of the people they know who think they are getting a balanced view of the news from Jon Stewart and make no effort to check multiple sources and and weigh the information in an attempt to filter out bias.  It's not an easy task and few people make the effort.

# September 14, 2008 1:39 PM

Bertrand Le Roy said:

@Speednet: right, thanks for the good laugh :) I'm still debating whether your comment falls under Poe's Law. Just for the sake of the argument, please point me to one thing that was factually incorrect on that site (and that wasn't duly corrected on the site itself). Please also provide an example of a blatant lie from Obama that wasn't exposed by factcheck. I'd also like to know what you'd consider to be a reliable and unbiased source of information. Factcheck seems to be good enough for the Republicans who use them in their own campaign spots (by grossly manipulating their quotes).

Oh, and thank so much for thinking I'm bright when it comes to technology. I think you're being way too kind.

@Charlie: thanks for the clarification.

# September 15, 2008 1:32 PM

Abhijit said:

Nice to know that IE 8 is catching up with Firefox. Firefox has had this search feature forever!

# September 16, 2008 1:10 AM

Rasmus H said:

Looks very cool.

About the conditional/comment issue, what about doing something in between what you are doing now and what Mike suggests, by putting the statement in an element attribute:

<div id="peopleIKnow" class="sys-template">

   <fieldset>

       <legend>{{ FirstName }} {{ LastName }}</legend>

<span sys:script="if (Photo) {" />

       <img sys:src="{{ 'Images/' + Photo }}"

            alt="{{ FirstName + ' ' + LastName }}" />

       <span sys:script="}" />

   </fieldset>

</div>

# September 16, 2008 10:39 AM

Bertrand Le Roy said:

@Rasmus: it's interesting but it's quite verbose, not very readable and doesn't allow for multiple lines of code. Thanks for the suggestion.

# September 16, 2008 12:39 PM

Greg L said:

From my perspective, it seems factcheck.org is trying to do the right thing.  It also seems to me that those 'fake news' shows are a catalyst for so many of those mud-slinging ads you speak of.

Lets be honest now, a much better source of information?  I enjoy the shows but can see them for what they are..(entertainment)..surely you can as well?

I've got a buddy that writes for Colbert.  He understands what they are doing quite well. (will submit credentials upon request)

# September 17, 2008 9:15 AM

Elijah Manor said:

You lost track of your train of thought on the question of, "How much attention do you have to pay attention to new browsers come out considering performance.".

Other than that you did a great job!

# September 17, 2008 11:27 AM

Bertrand Le Roy said:

@Greg: of course I can, let me explain. Today I don't consider TV news to be a source of information at all because I just can't watch them without feeling nauseous. I get my news from French radio stations, newspaper web sites, etc. But on more than one occasion, I learned about something on the Daily Show and then looked it up elsewhere. In that sense, it was a good source of information even if it was presented as a joke.

# September 17, 2008 12:04 PM

Bertrand Le Roy said:

@Elijah: not it. It's an actual technically false statement.

# September 17, 2008 12:06 PM

M said:

Just delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Media Device Manager\Plugins\SP tree in the registry, that makes the error go away!

# September 17, 2008 4:03 PM

Bertrand Le Roy said:

@M: Vista doesn't let me do this. Thanks for the idea though.

# September 17, 2008 6:28 PM

M said:

Ah, Vista, I see what you mean!

I had to take ownership and give myself full permissions a few times on the SP tree and then Vista finally let me delete them.  But I can't test that the registry entry removal actually works with making the message go away with Vista, as the only old WM device is not here right now :<

# September 18, 2008 10:33 AM

Showjumper said:

System.TypeLoadException: Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

# September 18, 2008 10:59 AM

Showjumper said:

When will the toolkit specifically the toolkitscriptmanager be updated so that the following error will not occur? My remote server does not have sp1 on it and the host is still testing sp1 before doing any final installs so installation of sp1 is not an option yet.

System.TypeLoadException: Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

# September 18, 2008 11:03 AM

Bertrand Le Roy said:

@M: even after that, it doesn't work for me. Maybe I need a reboot...

# September 18, 2008 12:03 PM

Bertrand Le Roy said:

@Showjumper: the latest release is only compiled against 3.5 SP1 and we're not planning on releasing a 3.5 version. If you need a non-SP1 version, you'll have to download a previous version or recompile against 3.5. Sorry about that.

# September 18, 2008 12:05 PM

Dean said:

Bertrand,

I was (am) another one of the frustrated users who felt abandoned when the Ajax Control Toolkit was getting left behind by other ajax libraries.  In 2007 when we were choosing which ajax package to go with, we were confident that MS's offering was the best choice -- after all, there was so much excitement and so many great, working examples.  However, this past year (2008) has shaken our confidence a bit.  Only Saltine crackes go stale quicker than the Ajax Control Toolkit did!  C'mon! The ACT sample page still refers to February's 20229 build!  To be fair though, our website is running well -- albeit with 2007 ajax technology.

The word I would choose to summarise the MS Ajax effort this year would be "disappointing", but the word I choose to describe the effort from this point forward is "hopeful."

I wish you the best of luck leading the ACT team and resurrecting the effort.  Your posts on the asp.net forums and here are what got us up and running in 2007 in the first place! Thanks for that.  I'm sure we'll see even greater things to come.

On a side note, the ajax preview packages didn't cut it for us.  We needed components that were fully-released, so our system is currently running a mix of ACT and YUI.  If YUI beats you to the punch with a fully released v3 in 2009, we may have to switch completely since maintaining an additional library just for the update panel (yeah, i know use it sparingly) doesn't make much sense.  Hopefully (there's that word again) you'll give us a reason to do it the other way around.

# September 18, 2008 7:12 PM

celik said:

Thanks, very helpful

# September 18, 2008 8:09 PM

Noel Akins said:

I just wanted to add that since you allowed for special characters, I assume that you allowed for space as well. I didn't have but three different directories of images to use. The other two directories would display an the thumbnail collection without any problem. But, the filenames in these two directories did not contain any spaces in the filename. The file name in the error had spaces in it, which lead me to assume that spaces was the problem. But I don't know enough about the code to understand what is going on. This particular file mentioned in the error is the last file in the directory. I regret jumping to a conclusion based on my limited knowledge, if indeed my first assumption is incorrect.

Thank you

# September 21, 2008 8:06 PM

Bertrand Le Roy said:

@noel: spaces shouldn't be a problem. If you can send me a simple repro at bleroy at microsoft I'll have a look.

# September 22, 2008 3:57 PM

James said:

Is there a way to add doc comments to global variables that are not part of a class? For example:

/// <field name="MyVar" type="String" mayBeNull="false">

/// This is my global variable.

/// </field>

var MyVar = "my global value";

# September 22, 2008 4:23 PM

James said:

Also, is there a way to emulate an enumeration using doc comments?  For example:

ConnectionState = function()

{

  /// <summary>An enumeration of connection states</summary>

  /// <field name="Open" type="Number" integer="true" mayBeNull="false">

  /// The connection is open.

  /// </field>

  /// <field name="Closed" type="Number" integer="true" mayBeNull="false">

  /// The connection is closed.

  /// </field>

}

The code above doesn't work (e.g. no intellisense), but is there another variation that could make it work?  I would like to be able to type "ConnectionState." and get a list of all the enumeration values, with intellisense for each value.

# September 22, 2008 4:28 PM

Bertrand Le Roy said:

@James: there is a way to document something in the global namespace but it's not going to be picked up by documentation tools like Sandcastle or for that matter even by Visual Studio IntelliSense. Global variables are not recommended anyway.

If you use the enumeration pattern in Microsoft Ajax, your enumerations should get picked up by IntelliSense.

# September 23, 2008 1:41 AM

Andy said:

I love FactCheck.org and similar sites.  And I am a big fan of The Daily Show and Colbert too.

BUT, if you really want a good source of news, turn off the cable networks and tune your radio to NPR, National Public Radio.  On NPR, you don't get quick sound bites.  You get long, in depth stories that get down to the details.  No flashy intros, sound effects and graphics.  Just good old fashioned journalism - the way it is supposed to be.

# September 23, 2008 7:55 AM

Tester said:

Not sure if I missed it, but having the template embedded with the initial html makes it hard to change templates at runtime? also caching templates in the client would become impossible?

I think it should be possible to load templates seperatly from the initial html to allow for advanced caching and runtime template change features.

# September 26, 2008 5:17 AM

John said:

Hi there

Thank you for your article. People say they have been helped by this article But i seem to have error

'Sys is undefined '

I have my MicrosftAjaxLibrary folder in the same higherarchy and my script manager is as follows

<asp:ScriptManager ID="smg" runat="server">

<Scripts>

<asp:ScriptReference Name="MicrosoftAjax.js" ScriptMode="Auto" Path="MicrosoftAjaxLibrary/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js" />

 </Scripts>

</asp:ScriptManager>

Could you please guide where am I wrong? I would highly appreciate it.

I need to plug an Ajax application in to another portal whcih does not allow me to run Ajax. Cross domain accessdenied error hence i am trying to find work around

My email is johnrenik@yahoo.com

# September 26, 2008 11:07 AM

Bertrand Le Roy said:

@Tester: not at all. You can point the dataView's template property to any element in the DOM (so the template is not necessarily inside the dataview element) so it's easy to create an element, set its innerHTML and point to that.

Why would caching templates be impossible? It's perfectly possible to load templates separately (although wé're not providing that feature at the moment out of the box) and set it at runtime.

# September 26, 2008 4:58 PM

Bertrand Le Roy said:

@John: check with Firebug or a similar network monitoring tool that the script is getting downloaded correctly. It it is, then you probably introduced a syntax error into the file, preventing it from parsing correctly.

# September 26, 2008 5:03 PM

redsquare said:

Bertrand, great news about the jQuery adoption. I knew it made sense a few months ago when you argued otherwise. Glad you can be swayed by the community.

# September 28, 2008 3:37 PM

HeartattacK said:

The "Evil Empire" is turning good? Cool :D

# September 29, 2008 12:38 AM

Dave Ward said:

Given my feedback on the ASP.NET 4.0 roadmap, I'm sure I don't have to tell you how happy this makes me.

Thank you!  Great work, guys.

# September 29, 2008 1:20 AM

redsquare said:

Great stuff, hopefully we can look forward to some great plugins from you guys now.

# September 29, 2008 1:53 AM

MisterFantastic said:

Hi ,

This is cool. Really its going to help a lot with client side programming which is going to be more futristic.

Thanks for the post

# September 29, 2008 2:16 AM

Rick Strahl said:

Betrand - This is really exciting - I'm really glad to see that you're opting to use jQuery instead of building your own replacement to provide similar functionality.

My hope is that some of the new features in 4.0 which sound exciting can be decoupled from the older Ajax libs which should provide a good way back into the MS Ajax stacks for some who've uhm left the fold. :-}

# September 29, 2008 3:27 AM

paul said:

This is great news - I've been using Jquery alongside asp.net for a good while now, and it'll be great to have inbuilt intellisense support in VWD!

Is this the last nail in the coffin for the AJAX TOOLKIT?

# September 29, 2008 4:06 AM

Yasser Awad-Allah said:

jQuery is a rich javascript library , i've use it in my latest project which i developed using asp.net ,.. it is easy to integrate with your code and easy to understand ..

# September 29, 2008 4:12 AM

mareek said:

What will happen to the parts of current MS librairies that overlap with jQuery such as the ajax control toolkit animation framework ?

# September 29, 2008 5:41 AM

cyrilcs said:

What an excellent news !

When I saw the first bits of ASP.net futures, I say to myself that ASP.net Ajax is trying to copy jquery, it was yet a good things for JavaScript developper using ASP.net.

But 3 questions :

- Does that mean that all Ms Ajax project will require jquery ? Will it be possible to use UdpatePanel without jquery ? If so, some function won't be duplicated ?

I hope all Ms Ajax project require jquery !

- How would you distribute jquery ? Will it be a ressource on an assembly ? or just a file added by a template project ?

- When ? When can we see the new ASP.net Ajax library coupled with jquery ? when does it will be RTM ? with ASP.net 4 ?

# September 29, 2008 6:47 AM

Hassan said:

Thanks a lot! Jquery is the most outstanding javascript framework i have ever used. This is really really exciting. Jquery rocks!

# September 29, 2008 6:54 AM

Chris said:

What's with all this listening and being responsive to developers?  What have you done with the real Microsoft?  Is it tied up in the broom closet?  Kidding aside, this may go down as one of the greatest decisions in ASP.NET history.  Thanks, Thanks, Thanks... Very nice work.

# September 29, 2008 7:52 AM

Michael Babcock said:

It's amazing to me that there are so many cultists/fanbois that never look outside of the m$ world....as the other person said, Mozilla FireFox has had this for a long time now.  Likewise, FF had tabbed browsing long before IE too.  So if you'd like these new great things, you could switch to FF or just stay with IE and get them years later.  <eg>

# September 29, 2008 11:13 AM

Bertrand Le Roy said:

@Michael: hence the "finally" in the post. <g>. Obviously, *you* are not a fanboy ;)

# September 29, 2008 1:55 PM

joelvarty said:

I agree.  Braid is not a contender for my limited gaming time.  

Bring on an update for Portal!

# September 29, 2008 2:04 PM

Bertrand Le Roy said:

@Rick: working on that :)

@Paul: not at all. Actually, the Toolkit is getting more resources than ever from Microsoft, as well as new controls (got a new submission yesterday actually).

@mareek: that remains to be decided but we might want to avoid taking the full jQuery dependancy for all of the existing toolkit. We're not going to prevent contributors from using it starting now, but we need to keep the existing animation in there for back compat. Still figuring out the details.

@cyrilcs: no, MS Ajax will not take a dependancy on jQuery, and UpdatePanel will be usable without jQuery. What we'll do is provide some simple integration points such as what I describe in this post.

For the moment we'll distribute it as a file in the template projects. Resource-based is a possibility but considering the rate of releases from jQuery (about 10 releases a year) it might make it more difficult for people to upgrade. Components that want to take a dependency may need resources but the versioning might be tricky. We'll see.

We're shooting for 4.0 but jQuery already works great with 3.5 SP1 and even earlier versions.

@Chris: hush, please lower your voice, they might hear you.

# September 29, 2008 2:09 PM

DSS said:

You should've done that originally and cancelled the MS Ajax libraries that are not as easy as the rest of the frameworks. Personally, it's very hard to understand why I would bother with the ms ajax documentation when it does not even have anything similar to the lightbox gallery or other cool controls. They only thing it does is respond to the postback actions with a bit of HTML returned from the server. That's the only thing it's used for. I haven't seen anything more than the ajax toolkit shipped as a separate add-on. No independent work from the community. The most annoying part is that you have to compile the ms ajax controls before you can use them and read a lot of stuff how to integrate them into a .dll.

# September 29, 2008 3:03 PM

Scott Radcliff said:

First off. "Tales from the Evil Empire" is an awesome title!

I can't comment much on the addition of jquery,I am just now diving into ASP.NET. But I can only see good things. Can't wait to see what kinds of apps are created with the new addition to the framework.

# September 29, 2008 7:01 PM

Scott said:

Have you decided yet how you'll handle updates to the jQuery library? Will they eventually be updated via hotfixes or service packs? I worry that thousands of ASP.NET web projects will be frozen at jQuery 1.2.6. ;)

# September 29, 2008 7:04 PM

Saif Khan said:

Dude,

This is really excellent news. jQuery is indeed a awesome library. Where do we find more documentation on this integration?

Thanks

# September 29, 2008 11:14 PM

random0xff said:

Yep, love it. Good choice (of framework and strategic).

# September 30, 2008 5:02 AM

icesnow said:

it's so excellent,jquery is a cool.i hope using in asp.net is firendly.

# September 30, 2008 6:08 AM

Tony Basallo said:

This is great. This is smart - with so many of the responses on the Roadmap thread on the ASP.NET forums referring to what jQuery does and how it should be duplicated in MS AJAX, this makes too much sense!

These are decisions usually made by start-up types, nimble, quicky adapting makin it happen types - not multi-billion dollar conglomerates that hold 20+ people staff meetings over what copy paper to purchase! (I've lived in this environment <shivering>.

This is solid demonstration (amongst many other other initiatives) that MS wants to lead the market with its developers in tow.

With these type of decisions being made, I have no doubt that MS can be a leader and us developers benefiting along with them!

# September 30, 2008 9:02 AM

Adam.Kahtava said:

Thank-you!!! This calls for a celebration, where can I send the beer?

# September 30, 2008 5:34 PM

Bertrand Le Roy said:

@Adam: I'll be at PDC. Will you?

# September 30, 2008 7:07 PM

Joe Pretontius said:

It's a sad, sad day when Microsoft decides to abandon its superior development efforts in favor of shipping trash from the open source community with Visual Studio.

Not one to have bashed Microsoft in the past simply for the sake of doing so and also one experienced enough to not be easily impressed with open source trinkets, I must differ with the majority of the other submitted comments - Microsoft's AJAX functionality was far more impressive than that of lukewarm efforts like jQuery and a much more sound foundation upon which to build upon.

I look forward to the day Microsoft decides to stop minimizing its distractions and once again begins kicking ass, rather than wasting time with the meanderings of hobbyists...

# September 30, 2008 8:46 PM

Asheesh Soni said:

Best server side framework (asp.net) now ships with the best client side library (jQuery) to create the ultimate platform for web development.

Thanks Guys!

You Rock!

# September 30, 2008 10:14 PM

Bertrand Le Roy said:

@Joe: we're not abandoning anything.

# October 1, 2008 12:53 AM

jgd12345 said:

Joe i think you're missing the point.  The whole asp.net ajax framework will still be in place but they will utilize jquery instead of compete against it.  I see asp.net ajax as the framework where as jquery is more about dom manipulation and making it easier for us to create our extenders.

# October 1, 2008 4:30 AM

Christoph said:

Hi Bertrand,

Great Work ! (i have been using my custom scripts.ashx in several projects, but couldnt include the Control Toolkit js).

Maybe you could add a minification to the script manager ? :-)

# October 1, 2008 6:56 AM

Neil Stevens said:

Hi,

Great blog, i just wanted to know if there is a way to add comments in javascript like we can in C#, simply by typing /// and then the ide would insert the code comment like C# does.

Is something like this possible?

# October 1, 2008 11:11 AM

Bertrand Le Roy said:

@Christoph: thanks. minification should really be done as part of the build process and not at runtime. It simply is too heavy.

# October 2, 2008 2:27 AM

Joe Pretontius said:

No, sorry.  I'm not missing the point, but I do think it funny that you believe anyone need 'compete' against open source.  My customers want nothing to do with open source.  Period.  Microsoft has more developers than the population of many mid-Western towns.  That they couldn't blow the doors off of jQuery instead of taking the easy way out, rolling over and playing dead?  Please...

# October 2, 2008 12:41 PM

Bertrand Le Roy said:

@Joe: how this is the "easy way out" eludes me completely :)

But I'd be interested in discussing with you the business needs of your customers and whether we could either find other technical ways of achieving your requirements or explain how what really counts here is Microsoft support. You can contact me at bleroy at Microsoft.

# October 2, 2008 1:45 PM

Anastasius said:

Thanks for the IE hack info!

But it doesn't work on the server, when current page is being refreshed. Strangely, it works locally.

I mean - I'm creating 0,1,2,3,4 hashes. Than refresh the page - and then when I press back, it doesn't gets me back to hash number 3.

And this is right only for the remote server, when I execure your files locally, it's all ok. :(

Are there any workarounds?

# October 3, 2008 8:40 AM

Anastasius said:

Have to add.... It doesn't work on remote server, when you use this technique in .php file. With .htm it does work.

# October 3, 2008 9:02 AM

Oren Ben-Kiki said:

When pondering how extensively to use client templates, a big issue is search engine optimization (SEO). It seems to me that any data placed in the page using {{...}} will be invisible to search engines. This seems like a major restriction of the approach, limiting it to only minor parts of the page - basically anything that is very dynamic such as today's date, the current user name and so on.

I don't see any easy way around this problem... A pity. I was looking forward to having a lovely architecture where the DAL and business logic are all buried under a set of JSON data services and all the view layer is client-template HTML.

Or am I missing something here?

# October 4, 2008 1:51 PM

Bertrand Le Roy said:

@Oren: what you're saying applies not only to client templates but simply to all Ajax applications. For all resources that must be optimized for searching, all the info must be available from a simple GET request in the first place, which means that it has to be formatted on the server. Just don't render on the client what must be available on the GET request. That still leaves a lot of room for Ajax to improve the usability of applications.

# October 5, 2008 3:19 AM

Oren Ben-Kiki said:

I agree, the search engine problem holds for all Ajax code. It is just that client templates are very tempting for MVC architecture - move the V layer into the browser where it belongs. Alas, the SEO problem puts a strong limit on this.

A common workaround used by Ajax applications is to place the data in some invisible div element for the search engine. This means sending the same data twice into the page, or using DOM operations to access the data from the invisible div.

The latter is an interesting option, but it has two problems - first, creating data services that send the data as search-engine-friendly HTML is not automatic, while sending JSON/XML is, and second extracting the data from the DOM is awkward and inefficient compared to accessing JSON data.

Of course, one could envision some extension to ADO and client templates that would address both problems (except the efficiency issue perhaps, but browsers JS/DOM implementations are getting faster...). But I guess this is such a twisted solution that making it mainstream is not in the cards :-)

# October 5, 2008 4:28 AM

Derek said:

Hi Bertrand,

I've just read these posts and your MSDN magazine article on AJAX 4.0 and i'd like to congratulate you on your innovative approach to client side templating, looking forward to rolling it out.

Also i've noticed you weathering a fair share of negativity in various forums lately and i've got to say i'm pretty impressed with how you've kept it professional, kudos. Some of the SharePoint boys could take a few pointers from you - sorry, couldn't help myself :)

# October 5, 2008 5:46 PM

Bertrand Le Roy said:

@Oren: you make really good points here. We actually have a couple of prototypes along those lines. In particular, we have a server-side DataSource control that renders its data under the form of HTML tables, with a client-side parser that transforms that into JS data objects that can then be exploited client-side. You've got to be careful about how you hide that rendering of the data though as search engines tend to not index something hidden and can even consider that to be spam.

We actually alluded to that kind of approach in our roadmap document (publicly available from CodePlex). This kind of server-side integration is currently on the back burner though.

@Derek: thanks for the kind words.

# October 6, 2008 12:38 AM

Mike Carillon said:

Great article! I'm looking forward to using this. When will the next version be out? Thanks.

# October 6, 2008 8:31 AM

XTIAN170174 said:

I just searched for C00D118E xdaii & arrived here from the results, I get the error in WMPlayer all the time & web help turns nothing up that puts paid to the message.....  

I'd really like to see all media file formats compatible on every type of device which in turn syncs any other device without incompatibility, exclusivity is meaningless unless there's hardware & programming somewhere that really does access all areas - and in which case, that's all the end-user wants.

# October 6, 2008 11:27 AM

Andy said:

Nice article , but why is the screendumps taken with firefox ? :)

# October 7, 2008 6:17 AM

fluxtah said:

Does anybody know how ScriptManager gets intellisense working for MicrosoftAjax.js?

I have a control called SnippetManager that simply registers a javascript file and nothing much else, I wanted to make it easy for someone to include the script by drag drop just like ScriptManager but it does not exhibit the intellisense enabling magic.

I might have to just stick 'register SnippetManager.js with ScriptManager' in the instructions and forget wrapping it up in a control.

# October 7, 2008 6:34 AM

martillo said:

Betrand, your article is exceptionally well-written and well-organized. Thank you!

# October 7, 2008 10:32 AM

Bertrand Le Roy said:

@fluxtah: yes, it should check if there is a script manager on the page and register it with it if there is one. There are lots of benefits in doing so. For example, your users will be able to relocate the script and combine it. But that won't be enough to give IntelliSense, the user will have to put the reference explicitly in ScriptManager in order to get IntelliSense in the page.

Visual Studio special-cases ScriptManager and queries a special API when it's there to get the list of script references. One thing you might be able to do is derive from ScriptManager and expose your script as a static script reference, as if it had been added by the user.

# October 7, 2008 1:30 PM

Bertrand Le Roy said:

@Mike: next version is going to be released this month.

@Andy: to make it very clear that everything we do in Microsoft Ajax is cross-browser. There are still people who believe that Microsoft Ajax only works on IE. This is not the case, we support Firefox, Safari, Opera and IE today.

@Martillo: thanks.

# October 7, 2008 1:33 PM

martillo said:

PS - in the code download, line 96 in 2_UpdatePanel.aspx does not compile.

To get it to compile I changed it from:

from p in AdventureWorksContext.Products [...]

to

using ( var AdventureWorksContext = new AdventureWorksDataContext() )

{[...]}

# October 7, 2008 1:49 PM

Fluxtah said:

Thanks for the answer Bertrand, I hope Visual Studio will support intellisense for ScriptControl's without having to additionally reference them with ScriptManager in the future.

# October 7, 2008 4:04 PM

nathanaeljones said:

You might be interested in this image resizing module, then.

It integrates with the pipeline, so you can just slap a query string onto any image URL to get it resized or converted:

image.jpg?thumbnail=jpg&maxwidth=30

It also permanently caches resized versions to disk... otherwise you run into serious scalability issues. With disk caching it's practical to use this on high-load production servers.

Take a look:

nathanaeljones.com/.../asp-net-image-resizer

# October 9, 2008 4:49 PM

Bertrand Le Roy said:

@Nathanael: well, yes, I also wrote this, which explains how to do the same thing:

weblogs.asp.net/.../generating-thumbnails-in-asp-net-dotnetslackers.aspx

# October 9, 2008 5:08 PM

nathanaeljones said:

Cool! I recently read the article, but hadn't realized you wrote it.

I usually have my photos in the same directory with the .aspx file that contain them, so putting everything in a photos folder would be a severe disadvantage... I like relative paths :).

MapPath completely ignores the security and access settings in the URL authorization portion of web.config. Since that's the easiest way to protect static files, it's nice to support it. Integrating as HttpHandler makes that compatibility automatic.

I also use a *wide* variety of thumbnail sizes, so having them all the same wouldn't benefit me much. I often need several versions of the same file, so the caching system needs to be that flexible also.

I also implemented automatic cache management to prevent denial of service attacks... you can read my comment at nathanaeljones.com/.../asp-net-image-resizer

# October 9, 2008 5:57 PM

atef ishak said:

this message out this file is not a personal folder and cant open the pst file

# October 11, 2008 7:42 AM

Jonas Follesø said:

Great article! I love the new Client Templates in ASP.NET AJAX 4.0.

I recently did a blog post about how you can use the client templates from Silverlight 2 to generate HTML on the client to support printing. The out-of-box printing experience in Silverlight 2 is really poor/useless, so people have to come up with workarounds.

One option is to use pop-ups and server side generation of HTML... But I tried to solve this using client templates to generate HTML, and then use CSS print style sheets to hide the Silverlight control and show the dynamically generated HTML.

Works great, as it's dead simple to serialize Silverlight 2 objects to JSON and invoke JavaScript functions :)

The post is up at jonas.follesoe.no/PrintingInSilverlight2UsingCSSAndASPNETAJAX4.aspx

Cheers,

Jonas

# October 12, 2008 10:37 PM

gramic said:

I see that this usage is really nice. What about binding visible template without creating a new instance of it. For example 3 inputs for FirstName, LastName and Age with Save Button. Is it possible to use {binding } with the twoWay in this case and then eventually save the result?

# October 13, 2008 9:42 AM

Jason said:

Same question as Mike above.  I can find the repair tool, but the browse option doesn't get me to the file.  I can find my user file, but there is no AppData folder to browse.

# October 13, 2008 4:57 PM

Jason said:

Nevermind.  I'm an idiot.  

# October 13, 2008 5:01 PM

Bertrand Le Roy said:

@gramic: You can create the Binding class from code and achieve that result. I'll also ask Dave whether that can be done declaratively by activating that part of the DOM. I'm not sure. Stay tuned.

# October 13, 2008 5:43 PM

Drew Marsh said:

So are you guys planning on adding the support to the new engine so that the processing of the markup isn't limited to templates only? Ya know, how the "old" XMLScript used to process markup for even static content?

Would seem like a very strange decision NOT to since it would force this half JS/half markup world... or force everyone to put a dataview around their whole page to make it a template.

Curious,

Drew

# October 14, 2008 4:42 PM

Bertrand Le Roy said:

@Drew: no, that would kill perf. Putting a dataview around your whole page would be just as stupid as putting an update panel around a whole page...

# October 14, 2008 4:46 PM

Ross said:

BTW.  There have been flash and javascript chess playing boards for years.  And far better ones than this.  Chessbase can automatically publish games for replay with a more impressive board than this.

You should comment on the live coverage site, which is a silverlight implementation about 1000 * more interesting :

www.foidoschess.tv/FoidosChess-Demo.aspx

# October 14, 2008 5:47 PM

Derek Morrison said:

Looks pretty cool, but this seems like overkill to me. There are tons of lowly JavaScript chess game players like this littered about.

Here's an example: www.chess.com/.../view.html

# October 14, 2008 6:00 PM

Drew Marsh said:

Totally! So what's the solution for the simple scenario that I want to have an <input type=text/> in my page and an <input type=submit> and want to hook up the TextBox and Button controls to those to have some behavior? In XMLScript I would have done:

<script language="text/xml-script">

<page>

 <components>

  <textbox id="myTextBox" />

  <button id="myButton" click="doSomething" />

 </components>

</page>

</script>

Now I would expect to just be able to do:

<input type="text" sys:attach="textbox" />

<input type="submit" sys:attach="button" button:click="doSomething" />

Where "doSomething" is just a global JS method in my page that does some processing in response to the click event like grab the textbox and check to make sure it has a valid value first.

AFAIK this scenario just isn't possible anymore, so unless you're doing templating the markup extensions are completely useless, right? Therefore you're forced to write JavaScript to $create the static controls on your page.

Thanks,

Drew

P.S. Admittedly I haven't had time to tinker enough with the new bits to know for sure, so feel free to smack me and point me to a sample if it is indeed possible. ;)

# October 14, 2008 7:04 PM

Mojtaabaa said:

thanks for the article.i am digesting it! ;)

# October 15, 2008 12:43 AM

Martin Bennedik said:

Of course I am aware of the Foidos, Chessbase and other offers. Most of these offers require a dedicated page and/or take up a lot of screen real estate.

The idea of the Silverlight chess board is to provide a chess board with a very small footprint. You can add it to your page or blog with one object tag. It is only 45 kb in size. In that sense I don't think it is overkill.

Mark Crowther, who runs The Week In Chess, has been using it since Silverlight beta 1 for live transmission of many chess events. This live transmission is free, while the Foidos one is pay-only.

In the release version you can also generate notation. The notation isn't part of the Silverlight view port though, it is part of the HTML DOM. In that way you can layout and style the notation any way you want. The idea again is to have very small footprint, not taking over the layout of your site but integrating into it.

I am not saying that the other offers are worse, and I don't really see them as a competition. I am just explaining that the idea is a bit different here.

# October 15, 2008 4:01 AM

gramic said:

Using markup that way is much better then using Sys.Binding class from code. I saw that it is possible to set  sys:activate="*"  at the parent tag of the template.

Even that I thought about a way to data bind without creation of any template compilation but just parse properties.

As in your example: the DOM elements are already created and the data binding markup is in the properties too. Maybe just tracing the DOM properties and do the Data Binding will suffice and will not take the performance away.

# October 15, 2008 6:15 AM

Bertrand Le Roy said:

@gramic: just looking at all attributes on all elements will kill initial performance. The way activate works, it only has to look at one thing on each element: sys:attach. I hope this clarifies.

# October 16, 2008 1:49 AM

Bertrand Le Roy said:

@Drew: I'm certainly not going to smack you but the exact code that is in your comment will work just fine provided you write the button and textbox controls (or re-use the old ones from Futures). The sys:attach attributes will work just anywhere and once it's been parsed the rest of the tag is fully activated. It's a binding on its own that will need to be in a template.

# October 16, 2008 2:31 AM

Hari Menon said:

Thanks a lot for this neat little post. Helped me fix the bug like a charm...

# October 17, 2008 11:52 AM

Drew Marsh said:

Bertrand,

Yeah, a coworker gave it a shot shortly after he saw my comment and we saw that it worked. I deserve a smack for not trying it before asking. :P It's just that it's not shown anywhere in the Road Map being used that way and it's always talked about in the context of templates so I thought maybe we regressed somehow.

Anywho, glad to see it works and looking forward to new info @ the PDC next week!

Cheers,

Drew

# October 19, 2008 3:37 PM

Ross said:

'Of course I am aware of Foidos, Chessbase and other offers'

What are you saying?  You are aware of everything?

And I'm not sure why you would be so 'aware' of Foidos.  It is relatively obscure as far as I know and only popped up for the championship.  

My original point was that as a Silverlight developer,  the TWIC offering wasn't doing anything that hasn't been done before in other 'languages' whereas the Foidos demo shows something that is somewhat ground breaking.

I don't have anything against TWIC.  I am a keen chess player, and have been following it since about 1996.

# October 19, 2008 8:44 PM

Bertrand Le Roy said:

@Ross: wow! why all the aggressivity? Martin didn't say "all other offers", he said "other offers", which means that he knows of other offers, nothing more, nothing less. I don't see how you could have extrapolated that to him saying he is "aware of everything". Martin follows closely what happens in the world of Chess, so it's really not surprising that he would know about Foidos.

Anyway, nobody said there was anything groundbreaking in this app, but it's a fine example of what you can do with Silverlight in relatively little time. As a matter of facts, most good applications are not groundbreaking in any way but just get things done.

# October 20, 2008 12:09 AM

Ravi said:

I am not able to find scanpst.exe  

can you please help me

# October 20, 2008 2:08 AM

Ross said:

Hey. Sorry.  No offense intended.  Its all said with a smile.  And I think from a technical point of view the application sounds good (now that we have elicited some information in that regard).

I just reacted in the way I would to any friend who in my opinion had said something illogical.  You just didn't hear me laughing at the same time.

But if you want to get all pedantic about it :

a) Your original post stated "It’s really cool to visualize a whole game like this:", which is what I was commenting about.  I wasn't commenting on the technical merits of the particular implementation.

b) Following on from a), Martin stepped in and started commenting on our remarks as though they were directed at him.  I had to check whose blog I was reading (seriously), as the wording read like we were continuing a conversation.  

c) And following on from b), you are now continuing the same logic by saying "so it's really not surprising that he would know about Foidos".  It is surprising, because I was addressing your blog, not Martin.  Martin hadn't made an appearance yet :-)

d) I would suggest that Martin's statement would be better worded "I am aware of Foidos....." The other way reads that it is a given that he knows about these things so why would I have bothered saying it.  And is arguably aggressive itself.

e) Martin's criteria for evaluation, out of the blue, is screen real estate and small footprint.

I can't go on.

# October 20, 2008 8:47 AM

lucasbfr said:

Merci boudin ;P

# October 20, 2008 12:11 PM

Bertrand Le Roy said:

@Ross: sorry for sounding pedantic. It seems only natural that Martin would step in to defend his work.

# October 20, 2008 1:44 PM

Corey J gaudin said:

How do you 2-way bind a date? When I utilize this AJAX  Client Templating to bind to a textbox and add the jQuery Datepicker, it goes all nuts. Changing the Date on the textbox changes it to a string and doesnt really 2-way bind correctly. Is there some Datepicker associated with this library I can use to test so that it maps to and from the Javascript Object seamlessly?

# October 20, 2008 7:14 PM

Corey J gaudin said:

How do you 2-way bind a date to a textbox control? When I utilize this AJAX  Client Templating to bind to a textbox and add the jQuery Datepicker, it goes all nuts. Changing the Date on the textbox changes it to a string and doesnt really 2-way bind correctly. Is there some Datepicker associated with this library I can use to test so that it maps to and from the Javascript Object seamlessly?

# October 20, 2008 9:12 PM

Ross said:

Don't worry about it.  Do be honest, I am a bit naive about the whole blog scene. If I had known the author would be reading your blog I probably would have been more polite.

Also, there wouldn't have been so much confusion if your link was to his article rather than to his atom.xml.  In that way I would have read what he had to say before commenting. The only thing I could see was the TWIC article.

# October 20, 2008 11:06 PM

Bertrand Le Roy said:

@Corey: I haven't tried the jQuery Datepicker but you can absolutely 2-way bind a textbox to a date. The trick is to use a convert function and a convertBack function on the binding to go from date to string and from string to date. The functions can use String.format and Date.parseLocale. We do have a date picker in the Ajax Control Toolkit: the Calendar behavior. www.asp.net/.../Calendar.aspx

# October 21, 2008 12:18 AM

Bertrand Le Roy said:

@Ross: yes, well, Martin wrote his article 5 days after I wrote this post. All I had at the time was the TWIC article. I'm adding the link to his post. You should always write as if it was going to be there forever and accessible to anyone ;)

# October 21, 2008 12:24 AM

Corey J gaudin said:

Bertrand,

Can you utilize that Calendar completely Client-side? I have used it Server Side, but I am using it on the latest blog post (using Client Template and MVC ASP.NET) on polymorphicview.blogspot.com/.../update-to-json-service-provider-using.html  

I am trying to bind a client side only Calendar control to that textbox that doesnt mess up the Live Template binding to it. The jQuery Datepicker breaks the Template Binding to it. I figured the Calendar Picker built into AJAX Toolkit would work, but have no idea how to utilize it completely client-side.

Any ideas?

# October 21, 2008 12:55 AM

Bertrand Le Roy said:

@Corey: yes, you can use it purely on the client-side but there is little documentation for that currently. There is a specific download for just the client files on the releases page. The scripts that you need are CommonToolkitScripts, DateTimeScripts, PopupExtender, AnimationScripts, ThreadingScripts. You'll also need the calendar css and of course the CalendarBehavior script. The behavior can be instantiated using $create.

# October 21, 2008 1:11 AM

egoZd said:

I like the bar picture of this blog so much . Really very impress!

# October 23, 2008 4:36 AM

Corey J Gaudin said:

Le Roy,

I managed to get the jQuery DatePicker to work with MS Ajax Templates by using the DatePicker in Dialog mode so that I can bind to its datechange event and shove that date back into a Javascript Object property.

Now I find myself trying to figure out how to do a combobox. I can effectively bind the check to it one way, but it does not work both ways. Do I have to utilize ConvertFrom to accomplish this, or is there some simple way I am not thinking about?

Ex:

<input type='check' checked='{binding PropertyName}' />

This will effectively show it checked or not checked if datasource.PropertyName is true of false, but checking and unchecking the box does not seem to have an effect.

# October 23, 2008 2:42 PM

InfinitiesLoop said:

Corey -- two problems. (1) you should have type="checkbox" not 'check' which isn't right. (2) you need to use sys:checked instead of checked. For example, <input type="checkbox" sys:checked="{binding...}"/>. The reason is that IE does not actually allow 'any' value to be in certain attributes such as checked (selected, ismap, readonly, to name a few others). Programmatically all you get back is 'true' or 'false'. So there's no way for us to notice the binding text in the markup. For this reason we allow any attribute to be prefixed with sys, which also helps you avoid any side effects the normal attribute would have. For example, if you put <image src="{binding..}"/> the browser would actually try to request a "{binding..}" url from the server.

# October 23, 2008 4:16 PM

Amit said:

Hi Bertrand, Thanks for the nice post. I modified Release and Debug JS as mentioned, and i was able to see it the script working in Frame.

Only issue i have is i get right and bottom a scroll bar in AutoCompleteExtender of AJAX Toolkit, which is hiding the one row of data which is last row.

I don't get the scroll bar if i run the application without frame and original files.

Any idea what could be causing the scrollbar to be displayed. I am using IE6

Thanks

Amit

# October 24, 2008 2:41 PM

Bertrand Le Roy said:

@Amit: We can take that offline (bleroy at Microsoft) but the first thing I'd check is that you have a doctype for standard mode.

# October 24, 2008 2:48 PM

Corey J gaudin said:

That worked perfectly InfinitesLoop! Now am I also missing how you can bind an array to a select box?

I.e.

<select id="someCombo" sys:datasource="{binding someArray}" sys:display="Text" sys:value="Value" />

If there is a javascript object

var someArray = [{

Text: "something",

Value: "somethingValue"

}, ...]

# October 25, 2008 12:23 PM

Bertrand Le Roy said:

@Corey: I think the readme says binding select is a known issue. For the moment you'd have to create a control. I think there's on in the old Futures release from last year that may still work.

# October 25, 2008 2:07 PM

IzzyToxic said:

I think song compatibility is certainly "doable" but, as always, greed will probably prevent this from happening any time soon, if ever.

I thought it interesting that you have chosen to kick "Guitar Hero: WT" to the curb. This will be the first GH title that I will not be purchasing. I am disgusted with the folks at Activision who have decided that their former customers can go to hell by not wanting to make their previous "downloadable song purchases" compatible with their new "World Tour" sequel.

As far as I'm concerned, Activision has just greeded itself out of my virtual guitar dimension (beam me up, Scotty). Pretty damn cocky attitude, IMO, for a game whose setlist and graphics are noticeably inferior to the "Rock Band" franchise.  

# October 26, 2008 12:12 AM

Longyearbyen said:

I just need to to say it sometimes:

JAvascript is a nightmare of a computer language and I hate it.

For how long will we have to suffer from this failure?

# October 27, 2008 10:47 AM

Bertrand Le Roy said:

@Longyearbyen: well, JS is now pretty much the most popular language in the world and it doesn't look like anything can seriously challenge it anytime soon. I highly recommend Crockford's "JavaScript, the good parts" as a way to deal with it :)

# October 27, 2008 12:35 PM

Dave Ward said:

Awesome!

Is there any difference between including it in a script block and including it as a reference like this?

/// <reference path="~/jquery-1.2.6-vsdoc.js"/>

# October 27, 2008 1:01 PM

Bertrand Le Roy said:

@Dave: good point, Dave, but references I believe currently only work in JS files, not in pages. But from JS files, that is clearly the best strategy for now. Eventually, you'll be able to just reference the main jquery file.

# October 27, 2008 1:10 PM

John M. Anderson said:

Script block can use the minified compressed version to save bandwidth, so you just want to use the vsdoc as a reference for intellisense... The comments take up to much space to be used in production.

# October 27, 2008 1:41 PM

NanhTrang said:

return should have attribute like numParam and allow multi return comment. example:

function func(a, b) {

/// <returns type="String" numberParam="1"></returns>

/// <returns type="Array"></returns>

if (b === undefined) {

return a;

} else {

return [a, b];

}

}

# October 27, 2008 2:53 PM

Regis said:

Can't wait to try that one, could never get it to work flawlessly with the previous 'hacks' :)

# October 27, 2008 4:02 PM

Bertrand Le Roy said:

@John: precisely. That's why I've been insisting in the post that this should never be used at runtime. We are going to enforce that in the future by allowing you to only reference the runtime and the IDE should be able to find the IntelliSense file automatically.

# October 27, 2008 7:19 PM

chanva said:

That's a great news.

# October 27, 2008 8:59 PM

Guy Harwood said:

Some instructions on how to get it working would be nice. ;-)

Previous info is scattered around with varying techniques that never seemed to work.....

# October 28, 2008 9:21 AM

Josh M. said:

I can't get intellisense to work for these files no matter how I include it (script reference or script inclusion).  In truth, I haven't been able to get js intellisense to work for my own javascript at all unless it's in a script block directly in the file.  I'm using vs2008 sp1 targeting the 2.0 framework.

# October 28, 2008 10:54 AM

peter said:

Nice... I love how you used FF rather than IE :)

# October 28, 2008 7:33 PM

Guy Harwood said:

Someone has bothered to do a full post...

blogs.msdn.com/.../rich-intellisense-for-jquery.aspx

# October 29, 2008 4:21 AM

CareySon said:

the technology really going fast beyond my imagination:-(

# October 29, 2008 6:09 AM

Paulo Soto said:

Hi Bertrand, thanks for the info!

After applying the patch I was also getting the 'Sys' and 'Type' undefined errors, but only on one particular WebServer.

Our problem was the same that Shane was experiencing: the server had the URLScan tool installed, and it was preventing Requests containing periods (in our case, the patched Ajax files).

If someone else is having this problem, you can configure the URLScan tool to allow Requests with periods (by default they are denied) by setting the AllowDotInPath=1 in the %windir%\system32\inetsrv\urlscan\UrlScan.ini file.

I hope this helps someone else!

# October 30, 2008 1:02 PM

joe diffy said:

not bad, but any idea when we might see a 5.0?

# November 3, 2008 1:33 PM

Bertrand Le Roy said:

@Joe: As you may have noticed, the ASP.NET team is now very open about the development process, so you'll start seeing 5.0 stuff pop up on CodePlex as soon as 4.0 is out the door and probably even before that.

# November 3, 2008 1:40 PM

Ajax Control Toolkit + ASP.NET MVC said:

Hello!

I really like the release!

However, since I am also checking out the ASP.NET MVC Framework, I am wondering about the plans the move the Ajax Control Toolkit to supporting the ASP.NET MVC Framework?

# November 3, 2008 7:45 PM

Bertrand Le Roy said:

See this post for some details on using the toolkit with MVC:

feeds.feedburner.com/.../asp-net-mvc-tip-37-create-an-auto-complete-text-field.aspx

# November 3, 2008 7:53 PM

Drew Marsh said:

Great talk and thanks for answering all my questions at the end there Bertrand. ;)

Cheers,

Drew

# November 3, 2008 11:01 PM

Crescent Fresh said:

>> so it's easy to create an element, set its innerHTML and point to that.

Not so fast. With the innerHTML approach you could not have "container agnostic" templates such as '<li>{{ bar }}</li>' or '<tr><td>{{ foo }}</td></tr>'. For example the consumer of the former would have to know that the template required a 'ul' container.

Not to mention innerHTML is borked in everyone's favorite browser for a number of elements (select, plus all the table related elements). So the '<tr>' example above would just simple error out in IE even if the developer DID know that the template required a 'table' container.

Personally I find the requirement that all templates must be defined as valid DOM nodes a little annoying, as I often like to load extraneous templates on demand from the server in order to increase the percieved initial page load speed, in which case I get them back as a string. However I understand the desire to leverage the browser's natural DOM parsing. As an added benefit the context-sensitive DOM node creation approach MS has taken lessens the risk of injection-based attacks (eg xss) that other Templating engines can't easily achieve with a string-based approach.

# November 5, 2008 12:16 PM

Bertrand Le Roy said:

@Crescent: good point, but in the same way that when creating the template inline you would include it in the right outer element for (X)HTML compliance, your string should also include a container. Once you've included it to the DOM using innerHTML, you can get the actual template element using getElementById.

# November 5, 2008 12:49 PM

Visual WebGui said:

I would like to draw your attention to an ASP.NET extension named Visual WebGui, very effective for such application. Take a look@ www.visualwebgui.com, and judge for yourselves

# November 7, 2008 4:07 AM

labilbe said:

Thank you Bertrand for sharing!

# November 8, 2008 2:48 AM

Peter said:

As I commented on Jeff's blog, a resource manager feature where I could tell the IDE what JS/CSS files it should assume are going to be available at runtime, would be a better option in my opinion. The IDE can't possible cover all the possible combinations of how a JS file would end up in the final HTML. So why not just cut out the guess work and let us tell it. It would be easier for the users to understand -- if it's not defined in the "resource manager" then you need to do define it there -- rather than trying to understand why the IDE couldn't figure out that my JS/CSS file would be available at runtime. No?!

# November 8, 2008 2:47 PM

Steve said:

This did not work for me

# November 8, 2008 7:02 PM

Steve said:

Does this require me to use the uncompressed version of jquery ?

I'm using asp.net mvc.

I installed the updated

I downloaded, and put the file in my scripts directory next to my jquery-1.2.6.min.js file

I goto my .js file and I get no intellisense for jQuery

# November 8, 2008 7:07 PM

Bertrand Le Roy said:

@Steve: if you're using the min file, you need to rename the vsdoc file too, to jquery-1.2.6.min-vsdoc.js.

# November 10, 2008 12:38 AM

Chris Bower said:

Hi Bertrand I have a couple of questions regarding what I should invest my time learning.

Should I go down the route of Ajax 4.0 or with Microsofts support for jQuery and from what I have seen from buying the book jQuery in Action, the ease at which you can use AJAX with jQuery. Also the use of jTemplates for dong the same as live bindings.

Which way should I go? Or am I being naive and really Ajax 4 has a lot more to offer.

# November 10, 2008 8:32 AM

Bruno said:

Our problem is similar, since we do get the access denied error, however all of the aspx scripts are pregenerated by Sybase Powerbuilder and, because of that, we don't have direct access to it. We're using an iframe on the html page that is linked to the aspx site on IIS. Any sugestions how to work this around? Any way to fix this without acquiring Visual Studio?

# November 10, 2008 11:24 AM

Bertrand Le Roy said:

@Bruno: you should contact Sybase's support (Visual Studio shouldn't have anything to do with it).

# November 10, 2008 12:33 PM

Bertrand Le Roy said:

@Chris: it's actually not one or the other: jQuery has great selector support, which Microsoft Ajax does not, and Microsoft Ajax has a great component model, globalization and localization support, live bindings, ASP.NET integration and lots of other things that jQuery does not. I use both on many of my projects. A few things to consider: only the core jQuery file is supported by Mirosoft (hence jTemplate is not supported). Also, jTemplate does *not* do what live bindings are doing.

# November 10, 2008 12:38 PM

Steve said:

Looks like

plugins.jquery.com/.../jquerytemplate

has had this for some time now.

Is this another invention of the wheel ?

# November 11, 2008 9:26 AM

Bertrand Le Roy said:

@Steve: sure, templating is nothing new in itself. We had client templates in the first alpha of Atlas three years ago, and we've had them on the server pretty much forever. It looks at first like it is a simple problem, just put the pieces in an array with the data, join the array, set innerHTML, done. 30 minutes worth of work.

Except that if you look closely at the other client template engines, they all have one or several of these problems (of which ours has none):

* Using string concat to build the DOM leads to easy injection, and encoding often depends on context (for example encoding url is different from encoding a text node or a regular attribute).

* Storing the template code in a string, a script tag or a similar text node of the DOM makes it undesignable and requires parsing. We leverage the native HTML parser.

* Using their own expression language means one more thing to learn and one more parser to run. We use JavaScript, which means you already know the language and we can use the browser’s parser and interpreter.

* Most of those engines do not have an easy mechanism to instantiate controls and behaviors on the generated markup.

* None of them (that I know of) do live bindings and integrate them to the template markup.

# November 11, 2008 12:02 PM

learner said:

I am a bit confused as to where repetition begins and ends as there is no markup indicator of what really is the template. In your example, it seem the templating engine repeat all the contents in the <div id="peopleIKnow" class="sys-template">. I know this seems obvious but I will like to know. Example, adobe spry  defines a spry:repeat region where as the repetition container.

labs.adobe.com/.../samples

# November 12, 2008 10:26 PM

Cem said:

Hi Bertrand,

i have a question about dataview:serviceuri.i think that to bind data to dataview,we must give webservice or svc.file in your examples.As u know,In Ajax Controls there is a feature ,which is called as PageMethods, and by using this method we can get  static web methods results.Is it possible to use in your example?Or will Asp.Net ajax 4.0 provide Page Methods soon?

Regards

# November 13, 2008 4:02 AM

Bruno said:

Bertrand Le Roy,

I did that but got no reply yet. So I'm really putting all my efforts to fix this as fast as possible.

I used Microsoft Script Editor as a debugging tool and I got that the line in wich the access denied occours is:

var offsetL = w.screenLeft - top.screenLeft - top.document.documentElement.scrollLeft + 2;

I could aply the fix replacing everything between 'case Sys.Browser.InternetExplorer:' and ' case Sys.Browser.Safari:' but it happens that these lines are being read from 'scriptresources.axd' and I can't edit it via MSE. Any suggestions?

Thanks in advance

# November 13, 2008 1:10 PM

Bertrand Le Roy said:

@Cem: page methods are just web services that happen to be defined from a page's code. Ajax 4.0 works well with any kind of JSON Web service and so should page methods. The difference is that you wouldn't be using an AdoNetDataSource. You could call the method using its client proxy (or call it using Sys.Net.WebServiceProxy.invoke) and set the data property of the dataview from the success callback. If you prefer to do things declaratively, you can do the same thing by using a DataSource using the query as the method name.

# November 13, 2008 1:16 PM

Bertrand Le Roy said:

@Bruno: please read the section of the post under the title "how to apply the fix". If Sysbase's application doesn't let you do that, only them can fix it. The only solution I would see would be to "monkey-patch" the method by adding another script file to the page that contains a fixed override for the method.

# November 13, 2008 1:20 PM

Bertrand Le Roy said:

@learner: that's a great point. I'm only showing a very simple case here, which is to repeat the whole contents of the dataview. This is the default. If you have a more complex template than that, we do support that also, through a pattern that is similar to what the server-side ListView control exposes (with a place holder in the template which is the place where the item template gets repeated). You can see an example of that in the fourth page of the samples that come with my PDC talk: channel9.msdn.com/.../PC32

# November 13, 2008 2:09 PM

Lev said:

This is pretty cool but it doesn't work in User controls.  Most of our application logic is in user controls, not pages or external js files.  Are there any plans to make this work in user controls?

# November 14, 2008 3:08 PM

kell (aka mofo in rockband) said:

yes, agreeable, rockband kicks a.. out of the 2. Me and 3 friends have been thrashing the 2 games since they came out and rockband has a way better track listing for a start. The thing that i ponder is why there are none of the other great bands like midnight oil, dire straights, the angels and the like. It would be good and so far haven't found much in the way of downloadaable content. Also, some Pantera would be nice!!! LOL!

In saying that, i love playing guitar, am the vocalist in our group and the rockband voc set-up is better. the guitar hero frets for the guitar and drums are better in that, we all agree the circles are seemingly more accurate than the rockband lines you get to strum on because of the size being easier to hit etc.

I loved GH3 and aerosmith, not big on GH2, and world tour has lost another fan from us 4. Rockband kicks butt!

# November 15, 2008 9:47 PM

Winston said:

Thanks for this tip. It really nice

# November 18, 2008 5:57 PM

Angus McDonald said:

Very nice. I agree with Peter though.

It would be helpful for me if it worked with VS2008 Team System as well (this patch doesn't).

# November 19, 2008 5:37 PM

Angus McDonald said:

Urgggh ... scratch that comment about VSTS, I actually needed to get onto SP1 first!

# November 19, 2008 7:22 PM

Angus McDonald said:

Looking forward to Code Snippets Manager supporting JavaScript files/language, or better yet being able to do the /// inside a function and having it create template comments for me ...

# November 19, 2008 7:41 PM

Bertrand Le Roy said:

@Angus: If you haven't already, check out this presentation by Jeff: channel9.msdn.com/.../TL48

# November 19, 2008 7:52 PM

AsifIqbal said:

Hi all

i want to develop a gadget how can i?

please help me in this regard.

thankksss in advance

asif iqbal

# November 20, 2008 9:10 AM

Bertrand Le Roy said:

@AsifIqbal: what do you mean by gadget? If you mean a control, Nokhil Kothari's "developing ASP.NET server controls and components" or Adam Calderon's "advanced ASP.NET AJAX server controls" are good resources.

# November 20, 2008 1:56 PM

bdukes said:

Your source code link is giving me a 404 error...

# November 21, 2008 1:22 PM

Bertrand Le Roy said:

That is weird. I tried the link yesterday and just tried it again, it downloads fine. Maybe something to do with your proxy or firewall?

# November 21, 2008 1:27 PM

bdukes said:

hmmm... tried it a couple of times this morning, just tried it again and it works fine.  Definitely weird.  Thanks for the tutorial/code!

# November 21, 2008 1:33 PM

Tiamat said:

Great example! it would be nice to see this edit in place along with other behaviors as you said the autocomplete and the watermark

# November 21, 2008 2:31 PM

PLJdn said:

The link for the source is stange. When i try to download the source in Opera i get a 404. If i use IE it is fine.

# November 21, 2008 2:35 PM

Matt said:

Thanks for the info, particularly about controlling the name expando. Is _all_ of this documented in the MSDN documentation?

# November 24, 2008 3:33 AM

Rick Strahl said:

Bertrand - Cool, but maybe a little simplistic. This approach falls flat when you have any sort of formatting (including spaces) in your HTML. Won't work if you have formatted text (like bold/italics) etc. if you're using a textbox for display.

I've built something like this some time ago for jQuery with any content converting to a textbox/textarea and it gets out of control pretty quickly to handle carriage returns, links etc. properly.

Have you given any thought to just using the DomElement.contentEditable instead of a textbox?

$("#editableControl).get(0).contentEditable = true;

That would make it much easier to in place editing and completely side step the issues of converting to and from plain text first and capture the essence of the html displayed.

You should be able to make any content editable this way and it looks like all major recent browsers now support this functionality (IE, FF, Opera, WebKit)

That may have issues of its own though - if you're only interested in plain text.

# November 24, 2008 4:55 AM

Bertrand Le Roy said:

@Rick: sure, there's a lot more you can do, and that wasn't the point of this exercise. I just built this because I needed something simple to use in samples. As I was building it, I realized it would also be a nice example of how to build components for Microsoft Ajax. If you're in the market for a professional edit in place control, this is not it. :)

# November 24, 2008 1:06 PM

jgd12345 said:

I really love the simplicity of the controls.  They make oop with javascript bareable.  I hope that the ajax control toolkit uses this pattern for all their controls and removes some of the bulk we have in the current version.

# November 25, 2008 6:42 AM

MisterFantastic said:

Hi,

When this thing will be integrated into visual studio . Can we expect this in Visual Studio 2010 ?

Thanks

# November 25, 2008 12:56 PM

Bertrand Le Roy said:

@MisterFantastic: we're currently not planning on integrating this into VS.

# November 25, 2008 1:01 PM

Chuck said:

Nice scripting, Life would have been much better if ms had fixed this bug, but at least there is a hack. All the more it makes me wish more people used firefox 2.x or higher

# November 26, 2008 3:05 AM

lucasbfr said:

Je serais pas d'accord! You'd need to speak Chinese!

More seriously, I think that either having access to good translations or being able to speak the main language is mandatory if you wish to master a field.

Obviously, English is too simple a language to have successful translations of programming books (just have a look at the French O'Reilly chapter that went bankrupt a few months ago).

However, I do think that the English-speaking world is too self centered, and does not wish (in its vast majority) to reach for the resources and talents in other languages. The lingua franca is English today, but I think things would (will?) be very different if an other language becomes the main technical language.

I'm not sure Russian and Chinese hackers know English, though. And they are apparently not THAT bad :P

# November 26, 2008 5:00 AM

anie said:

Hi Bertrand, need help on this.

I'm new in this kind of stuff, and I'm trying to have image buttons instead of text in the sitemap. I'm using web.sitemap file from ASP.Net. Then I specified this in my masterpage:

<asp:Menu ID="Menu1" Runat="server" DataSourceID="SiteMapDataSource1" Target ="_blank" Orientation="Horizontal" StaticDisplayLevels="2" DynamicEnableDefaultPopOutImage="false" StaticEnableDefaultPopOutImage ="false"></asp:Menu>

And add some coding part as you said in the article.

But it still return text-sitemap, not image sitemap the way I want. Is there anything I should add or something?

# November 26, 2008 5:05 AM

Prometheus said:

Certainly not if the increasingly impressive google translate continues:

translate.google.com/translate_t|en|%E5%A6%82%E6%9E%9C%E4%BD%A0%E4%B8%8D%E4%BC%9A%E8%8B%B1%E6%96%87%2C%20%E4%BD%A0%E5%B0%B1%E4%B8%8D%E6%98%AF%E4%B8%80%E4%B8%AA%E7%A8%8B%E5%BA%8F%E5%91%98

# November 26, 2008 7:00 AM

anie said:

Hi Bertrand, just found out why it didn't work out. My mistake, my asp:menu tag was not complete. It runs well now, Thanks..

# November 26, 2008 8:13 AM

Joe said:

Shows up as a bunch of boxes for me.  I think that we benefit from a common language in the software development world in the same way air traffic control is all conducted in one language (English).  That said, I can in no way defend that initial comment, as it simply isn't true.

# November 26, 2008 12:16 PM

Bertrand Le Roy said:

@Chuck: well, Microsoft *has* fixed this bug back in IE7.

# November 26, 2008 3:39 PM

Collin said:

There is not much that can be said to validate a comment like that.  Of course you can find people who can program and speak little or no English.

The better question would be, can you make it working for an American company with English as a second language.  To that I would say there are plenty of jobs that can be found for basic English speaking abilities but that person would be limited to certain groups within a company but your job security would have a lot to do with how well people around you can understand and share ideas with you.  I'm working now with 3 developers who speak poor English and 1 that finds himself translating for his group more than he gets to write code.  It is frustrating to talk about a project and constantly have a language barrier put in front of you.

In fact my own job was only available because of a .Net developer who didn't speak the language well enough which played a large part in him not meeting goals and ultimately his job being lost.

It's safe to say that most documentation is in English so the ability to read English would make it easier for a person to learn to program but I doubt it would stop someone who has genuine interest in learning to program.  So in business I would say it's a major requirement.  They know this in India where English is taught to aspiring developers.

# November 28, 2008 4:46 PM

Dave Sussman said:

I totally agree. I've always considered HTML to be content and have been pushing the semantic message for a while, but I don't think it's obvious to most people. I've done some CSS 101 talks at conferences and the semantic message is the most radical to a lot of people.

# November 29, 2008 4:41 AM

RichB said:

Excel has been able to parse all the tables in HTML at a given URL for many versions. It's one of the best reasons to semantically lay out your HTML.

# November 29, 2008 5:53 AM

Karl Agius said:

Sure makes sense ... I'm of the opinion that it's still a bit early to talk of pure content and alternatives to css until there's more widespread support for the full range of CSS3 selectors (which would allow full styling without actually touching the markup), but it's definitely a worthy ideal to work towards.

# November 29, 2008 7:59 AM

Anup Shah said:

I think this is a decent observation. It has also been something being discussed in the "web standards" community for quite a while now, though.

There's the potential, for example, for assistive technologies to be more useful. E.g. screen readers and the like. Instead, they have had to spend a lot of time and resources trying to understand horrible markup, nested layout-tables and the like. Resources that could otherwise go into providing all this extra functionality for their users.

Microformats are quite interesting too (though the ones I have seen seem limited mostly to the "social web" kind of examples).

HTML 5 of course offers a lot more native HTML elements that can give more meaning to the content, so hopefully if there is any way HTML 5 progress can be given a boost by all browser vendors then we might get somewhere in achieving what you have observed... :)

# November 29, 2008 2:01 PM

Steve said:

Interesting.  But I'm not seeing the 'unobtrusive' part.

ie. jQuery is 'unobtrusive'.

I think unobtrusive would be completely separated from the html.  

Unobtrusive to me would be that I could have 3 html pages of the exact same content with 3 different css styles or js files that 'act upon' the html.  The html would be untouched by it.

To be honest, I'd rather see MS go a different route here: you have WPF for windows apps - xaml.  Silverlight with xaml.  How about creating xaml on the web as well ?

Basically a xaml based view engine.  

# November 29, 2008 7:07 PM

Marcus L said:

When stripped of stylistic intent, HTML boils down to a text markup language more akin to something like Wikitext than to an "enriched text" format like the aptly named Rich Text Format, which can include stylistic elements such as font and formatting information.

The semantic elements of HTML and wikitext are useful outside of formatting, as you alluded to the use for cataloging outlines, etc... The difference is the precision with which you can discern intent, whereas wikitext has a more direct and inherent meaning to its elements necessarily imposed by common convention. HTML has been (mis)used so many different ways that it's difficult to generally decipher intent from its semantics.

Neither HTML, XML, nor JSON are better or worse suited to being consumed semantically, but it is common convention and ubiquity which gives meaning to the data. In that respect HTML has a big advantage in being used much more widely, but also means we should not ignore the majority of existing (less than ideal) contents.

# November 29, 2008 10:35 PM

Guy Sherman said:

I agree, I think HTML would be a great data format. I recently asked myself a similar question: why couldn't we just us XHTML as the format for our word processors? Surely it encapsulates everything that we can do already, in a much cleaner format that doc or docx?

# November 30, 2008 4:44 AM

Jasy White said:

but do you think Safari 3, is good to download on Windows.

# November 30, 2008 7:09 PM

Jay Kimble said:

Bertrand,

I hear what you are saying, but there are still alot of sites out there that don't use CSS (or use inline CSS... something I personally am guilty because I need to add something quickly to a site).

XHTML or HTML that uses a more modern/standards-based approach are bordering on data formats. But even there we are looking at a mess of divs with content that may not make sense. For instance, I've seen people use "float:right" to push the real content closer to a the top of a file. I guess you could have a bunch of content, but laying at that content in some other view engine might not be that easy.

I know you are talking theory, but when I look at XML I know that there are tags that will make sense as to what they represent. With HTML that may or may not be the case (it all depends on the programmer or designer, and if you don't want someone re-using your content then you don't want it making sense)

Just my two cents...

Jay Kimble

-- The Dev Theologian

# December 1, 2008 9:46 AM

Dennis said:

Bertrand - Do you have any samples that would use the MVC project as a starting point?  Data sources from controller methods as well as usage of the template engine in a project that has master pages (where the <body> is not present in each .aspx page.

Thanks, Dennis

# December 1, 2008 11:17 AM

Bertrand Le Roy said:

@Steve: so if I'm following you, you think unobtrusive means that even the data should be introduced in the template by script? You sure can do that but then the advantages of using templates become pretty small then. But if that's your thing, sure, go ahead and do that. We do support jQuery after all...

We had something closer to XAML in xml-script three years ago, also experimented with XAML for HTML and JS and it really didn't work very well. The problem is that you're not starting from scratch here like WPF was: you have HTML to deal with. We chose instead to use legal extensions to XHTML and we're quite happy with it. Your feedback is actually one of very few stating this is not the right approach out of overwhelmingly positive feedback. Not saying you're wrong, just that this works better for more people.

@Dennis: this is just HTML, you can apply that to MVC very easily. You can for example use a JSON result as the server data source. For the master page scenario, you can actually do the namespace declaration on the dataview's tag, and it will work just as well as on body. You can also call Sys.Application.processNode or processNodes to avoid having to touch body to activate the DOM.

# December 1, 2008 1:35 PM

Bertrand Le Roy said:

@Jasy: sure, Safari 3 on Windows is a very decent browser. I still find the Mac-isms and font rendering hideous but as a browser it's definitely one to consider.

# December 1, 2008 2:25 PM

shankar said:

hi,

thx for this article . but can i get a solution for it.

i am completely using ajax on my web site and its tending to slow my website

# December 3, 2008 7:02 AM

Pete Hurst said:

Sounds like this effect (especially Nikhil's version) could be acheived with two simple CSS rules:

input {

   border:none;

}

input:focus {

   border:....

}

Good to see a solid example of an AJAX behaviour, however make sure you're not encouraging "using a sledgehammer to crack a nut" stories!

# December 3, 2008 10:14 AM

Bertrand Le Roy said:

@Pete: Sure, if you read the follow-up to this post, you'll see a simplified version of this component and a discussion why the focus pseudo-class is not quite usable yet.

weblogs.asp.net/.../simplifying-the-edit-in-place-behavior.aspx

# December 3, 2008 12:37 PM

Bertrand Le Roy said:

@Shankar: just clean after yourself. If you're using building Microsoft Ajax, that means implementing dispose on all your components. In general, avoid capturing elements in closures. The above example can be cleaned by deleting the expando on the element.

# December 3, 2008 7:10 PM

Edward said:

Steve has a point about its remark kabout jquery. It is not unobtrusive. JQuery is a nice idea as it enables a quick way of doing some nice javascript thingies like animation and stuff. But look  at it:

<img sys:id="{{ $id('photo') }}" sys:src="{{ 'Images/' + Photo }}"

 alt="{binding FirstName}"

 onclick="{{'alert(\'You clicked '+FirstName+'\\\'s photo.\');'}}"/>

For me this is far from elegant coding. and yes I don't want to bother to learn another language or doing things differently.

Let me explain a bit more. With asp.net you can do most of it server side right? Why not using .NET to do the (ajax)javascript for you and server side too? You have to abstract javascript away from it all. It's there but you don't program in it. All the js features like animation, effects, etc should be done server side.  This is accomplished for example by gaiaware  (http://gaiaware.net/) see some introduction video's here http://tv.gaiaware.net/

I really like it (and use it) because it is unobtrusive, fast,elegant and does allow the creation of event handlers and components over the markup they generate because it is done server side.

# December 6, 2008 7:35 AM

deap82 said:

You write "but you really could include the script references and $create yourself."

This really interests me, how do I know what script references to include (for each toolkit control)?

/Dan

# December 6, 2008 11:03 AM

Bertrand Le Roy said:

@Edward: nobody claimed the final declarative sample was unobtrusive. Now the markup in the section before that contains only one thing that is not pure HTML: the binding expressions. If you think this is out of place, I guess you would find *any* template engine not pure enough for your taste. Which is fine, you still have plenty of options, but you may be missing on some major productivity gains.

Now the server-side approach to abstract the client-side stuff is something we've also done (and many, many others too, way before Gaiaware), and it works in many cases but nothing ever beats the pure client approach, if only because you can have a client-side representation of the data.

# December 8, 2008 3:09 AM

Bertrand Le Roy said:

@deap82: that's a really good question, and for the moment you'd need to use something like the script profiler tool that is available on http://www.codeplex.com/aspnet but in the next release I want to add to each of the toolkit scripts its list of dependencies, which should make things a lot easier.

# December 8, 2008 3:12 AM

Vaishali Nayer said:

How can I use the Alert.dll in VS2003, when I try to add a reference to it i get an error message saying

"A reference to XXX could  not be added.  This is not a valid assembly or COM component.  Only assemblied with extension 'dll' and COM components can be referenced.  Please make sure that the file is accesible and that it is a valid assembly or COM component"

Using .Net 1.1

# December 8, 2008 8:54 AM

Bertrand Le Roy said:

@Vaishali: 1.1? Wow. that's old. Sorry, this is compiled against 2.0.

# December 9, 2008 2:33 AM

Gabriela said:

Hello and sorry for my mistakes. My question is about how to send parameter to the method I call in the "query" statment:

var peopleIKnowView = $create(Sys.Preview.UI.DataView, {serviceuri: theservicename, query: themethodname(parameters)}, {}, {},          $get("peopleIKnow"));

all this because I need to paging the dataview... I don't have any clue and is a little bit frustrating...

regards,

Gabriela from Argentina

# December 9, 2008 8:13 PM

Bertrand Le Roy said:

@Gabriela: if you have parameters, just do a regular web service call from code and set the data property of the DataView from the callback.

# December 9, 2008 8:21 PM

Dave Ward said:

What happens when your designer runs those expando attributes through Dreamweaver or who-knows-what on their Mac?  I understand that they are technically unobtrusive in theory, but I don't think they'd work as well as the standard jQuery wireups in practice.

What he did is neat though, nevertheless.

# December 10, 2008 2:50 AM

Mike said:

"What do you think?"

Great!

# December 10, 2008 4:25 AM

Andy said:

Yes please, allowing adding jQuery plugins declaratively seems a must. I can imagine it would become a common Wish List item on the ASP.NET forums if this isn't added. Especially as jQuery UI and Layout scripts gain momentum. And would really justify all the positive press around using jQuery.

# December 10, 2008 6:21 AM

hajan said:

great tutorial.. I've been loking for similar one around the web and finally succeeded here :) *as always*

Thanks

# December 10, 2008 11:35 AM

James said:

In the next version of ASP.NET AJAX, can you please provide hosted support for the libraries like Google does with JQuery.  These ASP.NET AJAX are large and slow. Would be great if they were hosted on Microsoft's servers.

Thanks.

# December 10, 2008 1:55 PM

Bertrand Le Roy said:

@James: yes, I'm working on that. But I'd be interested in knowing where that perception that our libraries are "large and slow" comes from. MicrosoftAjax.js is 22kB on the wire, and the framework is optimized for fast loading. Can you send me mail at bleroy at microsoft so we can chat?

# December 10, 2008 4:17 PM

sean said:

if you don't know English, it is very hard to become a great programmer.

My 2 cents.

# December 10, 2008 6:26 PM

richardneverett said:

Just as I was about to go jQuerying...!

Very helpful post, many thanks.

# December 11, 2008 9:42 AM

Screwed said:

I tried copying (importing) old backup files (pst) from another computer using WinXP to the Outlook folder on a machine using Vista with Outlook XP.  Outlook didn't recognize (incompatible) so I removed them.  Now Outlook doesn't open and I know I didn't erase the existing Outlook.pst file (yet, it is gone now).  What the..............????

Please HELP

# December 11, 2008 9:54 PM

Bertrand Le Roy said:

@screwed: you should contact support.

# December 12, 2008 1:15 AM

geek111222 said:

Hi,

My question is similar to that asked by 'John Lewicki'. I am trying to bind a dataitem which is basically a javascript object. I want to  refer its fields inside my templates. Like :

{{ dataitem.subitem }}

Is this possible ?

Can it be made possible in future by allowing child templates, that use 'dataitem' from the parent parent as source?

Also, is it possible to attach a client side callback function (just like the ItemDataBound) which can passed the 'dataitem' object as parameter.

# December 12, 2008 8:58 AM

Bertrand Le Roy said:

@geek111222: sure, you can do all that already.

The syntax in {{ }} is JavaScript so you can reference *any* object from there. For the current dataitem, you don't even need to dereference and you can do {{ subitem }} directly. But you could also have a global object and reference that.

Nested templates are also already supported. You can reference the parent template's data item using $parentContext.dataItem.

The DataView exposes an itemCreated event that gets a TemplateContext in the event arguments. You can get to the data item by doing args.get_templateContext().get_dataItem().

See weblogs.asp.net/.../instantiating-components-on-template-markup.aspx for an example of that.

# December 12, 2008 1:45 PM

Lindsay Donaghe said:

I have been using the CompositeScript tag and it works great in combining our scripts but it never caches on the client side.  I have not been able to figure out why, but that is killing the performance benefit after the first page load.  

I have enabled caching by the scriptResourceHandler in the web config file, but that doesn't seem to have an effect.  

Has anyone else seen this problem or can give me a clue why it will never cache in the browser?

Thanks!

# December 15, 2008 11:19 AM

Bertrand Le Roy said:

@Lindsay: That sounds very strange. Can you send me a simple repro at bleroy at microsoft?

# December 15, 2008 2:10 PM

scott said:

have a 6320 ipac same problem

# December 15, 2008 5:04 PM

Moksha said:

its really nice tutorial, thanks for it.

# December 15, 2008 8:46 PM

KCC said:

Hi Bertrand,

I'm sorry if this would seem to be a very newbie question, but I didn't get the first step on how to fix the problem (script manager, script path step) Could you please help?

Thanks alot.

# December 16, 2008 8:30 AM

David Nelson said:

Did you know you have two "Rule #4"'s? :)

Good writeup, stuff every beginning programmer should know but most never learn.

# December 16, 2008 10:45 AM

Bertrand Le Roy said:

@KCC: Just create an explicit script reference for MicrosoftAjax.js as described in the following paragraph. But your best bet right now is to migrate to a more recent version of the framework, where this bug is fixed.

# December 16, 2008 12:18 PM

KCC said:

Hi Roy,

I was able to complete the steps you mentioned here, but unfortunately, the "Permission Denied" error still remains. I didn't even get the 'sys is undefined' error. I have checked (using Fiddler) that MicrosoftAjax.js has been properly loaded into the masterpage. I have also patched the files as mentioned.

Unfortunately, I can't use the recent version of the framework.

Thanks in advanced.

Any help would be appreciated.

# December 17, 2008 7:02 AM

Samir Shah said:

I have the same problem. I applied the patch and it worked fine. I installed it on our DEV Server and it was working fine. One day the DEV Server hardware was replaced (They claim to have not changed any thing else. )

Now all of sudden, the application is showing Access Denied error. My frames are using an asp page and an aspx page (.net 2.0) .

Thanks

Samir

# December 17, 2008 4:31 PM

Bertrand Le Roy said:

@KCC & @Samir: please contact me at bleroy at microsoft and I'll try to help.

# December 17, 2008 4:36 PM

Roger said:

Had the same problem with positioning a div over an text input box, but didn't want to use the iframe hack. It appears that if you set the backgroundcolor of the input to transparent, the problem is solved (only works if you don't mind a transparent input box).

# December 19, 2008 10:49 AM

Bertrand Le Roy said:

@Roger: as far as I know, plain inputs don't have this problem, so it's possible that you were experiencing a plain z-index issue. If not, I'd love to see a repro (bleroy at microsoft). Thanks for the feedback.

# December 19, 2008 3:09 PM

num said:

@Anastasius

This is true - I just whipped up a study on how to allow this technique to retain browser history in IE upon a reload...

<a href="www.overset.com/.../a>

@Bertrand

Fantastic information on this page! Thanks for packaging all of it up in a clean article with just the right details!

# December 21, 2008 4:19 AM

Abir said:

Thanks for that info, that is what i was looking for.

# December 22, 2008 8:29 AM

Jeff T. said:

I am working on converting this code to a VB format, but before I continue has anyone here already done that?

Thanks in advance!!

-Jeff

# December 22, 2008 4:31 PM

Bertrand Le Roy said:

@Jeff: no, nobody is working of that that I know of. How would you keep up with new releases though?

# December 22, 2008 6:29 PM

Jeff T. said:

Bertrand,

You are correct, that is my dilemma. I am now looking for a option. Thanks for your response!

# December 23, 2008 7:16 AM

Madhu said:

Hi,

I have developed a website which will retrieve the Users, groups, stores information etc from active directory. we have used the Ajax tab control in our website.

I am getting a "Access denied Error" while clicking on the Tab Panel.Please find the error details:-

Line: 5960

Char: 49

Error: Access is denied

Code: 0

usdec.xxxxx.com/adsearch.aspx

while showing the webpage ajax tab control is showing fine but while clicking on the tab panel i am getting the access denied.

i would be greateful if you could please let me know your suggestions on this.

Many Thanks,

Madhu

# December 23, 2008 10:03 AM

Bertrand Le Roy said:

@Jeff: actually I'm not quite sure why you would want to do that in the first place. If you really want to do it, I'd at least wait for the next update, which will be quite major.

# December 23, 2008 1:37 PM

James Shaw said:

This is a pretty innovative templating engine Bertrand!  One quick question:

What's the binding expression for the current JSON object?  For example, in my template I have

<a href="javascript:self.location.href=Util.getBusinessDetailsUrl({{this}}, 'myRatings')">{{Name}}</a>

Util.getBusinessDetailsUrl is my own function that takes in the entire bound object, not just a field ("Name" is a field of my object for example).  Is {{this}} correct?

# December 24, 2008 2:42 PM

James Shaw said:

I do believe it's harder for non-English speakers to program mainly because documentation is mostly in English, although algorithms themselves are language-agnostic.

# December 24, 2008 2:49 PM

Bertrand Le Roy said:

@James: the correct markup for this would probably be <a href="{{ Util.getBusinessDetailsUrl($dataItem, 'myRatings') }}">{{Name}}</a>

Notice how the binding expression takes the whole attribute value.

# December 29, 2008 2:41 PM

MarcLaFleur said:

This is caused by an IPv6 DNS problem. By using the 127.0.0.1 address you're getting around this problem by a) using an IPv4 address and b) skipping DNS entirely.

You can also fix this by disabling IPv6 support in Firefox.  Simply navigate to about:config and change the property “network.dns.disableIPv6” to true.

Credit to Dan Wahlin for finding this (http://weblogs.asp.net/dwahlin)

# December 29, 2008 4:14 PM

takepara said:

edit your hosts file.

%SystemRoot%\system32\drivers\hosts

127.0.0.1       localhost

#::1             localhost <- comment out here

# December 29, 2008 8:56 PM

Artur said:

Great article and comments. I also started to play with this topics and stopped with .Net Framework 3.5 and methods AddHistoryPoint. It is working very nice - especially with UpdatePanel feature changing only part of the page. The only problem I've got is when you use IE and navigate to another server and then going back you are loosing history... Still I think it is one of the best currently available solutions. Please find example and more information <a href="malcan.com/.../DispForm.aspx Malcan</a>

It seems we need to wait for good implementation of History.pushState as suggested by W3C in HTML5.

# December 30, 2008 4:48 AM

babji.sunny@gmail.com said:

Hi,

Can you please let me know "How do I make the code to select the Images present in a particular folder and subfloders present in that folder"?

I mean to say "If I have placed a folder with the name ALBUMS and this folder ALBUM contains so many subfloders with the related images". So in this case how would I make the code to select the folders present only in the ALBUM Folder?

# December 31, 2008 12:32 AM

SKT_01 said:

Interesting that we can read something from a "MVP extraordinaire" - I don't know what this is - about jQuery but we never read something about the changes of the Microsoft AJAX Library from one version of the .NET Framework to another.

# January 2, 2009 11:41 AM

Ahmed said:

i want to define avariable that can use in the other forms in c# application please how,

# January 4, 2009 3:33 PM

Mark said:

This worked brilliantly in conjuntion with the toolkit fix.

Make sure your script path is just the top level ie. "~/scripts" and not "~/scripts/system.web.extensions/v1..........."

Hope this helps someone!

# January 5, 2009 6:49 AM

Bertrand Le Roy said:

@SKT: I have no idea what you mean by that. If you look at the list of things Wally talks about, you'll see that the new Microsoft Ajax features are the first two things in the list, before jQuery, and he spends a lot more time on those than on jQuery...

# January 5, 2009 3:45 PM

Bertrand Le Roy said:

@babji.sunny: I'm not following you. The photo album already works with subfolders.

# January 5, 2009 3:46 PM

Bertrand Le Roy said:

@Ahmed: this should be a good starting point: msdn.microsoft.com/.../ms178581.aspx

# January 5, 2009 3:48 PM

Adam Peller said:

What does the RegExp match do to performance?  Quite often, it's going to be wasted cycles.

This problem has been around a long time, and I fear there is no elegant solution for JSON without a native Date type in JS, since it's basically a language subset.  If you do pass some date representation, though, you really ought to use some ISO subset.  It's readable, in the spirit of JSON, sortable, and has the ability to specify timezones or use local time.  Using Unix Epoch is going to make it very difficult to identify a date only without being off by one and getting different results somewhere in the world!

I guess a lot of this is moot now that the ES31 spec is out there and IE8 and FF3.1 seem to offer implementations.  The reviver/replacer arguments aren't as magical as something type-based, but it avoids the syntax problem and is extensible without impacting base performance.

# January 6, 2009 1:31 PM

Bertrand Le Roy said:

@Adam: no, RegExp matches do nothing to improve perf... About date literals in JavaScript, well, it's not going to happen as far as I know. We are looking at the native implementations that are now available, but I wouldn't say base performance is not impacted...

# January 6, 2009 2:32 PM

Adam Peller said:

@Bertrand: I guess all I meant to say was that under the new scheme, you would have the option of providing a reviver/replacer to trigger your code on a branch, as opposed to putting a RegExp on the main codepath for all JSON.  Having native implementations for JSON should also be a fairly big win, though I haven't seen any numbers yet to indicate how big.

# January 6, 2009 3:13 PM

Bertrand Le Roy said:

@Adam: yes, the native implementation in IE8 for example, is based on json2.js so it has the reviver/replacer infrastructure in place. We're exploring using that when it exists. But for a script implementation to have reviver/replacer, you need to traverse the deserialized graph, which, depending on the data, can be more expensive than the regular expression. I agree that the advantage is better extensibility and an easy way to opt in or out of most date encoding scheme.

# January 6, 2009 7:58 PM

bahamas4ever said:

using htmlencode/decode works well i have been using it awhile. it is a bit of a pain to have to encode all user input but it works.

i never really thought about the error messages being a weakness but it makes perfect sense, it really would reveal database information.

the db connection thing in webconfig i can't seem to get around not having to put user & password information in it.

any ideas ?

# January 6, 2009 10:56 PM

ningcaptor said:

GH: WT is by far the best of the GH series atm.  I went out and bought Rock Band, put it in my 360, and when I played the first song, I noticed that the stage and performers behind the note highway were not as fluid moving as GH: WT.  the same can also be said for the PS2 version of GH: WT.

Song compatibility would be awesome, it would be interesting how they pull it off if they ever decided to do it ... cough NEVER! cough.

Guitar Hero: World Tour rocks!!! (someone has to stick up for them!)

# January 7, 2009 3:32 AM

Bertrand Le Roy said:

@bahamas4ever: you should use integrated security to avoid sticking passwords in config msdn.microsoft.com/.../ms254500.aspx

# January 7, 2009 7:37 PM

Rshaikh said:

Can you please provide one single static file for AjaxcontrolTooKit controls. We would cache this file for all our applications. I did try combining file by file but problem is sequence of file. Some file are dependent on other tookit file.

Thanks

Rshaikh

# January 9, 2009 5:15 PM

Bertrand Le Roy said:

@Rshaikh: very few applications need the whole set of controls. One thing you can do is use the profiling tool to generate the combined file you need, in the right order. www.codeplex.com/.../ProjectReleases.aspx

# January 9, 2009 8:12 PM

Rshaikh said:

Yes every apps don't need whole set, but our application is very large and each app teams develops different application, we can't track who is using which control. For profiling we need to put all controls in one page and then run profiler.

We want to make one js file for all controls and cache it for whole applications.

Thanks

# January 10, 2009 11:50 PM

koistya said:

Here is my list of asp.net developoment books:

http://www.riaguy.com/books/

And I am also a big fan of jQuery :-)

# January 12, 2009 2:28 AM

Bertrand Le Roy said:

@Rshaikh: yes, you would need to build a sample page with all the controls and then run the profiler, but that's probably the easiest way to get the full list of scripts in the right order.

# January 12, 2009 2:31 PM

KCC said:

I was able to fix the problem "Access is denied" and just wanted to share with everyone. I lowered the security settings in my IE (Tools > Options > Security). Select Meidum-low or anything lower than that and it would accept the scripts.

# January 13, 2009 12:32 AM

Bertrand Le Roy said:

I would not recommend anyone follow KCC's advice. First, you can't and shouldn't ask all your customers to lower the level of security of their browsers. Second, you're fixing the symptom rather than the actual problem.

# January 13, 2009 12:44 AM

Sunil kumar said:

its very nice to use....thanks dude....

# January 14, 2009 2:10 AM

TIGGR said:

?? ok...bare f*ing minimum so +100 Kudos points

-500 Kudos points for being an arrogant XXX .... This is TESTING we are talking about...testers, generally are not *propeller heads* like us JS Ninjas.... fair suck of the sav - this library/script is really for the coder and not a real contender in the JS Testing space.

All the same, well done.

Tiggr

Mr<dot>Tiggr @t g00gle mail <dot> com

# January 14, 2009 10:27 AM

Bruce Cho said:

Found a simple solution.

Instead of using Response.redirect(URL)

Use Server.Transfer(URL)

Seems to preserve

Session[], at least for me.

Hope it helps for you as well.

Bruce Cho

bcho@dialamerica.com

# January 14, 2009 5:45 PM

Bertrand Le Roy said:

@Bruce: sure, transfer always works for session but it's not a redirect, it works on the same request/response as far as the client is concerned and the URL does not get modified, which is the big reason why people use redirects rather than deleting the response and starting over, which is pretty much what transfer does.

# January 14, 2009 6:03 PM

Jeremy said:

This is a cool app. Thanks for sharing it!

Here is my question: Does this work if it's used with a Master Page? I am using a Master Page so that I have the same look on each page. It seems that the photo album is starting at the root of my web application and trying to grab images and directories from there. Have you ever tried this with a Master Page before?

# January 14, 2009 8:47 PM

Bertrand Le Roy said:

@Jeremy: sure, it should work just fine with a master. You should be able to set the path property on the control to any directory you want.

# January 15, 2009 1:42 AM

KCC said:

I must agree with Bertrand that what I mentioned is indeed an ugly "fix". I think the "Access denied" error I got is not from the "getLocation" function of the ajax javascript, but rather from a built-in security feature in most browsers which disables acess to cross domain data. I haven't really fixed my problem but here's a link which provides information and possible workarounds.

www.simple-talk.com/.../calling-cross-domain-web-services-in-ajax

# January 15, 2009 9:21 PM

Jules H said:

Having read this excellent article and all the comments, I followed the all the steps. I still got the error when trying to instantiate an AJAX calendar popup.

My solution was to upgrade the site from VS2005 (ASP.Net 2.0) to VS2008 (ASP.Net 3.5). Works fine now!

# January 16, 2009 10:12 AM

AI said:

I'm a little confused. Can you please comment on why this method is superior to unobtrusive javascript. Doesn't that accomplish your goal: "separate styling, markup *and* behavior" ?

Thanks

# January 19, 2009 7:17 PM

Bertrand Le Roy said:

@AI: it does the separation but is not declarative. And I'm not saying one is "superior" to the other. They are more like different styles.

# January 19, 2009 7:53 PM

Sunil said:

how to change bgcolor of folder, I want white color..............

:((((((((((((((((((((

pls tell me how to change....pls

# January 20, 2009 10:58 AM

Bertrand Le Roy said:

@Rich: yes, I should have thought about XBL and mentioned it. But is there a pure JavaScript implementation of it that works on all current browsers?

Also, it is mainly a component model, and the industry hasn't been waiting for that to create purely JavaScript based component models. What I'm advocating here is to physically separate behavior from style (instead of introducing new confusion by merging behavior into style like both htc and xbl are doing). The model that I describe should in principle work with any component model (although I'm using Microsoft Ajax in this example). And the implementation works today on all browsers, while remaining fairly simple.

# January 20, 2009 12:37 PM

coffee said:

wow, awesome, never seen such a thing

# January 21, 2009 3:05 AM

Emil Ivanov said:

Have you checked dojo behaviors:

api.dojotoolkit.org/.../dojo.behavior

# January 21, 2009 7:58 AM

Bertrand Le Roy said:

Dojo behavior or the way some jQuery plug-ins work come pretty close, but in an imperative way. Here, I’m playing with a more *declarative* approach that aims at clean separation of style, behavior and markup.

# January 21, 2009 1:57 PM

Clayton Scott said:

Javascript Event Sheets by Stuart Langridge are a very early implementation of this.

www.kryogenix.org/.../jses

There's also this discussion on Ajaxian from 2005:

ajaxian.com/.../beautiful-javascript-powered-pages-with-behaviour

# January 21, 2009 5:26 PM

Omari said:

I have been waiting something similar to HTC since IE 5, but your idea even better.

With live behavior instantiation it would be.. so useful

# January 22, 2009 1:11 AM

Mario Valente said:

# January 22, 2009 9:14 AM

Mario Valente said:

# January 22, 2009 11:21 AM

Bertrand Le Roy said:

@Mario: thanks for the links, DHerman's stuff comes pretty close too. Please note that jQuery Live Query is no longer necessary now that 1.3.1 is out (which is what I'm using in this experiment).

# January 22, 2009 4:20 PM

Jerry van de Beek said:

Thanks for this quick an nice solution.

It took me less than 2 minutes to get it up-and running.

Nice application for jpg handling.

# January 23, 2009 2:09 AM

Sean Hogan said:

There are already partial Javascript implementations of XBL-2.0.

http://xbl.googlecode.com

dojoe.nexaweb.com/index.html@cid=2789.html

www.meekostuff.net/.../XBLUI <-- my implementation

XBL-1.0 contributes a significant amount of the chrome for Firefox, and is (I assume) the most tested of the "behavior sheet"-like frameworks around. XBL-2.0 is the result of learning from the successes and failures of XBL-1.0.

I'm sure that XBL-2.0 could be bettered, but I imagine that any better solution for "behavior-sheets" will look a lot like XBL-2.0 anyway.

# January 23, 2009 5:50 AM

Len said:

Awsome app,  Worked great right off the bat additional user privledges needed to get the app creating its folder icons but I figured it out. Thanks for putting this together. Most companies are chrging through the nose for the ability to have a nice photo album on a website!

# January 23, 2009 2:30 PM

Jay Kimble said:

Bertrand,

The only big thing I see is that often times when I am building behaviors (with the MS Ajax) I like to allow for css classes to style various effects. I know this might be difficult but what would be cool is if in those cases the reference could be left out and some kind of mechanism in the CSS stylesheet could clue me in. Something like:

a $JaysCoolBehavior.ActiveCSSClass {border:solid 1px black;color:red}

a .someDiv $JaysCoolBehavior.ActiveCSSClass {border:solid 1px black;color:blue}

presumably my JaysCoolBehavior would use this class specified in place of the property and it would select the appropriate one accordingly.

I don't know if that's doable or even that what I threw in there is legal... just throwing something else for you to think about.

Jay Kimble

-- The Dev Theologian

# January 23, 2009 4:31 PM

vFragosop said:

Well,

In my opinion both, yours and jses solutions, gets pretty close to be good enough.

Since almost anyone is using jquery nowadays, needing another library just slows down the thing. A jquery plugin based script is better. At that point you're right.

But, jses linking system for the jses file makes sense, and the aspect of the file is identical to css, and not like json.

So, a regex based solution, that uses jquery selector and events api, parsing a external file, linked with it's own extension and type, is even better.

And the funny thing is that is a easy to do regex, since the syntax is always string { string: string }.

That results on a $(string).live(string, eval(string));

We could even do type="text/behaviorsheet" to clear out things.

# January 25, 2009 9:30 AM

Siderite said:

It's all good, I would really love this stuff in my browser, but then I have to think of the possible way to abuse or misuse this. How does one debug something like this? How do you do intellisense, if the behaviour file references javascript functions that are declared in js files that have no direct connection to it?

So, I would press on having a linking syntax first, something that would work either like a "javascript project file" - that can be read by both browser and Visual Studio or whatever IDE is used -, or something like register markup.

Also, maybe it's just me, but wouldn't it be a lot cleaner if the only thing declared in the CSS is the name of the function to be called on an event fire? I mean, the only possible parameters are 'this' and 'event', and in this way all the javascript would actually be in the js file.

# January 26, 2009 3:28 AM

Bertrand Le Roy said:

@vFragosop: please keep in mind that this is an experiment and I used what got me to a working sample the fastest. The dependecies are thus quite arbitrary and shouldn't influence the discussion.

I disagree the regex would be simple: if you're allowing authors to write handlers inline in the behavior sheet, those functions can contain pretty much any chars, string constants, etc. I agree that a real world implementation would probably imply writing a more elaborate parser, but that wasn't my goal here.

@Siderite: debugging actually works mostly fine, at least in Visual Studio. You can step into that code just fine. Setting a breakpoint can be a little more challenging but is still possible. But in general that's a good point: any extension of this type, whether it's implemented by the browser or by script, needs good tool support to be productively used.

I understand your point about putting function references rather than inline code and that might very well be the recommendation. On the other hand, any such effort shouldn't stand in the way of the extreme simplicity which has made the success of the web. If you look at the typical use of jQuery, for example, you'll see a lot of inline functions, which makes the code very fluid, expressive and easy to read. It should also remain very simple to throw together a sample and experiment. An incremental approach is the most productive for lots of people.

# January 26, 2009 1:56 PM

Ran Davidovitz said:

this issue made me crazy!, thanks for sharing.

# January 27, 2009 6:52 AM

romek said:

I know that this is pretty old topic, but can't figure out how to cover windows media player object in similar way..

# January 27, 2009 7:32 AM

Radoslav Stankov said:

I used such technique, for some time now I'm really happy how it works. You can check my implementation here github.com/.../behaviors.js

# January 27, 2009 8:11 AM

Bertrand Le Roy said:

@romek: windows media player objects should be subject to the exact same fix.

# January 27, 2009 1:58 PM

charlie said:

Bertrand, Ive read the article above and am still having some issues.

my session variable works on all my aspx pages but one. the page in question is quite simple. on load, it checks for a session variable but does not find it.

the page contains 2 frames which are simply showing a .htm file each.

i have checked the session id on both the working pages and this page and they all seem to be the same yet i cant seem to pass the session variable to this one page

any ideas?

thanks in advance

# January 27, 2009 3:09 PM

Bertrand Le Roy said:

@Charlie: if you've tried all the advice in this post and read through the comments, you should probably call support. Without knowing what you're doing in that page, there is little I can do. My psychic abilities are not what they used to be ;)

# January 27, 2009 3:28 PM

Simon Arthur said:

In your very second line,

 if (SomeObject.foo) {

SomeObject.foo might be a numeric type with the value 0. And the intent of the original code is to determine whether foo has been set. So your code doesn't do that.

From a Jash session:

>> 0?"first":"second"

second

>> 1?"first":"second"

first

>> null?"first":"second"

second

# January 28, 2009 2:14 PM

Bertrand Le Roy said:

@Simon: sure, hence the bold 'object' in the post.

# January 28, 2009 2:39 PM

George said:

Hi, This looks great and something I think I can really use, but unfortunately I am encountering problems trying it on brinkster.  Here is the error I am receiving.  Any help you can provide is greatly appreciated.  Thanks much in advance.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'com' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 52: using System.Web.UI.WebControls;

Line 53:

Line 54: using com.drew.metadata.exif;

Line 55: using com.drew.metadata.jpeg;

Line 56: using com.drew.metadata.iptc;

# January 28, 2009 2:58 PM

Bertrand Le Roy said:

@George: you probably didn't upload the dll into the bin folder of the application.

# January 28, 2009 3:02 PM

George said:

Hi, thanks for the quick response, but yes, I have uploaded the bin file to the application.  Any other ideas?

# January 28, 2009 3:35 PM

Bertrand Le Roy said:

Are you sure that bin folder is at the root of the configured IIS web application? (this is the only reason why you'd see that message)

# January 28, 2009 3:47 PM

George said:

Ahh ha... thanks again for the quick responses.  I had the dll in the bin folder under the webroot folder.  I just copied up the file album.ashx to my webroot folder though and it works fine there.  I have not been able to get it to work in just a subdirectory yet though.  I will try again tomorrow.  Thanks very much for your assistance!!  Great utility!!

# January 28, 2009 4:29 PM

Tango said:

Do you have a VB.NET Version?

# January 28, 2009 9:18 PM

Bertrand Le Roy said:

@Tango: no.

# January 28, 2009 11:22 PM

George said:

Hi, this is great, but I can still only  get it working in my webroot directory.  If I put album.ashx in a sub folder I get the error "type or namespace com could not be found".  I do have the dll in the bin folder of webroot though.  Do you have any ideas on how I might resolve this?  I really only want to display images from the subfolder.  Thanks in advance.

# January 29, 2009 11:34 AM

George said:

some additional information... the version of the dll I am using is 2.2.2.41745.  Thanks - George

# January 29, 2009 11:39 AM

Bertrand Le Roy said:

@George: you can use the album as a user control and set its path property.

# January 29, 2009 3:10 PM

miraz912 said:

Hi great job. Working fine on mine. Just wondering if it is possible to have image titles or description added.

Thanks

# January 29, 2009 6:55 PM

Bertrand Le Roy said:

@miraz: that's failry easy if you use it as a user control (there are templates for precisely that), otherwise you can delve into the rendering code and add it.

# January 29, 2009 7:00 PM

RichB said:

That's horrible non-semantic code. You shouldn't be touching anything to do with styling at this point in the data flow. These sort of problems have already been solved - Simply use the tr:nth-child(even) CSS selector.

or if you happen to use a web browser without that support, you can map it in a runtime easily with JQuery:

$('#peopleIKnow tr:nth-child(even)').addClass('even');

# January 30, 2009 5:49 AM

David Evan said:

While I appreciate Microsoft's constant future thinking I'd appreciate it if you please indicate in an article title when the solution or its code requires beta, release-candidate or other non-release technology.   This rule should be applied to all articles, solutions and code on this site.  Keep up the great work in keeping us informed.

# January 30, 2009 9:27 AM

Chris Bower said:

With Microsoft adopting jQuery would it not be easier to use the :odd filter to style the rows?

# January 30, 2009 11:10 AM

George said:

Hi, I dont' mean to be a pain (fairly new to this), but where do I set the path and property?  Do I do it in album.ashx?  If so, do you know which line, or do you have an example.  Thanks again very much in advance.  Again, it works fine in my webroot, but I receive the error "The type or namespace name 'com' could not be found" when I try it in a sub directory.

Thanks

# January 30, 2009 11:51 AM

Bertrand Le Roy said:

@George: look at the sample that comes with the handler. It uses the handler as a control inside a page. You can set the path property on this control.

# January 30, 2009 12:31 PM

Bertrand Le Roy said:

@Rich: you might not want to take an additional 18kB dependency just to add style. You are right that nth-child is unfortunately not supported by all currently common browsers and that otherwise it would work nicely in this case. Except that "class" has the advantage of removing the coupling between the shape of the markup and the style. If you decide to switch from a table to a plain list, for example, your CSS rule would have to be rewritten. Not so if you use a class like I do. But I concede that from a purely semantic standpoint, the stylesheet should be the right place, but maybe you'd want at least to write this rule without relying on tr. You should also see beyond this example that CSS can't do everything. For example, imagine that you want to put a green background behind stock quotes that have a raising value and red on the other ones, or some more complicated business rule. In such cases, the method above is both useful and semantically correct (the rule to apply the class is then no longer positional but is now data-driven, so it belongs in the template).

@David: I'm not sure what I could have said that would have made it clearer... From the post, "uses Microsoft Ajax 4.0 Preview 3". Also, the DataView control has never been released in anything else than previews.

@Chris: that's if you are using jQuery, which is an additional and optional 18kB dependancy. We support the use of jQuery but we're not forcing our users to adopt it.

# January 30, 2009 12:55 PM

foobar said:

@Rich: What if the alternate coloring was a user preference?  Then what?

# January 30, 2009 1:32 PM

Chris Bower said:

I would sacrifise 18kb for the ease jQuery places on html manipulation. I think that the ASP.NET AJAX templates combined with jQuery make desktop applications on the web seem relatively easy. An exciting time to be a web developer.  

# January 30, 2009 7:22 PM

bcardiff said:

I like it. It removes the ugly concatenation of css classes. I understand and agree in the use of :nth-child or :odd with either css or jquery, but that just applies to this example.

Thinking of applying a cssClass upon $dataItem state, I would like to see bindings (probably with converters).

For example, in a TODO list, dom that display item could have a class="completed" binded to a item.Completed property. Otherwise some code is necessary on OnItemCreated to achieve that.

# January 30, 2009 11:57 PM

Ran Davidovitz said:

i am sure tha Microsoft client templating will be the easiest solution in the market BUT i ask my self why you need to develop a new method of templating and indeed not extend other already build client templating mechanism (e.g. even written in JQuery)?

I am sure that with the great power of Microsoft people such as you JQuery would become even larger and more adopted.

# January 31, 2009 1:44 PM

Buzz said:

@Bertrand Le Roy (21 Aug 2008) said

Next preview of the Ajax framework is next week

-------------

The toolkit is great. but I feel like we have been left in libo with the status of the project with the last release being on the 20 Aug 08 which was forced due to the 3.5SP1 framework update.

I dont have an issue with the time between now and the previous update, its the lack of information thats the problem. The toolkit project shows their are no planned releases.

Can we please have a date for the next planned release and what has been/will be done in the next release.

# January 31, 2009 3:27 PM

Bertrand Le Roy said:

@Buzz: just look at the great controls that have been added since the last release. In particular, last week, we got a fantastic rich text editor, which was in very high demand. We will try to do a new release soon, but you can already download the latest source code drop and compile it to get the new controls.

# February 1, 2009 1:00 AM

Buzz said:

@Bertrand Le Roy

Thanks for the reply.

I was not thinking about new controls, but fixs to existing ones. Such as the rating control can not centre justify in a div (it always floats left) in IE8 and firefox 3.05 (ok in IE7).

We can see various issues have been fixed, looking at the issue tracker, but I don't want to download a version which may not be a stable release.

# February 1, 2009 7:01 PM

Joe Chung said:

This technique would be useful for assigning a class name to an element when the logic involved is more complicated than "is this row odd or even?"

Anyways, speaking of bit forcing people to adopt JavaScript libraries, any chance of us being able to get rid of WebResouce.axd scripts or at least being able to put them on a CDN?

# February 2, 2009 8:20 AM

Bertrand Le Roy said:

@Joe: you can get rid of scriptresource.axd by adding script references with the same name but with a path. As for webresource.axd, for the moment, the only way to suppress them is not to use the features that bring them in (such as Menu, TreeView, validation, etc.). For the CDN, that should be available very soon for the Microsoft Ajax files.

# February 2, 2009 12:58 PM

Bertrand Le Roy said:

@Buzz: I apologize about the delay. We'll try to get a new release out as soon as we can.

# February 2, 2009 1:00 PM

Gabriela said:

Hello again and tks for your answer. Well my new question is about hot to delete all data an re fill the list. I have one list that shows messages. Well, if a user enters a new message, the list must be reloaded. In my case,I call the load data method and the result is that all the registers are added to the list without erase the previous one? What do you think? Should I delete by javascript all the li elements generated in the previous call to the loaddata method and then reload data or there is a method in the template that can help me.

Sorry again for all mistakes because, I'm still learning how to do this in English.

Gabriela from Argentina

# February 2, 2009 5:58 PM

Bertrand Le Roy said:

@Gabriela: if you call set_data with the new data, that should wipe out the old rendering and replace it with the new. Please check that your data does not still have the old data.

# February 2, 2009 6:03 PM

John Pennington said:

Bertrand, I couldn't help but notice a reference in this post to Ajax 4.0 Preview 4 in the "Injection Attacks" section. I understood that P4 was originally targeted for release in December 2008. Do you have an update for when P4 will become available on CodePlex? Thanks and keep the posts coming.

# February 5, 2009 8:32 AM

Chris said:

Of all the template languages I've used in Rails, CakePHP, Catalyst, Merb, Django, etc, Django is the only one I've encountered where the variables you put in the templates are all automatically encoded/escaped by default. You could tell it to NOT automatically encode values on a variable by variable basisc if you needed to.

It would seem that the escape-by-default should be the default behavior on a lot more templating engines.

# February 5, 2009 9:48 AM

Keith Yanachik said:

Bertrand,

Thank you for the good article.  I have had alot of luck with EJS (Embedded Javascript) templates in my ASP.Net applications.  It's Partials allow me to call templates recursively.  http://embeddedjs.com/

I tried PURE templates and had luck but could not get the recursion working properly.  http://beebole.com/pure/

# February 5, 2009 11:23 AM

Bertrand Le Roy said:

@John: soon. Almost done. :)

@Chris: it's great to encode by default, and that's what we're doing in our client templates, but it's important to keep in mind that it's not enough. For example, it doesn't protect against the javascript protocol being injected into a url attribute.

# February 5, 2009 1:04 PM

InfinitiesLoop said:

Actually, there's an important difference between "enocding automatically" and not needing to encode in the first place. Because our solution uses DOM apis to build the instance nodes, it isnt actually enocoding anything, because it doesn't need to. An engine that needs to encode, even though it does it automatically, will suffer from that performance/memory usage hit as well as be vulnerable to attacks on the encoding/decoding mechanism itself (if any).

# February 5, 2009 4:00 PM

Bertrand Le Roy said:

@Keith: yes, nested templates are an important feature, which we're handling fine.

# February 5, 2009 6:44 PM

florim said:

Yes super.

# February 6, 2009 8:14 PM

jeffreyq21 said:

Hi I had a problem when i attach jQuery 1.3.1-vsdoc.js in scriptmanager. I have a page which when it will load it uses jquery and when the page loads a  javascript error was thrown says "jQuery.support.opacity is null or not an object". when I remove the jQuery 1.3.1-vsdoc.js in my scriptmanager it works fine..

# February 7, 2009 2:36 AM

MisterFantastic said:

Hi,

Thats really valuable news. Thanks for the sharin the info.

Thanks & regards,

Thanigainathan.S

# February 7, 2009 9:42 AM

Bertrand Le Roy said:

@Jeffrey: the solution is actually quite simple... :) You should never, ever use the vsdoc version at runtime. Always reference the regular jQuery file, the one you want to use at runtime. Visual Studio, if it has the JS IntelliSense hotfix, will just find the vsdoc version at design time.

# February 9, 2009 1:03 AM

Mike said:

Great post, it helps me evaluate template engines before I even knew what to look for. I did know that I wanted pure javascript. Looks like the ASP.NET Ajax templating solution is a good one. How large is it to include on a page?

# February 9, 2009 6:51 AM

danpep said:

This is just what I needed! Thanks for sharing this wonderful app.

I have close to zero experience with IIS and ASP.NET yet I was still able to get up and running in about an hour or 2 with help from these messages and google.

I plan to create a mobile.ashx/aspx with smaller image dimensions so I can view my photos from anywhere on my phone.

Thanks again.

# February 10, 2009 11:23 AM

SonuKapoor said:

Awesome! I love jQuery. I have been using it to implement some new features in the AjaxDataControls V2.

# February 11, 2009 10:08 AM

RichB said:

@bleroy: 18Kb is 10% of the page weight of this blog page. I can live with that.

@foobar: It depends on where the user preference is stored. DOM storage, then you're doing everything client-side anyway. Server-storage, then you can switch stylesheets/JavaScript shims depending on user.

# February 12, 2009 5:11 AM

CaitNY said:

This is a little off topic, but since you mentioned that the script manager removes duplicates...

For some reason removing duplicates doesn't work with script combining.  I posted on the forum but no one could help.

forums.asp.net/.../2924346.aspx

Any ideas?

# February 12, 2009 1:32 PM

CaitNY said:

This is great by the way, but it doesn't add the js file specified by FrameworkPath into the CompositeScripts...?

# February 12, 2009 2:35 PM

Bertrand Le Roy said:

@CaitNY: I'll look at that forum post. If you're using CompositeScript, you should be able to modify the source code so that the new reference is added to the composite list instead. The source code isn't that complex, that should be relatively easy to do. Let me know how that goes.

# February 12, 2009 2:54 PM

Nathan J. said:

Thanks for the guide; I'm planning to take our old (relatively unused, but good working) Guitar Hero 3 guitar, same as you got before you painted it, and give it to our niece for her sixth birthday.  I see that arts and crafts store only carries it in black, white and red (how original) but I bet if I check paint stores I can find pink or purple.

I agree with the above poster, white is boring.  The stickers they give you don't help, either.  Your red guitar looks great.

# February 12, 2009 3:40 PM

Nathan said:

I tested the all the above, but what I can't figure out is the following:

I have an Active-X document that has 100% height and width..(It shows document's and stuff in the browser)...

What I would like to do, is post a note above the active-x...

I can't seem to get this to work..

# February 16, 2009 8:21 AM

Alek Davis said:

Bertrand Le Roy said: "You should never, ever use the vsdoc version at runtime." May I ask why? I assume that the vsdoc version of the file is functionally the same as the original file (with the exception of the dummy vsdoc files generated for comments only). Thanks.

# February 17, 2009 6:47 PM

Bertrand Le Roy said:

Because it's much larger, because its code structure is slightly different (in principle it's equivalent but we do no testing to ensure it nor any claim to support it) and because you don't need to. With the VS patch, you can just reference the minimized version and VS will know where to find the vsdoc version to provide IntelliSense.

So rather than asking why you couldn't use the vsdoc file at runtime, the right question is why would you?

# February 17, 2009 7:30 PM

Alek Davis said:

I assume that the VS patch applies to VS 2008 SP1. If my assumption is correct, for projects which are still on VS 2005 and earlier, using the vsdoc version makes sense. Sure, it's larger, but would anyone -- meaning a human -- really notice a difference between the times to load the vsdoc version and another version? I doubt. If the vsdoc version is provided for documentation only, it should not contain any functional code (like a dummy file generated via InfoBasis JQuery IntelliSense Header Generator); otherwise, people assume that it's a functional version. I spent almost an hour trying to figure out what caused the error reported by jeffreyq21 (until I compared results to a non-vsdoc version). And if the vsdoc version is intended to be functional, then reported bugs must be addressed.

# February 17, 2009 8:39 PM

Bertrand Le Roy said:

@Alek: Visual Studio relies on actually running the script to determine a good deal of the IntelliSense information, and the final API of jQuery is created dynamically at runtime, with a lot of "code generation". Generating an empty doc file would mean lots of reverse engineering and unfolding of the code (we had to do some of that but only a little) and we would probably not get it exactly right in the end. It's much more reliable this way and much faster to generate, which is important seeing how often jQuery revs. We went to great efforts to make sure that you would never need to reference that file from VS while still getting full IntelliSense. We also made sure the file on jquery.com is labeled as documentation and not as a runtime file.

In the end, you do what you want, but there is no way we're going to support such a scenario and you need to understand the performance and possibly reliability impact.

# February 17, 2009 8:54 PM

Alek Davis said:

@Bertrand: OK, so if the vsdoc file is only intended for IntelliSense, what is the difference between the one you built and the one that can be generated using <a href="www.infobasis.com/.../">InfoBasis JQuery IntelliSense Header Generator</a>? The InfoBasis version does not contain any functional code, but I'm not sure if it contains the same documentation or if it's different. Thanks for quick responses.

# February 17, 2009 9:08 PM

Bertrand Le Roy said:

@Alek: feel free to use that file if you want. I don't know what these guys are doing to generate the file or how well it works. The vsdoc file on the other hand is produced by the same team that works on JavaScript IntelliSense in Visual Studio and is the best you can get for 2008 SP1.

# February 17, 2009 11:37 PM

Rick said:

I am a newbie and I have this handler up and running. I need to restrict the handler to pick up a specific directory. I have tried dropping the handler(album.ashx) in the specific directory but then when I run it, I get the thumbnails with red x's. I am simply trying to get the folder \Photos with Sub Dir's \Album1, \Album2, etc. to display without pulling from the root of the website. I have treid multiple configurations and seem to run into issues. It lloks like I can set the path in the control properties but that gives me another error ~/Photos/album.ashx. Please help!

# February 18, 2009 10:23 AM

Bertrand Le Roy said:

@Rick: You don't *need* to use the page and control if you're not going to add stuff around the album or modify the templates. You can use just the handler on its own, and drop it into the photo directory.

If you do want to use it as a control, the path must not point at the handler but rather at the photo path.

# February 18, 2009 12:31 PM

Alek Davis said:

Thanks Bertrand. I appreciate the feedback.

# February 18, 2009 3:38 PM

Stilgar said:

Oh thank you! I don't know how I would have fixed it without this article.

BTW how is that I always scream against all the fancy AJAX stuff when my coworkers include it in the project and no one pays any attention but when it comes down to fixing the bugs I get to do it?

# February 23, 2009 8:52 AM

Moshe Kaplan said:

I'll be glad to have a cross broswer version,

Best Regards,

Moshe Kaplan. RockeTier

# February 23, 2009 12:15 PM

Rick said:

Got it working. Thanks! I did not realize that you could use the .ashx directly as a page. Is there a simple way to use this with an MSACCESS database BLOB for your pics?

# February 24, 2009 10:20 AM

Bertrand Le Roy said:

@Rick: no, no database support, sorry, unless you add it yourself. But why would you want to do that? Is it an existing database that you have from which you want to extract pictures?

# February 24, 2009 1:21 PM

Joe Chung said:

"Would anyone -- meaning a human -- really notice a difference between the times to load the vsdoc version and another version?"

A human would notice the bandwidth bills from using a 190K JavaScript file vs. using a 55K one.  People viewing your site on 56K modems would also notice.

The 1.3.2 vsdoc is out, by the way.

# February 25, 2009 8:28 AM

Rick Connell said:

I have a simple app that logs in a user based upon their email address. (This is not sensitive data) I look up the user in the database and if they are found the session variables are set with userID, FirstName, etc...

I have set the session variables correctly. That is a pretty straight forward process. When I access another page all the variables are null. They don't persist whether I Response.Redirect, Server.Transfer or just type in the next page in the address bar. I am testing on Visual Studio 2008, it is really quite frustrating.

# February 25, 2009 4:28 PM

Bertrand Le Roy said:

@Rick: please read the post. It addresses precisely your problem. What you'll probably want to use is RedirectFromLoginPage.

# February 25, 2009 4:57 PM

Pouya Vatanpour said:

I'm looking for source code to extract metadata from jpeg file in IPTC format, please help with C# or VB.NET

vatanpour@msn.com

# March 1, 2009 2:10 AM

Rima said:

I have a client who is in a hurry and wants an image gallery to be working by tomorrow ..

So I came across this site.. it seems really cool..

I'm still trying to figure out a way to add a description for each photo without using data tables..

I think I am going to use one xml file for each folder..

not sure yet..

any quick suggestions?

# March 3, 2009 2:10 PM

Bertrand Le Roy said:

@Rima: the metadata in the image files themselves is more than capable to do that, and the album handler already knows how to read that information. Adding an xml file seems unnecessary.

# March 3, 2009 11:54 PM

Nathan Duby said:

The issue I am having is that it creates the initial album perfectly, but I am pointing to a virtual folder through IIS and the script seems to set all the addresses as f/photos instead of /photos, so I cannot click on the thumbnails for the folders to look inside...any ideas?

# March 4, 2009 4:17 PM

Bertrand Le Roy said:

@Nathan: I don't understand. Can you send me e-mail at bleroy at microsoft with some more details about what you're trying to do?

# March 4, 2009 8:44 PM

Rima said:

Roy, the issue is, I am adding a backend for the album, to allow uploading photos, the guy isn't really into using FTP to upload each photo.

So I need a way to make uploading images, editing titles, metas and directories, deleting  possible.

and I added directories creating, editing, deleting..

but the issue is I want him to select an image or album from the rendered control and edit them..

Hope you got my point.

What I am trying to add now is a button inside the <ITEMTEMPLATE> that hold "command name and command argument" though dealing with a repeater in this is a real pain.

Why I can do it separately, but I actually want to use the power of thumbnail generation on disk.

any suggestions?

# March 5, 2009 2:37 AM

Bhushan said:

Hi,

Previously I had worked on

Response.Redirect("admin.aspx");

After adding

global.asax inVS2005

it showed error

Data: error: cannot obtain value

HelpLink: error: cannot obtain value

InnerException: error: cannot obtain value

then i tried working with

Response.Redirect("admin.aspx", false);

and it started working properly.

I now want to know

1.why is this happening, only when i add this syntax

Response.Redirect("admin.aspx", false);

2. I also want to use session variable before Response.Redirect

# March 5, 2009 8:36 AM

Greg said:

Is the CSS in the current version on codeplex the newest version? because the layout doesnt look the same as the one on those images, I think i have the same problem as posted by Martin Dolphin in the very first post here

# March 5, 2009 4:59 PM

Bertrand Le Roy said:

@Rima: the library that I'm using currently doesn't support writing the meta-data back to the image files but that sounds like the right thing to do in principle (and I believe .NET now has read/write APIs for EXIF data). Storing that data in a database might get you there faster though.

@greg: let's follow up offline on that.

# March 5, 2009 5:22 PM

Bertrand Le Roy said:

@Bhushan: it's pretty much impossible to tell without knowing anything about your code.

# March 5, 2009 5:43 PM

Rima said:

I did not add the editing.. just added file upload, directories and files names editing and deleting.

I still can't get this PATH attribute work.

keeps getting:

Value cannot be null.

Parameter name: value

on the line:

if (path != _requestDir && !path.StartsWith(_requestPathPrefix)) {

I can't use the default album.ashx,  I need to edit the template.

I have the images in a directory called: Gallery

So I tried setting the path:

~/Gallery

Gallery

~/Gallery/

Gallery/

/Gallery/

And keeping the Register

<%@ Register Src="album.ashx" TagPrefix="photo" TagName="album" %>

HELP :( :(

# March 6, 2009 8:27 AM

mckamey said:

First of all, thanks Bertrand for the good thought that went into this post.

Disclaimer: I built the JBST client templating in JsonFx.NET, so my responses are equally biased.

1. Expression delimiter:

I find that the familiarity of "<%=" and "%>" makes it the most natural to work within.  It can be escaped the same way they have since SGML, with character entities: "&lt;%=" and "%&gt;". All the JsonFx documentation has embeded examples writing in the templates.

XHTML compliance? This assumes that your templates are stored directly in the markup. JsonFx precompiles JBST controls to pure JavaScript. This means that the resulting templates themselves are built from XHTML but may be compacted, compressed and cached just like any other JavaScript file.

Server-side code: This hasn't been an issue in JsonFx either because JBST controls are built just like ASP.NET UserControls which are then attached to a page rather than residing within them.  Again caching was the driver on this one.

2. Expression language:

I wholeheartedly agree. Adding another language to the mix is unnecessary. JavaScript has its own beauty and fits well within a template solution. Again familiarity is a design choice.

3. Script injection protection:

The only way this is an issue is if user data is being treated as markup. JsonFx doesn't combine data as markup but as encoded text by default. There exists a mechanism to treat user content as markup, but the template compiler also doubles as a highly configurable HTML parser which can scrub user data first.

4. Template location

JsonFx uses built-in Visual Studio tools to precompile and deploy templates as cachable attached scripts.  These can be combined (at build-time) with the scripts that already must be deployed, so the result is actually *fewer* requests to the server.  I have yet to find a real world situation where this is worse than embeded.

5. Events

I agree with the choice on this one. Sometimes it can actually improve the readability to attach events directly. In all reality, unobtrusive JavaScript loses its utility when the DOM elements aren't even available without JavaScript. At that point it becomes pure academia. JsonFx provides mechanisms for both.

6. Live bindings

Amen! This is the whole point of client-side templating. The other choice is what's called HTML message pattern which is easy to build but far, far less efficient.

7. Constraints on markup shape

Tables in IE aren't the only oddity of IE DOM, but they certainly are one of the worst (stylesheets are up there as well). JsonFx uses full DOM methods to create the data-bound templates which avoids the pitfalls of innerHTML.

8. Ease of data field access

Access to data is something which I toiled over when creating JsonFx. My design choice was to leverage the "this" keyword since in global usage it is of little use being bound to the global "window" object.  JsonFx allows access to template specific functions, data and meta-data via "this.".  Those extra characters allow references to data like "price" to not collide with otherwise globally accessible objects and data. Pure ease-of-use is a double-edged sword that can have painful side effects if not careful.

9. Readability

Amen, amen, amen (subjectively, of course).  JsonFx looks/feels just like ASP/JSP/ASP.NET UserControls.

10. Performance

This is extremely important. This is the thing that drives someone to choose client-side templating, so it shouldn't be the part that breaks down first.

11. XHTML Compliance

I agree that XHMTL compliance should not be prevented, nor forced. Again, though, this is very ASP.NET AJAX design-centric. If your templates never sit in markup and they are rendered with JavaScript/DOM then this is moot.

12. Nested Templates

Agreed. No real world scenario would be maintainable without nested templates. The reuse of sub-templates makes life a lot simpler.

In conclusion...

It is interesting that virtually all of these factors are very ASP.NET 4.0 AJAX centric. For other templating systems such as JsonFx.NET, many don't even apply. I encourage those looking at ASP.NET AJAX to take a look at JBST development within JsonFx: starterkit.jsonfx.net

# March 8, 2009 4:21 PM

Bertrand Le Roy said:

@mckamey: I disagree that this is ASP.NET centric and that some criteria don't apply to other engines. Rather, it's that you chose to ignore those, (which might be fine depending on your requirements). Case in point, making the template markup part of the document is what we do by default because we think there is a number of benefits in doing that (as explained in the post) and there is nothing specific to ASP.NET about that. Now you argued that this doesn't apply to your framework because you are precompiling your templates at build time and the templates end-up being a js file at runtime. The thing is, it is entirely possible to do the same thing with Microsoft Ajax (we do also compile templates to JS, but we usually do so at runtime), but the point is that you don't have to. So in this case, there is actually a constraint in the way you do things, and you have choices with Microsoft Ajax that you will never have with JsonFx due to the way it's designed. Which, again, might be perfectly fine if what you're doing is aligned with the constraints of what you're doing.

I'd also be curious to know what you're doing against malicious user data using the javascript protocol in url attributes.

Thanks for the detailed comment.

# March 10, 2009 8:53 PM

victor said:

I am an IT auditor. I find that there were developers who had modify rights on inetpub directory in the production environment. How risky or dangerous it is? please help

# March 11, 2009 4:26 AM

Bertrand Le Roy said:

@Victor: please don't take my advice as the official Microsoft recommendation but only as my opinion. If those developers must publish the development site to the production server, this seems quite normal. I'm not sure what to do if that is not acceptable. One thing you might want to do is turn on write audits on that directory. That won't prevent attacks from insiders but it would enable you to find who's responsible for it.

# March 11, 2009 1:30 PM

softmaran said:

it doesnt work for me if i put it in datalist

# March 12, 2009 3:01 AM

victor said:

Thanks very much. Bertrand Le Roy. I will also do some reading from the best parctice.

# March 12, 2009 4:01 AM

Christian Hagelid said:

@Dan: and you can use CTRL+SHIFT+I to start searching from the bottom

# March 13, 2009 3:18 AM

vallamreddy123 said:

Really worthful article.

It's really worked for me.

I am very much tahnkful to u as it saved my job.

# March 18, 2009 2:09 AM

Bhakthan said:

I'm all for checking out preview 4!. Great work.

# March 18, 2009 6:55 AM

ETF Screener said:

I like the attribute-based declaration of javascript behaviors and bindings. The "code:if" would be very useful in templates.

One question: how well will this integrate with jQuery (or other JS libraries)? Instead of $addHandler and $get, would it be possible to use jQuery's version of getting and adding event handlers to elements?

# March 18, 2009 11:33 AM

Bertrand Le Roy said:

@ETF Screener: you can use any JavaScript you want in {{ }} expressions, as well as to create handlers and stuff. So yes, this works with jQuery and others. We are also experimenting with other ideas related to interacting with other libraries. Stay tuned for preview 5...

# March 18, 2009 1:58 PM

JKong said:

This is great. I'm excited about this!

# March 18, 2009 2:43 PM

Andrew Arnott said:

Excellent post!  thanks

# March 20, 2009 5:55 PM

Scott M said:

I have found that the debug/release links that the SRP provides on the page will not always provide the correct version of the script, if you've already clicked one of the links.  For example, if you click the debug link you get the debug script, but if you then click the release link, you still get the debug script.  I've found that refreshing the page before clicking either link ensures that you get the right script.

Also, I've found that even if I provide a .debug.js and a .release.js version of my custom scripts, the combined script provided will always provide the release version of my script.

# March 21, 2009 9:49 AM

Bertrand Le Roy said:

@Scott: I'll look at the first problem, but for the second one you might want to specify ScriptMode=inherit on the script reference if you want the system to understand a debug version of a static script file exists. foo.release.js should really be foo.js, also.

# March 21, 2009 8:41 PM

Andy said:

Client side change tracking and batched updates with the DataProviders is amazing.

What's the status of using these Previews (I realise unsupported) scripts in Live/Production deployments?

I'd be interested if HtmlHelpers could be authored for ASP.NET MVC that either generate vanilla HTML for input controls and forms when javascript is switched off, or add the binding syntax when javascript is on. As the layout/html for a form would have to be authored twice for live/static versions.

# March 23, 2009 10:03 AM

gramic said:

I didn't get what is the role of sys-key in the declarative markup. Is it some kind of global variable or what.

# March 23, 2009 12:31 PM

Bertrand Le Roy said:

@Andy: The preview is perfectly fine to use in production (at your own risks, of course). The license can be found here: aspnet.codeplex.com/license and is the same as all other ASP.NET previews. Eventually, the final version will be available under MS-PL.

Not sure how you'd know from the server if javascript is off, except for a few known user agents such as search engines.

@gramic: sys-key is creating a local variable that is a reference to the current element or component, making it easier for an expression to refer to a component without having to generate a unique id or using $find.

# March 23, 2009 12:43 PM

Daniel Gasienica said:

Now there’s an official distribution of the Python Deep Zoom Tools, originally developed by Kapil Thangavelu, brought to you by the OpenZoom Project. I’ve greatly enhanced them and additionally to the Deep Zoom image pyramid generation added support for Deep Zoom XML image descriptors and Deep Zoom collections.

<em>Download</em>

<strong>Python Deep Zoom Tools (0.1.0)</strong>

open-zoom.googlecode.com/.../deep-zoom-tools-0.1.0.zip

Cheers,

Daniel

P.S. Please write about your experience at getsatisfaction.com/openzoom

# March 23, 2009 7:07 PM

Lucas said:

Are these the right ones?

KB962351 - WebBaseEvent.Raise fails in the Application_Start event on IIS 7.0

KB967535 - IIS 7.0 Request.TransmitFile / Request.WriteFile not working expected

# March 23, 2009 7:42 PM

mike johnson said:

those links point to IIS 7 patches? is that right ? i would have thought these would have been for the CLR or something similar?

# March 23, 2009 7:46 PM

Bertrand Le Roy said:

Yes, these are the right patches. I know the titles are a little off, but these patches do contain the menu fix.

# March 23, 2009 7:50 PM

mhildreth said:

If anyone is intersted, there is also a simple CSS fix for this issue. All you need to do is set the z-index of the dynamic popouts. I blogged about it here if anyone wants additional details:

weblogs.asp.net/.../testing.aspx

# March 23, 2009 8:09 PM

JOGI said:

When we use response.redirect it send a another request to web from client hidenly.

if you use response.redirect("~/abc.aspx",false)

then you dont get exception thread aborted because now web do not want reply.

Same You can with server,transfer also.

And in response.redirect request scope it end.

but session scope data always there.

So no problem if you are not flow the data using request

JOgi

# March 24, 2009 3:20 AM

Thanigainathan said:

Hi,

how this is different from JQuery based on the performance ?

Thanks ,

Thani

# March 24, 2009 5:07 AM

Mike said:

Ok, so it takes exactly 3 days to get a fix for rendering issues in YOUR browser, but rendering issues in Safari have NEVER been fixed since .NET 2.0

Microsoft, always the same company: evil empire

# March 24, 2009 8:25 AM

mcbeev said:

Will this fix eventually make it to a windows update ?

# March 24, 2009 8:45 AM

Juan T. Llibre said:

How can KB 962351 be a patch for Windows 2000, XP and Windows Server 2003, when the patch is tagged as a  fix for IIS 7.0 ?

None of those OS's can run IIS 7.0.

# March 24, 2009 1:09 PM

Bertrand Le Roy said:

@Thanigainathan: well, jQuery does none of that so it's a tough question to answer...

# March 24, 2009 4:25 PM

Bertrand Le Roy said:

@Mike: believe me, it took a lot longer than 3 days... And please don't shoot the messenger. What Safari issue are you referring to exactly?

@mcbeev: probably not, but the fix is in 4.0 already.

@Juan: there is more than one patch in the download.

# March 24, 2009 4:29 PM

tfbarrett1981 said:

Just a quick question. This patch is backward compatible for IE7 and IE6 correct?

# March 25, 2009 9:03 AM

tfbarrett1981 said:

Our sites are pre-compiled will the sites have to be re-pre-compiled after we apply the patch?

Tom B

# March 25, 2009 9:40 AM

Rob Karatzas said:

to have the asp:menu work in all other browsers (where it is NOT working by default), simply add:

Context.Request.Browser.Adapters.Clear()  ' vb.net

to your login or master page.

i wrote scott guthrie months ago about this, explaining to him that the asp:menu control has become an 'orphan' when we found this problem in Win 7 beta (and that I didn't think adequate resources where being allocated for cross-browser compatibility in general).

sadly, when i use to know SG as a development manager, he use to write back (or Rob Howard who is long gone as well).

rob k

# March 25, 2009 12:27 PM

Andrew Webb said:

Umm... I think I'm missing something here...

I have a "/Date(1198908717056)/" string in one of my vars.

Can you give me a simple line or two of JS that will convert this string to a JS date?  Thanks.

# March 25, 2009 12:56 PM

Bertrand Le Roy said:

@Andrew: it needs to be "\/Date(1198908717056)\/", not "/Date(1198908717056)/". Then calling (new Sys.Serialization.JavaScriptSerializer()).deserialize will convert it to a date object.

# March 25, 2009 5:01 PM

Andrew Webb said:

@Bertrand: That doesn't seem to work.  Perhaps you can help me.

The first thing to trip me up is that ExtJs's JSON decoder converts "\/Date(1238025600000)\/" (23 chars) to "/Date(1238025600000)/" (21 chars).

The second thing is that 'serialize' and 'deserialize' are static methods, so we don't want to construct JavaScriptSerializer.

So I did this simple test:-

var s = "\\/Date(1238025600000)\\/";

var today = Sys.Serialization.JavaScriptSerializer.deserialize (s);

Before calling the deserialize method I checked that the contents of 's' were correct, and that its length was 23.  's' contains "\/Date(1238025600000)\/", trust me!  So now it should be able to be deserialized right?

However the 'deserialize' method throws this error:-

"Microsoft JScript runtime error: Sys.ArgumentException: Cannot deserialize. The data does not correspond to valid JSON.

Parameter name: data"

The correct technique still eludes me.  I searched high and low on the Internet yesterday and found loads of implementations - lengthy and short.  I tried a few; none of them worked!

What is the correct way please?

TIA

Andrew

P.S. I tried enabling script globalization on the ScriptManager - it didn't help.  I'm using ASP.NET 3.5 SP1, btw.

# March 26, 2009 5:29 AM

John said:

i will use it

# March 26, 2009 10:27 AM

Bertrand Le Roy said:

@Andrew: I see. Sooo...

* ExtJS has no idea that this convention exists so I'm not surprised this doesn't work.

* Apologies about the static method. Of course it is. My mistake.

* If you want this to be valid JSON, it has to be a string within a JSON-valid string. This is because the actual common use case is '{foo: "\/Date(1238025600000)\/"}' (omitting escaping here). So if you just want the date on its own, unwrapped, you probably need to do '"\/Date(1238025600000)\/"'.

# March 26, 2009 2:04 PM

Andrew Webb said:

@Bertand: ah, I see.  My mistake.  Thanks.  So now...

var msJsonDate = '{ data: "\\/Date(1238025600000)\\/" }';

var day = Sys.Serialization.JavaScriptSerializer.deserialize(msJsonDate);

alert(day.toString());

This works, gives me a date, although the alert shows "[object Object]".  So it's not a fully functional Date object.

After more experimentation, I decided on this:-

 var s = "\\/Date(1238025600000)\\/";

 s = s.slice(7, 20);

 var n = parseInt(s);

 var d = new Date(n);

 alert(d.toString());

This alert shows "Thur Mar 26 00:00:00 UTC 2009".

# March 27, 2009 3:41 AM

Bertrand Le Roy said:

@Andrew: Sure, you need to do day.data.toString(), not day.toString.

When I do this: alert(Sys.Serialization.JavaScriptSerializer.deserialize('"\\/Date(1238025600000)\\/"').toString()); I am getting "Wed Mar 25 17:00:00 PDT 2009" as expected.

Please do not do your own parsing.

# March 27, 2009 4:02 AM

Andrew Webb said:

@Bertrand:

* "Sure, you need to do day.data.toString(), not day.toString" - of course; silly me.

* '"\\/Date(1238025600000)\\/"' - please explain this double-stringing technique.  Coming from a C, C++, C# background, I've never seen this!

* "Please do not do your own parsing" - fair play.  If I use 'deserialize' then you can change the format in the future, and my JS will still work.  I get it.

# March 27, 2009 2:03 PM

Bertrand Le Roy said:

@Andrew: for the double string, it looks artificial in this trivial case but it's actually quite simple. The deserialize method takes a string as its parameter. This string /contents/ are the JSON representation of the object to rehydrate (which can be the representation of a string, a number, a Boolean, an object, etc., the deserializer doesn't know in advance, nor does it have to).

Now let's imagine we are deserializing a string object containing 42. In other words the string "42". In JSON notation, it is represented by: "42" (and not: 42). Now if you want to express that JSON string as a JavaScript string constant, this would be var a = '"42"'; and not var a = '42';. The first one will be deserialized as the string containing 42 as expected, whereas the second one will be deserialized into the number 42. I hope this helps clarify.

# March 27, 2009 5:26 PM

Scott M said:

Hi again Bertrand,

One last item to note:

When I specify the debug version of my script should be used (via the ScriptManager's ScriptMode or the ScriptRefrence's ScriptMode), I will get that script version referenced in the rendered page, but the SRP will always list the release version on the screen.  This is even true with the MS scripts.

-Scott

# March 28, 2009 3:22 PM

Andrew Webb said:

@Bertrand: thanks for taking the time to explain this to me, and for your other answers.  I feel a bit like a fish out of water when doing JavaScript, but I'm slowly getting there.  Crockford's "JavaScript: The Good Parts" is my guide; I've read it once, and it's probably time to read it again.  Thanks again.

# March 29, 2009 10:48 AM

Mic Cvilic said:

@Keith:

If you have time, could you just drop a post to our discussion group about the recursion problem you faced. I thought we had it working well.

The address is:

groups.google.com/group/Pure-Unobtrusive-Rendering-Engine

Thanks for your reference to PURE.

# March 30, 2009 3:35 AM

Peter said:

Why is DeepZoom so slow? I mean there's always a lag  after I move the mouse until it reacts. If you go to one of the maps sites (live or google) and do the same thing, with JS, it's actually more responsive? How can that be? Thanks.

# March 30, 2009 11:34 PM

Bertrand Le Roy said:

@Peter: it's pretty smooth for me. Maybe you tried at a time when the server was feeling a little cold. What browser are you using?

# March 31, 2009 12:29 AM

Mike said:

I don't see why it's so good for plugins, adding a .dll to the bin folder beats adding .cs files to a plugins folder right?

Do you have a code sample, because I don't get it.

# March 31, 2009 4:03 AM

Bertrand Le Roy said:

@Mike: Applications such as WordPress enable you to create plug-ins with just notepad. We don't want our users to have to install Visual Studio in order to be able to start working and tweaking the application.

This model enables plug-ins to be deployed as simple code files, and it also enables the administrator to create and modify plug-ins directly online, from the site.

code: mvcsamples.codeplex.com

screencast: blog.wekeroad.com/.../kona-1

# March 31, 2009 12:47 PM

Jarid said:

It works perfectly. thanks

# March 31, 2009 1:20 PM

Peter said:

I tried IE7, FF3, and Chrome; same result in all. It's not that is not smooth, it is, more like it's lagging. Let's say I click and drag over 300px, it takes about one second for the image to catch up to the mouse. If this is intentional then it's a bad choice IMO, it gives the impression that it can't keep up with you. Like when you play a video game that has a very low frame rate, you do something and the actual game is lagging behind. Also the CPU pegs at 100% on one core which tells me it can't keep up. I tried this with SL2 and SL3 beta. Are you not experiencing these things? I tried this on two computers (one Windows 2003 and one Windows 7) and got the same UX.

# March 31, 2009 4:03 PM

Bertrand Le Roy said:

@Peter: no, I'm not experiencing any of that, in any browser. The CPU does have a short spike on interactions, but nothing that affects perceived performance, which is instantaneous for me. Please contact the SeaDragon team to get to the bottom of this: getsatisfaction.com/.../livelabs_seadragon_ajax

# March 31, 2009 4:12 PM

Mike said:

Ok, I understand. But do you think that is actualy what users want? I have written some simple plugins (for Graffiti CMS for instance) using Visual Studio. I can't imagine doing it without visual studio. I have to reference assemblies, I write C#, it needs to compile before it can run, etc. It would be painful to write that in a textarea and catching compile errors in the browser...

# April 1, 2009 2:58 AM

Mike said:

Also, I watched the Kona screencast, notice how the web code editor has syntax highlighting? Where are we going with this really? We don't want to use Visual Studio, but we do feel the need for code highlighting in our browser editor? How about intellisense?

# April 1, 2009 3:13 AM

steve said:

For advanced chart, check out <a href="http://chart.inetsoft.com">style chart</a>. It's also free.

# April 1, 2009 10:39 AM

Karen said:

Is there any way to get this anymore?  We are still using .net 2.0 so I can't use the futures implementation.

# April 1, 2009 10:58 AM

Bertrand Le Roy said:

@Mike: yes, that is actually what users want, but in fact you have a choice. You can write a Kona plug-in as a simple code file (in Notepad or in VS), but you can also build it into a dll and deploy that into bin. Kona will be able to discover it just as well, it just won't be able to modify it in the online editor.

The code highlighting that is currently in Kona is a fast, existing component we included to demonstrate the direction we are going into but this is not what we are going to use in the end. We are exploring including a more elaborate editor that includes IntelliSense.

# April 1, 2009 1:23 PM

Bertrand Le Roy said:

@Karen: follow the link at the end of the post... Let me paste that here for you...

weblogs.asp.net/.../432188.ashx

# April 1, 2009 1:26 PM

Mike said:

"We are exploring including a more elaborate editor that includes IntelliSense."

Is that an april fools joke?

# April 1, 2009 5:23 PM

Bertrand Le Roy said:

@Mike: I don't do April fools jokes by company policy: weblogs.asp.net/.../396731.aspx

# April 1, 2009 6:39 PM

joelvarty said:

Dude - you've totally lost me on the comparison betwen what you are talking about and Eilon was discussing, and frankly it doesn't seem the Eilon was really talking about quantum computing at all - just the fact that if the string is an input, it should be maintained along with the Type information that it was maintained with.

I agree that "fixing" the string as an input Type seems too simplified, but that might be a good thing, especially for asp.net, if the kinds of data conversion that make "human" sense with string can be allowed.

Another post to sort things out, or whatever, would be a good idea.  

I hope you don't get fired... ;)

# April 2, 2009 8:23 AM

Bertrand Le Roy said:

@Joel: I guess now that it's April 2nd, I can reveal that yesterday was in fact April 1st. :)

# April 2, 2009 11:58 AM

vkelman said:

Non-related question, sorry:

There seems to be no easy way to submit IE8 feedback / bug report :( connect.microsoft.com/.../feedback page is displayed until you login with Windows Live account, but cannot be found after login... very unfriendly environment.

I'm aware of two bugs / non-standard behaviors, one lasts since IE6 or even 5:

1) Incorrect behavior of window.onblur event under IE and a workaround pro-thoughts.blogspot.com/.../incorrect-behavior-of-windowonblur.html

2) Internet Explorer Global Variable Blow ups www.west-wind.com/.../677442.aspx

# April 2, 2009 12:22 PM

Bertrand Le Roy said:

@vkelman: I don't work on the IE team, but I think those bugs are known. I also tried the connect page and it works fine for me, on Chrome at least. You might want to give it another shot.

# April 2, 2009 12:37 PM

vkelman said:

@Bertrand,

connect.microsoft.com/.../feedback works... until you login to Windows Live, after a login it breaks. Thanks anyway.

# April 2, 2009 2:21 PM

Bertrand Le Roy said:

@vkelman: I can't reproduce that problem. You can report it the the Connect team on this page: connect.microsoft.com/.../emailsupport.aspx

# April 2, 2009 7:41 PM

Erik said:

Worked great. I think it's funny that microsoft didn't test their program and controls with their new ie release.

# April 3, 2009 11:50 AM

Bertrand Le Roy said:

@Erik: of course we did. That's why we're able to provide the patch the same week IE8 goes RTM. It also enabled us to find and report many IE bugs to the IE team over the last year.

# April 3, 2009 12:32 PM

David Maltby said:

Thanks!  That was helpful.

# April 3, 2009 3:50 PM

AI said:

LOL...at least you were able to trick someone..the poor fool.

"and I might get fired for this post" was a dead giveaway!

# April 3, 2009 4:32 PM

Matt said:

I tried this on two different IIS 6/Win2k3 installs, it didn't work on either of them.  It just says something about 'none of the products that are addressed by this software update are installed on this computer', even though they most definitely are.

# April 3, 2009 4:40 PM

Bertrand Le Roy said:

@Matt: apparently you didn't have SP1 installed on those machines. Is that correct?

# April 3, 2009 7:13 PM

Armando said:

Salut Bertrand,

I run the KB in a box XP SP2, but I'm getting the following message:

"None of the products that are addressed by this software update are installed on this computer. Click Cancel to exit setup."

Any suggestions ???

# April 6, 2009 5:17 AM

Bertrand Le Roy said:

@Armando: please check you have 3.5 SP1 installed.

# April 6, 2009 1:56 PM

Hong Li said:

Please make sure that 2.0 SP2 is installed on the machine.

If you have more issues, you can contact hongli at Microsoft.

# April 6, 2009 4:57 PM

Ryan said:

I just saw this today, awesome :) I wouldn't have fallen for it on the first though. When I saw the System.QuantumEntanglement namespace I couldn't stop laughing.

# April 7, 2009 1:13 PM

Mike said:

Same here...  images in a subfolder and Path property wont work. where's the documentation for this thing??  nice application isn't so nice without docs.

# April 11, 2009 4:04 PM

Masoud said:

It's not work for me.. )-;

?????????????????????????

# April 11, 2009 4:23 PM

Bertrand Le Roy said:

Try putting the handler in the same folder as the images. There is no documentation for this. This is something I'm building for myself. I'm putting the source out there in case people find it useful but that's all. Not my day job. Sorry.

# April 11, 2009 5:48 PM

RichB said:

# April 14, 2009 3:48 AM

bcardiff said:

YUI Library CSS Tools at developer.yahoo.com/yui contains a CSS to RESET browser's default styles and apply some consistent cross browser BASE style.

Rules in YUI CSS applies to ALL elements, but it can be modified to define .isolate class.

It is an not an easier way, it is the same approach, but it is already tested and used.

# April 14, 2009 9:22 AM

helephant said:

You're not the only one who wants it:

www.mail-archive.com/.../msg03931.html :)

# April 14, 2009 11:38 AM

_ra170 said:

I converted the example to .net 3.5. When I run your example in Firefox, nothing happens, when I run it in IE I get: Microsoft JScript runtime error: Object expected

# April 14, 2009 12:28 PM

Regis said:

I'm using a simplified version of Meyers's CSS reset and append my #reset in front of those selectors. Having the * makes it reaaaaly slow in IE6 I found out.

Then I have to prefix all my inner selectors with #reset... not fun, but it works. Can't wait to hear about a better solution though :)

(I build widgets that gets included in other pages, no iframe, so I have to deal with that and JS conflict/pollution)

# April 14, 2009 12:43 PM

Bertrand Le Roy said:

Thanks all for the great links and feedback, which showed me the extent of my ignorance :)

To summarize the whatwg discussions, XBL has an attribute for components that enable them to be style-isolated, but we can't use that right now because it's not available in all current browsers. The proposal to have a reset CSS property, HTML attribute or element seems to be taken seriously and it's reasonably likely that it will make it into a future version of CSS but again that doesn't help us right now.

I did know about the CSS reset work from Yahoo! and Meyer, but they're doing something quite different, which is to level the CSS playing field and bring the default from all browsers to common values so that styling can be done in a more predictable way.

Two of you mentioned that they were using a modified version of those stylesheets along the lines of what I'm doing here, but that only resets those few styles that happen to be different across browsers.

# April 14, 2009 2:27 PM

Bertrand Le Roy said:

@ra170: Sorry to hear that. Not sure what's going on here. Feel free to send me a zip file with your site at bleroy at microsoft and I'll have a look.

# April 14, 2009 2:47 PM

Raghavendran said:

how put paging in the photo thumbnails page..

# April 15, 2009 11:47 AM

Shane said:

How would you modify this to work with a non-WCF web service? I've tried to follow your example calling an asmx service and get a bad request error.

# April 21, 2009 12:38 PM

Bertrand Le Roy said:

@Shane: you'd have to implement everything that ADO.NET Data Services give you for free. It's definitely possible but it's a lot more work. It's hard to guess where a "bad request" error could come from without seeing your code...

# April 21, 2009 1:40 PM

Nick Katsivelos said:

Oh sure... you think it is great because of thr AJAX stuff... but you don;t even mention the ADO.NET Data Services part ... great*2 ;)

# April 21, 2009 6:22 PM

Bertrand Le Roy said:

@Nick: actually I do: "Ajax templates *and data*" (emphasis added). The client-side support for ADO.NET data services is pretty awesome too.

# April 21, 2009 6:29 PM

Shane said:

I prefer less work. I changed to a WCF service and it works great. Can't wait to dig deeper into this stuff...

# April 21, 2009 6:53 PM

joelvarty said:

lol.  didn't see the date in my rss reader.  That was fun.

# April 22, 2009 9:53 AM

sakthi said:

it is not working

# April 24, 2009 7:18 AM

Andy P said:

This fix worked like a dream first time after a morning of panic after seeing my eCommerce site going fubar in an iFrame.

Thanks a million.

# April 24, 2009 9:33 AM

Bertrand Le Roy said:

@sakhti: sorry to hear that, but what exactly is not working, and how?

# April 24, 2009 1:42 PM

dwhite said:

How would you access a WCF REST service?  I was able to get to a very simple one without any params by setting httpverb to GET, but I'm stuck when adding a parameter.  I've tried various combinations without luck.

Thanks,

-Damien

# April 25, 2009 8:37 PM

dwhite said:

Please disregard my last question.  I ended up getting it to work like this:

dataview:httpverb="GET"

dataview:dataprovider="SampleService.svc"

dataview:fetchoperation="getItem/1"

I'm loving the new AJAX preview, can't wait to see what's next :)

Thanks,

-Damien

# April 25, 2009 8:46 PM

Jeff K said:

The way I handle this is put a container around the main content then define the styles as context specific e.g.

div id=mycontainer

#mycontiner p { color: red; }

then have a separate container for the admin portion and specify those as context selectors too

div id=myAdminPanel

to place the admin panel there are several options which may or may not restrict older browsers  supported

#myAdminPanel p {color: blue; }

to contain the variances between browsers I use YUI's reset-font-grid css as others here have mentioned

# April 26, 2009 11:08 AM

Tim Page said:

Just starting playing around with ASP.NET AJAX 4.0 but having problems when it appears on a page alongside partial page requests using UpdatePanel.  As an example, take the Samples project from aspnet.codeplex.com/.../ProjectReleases.aspx and on the page 3_Data_From_Service.aspx add an update panel containing a button:

<asp:UpdatePanel ID="updatePanel" runat="server">

   <ContentTemplate>

       <asp:Button ID="btnTest" runat="server" Text="Partial Page Update" />

   </ContentTemplate>

</asp:UpdatePanel>

When I browse to the page the template loads fine as normal but when I click the button I get an error "Microsoft JScript runtime error: 'Sys._ScriptLoader' is null or not an object" in MicrosoftAjaxWebForms.debug.js when calling Sys._ScriptLoader.readLoadedScripts() in Sys$WebForms$PageRequestManager$_onFormSubmitCompleted.

The MicrosoftAjaxWebForms.debug.js is the 3.5.0.0 version... should there be a 4.0.0.0 version of this I should be referencing?

# April 27, 2009 3:18 AM

Shankar Nath said:

Sir,

Your Development (A simple ASP.NET photo album) is Excellent.

But I need a Small thing.

I Have Three Folders in my web directory,

Folder 1: images     (some JPG images are there)

Folder 2: Products (some JPG images are there)

Folder 3: Album

  Album_one  (subfolder of Album)

  Album_two  (subfolder of Album)

I want this photo album is only applicable for

Album folder and subfolders of Album_one, and Album_two.

How to Change the code.

Thank you.

Nath

www.nathworks.net

# April 27, 2009 4:21 AM

Bertrand Le Roy said:

@Jeff, right, but if you have no control over the main stylesheet, that doesn't work.

# April 27, 2009 12:04 PM

Bertrand Le Roy said:

@Shankar: no need to change the code, just put the handler in that Album folder.

# April 27, 2009 12:05 PM

Joe said:

I encountered this error today. My dev system worked fine without any fixes (regular Internet security, not Trusted site level). Our beta test server had the Access Denied problem. I've applied this fix and resolved a new (but temporary) Sys Is Undefined error. Now I am getting Permission Denied.

I have an ASP page on web site #1 with a button control. I have an ASPX AJAX page on web site #2 with a hidden LinkButton control that is within an IFrame on the ASP page. When the ASP button control is clicked, it attempts to click the LinkButton. No error on the dev system, but this results in a Permission Denied on the beta system.

# April 28, 2009 9:47 AM

Alex Taylor said:

Added the Alert control to my project without issues, and it compiles fine, but when I trigger the .Show() method, the message box opens with an HTTP 404 in it, instead of the specified HTML.

I use Master Pages for my layout, if that makes any difference (downloaded it today from codeplex so I should have the latest version).

Any ideas?

# April 28, 2009 12:23 PM

Bertrand Le Roy said:

@Alex: you forgot to copy the alert/displayalert.htm file to your site.

# April 28, 2009 1:41 PM

Bertrand Le Roy said:

@Joe: could be several things. You might have patched only the debug version and not the release one (that would explain that it works on the dev box and not the server), you might have omitted to copy your patched files over, the error might come from your own code, something I haven't thought of or a combination of the above.

# April 28, 2009 1:44 PM

Chad said:

Thanks.

Will check it today.

# April 28, 2009 3:38 PM

ancalagon said:

Cool!

# April 28, 2009 4:36 PM

shailatlas said:

I am looking for jQuery callout plugin. Something like Validator callout from AJAX control toolkit. Any ideas ?

# April 29, 2009 3:39 AM

Ray said:

This tool is so cool, can't wait for more wizards!

# April 29, 2009 1:25 PM

Dima said:

Hi Bertrand.

Having same problem. Using redirect ("xxx.aspx", false), but sometimes Im loosing session value on A HREF link.

How is it possible?

thx

# April 29, 2009 2:44 PM

Bertrand Le Roy said:

@Dima: could it be a timeout?

# April 29, 2009 2:49 PM

Dima said:

No.

This happening after 2 minuts I logged in, and timeout configured for 60 minutes. Also, Im checkin with Session.SessionId, and it's always there, same string, never lost, but values from Session("logged") or ("UserName") are gone, NULL.

# April 29, 2009 2:52 PM

Bertrand Le Roy said:

@Dima: let's follow-up offline. You can send me mail at bleroy at microsoft.

# April 29, 2009 3:37 PM

Augusto said:

I've referenced the altered script like this:

<asp:ScriptManager ID="ScriptManager1" runat="server"  EnablePartialRendering="true" EnablePageMethods="true">

       <Scripts>

           <asp:ScriptReference

           Name="MicrosoftAjax.js" ScriptMode="Auto"

           Path="~/scripts/AJAX/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js"/>

       </Scripts>

  </asp:ScriptManager>

The scriptManager tag is in a masterpage, and I've aplied the correction to the MicrosoftAjax.js as described above. Also, I downloaded the newer version of ajaxControlToolkit WITH the 'Common.js' already aplied.

I can run the code without any error on my javascript, but when I deploy it to our development server, I get the 'Sys is undefined' error at ScriptResource.axd, and the a 'Type is undefined' error, even if I use the original version or the altered version of the script.

Can you point me where could be a file/installation defining this?

# April 29, 2009 7:05 PM

Bertrand Le Roy said:

@Augusto: did you deploy the patched MicrosoftAjax.js file to the dev server? Did you check the script was getting downloaded using Firebug or Fiddler? Did you check you were getting no syntax errors?

# April 29, 2009 7:19 PM

James Newton-King said:

If you think Portal is good then you should check out Braid. It swaps portals for time control and is an amazing game, both in look and puzzle gameplay. The ending is absolutely fantastic too.

# May 3, 2009 4:24 AM

Dave Reed said:

Puzzle Quest was fun but wow what a long game. Playing casually and occasionally it took me months and months to finish it. Loved the humor.

I would add: Geometry Wars 2 :)

# May 3, 2009 11:21 AM

Kevin said:

This is great...except it hasn't been updated in a long time...there are much newer versions of the exif extractor here: renaud91.free.fr/MetaDataExtractor

For example, I don't think the version supported here displays the "Lens" from the exif data.

Thoughts?

# May 3, 2009 1:07 PM

Kevin said:

I've successfully migrated the code to use the newest MetaDataExtractor.dll (V2.4.0b)

Are you intersted in the (minor) changes?

# May 3, 2009 3:57 PM

John Walker said:

Hmm, won't install on Win7 RC.

# May 4, 2009 12:38 AM

Bertrand Le Roy said:

@James: Braid didn't work for me (see weblogs.asp.net/.../i-don-t-like-braid-what-s-wrong-with-me.aspx).

@Dave: for some reason, I just can't play Geometry Wars. I own the game but never got even the simplest achievements. Just not for me. But I agree they're pretty good games.

# May 4, 2009 1:22 AM

Bertrand Le Roy said:

@John: You should contact support about that. My guess would be that the RTM of Win7 will have the fix built-in.

# May 4, 2009 1:31 AM

Bertrand Le Roy said:

@Kevin: I might use a diff, thanks. But I might be unable to include those changes as I've changed the way the library is included since last version was published.

# May 4, 2009 1:33 AM

Morten said:

MegaMan 9 ! It's all about gameplay, and the graphics and sound is sooo retro. This is actually a brand new game even with online experiences, but looks and feels like the original MegaMan games.

# May 4, 2009 3:01 AM

InfinitiesLoop said:

Give GW another chance. When I first played GW1 I thought it was fun but wasn't compelled to go for achievements or anything. When GW2 came out I gave it another shot and it hooked me. I've gotten most of the achievements for GW2 -- I gave up on one of them though (wax off -- holy crap its hard!)

# May 4, 2009 3:07 PM

Chris Bower said:

Thanks Bertrand, this will make the client web applications easier to design.

# May 5, 2009 3:45 AM

MisterFantastic said:

Hi Sir,

The article is very nice but the starting is little bit confusing. Thanks for letting us know this.

Thanks,

Thani

# May 5, 2009 7:10 AM

Aaron Powell said:

Hey Bertrand, nice post, I decided to take your concept and have it do all of a certain base type. Just a POC and something for a bit of fun :P

www.aaron-powell.com/.../creating-jquery-plugins-for-ms-ajax-components,-dynamically!.aspx

# May 5, 2009 8:33 AM

WHY ??? said:

WHY ???WHY ???WHY ???WHY ???WHY ???

# May 5, 2009 9:18 AM

WHY 2 said:

I haven't found a good reason yet to mix the 2.  I have found using jquery without the .net ajax so much better and jquery can process web services just like .net ajax.  The .net ajax is so bloated. This site is the best option I feel.

encosia.com/.../using-jquery-to-consume-aspnet-json-web-services

# May 5, 2009 4:11 PM

Bertrand Le Roy said:

Globalization, client templates, client data and live bindings, integration with ADO.NET Data Services, client and server-side support for the back button, a client component model on which third parties are building professional & supported components (Telerik, Infragistics, ComponentArt, etc.), etc. What's bloat to you is useful to others. Client library is 24kB gzipped (jQuery is 18kB), and in 4.0 you can reduce it down to 7kB depending on what pieces you need.

# May 5, 2009 4:27 PM

Kyle Corley said:

I also have hit the same snag, although I'm using the Telerik RadAjaxManager (which, I believe, creates UpdatePanels) rather than creating UpdatePanels directly.

The new ADO.NET Data Services client stuff was working perfectly (hats off to the developers) when I used it on a standalone test page.  I am using it to hit a data service and populate a TreeView on the client, and it was very easy to use and performed very well.  Unfortunately, it choked (with the error mentioned above) when I used it on my real page, which had the RadAjaxManager on it.

Sure hope there's a workaround or fix...

# May 5, 2009 7:07 PM

Bertrand Le Roy said:

@Tim: yes, you need to use the 4.0 version of MicrosoftAjax, but even if you do, the current preview is incompatible with UpdatePanel. This will be fixed for the final release, of course.

@Kyle: this is probably the same problem, although I can't speak for Telerik. It is possible that they will have to provide an update for that once 4.0 is released.

# May 5, 2009 11:49 PM

Andrew Webb said:

For us, globalization is sooo important.  Every date and number that is displayed to the user must be formatted according to the browser's preferred language.  Some of this formatting we do in web methods, but some formatting must be done client-side.  The MS AJAX 3.5 library is so good at this (although naturally it doesn't have as full a range of formatting options as the .NET Framework itself).

Don't know how the 4.0 library will do it, but I've written up how to enable script globalization in MS AJAX 3.5 for ASP.NET MVC apps here:-

stackoverflow.com/.../what-about-script-globalization-of-microsoftajax-js-in-asp-net-mvc

# May 6, 2009 2:22 AM

ewschone said:

If the globalization etc is indeed so good, then why not contribute to jquery ?

# May 6, 2009 9:08 AM

bcardiff said:

Just nice. Between this and the my previous work on <a href="weblogs.manas.com.ar/.../">Declarative jQuery (with Microsoft Ajax)</a> we are able to go from one side to the other :-) letting users of either libraries use the components of the other one with less effort.

# May 6, 2009 9:13 AM

Karl said:

Do you guys set aside a day of the week to justify the work you do? Globalization? Is that how people are dong it these days? Via javascript? Huh...

Data Services return JSON, why do you need msAjax for that?

Using jQuery you can build your own plugin quicker than you can download those "professional" third-party components. Or you know, you can just goto plugins.jquery.com

It isn't about size or bloat, but about continuing to put effort into outdated and inferior solutions (and dragging countless developers down with you). Its about streamlining and adapting.

# May 6, 2009 9:34 AM

jgdean said:

Thanks Bertrand for the fix. We are running .NET 2.0 using VS2008 and using the Toolkit as well. I referenced the altered MicrosoftAjax.js per instructions above, and I still needed to let the scriptmanager reference the Toolkit. As a result, the Scriptmanager version in the "/ScriptResource.axd?..." was being called first and the fix was not applied, even though I can see the altered version of MicrosoftAjax.js being referenced after the scriptmanager version in the source code. So I was left with trying to create static references to the toolkit code or apply a "monkey-patch". I struggled to find a version of the .NET20 Toolkit .sln that would compile in VS2008 so ended up with the patch. It works but it's not pretty. Is there a newer version of the system.web.extensions  than 1.0.61025.0 that already has this fix in place for .NET2.0? Or maybe I am not referencing the toolkit correctly?

Thanks again, without your post I would be lost!

# May 6, 2009 11:18 AM

Bertrand Le Roy said:

@Karl: if you're going to build a real client application that uses the browser as more than a dumb terminal, you're going to handle data on the client. On the wire, the data should be culture-neutral, which means that the client needs strong globalization capabilities. The built-in JavaScript support is just lame and US-centric. We had a long thread on Dave Ward's post on date handling.

For data services, sure they are JSON, but that's beside the point. With Microsoft Ajax, you can just point at a data service and poof, you have automatic change tracking on the client and can send those back by just calling save. It doesn't get any easier, which some people value.

Using jQuery *you* can build your own plugin faster. Good for you. About plugins.jquery.com, there are some real gems over there, I'm not the one who's going to say otherwise. But there is also a lot of junk, and it's mostly unsupported and unsupportable. Discovering the good ones takes time (despite the rating system: the organization of the catalog is showing signs of weakness under the load) and not everyone can afford that. Believe it or not, there are people who prefer to pay for a guaranteed level of quality and support. I would tend to be more on the side of exploring, building and using jQuery plugins myself for many things because that's the way my brain is wired but I know for a fact that this is not representative of the whole user base for ASP.NET.

So for *you* it's not about bloat and size (although you just said "using jQuery you can build your own plugin quicker than you can download those 'professional' third-party components" so apparently it is, at least a little bit). Apparently, for the very brave "WHY 2" it is: "the .net ajax is so bloated". So it's about streamlining. Sure. You streamline your applications the way you want (with jQuery), we streamline our framework and provide cool new features for our users to streamline their own applications. At least we try. Adapting? We adopted jQuery instead of building our own. How's that for adapting?

I'm not sure what you're trying to say here. Sometimes it seems like you would only be satisfied if Microsoft stopped all software development. I'm afraid this is not going to happen.

@Ewschone: that's an interesting idea, but it's actually already done, in a way. The Microsoft Ajax library contains all globalization files, which are perfectly fine to use with any other library. In 4.0, we also split our library into much smaller pieces so that you can pick just the pieces that you need. I'm not sure it's very interesting to tie those pieces onto the jQuery object (it's actually a few lines of code but what's the value really?). jQuery is mainly about DOM manipulation. Globalization is a little orthogonal to that. I'm really not sure there's much value in grafting globalization on it. But I'm absolutely open to any arguments you may have and as we're precisely exploring ways we can contribute to the jQuery ecosystem I'm really willing to listen to what you'd have to say about that.

# May 6, 2009 1:32 PM

Bertrand Le Roy said:

@jgdean: having static script references is the way to go. The script profiler that is available on CodePlex/aspnet can help you determine the set of scripts you need for any given page.

I'd also encourage you to upgrade to 3.5 SP1 if you can.

# May 6, 2009 1:42 PM

Hamza said:

Really great stuff here. Nice work guys but can i know when this will ship or be mature enough to be used in production. I really want to use it in my next project.

# May 6, 2009 1:56 PM

Bertrand Le Roy said:

@Hamza: I'm really just experimenting here, but we're talking about four lines of code here. This shouldn't be too risky to use in your next project. Just ping me if you have any problem with it.

# May 6, 2009 2:14 PM

Sean Perry said:

Bertrand I put this in my website and it works perfectly. I just have one problem that I am sure is my own lack of understanding. I have a central utility that carries out actions and posts various alerts if something goes wrong. The error message is passed as a string from server side code of the page to the server side code of the utility. I managed to get the utility to post the alert by using 'Imports Microsoft.Samples.Alert' but I can't find a way to get the error message string into the alert. There are many text options on the Alert Object like ServerAlert.Title or ServerAlert.OKText but there doesn't seem to be a ServerAlert.MessageText I noted in the html you have 'This is a rich alert box that was triggered by<br /><i>server-side code</i>' I am guessing that I can call a serverside proceedure between the <i>'s to supply text but I don't know the syntax or how.

# May 6, 2009 3:06 PM

Bertrand Le Roy said:

@Sean: haven't touched that code in a while, but from the top of my head, the control uses its own contents as the text of the alert, so if you add a literal control to it with your message, it should work.

# May 6, 2009 3:24 PM

Sean Perry said:

Bertrand: I put a label inside the alert, passed the label to my utility, set label.text = 'error message string' and it worked perfectly. I feel a little dumb looking for long programatic solutions when like you pointed out the alert contents can be set up like any html page. Thank You for the help and the very usefull control.

# May 6, 2009 4:03 PM

Andrew Webb said:

It's important to bear in mind that not everyone uses jQuery.  We started off with the intention to use it, but ended up with ExtJs for our current web app because of its far more mature widgets (check out the grid), which you can find all in one place.  No hunting around the plugin-o-sphere.

ExtJs has 45 localization files, but they mainly contain localized resource strings for the widgets.  There's limited support for formatting a date for display, and no support for formatting a floating point number (AFAICS).  Compare this with MS AJAX's globalization files, which give you great support for formatting and parsing dates and numbers in 205 different cultures.  Most of our formatting for display takes place on the server, but occasionally we need the client-side globalization support (e.g. for formatting numbers that the user enters into the editable ExtJs grid).

So if Bertrand and team are going to keep globalization (and other useful parts of MS AJAX) separate from jQuery, and applicable to both jQuery and other JavaScript libraries, I can only applaud.

# May 7, 2009 2:18 AM

AS said:

Remove hoaxes once it's out, otherwise you clug the searches with junk.

# May 9, 2009 12:13 PM

Shyju said:

Is it not available for Visual studio 2005 ?

# May 11, 2009 2:37 AM

Bertrand Le Roy said:

@Shyju: no.

# May 11, 2009 12:46 PM

Bertrand Le Roy said:

@AS: no.

# May 11, 2009 12:47 PM

Shane said:

Hello,

I'm trying to pass the "event" keyword to a javascript function in the "onkeydown" event like this:

<input type="text" id="{{$id('ChargeCode_')}}" value="{binding ChargeCode }" onkeydown="ChargeCdKeyDown(event, this)"/>

This causes an error "event is not defined" at line 2618 of MicrosoftAjaxTemplates.debug.js. Any idea how I can get this to work?

# May 12, 2009 6:52 PM

Bertrand Le Roy said:

@Shane: mmh. Works for me. Maybe add a semicolon after the closing paren. What version of Microsoft Ajax are you using? What browser is it failing on?

# May 12, 2009 7:37 PM

Shane said:

I'm seeing the error in Firebug on Firefox 3.0.1. Just tried IE8 and it works. I'm developing this with VS 2008, .NET 3.5 SP1.

# May 13, 2009 11:10 AM

Shane said:

Looks like this issues has been reported on the Codeplex site. Hopefully it gets worked on soon.  aspnet.codeplex.com/.../View.aspx

# May 13, 2009 6:54 PM

Frenki said:

Just what I was waiting for. Thanks

# May 14, 2009 3:11 AM

Nazo said:

I got excited when I saw ComboBox but 2 minutes playing with the sample site left me disappointed.

Seems to work ok in IE 7 but in FF it's broken. Suggest behaviour results in the list not closing when an item is selected. The backspace key sometimes doesn't seem to be passed on to the textbox too meaning users can add more text but not delete what's there.

Should be good when it's finished but not ready for release yet IMO.

# May 14, 2009 4:42 AM

HeartattacK said:

HTML Editor......WOW!!!...Thanks...It has been a VERY MAJOR Pain Point...Thank obout...:)

# May 14, 2009 4:43 AM

Ram said:

Thanks a lot. Very Useful

# May 14, 2009 4:44 AM

Sarvesh Gupta said:

Great!! I envy this.

Does AJAX HTML Editor has Spell Checker also.

# May 14, 2009 4:55 AM

santosh kumar said:

great.

# May 14, 2009 4:56 AM

Noms said:

Thanks alot everyone who have worked on this.. Great help..

# May 14, 2009 5:24 AM

mattbrooks said:

These are three really valuable additions to the control kit.

# May 14, 2009 5:26 AM

Viator said:

Can't wait to download. Thanks

# May 14, 2009 5:59 AM

SKT_01 said:

Great!

The AjaxControlToolkit.dll seems to be corrupted:

"Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified."

# May 14, 2009 6:47 AM

digish said:

We love you guys. Simply cool. Dont know, how much of weight of gone off our backs.

Thank you

Thanks a lot.

# May 14, 2009 7:00 AM

nishanthnair said:

Awesome.... These are super cool  controls. Thanks a lot!!

# May 14, 2009 8:27 AM

rtpHarry said:

The drop down doesn't align and the skins dont work.

Anyone else experiencing this?

Having the combobox functionality at our disposal is great but I am just wondering how many users will realise this is different to a normal ddl without it being explained to them.

Nice to see the rte has been fixed up and doesnt generate font tags any more.

# May 14, 2009 8:43 AM

Chris said:

Thanks Guys!

# May 14, 2009 9:32 AM

bmains said:

Excellent addon's to the toolkit.

# May 14, 2009 10:14 AM

Issa Qandil said:

They look nice but i guess they are somehow a little bit late, i already created my own.

But on the other side am happy to see such controls been added as an open source.

Finally i would like to thank you for sharing and keeping us updated ;)

Regards,

I. Qandil

# May 14, 2009 10:34 AM

mehfuzh said:

Hi Bertrand .

Nice color picking control. But i would like to ask what new in it provided for user. I made a color picker back in 2006  that supports same type of feature that you have just mentioned.

www.codeproject.com/.../ColorPicker.aspx

Just being curious,

Mehfuz.

# May 14, 2009 10:43 AM

Kazi Manzur Rashid said:

The Color Picker looks very old, reminds me year 2002.

# May 14, 2009 10:51 AM

Tim said:

Maybe the HTML Editor will be good enough to get rid of TinyMCE! Thanks Obout!

# May 14, 2009 10:56 AM

BrianOConnell said:

HTML Editor:

Why does it render wrapped in a table?

Why doesn't it degrade to a textarea if script is off?

What part of it uses AJAX?

Combo Box:

Why does it render wrapped in a table?

Why doesn't it degrade to a standard select?

What part of it uses AJAX?

Color Picker:

Why doesn't it degrade into a select list of colors?

What part of it uses AJAX?

# May 14, 2009 11:41 AM

Lee Dumond said:

Really nice job on this. New controls look great. I'm glad the Toolkit is alive and well, and hope you guys keep up the good work!

# May 14, 2009 11:52 AM

Ben Scheirman said:

Now there's a step in the right direction.  Nice!

# May 14, 2009 12:27 PM

TATWORTH said:

I like the accordion control persisting which part was open.

# May 14, 2009 1:22 PM

Nemesis116 said:

This is great. Keep up the good work!

# May 14, 2009 1:26 PM

redsquare said:

All the controls look and feel a bit outdated. The combo box comes packed full of alignment issues in ff and especially ie8, have these widgets been tested at all? Rendering the combo box demo sends down 130k's worth. I cant see why anyone would choose this lib, its a buyers market and there are much better & cheaper (speed, size etc) options!

# May 14, 2009 2:24 PM

Bertrand Le Roy said:

Thanks all for your support. I'll try to answer some of the questions.

To those of you seeing difficulties in running the release, the files on CodePlex do work, so please retry the download, you may have a corrupted file for some reason.

On ComboBox + FF questions: yes, you may have to click outside of the drop-down to make it go away. This actually also reproes on Chrome, not just on Firefox. I created ajaxcontroltoolkit.codeplex.com/.../View.aspx to track this.

In case you're wondering, we test on IE 7 and 8, Firefox (latest), Chrome (latest), Safari (latest) and Opera (latest).

Spell checker on HTML editor: no, we don't have that, but feel free to file a suggestion here: ajaxcontroltoolkit.codeplex.com/.../Create.aspx

# May 14, 2009 4:09 PM

Janek said:

Color picker is rather lame. Just open the Photoshop and check how the color picker supposed to look like. Check also developer.yahoo.com/.../colorpicker or www.obout.com/ColorPicker for other examples. I would call the one you just created the "Limited List of Colors Selector - Retro Version".  Maybe I am missing something.  On the other hand the HTML editor looks very promising although why all buttons are fuzzy? - at least on the demo page www.asp.net/.../HTMLEditor.aspx

# May 14, 2009 4:34 PM

David Farrugia said:

I disagree that the introduction of "new Date(millis)" to express a date is as bad an idea as you suggest.

Understood strictly, the JSON spec doesn't provide for passing dates - end of discussion. Any solution involving parsing strings, revivers, replacers and the like is fine, but is a separate concern and should no more infect the JSON spec as it stands than should the calling of arbitary constructors. The slash-escaping idea just looks like a terrifying hack.

Why not accept this, and define an "extended-JSON" which allows the contruction of Date objects, using the unambiguous number argument, if you consider Date objects to be fundamental?

That is to say, either dates are fundamental, and you wish to serialize them without scope for error, or they are not, and they should stay out of the data format. I don't see that it sets a precedent.

# May 14, 2009 4:35 PM

Sergey said:

Wow, very good news. I'm glad!

# May 14, 2009 5:24 PM

jaydev said:

but it won't support framework 2.0 :-(

# May 14, 2009 6:40 PM

gt1329a said:

I agree completely.  There's no compelling advantage of setInterval to offset the control that "recursive" setTimeout offers.

Explicitly re-registering the setTimeout is more expressive too.  There's no question what that code is doing.

# May 15, 2009 2:18 AM

johram said:

Good work! But I am interested to know which "20 most voted for bugs" were fixed. Where's the changelog for the new release? I tried to search the issue list on CodePlex but there were no issues at all registered with the latest release?

Thanks.

# May 15, 2009 3:39 AM

mattbrooks said:

Nice tip!

May I request a post describing the difference in behaviour and usage between Function.createCallback and Function.createDelegate?

When I was learning MS AJAX to aid development of a recent project I was initially confused by the two. Specifically, when exactly to use each one. I didn't find that the documentation was overly clear on that note. In the end I looked at the source code in order to try and understand each ones exact behaviour. (One advantage of having access to the source I guess!)

For what it is worth, MS AJAX approaches really helped on that project and more since. One area that still confuses me though is the dispose pattern for components, behaviours, etc. I find most of the MSDN documentation tells you to implement a dispose method and shows (various) implementation patterns for clean-up but doesn't tell you exactly WHY it needs to be done or the specific reasons for that particular pattern. Without this information it is very hard to reason about other scenarios where you think proper disposal is needed but aren't sure exactly how to go about it.

# May 15, 2009 4:07 AM

Terje said:

Agree on the color picker comment. Actually the color picker in the html editor is much nicer.

I don't know why this seem to be a tradition at MS but it would help to provide some nice default styles to web controls and other web templates. Look to apple, yahoo...

Sorry about the rant. The controls are otherwise a very nice addition

# May 15, 2009 5:28 AM

Manish Dave said:

Its very good,........... enjoy new ajax control with u r website

# May 15, 2009 6:58 AM

joelvarty said:

Great heads-up on the currying capabilities of javascript.  Here is a link from the wiki article with an example implementation: flesler.blogspot.com/.../haskell-functions-for-javascript.html

If only Javascript had real threading capabilities, our lives would be a little easier, until then, I think setTimeout is good - but it only makes things slightly less difficult than setInterval, in my opinion.  

For animations and fades and stuff, I quite like having a callback framework such as jQuery provides so that you don't have to maintain an animation loop.

# May 15, 2009 9:17 AM

Kostya said:

a lot of bugs, please fix them. for example calendar picker has problem if language is not english.  

# May 15, 2009 10:08 AM

johram said:

Good work! But I am interested to know which "20 most voted for bugs" were fixed. Where's the changelog for the new release? I tried to search the issue list on CodePlex but there were no issues at all registered with the latest release?

Thanks.

# May 15, 2009 10:32 AM

Greg said:

It's not a good idea to rely on timed events in scripting languages inside of a browser.

# May 15, 2009 10:58 AM

Jeremy said:

Last update that came out also said it "only supports 3.5 Framework," but I downloaded the source and built it against the 2.0 assemblies.  Will that still work for this version?

Any way to know what the 20+ bug fixes were?

Thanks!

# May 15, 2009 11:11 AM

rajbk said:

One thing worth noting is that setTimeout waits for the function to finish executing, waits 5000ms and then call the function again.

setInterval, on the other hand, will try to execute the function every 5000ms regardless of when the function was last called or how long the function takes to execute.

Raj

# May 15, 2009 11:36 AM

NXTwothou said:

I've installed the path, it fixed some of the problems.  Now I've got one wierd problem.  I've got a masterpage that has a menu control.  

When I browse to a page that has very few controls(like my login.aspx page) hover effects and popout menus are lightening quick(as soon as you move your mouse, it reacts).  I can switch back and forth to compatibility mode and its the same speed either way.

Then I go to a page that has a gridview with 40 lines in it.  Suddenly the hover effects on the menu control take 1-3 seconds to respond when I mouseover/mouseout on them.  If I switch to compatibility mode, back to the same speed as my login page.  Only IE8, works as expected on FireFox, Chrome, and Safari.

Its driving my customers and I nuts.

# May 15, 2009 3:04 PM

Bertrand Le Roy said:

The list of bugs closed since the last release can be obtained by going into the advanced view of the issue tracker on CodePlex, filtering by status (select "closed") and ordering by update date.

While the toolkit will probably compile just fine under 2.0, the client code relies on so many of the fixes that went into ASP.NET Ajax 3.5 SP1 that there will be for sure some weird issues with the resulting code. Essentially, to make it run reliably well on 2.0, we'd have to port the fixes that went into Microsoft Ajax 3.5 SP1. That wouldn't make a lot of sense as this is pretty much what installing 3.5 SP1 does: 3.5 SP1 is a low-impact update that does not remove 2.0 itself so you can still run old sites that you don't want to migrate under 2.0 and upgrade only the sites you want to upgrade.

Please note that VS 2008 is in no way requested and only the update to 3.5 SP1 (which is free) is necessary to run this release. VS 2005 will edit a 3.5 site with ACT just fine.

# May 15, 2009 5:42 PM

Jeremy said:

Thanks for the info, earlier this afternoon, the issue tracker showed no results no matter what settings I tried, but it seems to be working now.

As far as 3.5 vs. 2.0, I'm fully aware of how VS2008 works with both versions cleanly, but we are working on a commercially released, web-based app that is stuck in 2.0 because of Silverlight issues (major component built years ago in Silverlight 1.0, throws all sorts of build errors when we try upgrading the app to .net 3.5, and we can't take the time to upgrade the silverlight piece to 2.0 anytime soon.  I guess we'll continue living with the last version of ACT.

Thanks!

# May 15, 2009 9:13 PM

FG said:

I'm getting this format:

/Date(1233323754523+0100)/

I assume the +0100 is the timezone ? Not mentioned in your article.

# May 16, 2009 4:20 AM

ZK@Web Marketing Blog said:

jQuery.support has been commented out (didn't have time to investigate the reason) -- so any code that references jQuery.support must also in turn be commented.  There are maybe 10 spots in the vsdoc file that code needs to be commented out.  Once you do that, you're golden.

# May 17, 2009 3:27 PM

MisterFantastic said:

Nice post. But you said SetInterval will be called on regualr basis whereas settimeout will be called only once. How can i use this in such a situation ?

Thanks,

Thani

# May 17, 2009 9:41 PM

Bertrand Le Roy said:

@MisterFantastic: if you look at the code a little closer, you'll see that at the end of the callback code, setTimeout is called again for the next iteration.

# May 18, 2009 1:13 AM

Kittu said:

Nice Article, I am waiting for this. Thanks

# May 18, 2009 10:47 AM

Jason said:

If you have any complexity in your code, setInterval makes it that much more complex. You have to deal with unexpected behavior when one thread overwrites another's data. I did this in my early days and learned the hard way to use setTimeout and call it again just as the Evil blog guy says.

# May 18, 2009 4:28 PM

Vlad said:

Bertrand Le Roy THANKS!!!!!

# May 19, 2009 8:56 AM

NIC said:

So how do you get this to work with classic asp

# May 19, 2009 12:21 PM

Bertrand Le Roy said:

@NIC: I don't know, I haven't touched classic ASP for about 6 years.

# May 19, 2009 1:21 PM

Nicholas C. Zakas said:

Nice writeup. I think the one piece of information that's missing is the slight difference in the way that setInterval works versus chained setTimeout calls. When using setInterval, the next batch of code will be run in a time that is less than or equal to the indicated interval whereas chained setTimeout calls will run in a time that is greater than or equal to the indicated interval. setInterval can, in a sense, "catch-up" when it's behind while chained setTimeout calls tends to lose time over multiple executions. This is why setInterval tends to be the preferred way for running complex animations on a page (see www.schillmania.com/.../javascript-animation-3).

Thanks again for sharing, I enjoyed this post.

# May 19, 2009 1:22 PM

Bertrand Le Roy said:

@Nicholas: that is true, although a setInterval occurrence won't interrupt JS code that may still be running, so there are cases where the real interval will be larger than the one specified. Still, for operations that are sensitive to precise timing, you can take two approaches. First, you can use setInterval and deal with the disadvantages, knowing that at least you get timing that is as precise as it can get in JS. Second, you can use setTimeout and move the renewal of the timeout to the top of the function. This way, the timing should be very close to the one you'd get from setInterval. I should probably mention that I didn't verify this yet. Might be an interesting follow-up post...

# May 19, 2009 1:32 PM

bodar77 said:

Hi Bertrand do you know of any resourses regarding using the client only version of the toolkit e.g. which js files to include with which control. Many thanks for all your hard work producing the latest Ajax tools and components.

# May 20, 2009 8:47 AM

Bertrand Le Roy said:

@bodar: we are working on documenting that, but for the moment you can look at the debug versions of the scripts, which contain comments at the top specifying the dependencies. You can also use the script profiler control on an aspx page that contains an instance of each of the controls you want to use and it will give you the list of scripts it needs: aspnet.codeplex.com/.../ProjectReleases.aspx

# May 20, 2009 12:36 PM

tp said:

Hi There,

For me just applying the CSS fix din't help. Instead I had to install the hotfix as well as the css fix.

Now it works as expected. Thanks for the article!

Regards,

TP

# May 20, 2009 6:28 PM

Dominic Pettifer said:

So what's the prize for winning? :-)

# May 21, 2009 4:29 AM

Paul said:

How sad are you!

# May 21, 2009 8:20 AM

rtpHarry said:

Hey, couldn't find your twitter username anywhere on the site... is it a secret? :)

# May 21, 2009 8:35 AM

Willem van Zyl said:

Great idea!

Your search link isn't working though, it should be:

search.twitter.com/search

(...SEARCH.twitter.com...)

# May 21, 2009 10:24 AM

Bertrand Le Roy said:

@Dominic: the prize is bragging rights of course! Actually, wait, I said contest but I'm not going to pick a winner. Let's have everyone pick their favorite by making a tweet pointing at it.

@Harry: @bleroy. I added a Twitter badge to the left sidebar of the blog.

@Willem: mmh. How is it not working? Are you getting an error or something else?

# May 21, 2009 2:23 PM

Ted said:

You get an ugly, raw RSS feed with your link(which may look fine in Firefox but not in Chrome).  Willem's link gives you a browser agnostic view.

# May 21, 2009 2:32 PM

Bertrand Le Roy said:

@Ted & @Willem: thanks, I fixed the links.

# May 21, 2009 2:51 PM

Willem van Zyl said:

Great, working now. :)

# May 21, 2009 6:54 PM

Enes TAYLAN said:

Very cool idea. :))

# May 22, 2009 8:23 AM

Alex said:

# May 22, 2009 12:07 PM

Dean L. said:

Done!

# May 22, 2009 6:37 PM

Preetam Sarkar said:

I do use AJAX a lot in my web apps, but I think there are still some drawbacks in using AJAX. Basically, I use the feature and functionality of ICallback Event Handler. I think it would be better if we could be able to bind data controls using AJAX Or Callback. For example - Binding a Grid Control, implementing paging and sorting etc...

# May 23, 2009 1:30 AM

Kir said:

looks great. looking forward to using it :)

# May 23, 2009 9:05 AM

ducphan said:

I'm done!

# May 25, 2009 1:31 AM

aaa said:

I also use AJAX,but not ASP.NET AJAX, I find it that Maybe It is simple and quick to use AJAX directly.

To learn and use ASP.NET AJAX, it will need lots of time and also use it very difficult.

# May 25, 2009 4:02 AM

shailesh said:

AJAX Technology. I have used in user login and register page in my website.

# May 25, 2009 5:26 AM

Web Design Dubai said:

Good Survey, hopefully will see the result soon.

We stick to Microsoft.Net Ajax, and jQuery.

# May 25, 2009 5:16 PM

duy nguyen ngoc said:

Thanks for your works! It's wonderful!

# May 26, 2009 3:01 AM

Anmol said:

I have used ajax using jquery and avoid using .net ajax as it make use of large javascript files which really effect performance.

# May 26, 2009 5:15 AM

Adeel said:

I was using ajax in many of my websites but have to remove them as it was effecting performance so much.

# May 27, 2009 2:09 AM

scottt40 said:

Thanks for the great HTML Editor!  I love the flexibility in the presentation of info that this tool now provides me within the framework!  Thanks Again!

# June 1, 2009 8:55 AM

dan cavina said:

This is great work! I have been wanting to implement a nice HTML editor and was resisting rolling out my own.

However, I need to support some additional functions and HTML tags. Is there any way to extend both the toolbar buttons to add custom functions and handle additional custom tags in the HTML?

Also, is there any support for creating tables and div sections in the HTML?

# June 1, 2009 2:03 PM

bodar77 said:

There has been some early stats released on Simone’s Blog:

codeclimber.net.nz/.../survey-on-ajax-adoption-some-quick-stats.aspx

I was amazed that 8% still hand craft the ajax calls not using microsofts ajax library for the donkey work.

# June 2, 2009 9:53 AM

Yabeya said:

if (!! foo) alert('Yo, foo is defined and not-null');

if (! foo) alert('Yo, foo is undefined or null');

The "!!" trick is most useful with an object:

if (!! foo && foo.bar) {

 alert('Yo, foo is defined and foo.bar is like false');

}

# June 3, 2009 12:59 AM

Jose said:

Hi,

Thanks for the article and the hotfix.

Works fine now :-D

Regards,

Jose

# June 4, 2009 3:59 AM

Hunter said:

can u take off access denied on this computer?

# June 4, 2009 11:06 AM

Hector said:

What's wrong with creating unique classes for every element that you are using in a widget from a separate server? It should work no matter what the browser since you are sort hard-coding your style in the parent website.

As I understand the reset.css that YUI is working on levels the playing field for all website developers who are developing an actual webpage.

If you are developing widgets and the such that cross domains then you need a separate solution.

# June 5, 2009 3:48 PM

Bertrand Le Roy said:

@Hector: you seem to be assuming you're the widget author and have control over its markup. Or are you saying that you want to slap those classes on every single element after including the widget?

In any case, having a style on an element is not going to prevent and style that you are not setting explicitly to bleed through from the main CSS for the page. This is the problem we're trying to solve here.

# June 5, 2009 3:58 PM

Andrei Rinea said:

Haven't thought it could be such a simple thing.. But still, if you would fire up firebug and watch the Net tab you would see a 200 code for the script request.

# June 6, 2009 4:52 AM

Arif said:

Html Editor is Great but Color picker look old

# June 7, 2009 3:24 AM

Omari Omarov said:

I'd like to have a choice whether to instantiate components imperativly via $create, declaratively in markup or declaratively but not touching markup.

# June 7, 2009 12:42 PM

Bertrand Le Roy said:

@Andrei: not sure what you're saying here: 200 is OK.

# June 7, 2009 4:16 PM

Bertrand Le Roy said:

@Omari: the first two you can do out of the box with Microsoft Ajax 4.0. The behavior sheets I'm showing here enable you to do the third one.

# June 7, 2009 4:19 PM

gunteman said:

The fact that the ampersands should be html encoded (and a lot of other things as well. HTML encoding is not used enough...) is something that should be shouted out loud to the web development community. I often encounter very experienced web developers that are completely oblivious to this fact, and often they even say "yeah, right".

# June 7, 2009 6:06 PM

Herman said:

@Bertrand: Yes, that's what he meant. Looking in Firebug would have already shown you nothing is wrong here, as the request returns a 200 status.

# June 8, 2009 3:11 AM

Oskar Austegard said:

#twitcode version of Bertrand's exposeTojQuery function:

c=Sys.Component;c.$it=function(t,pn){return jQuery.fn[pn]=function(p){return this.each(function(){c.create(t,p,{},{},this);});}}

;-)

# June 8, 2009 10:47 AM

Bertrand Le Roy said:

@Oskar: awesome, but you should add var in front of that c to avoid a warning in strict mode.

# June 8, 2009 4:51 PM

AndreiR23 said:

What I meant is if they (who reported the "bug") would have debugged using firebug or a similar tool they would have seen the request is served ok and wouldn't have reported the "bug" in the end.

# June 10, 2009 3:44 AM

Martin said:

my css fix didnt work either, installing hotfix tonight..

# June 14, 2009 11:54 PM

mattbrooks said:

@Bertrand: Please see this MS Connect issue for a similar but 'real' issue: connect.microsoft.com/.../ViewFeedback.aspx.

# June 15, 2009 6:15 AM

Bertrand Le Roy said:

@Matt: yes, that issue is definitely real, and definitely different from this. The issue you're pointing to is still under active investigation by Dave Reed. I can get you in contact with him if you want details or if you want to help with the investigation. We have a number of hypotheses for this that we're looking at, one of which is browser cache corruption.

# June 15, 2009 12:09 PM

Fred said:

Here you can find a very easy fix for it.

forums.asp.net/.../1216682.aspx

# June 16, 2009 5:57 AM

Jorge Alves said:

And use F8 to cycle through them!

# June 16, 2009 7:58 PM

Joe said:

//TODO: Follow Bertrand's advice.

# June 16, 2009 8:22 PM

Jack said:

Great! I didn't know how to use TODO before! I also use #warning instead, to remind me not to forget something important.

Thanks for sharing

# June 16, 2009 9:36 PM

Yash said:

Doesnt make any sense to me.

CTRL  + SHFT + F ... search for TODO.

-Yash

# June 17, 2009 1:50 AM

MisterFantastic said:

Hi,

Do I need to know about this framework MOQ ?

Thanks,

Thani

# June 17, 2009 3:01 AM

Bertrand Le Roy said:

@MisterFantastic: if you're unit testing your code, you probably should check it out... :)

# June 17, 2009 3:05 AM

MisterFantastic said:

Thanks, very nice tips

# June 17, 2009 3:10 AM

labilbe said:

One thing I don't like so much, is these TODOs are limited to the current selected project.

That's why i prefer the Resharper TODO explorer which allows to view the TODOs of the whole solution. Moreover you can parameter the strings to find (//HACK for instance).

# June 17, 2009 4:28 AM

sector0000h said:

This is cool. I actually used the TODO: but forgot where to retrieve the list. Thanks!

# June 17, 2009 5:07 AM

Danny Douglass said:

So simple, yet so helpful!

# June 17, 2009 8:36 AM

Zack Jones said:

I wish I hadn't read this. I did a search through the entire project source tree and found 632 TODO's in 186 files. Man I need to get busy! :)

# June 17, 2009 8:44 AM

Jon said:

Good tip. Mine key combination was defaulted to ctrl-\, ctrl-t. That seems like a strange default.

# June 17, 2009 10:06 AM

David Radcliffe said:

The Task list is Ctrl+W, T

# June 17, 2009 10:08 AM

Andrei Rinea said:

I've always seen in examples and templates the // TODO pattern but only later last year I found out this cool feature. Thanks for sharing!

# June 17, 2009 10:42 AM

jsalinase said:

Nice!, very useful.

# June 17, 2009 12:43 PM

CEY said:

probably the lamest tip ever.  you got to come stronger than this

# June 17, 2009 12:58 PM

PHenry said:

The one sole problem with this approach (not your's but VS') is you only see the ///todo's for the open files.  It is my opinion VS should be doing it by solution, however MS says the performance degradation is too severe to do that. :<  

So here's my solution.

www.pchenry.com/.../Default.aspx

# June 17, 2009 1:06 PM

Terry said:

It is simple, just have a DIV mask then disable all the SELECT elements.

# June 17, 2009 6:54 PM

Sathishne said:

Its a Cool tip! Thanks

# June 18, 2009 5:31 AM

Phillip said:

Wow, just what we need, more crap controls in the ajax framework, nothing worth using yet.

# June 22, 2009 2:53 AM

helephant said:

I would but I'm too busy doing something more important that will help our software ship. :)

# June 22, 2009 4:34 AM

Rick said:

I see an alignment issue with the new combobox and asp text boxes in separate columns of a table.  In VS2008 Design view all is well, but when rendered the text boxes and the combo boxes do not line up.  The text boxes appear higher than the combo boxes.

Any thoughts on how to fix this? IE6 is the browser we are using.

# June 24, 2009 3:48 PM

Bertrand Le Roy said:

@Rick: first check that you are using a doctype that switches IE into standard mode. If you still see that problem after you've done that, please file a bug here:

ajaxcontroltoolkit.codeplex.com/.../Create.aspx

# June 24, 2009 5:23 PM

jaydev said:

It is sad to know that .NET 2 is not supported any more :-(

# June 27, 2009 1:15 PM

Stephen Peer said:

Works great.  This has been driving me crazy.

Thanks for you help.

Stephen

# July 6, 2009 12:26 AM

Smiley said:

I am not sure if its related. But I have a typical problem. I have a static class and a static session property created in it(just to keep it generic and accessible at various places on website pages). There's a user control on master page, and I invoke a static method of this static class, to get/set this session property. The point where it either gets or sets this session, I get a null reference exception.

That somehow doesn't break the flow due to some reasons not aware.I don't get the exception if I call the same static method at the page level (content place holder for the master page).I am using 'stateserver' as session mode. Now this scenario doesn't happen when I do it from my machine. But it happens when I deploy on prod environment. Right now I have resolved it by placing a try catch around the property get/set, so that it suppresses the exception and error stops flowing in error log. I am sure there has to be a better solution for it. I am just curious about the reason why it happens, is it somehow related to the explanation you have given above?

# July 6, 2009 3:00 AM

Virgilio Freire said:

I am trying to embed a picture in my blog - actually it is the hi-res picture of the Declaration of Independence.

If I try to use the Composer, it allways fails to publish...

If I go through the DeepZoomPix, the picture appears in the album, but if I try to get the URL at the bottom and get the embed code, it says it is not a valid embed code

deepzoompix.com/Album.aspx

Then if I try to use the code snippets, I copy and paste in the HTML gadget space, if it is just the post, edit/view, etc, it works.

The moment I try to post it, nothing happens, I never get the "fetching" message, and just the navigation buttons on the upper right hand...

Very frustrating... can you help?

Thanks a lot

virgilio.freire@gmail.com

# July 6, 2009 7:06 AM

Bertrand Le Roy said:

@Virgilio: you can get support from the SeaDragon team here: getsatisfaction.com/.../livelabs_seadragon_ajax

# July 8, 2009 7:47 PM

Bertrand Le Roy said:

@Smiley: static properties in web apps? That's asking for trouble: you'll have thread safety issues, and you may force object lifetime to be longer than it should be (objects in web environment should typically not live longer than the current request). AppDomain restarts may also break your expectations.

Session is very easily available from anywhere through HttpContext.Current.Session.

# July 8, 2009 7:53 PM

rstrahl said:

I have a love hate relationship with MasterPages. The functionality they provide is great, but the naming container mangling really is the biggest bummer.

I really wish that all ASP.NET controls/Masters/UserControls could have a switch to turn off the name mangling and leave the full control over all naming up to the developer (ie. ensuring no name conflicts across controls) and assign control IDs to the page (ie. no prefixes). I haven't checked but I think the master scenario won't be addressed by the new Client ID features of ASP.NET 4.0?

It's interesting how perception of these issues change once you start building more client centric apps. With server centric apps these issues don't matter much, but when dealing with script driven apps this becomes somewhat important.

BTW it'd also be nice if there could be a strongly typed master page definition in the page (Page<TMasterPage> kind of like an MVC ViewPage that can take the model).

# July 8, 2009 8:18 PM

Bertrand Le Roy said:

@Rick: nice idea, I'll forward that. About the control over ids, there are no reasons why it wouldn't work in a content or master page. As you can act at the naming container level, you should be able to get control back for any id with minimal effort. I'll check with Scott Galloway.

# July 9, 2009 1:10 AM

elvstine said:

IE explorer have siply messed up my whole website beacuse it is CSS based.

I have a hard time applying styles to my ASP:Menu.

1. Hpw do you set the distance between your vertical menuitems?

2. How do you set the distance between the dynamic popouts?

/Stine

# July 9, 2009 6:49 AM

Matthew said:

The hotfix works, sortof.  I now see the menu items however, the verticle spacing is off making the menu items overlap each other. :(

# July 9, 2009 9:05 AM

Mark Brackett said:

@rstrahl: "it'd also be nice if there could be a strongly typed master page definition in the page"

Use @MasterType - msdn.microsoft.com/.../ms228274.aspx

# July 9, 2009 10:55 AM

sach said:

I like how this article gives the impression that ASP.NET master pages were the dawn of templates -- I'm pretty sure I was using includes within perl scripts in early cgi days :).  

Seriously though, one quick less than 30 minute intro to ASP.NET for a new developer should make Master pages clear -- if someone has difficulty comprehending Master pages, they shouldn't be writing ASP.NET code anyway.

# July 9, 2009 12:11 PM

Payton Byrd said:

Dude, your final example is exactly what I was doing 10 years ago in ASP 3. IT SUCKED @$$!  It's not any better today.  Let the freaking framework render the HTML, that's what it's there for.  Would you want to manually render all of your GDI+ on a WinForms app?  Of course not!  This whole fascination with ASP.Net MVC is mind boggling as it's literally setting ASP.Net back 10 years for the sake of unit testing.

# July 9, 2009 12:25 PM

Dillie-O said:

I'd second the notion of optionally eliminating the naming container mangling. I thought I had heard somewhere that AJAX 4.0 was going to do something like that too with some of their controls, so you could set the Id yourself and take the responsibility if you had a naming collision. I think this would work great here too.

# July 9, 2009 12:42 PM

Steve said:

Would you share the code for the Include() extension method?

# July 9, 2009 1:40 PM

Bertrand Le Roy said:

@elvstine: in your case, I'd recommend using the CSS adapters (until ASP.NET 4.0 comes out and makes the menu CSS friendly once and for all). They can be found here: www.asp.net/cssadapters

@Matthew: that's weird. I'd probably contact support for that. Or contact me at bleroy at microsoft.

# July 9, 2009 2:28 PM

Bertrand Le Roy said:

@sach: sorry if it gives that impression. I thought "Before master pages, sharing layout between pages was done using includes (or user controls)" made it pretty clear that using includes is almost as old as the web itself.

And sure, 30 minutes is enough to teach master pages to a developer. That is not my point. What if the person who has to write the page is *not* a developer? What if there is nobody to teach master pages to that person? That person is very likely to just walk away and get back to what she knows already, which works and which she understands without having to learn anything new.

I don't think the elitist attitude is going to help in such situations ;) And that person is not trying to write ASP.NET code but to design a page, for which HTML, CSS and some rudimentary understanding of script should suffice.

I also think that developers should not be in the business of designing pages. Designers should do that. They can only do so if you don't build a wall between them and the markup.

@Payton: I used to make that exact argument all the time about ASP.NET but I'm sorry to say that it is flawed. First, the higher level abstractions are a barrier to entry to many people, usually the ones that should be writing the pages. Second, there is a big difference between GDI+ and HTML: HTML has been designed to operate at a much higher level of abstraction to begin with. It so happens that this level of abstraction seems to be exactly right for the majority of people who write web pages (just look at how successful it's been). The abstractions that WebForms introduce are in my present opinion a developer's thing, but are much harder to understand than plain HTML for most people who are not developers.

This is turning into a blog post :) This is great, this is exactly the kind of debate I wanted to see...

# July 9, 2009 3:01 PM

AndrewSeven said:

I'm not sure when David Ebbo invented master pages, I had an implementation with basic design time support in Visual Studio for Asp.Net 1.1 and there was at least one other implementation on the web that used the same approach as me. This was before I ever heard an announcement of the feature in Asp.Net. I abandoned the code when it was annonced.

I'm sure it was thought of and being worked on long before it was anounced but I remain curious: Could you clarify what was invented? Was it the specific implementation?

If taking 30 minutes to understand something is elitist, we are all in big trouble :P

I don't have a problem using master pages and I've never had to work with anyone who couldn't deal with them. That being said, there are some things that are counter intuitive and unexpected.(eg The way a master page treats css links in the head seems to confuse almost everybody.)

# July 9, 2009 5:11 PM

Bertrand Le Roy said:

@Andrew: with David's help, I was able to trace it back to that June 2002 sample:

www.asp.net/.../Item.aspx

It was later extended by Paul Wilson:

authors.aspalliance.com/.../Articles

authors.aspalliance.com/.../Articles

Was your implementation before that? If so, I'll plead ignorance :) Even David had trouble remembering the whole thing...

My arrogance comment was more aimed at the "if someone has difficulty comprehending Master pages, they shouldn't be writing ASP.NET code anyway" comment, not at the 30 minutes comment. I'm not really saying that people couldn't deal with the concept if you could explain it to them, more that you usually don't have the luxury to do that, and even if you did, what is the benefit to them that justifies them doing things differently whereas what they know works perfectly well as far as they are concerned? You have got to provide a justification for asking people to forget about what they know and learn something completely different.

# July 9, 2009 6:42 PM

AndrewSeven said:

I'm pretty sure it was after that, maybe in the fall. I remember finding Paul Wilson's demo not long after I had mine working and   wishing I had found it earlier.

# July 9, 2009 8:21 PM

danludwig said:

I just found out about this bug today when a client of mine installed IE8. Had to download the IETester virtual hard drive and install UtilDev Cassini, but eventually got a test environment up where I could debug without deploying to a remote server.

This client site is hosted at DiscountASP.NET, and a support ticket yielded the reply: "We are actually waiting for a rollup fix that includes this issue. We are aware of the hotfix however there is an issue that is preventing us from applying it to all the servers. While I dont have the exact details, I can tell you that as soon as the rollup fix is available we will install it." from Mike O @ DiscountASP.NET.

As it turns out, the fix was rather easy without any changes to the server. It took me about as long to download the IE8 VHD as it did to solve the rendering issues. Aside from specifying the z-index for the DynamicMenuStyle CssClass, I also had to explicity set StaticSubMenuIndent="0px" on the Menu control itself (default of 16 pixels was causing problems in some static menu items). The only other change needed was an explicit height for a div defined inside a StaticItemTemplate for the Menu.

Bertrand you rock... but I do have to second the notion of fixing Safari problems, mainly the AJAX framework's detection of AppleWebKit -- you know what I mean ;)

-Dan Ludwig

# July 9, 2009 9:13 PM

Bertrand Le Roy said:

Well, the menu control is getting redone from the ground up in 4.0, and should work in all browsers. I'll triple-check though.

# July 10, 2009 2:39 AM

InfinitiesLoop said:

Bypasses page lifecycle of course.. that include better not require script references, postback data, etc... basically, render-only stuff.

Any reason for not using ResolveUrl instead of Path.Combine? If you have an include within an include and the inner one is in a different directory wouldn't it resolve incorrectly?

# July 10, 2009 3:06 AM

Bertrand Le Roy said:

@Dave: resolveUrl resolves into a client url, not exactly the same thing although it might very well give the same results. Good point about include within includes. You might want to use app-relative paths then, I suppose.

# July 10, 2009 3:56 AM

John Bubriski said:

I just register all of my controls in the web.config, then I never have to worry about registering them on a page-by-page basis.  Of course, I still have to do that 1 registration in the web.config, but its easy to copy and paste one, especially if you organize all of your controls into one directory.

Plus, I think you would need the declarative approach to set Properties on the control.  In this case, you're including some sort of header, but if its just some sort of "static" header, why not just throw the reference in the master page?

# July 10, 2009 12:25 PM

Bertrand Le Roy said:

@John: that's absolutely right (see my previous post about master pages).

# July 10, 2009 2:08 PM

RichardD said:

Presumable, that should be:

<%= this.Include("Header.ascx"); %>

instead of:

<% this.Include("Header.ascx"); %>

Otherwise, the control output will come before the page output.

# July 10, 2009 2:26 PM

Bertrand Le Roy said:

@Richard: no. <% %> blocks are executed during render so the include will go in place. Plus, the method is not returning anything so the <%= %> wouldn't do anything.

# July 10, 2009 3:10 PM

InfinitiesLoop said:

ResolveUrl always goes absolute (e.g. /app/foo), ResolveClientUrl goes relative. No?

# July 10, 2009 4:37 PM

InfinitiesLoop said:

Oh and this.ResolveUrl will use the current template path as the base, so app relative paths wouldn't be necessary.

# July 10, 2009 4:48 PM

Bertrand Le Roy said:

@Dave: you win :) I've updated the code to use ResolveUrl and it works fine. I've also changed the type of the first parameter to TemplateControl so that you can now use Include in both pages and user controls.

# July 10, 2009 5:12 PM

Joe Chung said:

Cool, this is looking a lot like Rails' partial views.  It would have a lot less Reflection cruft if you used C# 4.0 dynamics ... or if you wrote it in VB. ;)

# July 10, 2009 9:07 PM

KiniK said:

Couldn't fit the whole url in the tweet, so here's the actual coder behind it: http://blog.nihilogic.dk/

:)

# July 10, 2009 9:09 PM

Erik Porter said:

Amen.  Use the right tool for the job.  If you're a dev and you need reusable layout, use master pages (yes, some devs also do the implementing of UI that designers designed).  However, it is a completely valid point that if you want non-devs to implement UI in your app and they have a choice not to, it doesn't make sense to use master pages.

That said, I personally believe there are better ways to do templating so you don't have to repeat a bunch of markup in each file.  Nobody's implemented it yet.  ;)

The real "problem" with master pages is that they're backwards.  Includes have the same problem really.  The page shouldn't decide what layout should be used to render.  The site should.  The page should just render its content and not "decide" anything else and whatever is handling the rendering of the url being request should handle what template gets used to wrap the content of the page.  It gets tricky when you have multiple content areas.  Master pages solves that issue while creating another.  I am SURE there's a better answer.  I have some ideas, just not enough hours in the day.  :(

# July 11, 2009 3:48 AM

Duncan Smart said:

The server side <!-- #include --> style syntax is actually parsed and processed by ASP.NET so will work anywhere, and would be the simpler solution IMHO.

# July 11, 2009 8:44 AM

Jarrett said:

This is nice.  I have a similar widget based include system built into AtomSite (free open-source) and it supports scripts and tail script.  Source code is on codeplex.

# July 12, 2009 12:54 AM

erkekkedi said:

Why is it that people don't prefer to Register their ascx file but persistently use include instead?

# July 12, 2009 5:40 AM

Arun Mahendrakar said:

This is really interesting. I don't see a need for it right now, but I'm sure it's an awesome thing to know.

# July 12, 2009 1:25 PM

Brett said:

I have done this for a while now as i deal with a graphic designer who doesn't want me futzing too much with the aspx files...

1. Add a UserControl that just has this:

public string Path { get; set; }

protected void Page_Load(object sender, EventArgs e)

{

  this.Controls.Add(LoadControl(Path));

}

2. In web.config

 <pages>

   <controls>

     <add tagPrefix="x" assembly="y" namespace="z" />

   </controls>

 </pages>

3. On any aspx page - regardless of the existence of the @Page directive or control registration etc....all you do is add the glabally registered control and enter the path of the control ... <x:Control runat=server Path="~/TheControl.ascx" /> - postback etc. works as normal

4. ???

5. Profit.

# July 12, 2009 8:10 PM

Bertrand Le Roy said:

@Brett: yes, I'm preparing the next post along those lines, except you'll also be able to set properties for the included control. :) And maybe something else after that...

# July 13, 2009 1:05 AM

Joel Coehoorn said:

I don't know: if you use this much it looks like an awful lot of extra reflection code to go through at runtime.  Could be a real performance hog for not a lot of syntax savings.  I'd like to see some load testing.

# July 13, 2009 1:23 PM

Scott Galloway said:

Really it's using a Pile Driver to crack a peanut.WebForms is designed to enable completely different scenarios and isn't suited to MVC IMHO.

# July 13, 2009 2:17 PM

Simone said:

All the webforms method that popup in the intellisense, the webform code snippets, the fact that you have to encode all the output manually (with spark all response.write are automatically encoded), but obviously the 3 biggest ones are the ones you wrote: page lifecycle and runat=server for the mvc controls

# July 13, 2009 2:24 PM

Adam D. said:

You're kidding, right? :)

# July 13, 2009 2:38 PM

Scott Allen said:

In addition to your list:

Server controls in Intellisense.

Having a default of AutoEventWireup="true" baked in the framework (a micro-optimization, perhaps, but you could save everyone a lot of cycles if it was off for views).

# July 13, 2009 2:49 PM

Eric Hoff said:

Personally, I use them all the time.  Most of the complaints I've seen on Twitter revolver around the fact that User Controls and Pages don't render as strings (though I'm sure you can hack around that).

For most things in the page you use <%= ... %> but with Partials and BeginForm you use <% %> blocks.

# July 13, 2009 2:50 PM

Adam D. said:

ok, since you didn't publish my last comment, here's one:

master-detail grids

# July 13, 2009 2:52 PM

Joe said:

It's not NHaml.  :)

You've caught the big ones.  You've got a situation where all you really want to do is render data to the client but you've got a monster of an engine trying to do it.  It's like rolling out a quint to water my lawn (A quint is a piece of firefighting equipment that's both a fire truck (carries ladders and equipment) and a fire engine (carries water, has massive pumps).  Yeah, it'll get water on my lawn but I'll never need those laders or the gallons-per-minute that a quint allows.

# July 13, 2009 2:56 PM

Matt Kellogg said:

At least in C#, my biggest complaint is the bracket mess.

# July 13, 2009 2:58 PM

Scott said:

WebForms views are untestable. No way to access the content during a test due to the dependency on HttpContext.

ViewData Dictionary magic strings.

# July 13, 2009 3:02 PM

Chris W said:

Some of these may not be strictly from webforms, but here you go...

Viewstate, Random 'Invalid viewstate' errors, random validation of viewstate MAC errors, Postbacks, freaky control id names in html, too many events in control life cycle, having to remember the control life cycle...  

ASP.NET is pretty cool, when you avoid the above list and add in jQuery.

# July 13, 2009 3:30 PM

Mark S. said:

Similar to someone elses view, but MVC is the screw (a small machine screw), and WebForms is the 30lb sledge hammer.

# July 13, 2009 3:35 PM

Brett said:

Just replace this as the UserControl in my comments above...

System.Web.UI.Control control=LoadControl(Path);

foreach (string key in this.Attributes.Keys)

{

 PropertyInfo pinfo = control.GetType().GetProperty(key);

 pinfo.SetValue(control, Convert.ChangeType(this.Attributes[key], pinfo.PropertyType), null);

}

this.Controls.Add(control);

then you can add properties like

<x:Control runat=server Path="~/TheControl.ascx" idx="1" category="books" />

Good for standard types.

# July 13, 2009 3:54 PM

Bertrand Le Roy said:

@Brett: yep. Still not getting IntelliSense on those properties. Working on an interesting solution, going almost full-circle to where we started...

# July 13, 2009 4:44 PM

Jon Davis said:

This question doesn't make a whole lot of sense; Web Forms is not an engine, it's a whole application lifecycle. You click on a button, Web Forms magic does a whole bunch of "magic" to get an event generated for you. It's a beautiful engine, but trying to fit it in with ASP.NET MVC makes no sense at all, because ASP.NET MVC has its own lifecycle.

Now, that is not to say that Web Forms cannot have a future with MVC as a *pattern*. It's just that with MVC, every URL GET/POST, every callback, every postback, is all isolated from the view engine and instead sent directly to the controller. This breaks things completely out of the relevance of the Web Forms lifecycle, which says that everything that happens from a web page comes back to the same view engine to be processed by the view engine before any controller-related functionality is even executed (in my opinion, completely backwards from the ideal programming workflow, which is why ASP.NET MVC is taking off so well).

So really, Web Forms should remain what it was originally intended to be: a technology that tries to simulate the drag-and-drop VB6-era Windows app development lifecycle of applying event handlers to user controls. IMO, this should not change. Web Forms should start taking a back seat for those of us who don't need such giant and inflexible sledgehammers. This does not mean it should be tossed aside, and it doesn't mean that Web Forms is legacy. It suits many application scenarios, such as internal-only admin sites where RAD development is truly needed.

It's just that RAD development is passe, and we need lots of small, lightweight tools that aren't trying to be the standalone silver bullet.

# July 13, 2009 5:17 PM

Marcus McConnell said:

Adding and Removing Controls after a page has loaded can cause viewstate errors.

Runat="server"

MVC still requires Session variables which requires a session state server for web farms.

Problems with intellisense for <%=MyVar %> not working inside some tag attributes.

# July 13, 2009 5:23 PM

Steven Berkovitz said:

Not being able to add controls to the page header if you have a <%= %> block in it

Repetitive code writing in properties that access viewstate (if null, return something, else, cast and return)

Validators and all the markup (both html and javascript) that gets emitted when working with a scriptmanager

# July 13, 2009 7:42 PM

kipusoep said:

Thanks for the heads up on the src attribute of the img tag :)

I was looking for a way to display images with ajax 4.0 templates and was wondering why it didn't work in IE7.

Now, with the sys:src attribute, it does work :)

# July 14, 2009 4:50 AM

Adam said:

The biggest issue i can see is the <% %> breakout and then breakin, then breakout, then breakin etc. Its difficult to see the html structure. Its the main reason why we rendered everything in strings using response writes to avoid the tag soup.

This is where something like spark gets it right. The intellisense is great though, but needs to be improved within attributes.

# July 14, 2009 7:40 AM

Pure Krome said:

+1 Scott Allen with AutoEventWireup="true". Gawd that upsets me :) I have to turn everything off and remove unless modules in the .config file.

every cycle counts for the pathetic lowtech code I produce.

# July 14, 2009 8:03 AM

John Goode said:

ViewState, period!

# July 14, 2009 11:13 AM

Andy said:

Would like to use WebForms ViewEngine for email view templating, but WebForms writing directly to Response stream cuts this out.

# July 14, 2009 12:38 PM

Gerardo said:

If you have this problem using a IIS or Apache server in Windows try to look  at the URL where you are redirecting it must be writed in the same way as the URL from you are redirecting.

site.com/pages/index.php redirection to site.com/Pages/index2.php is going to loose the session in IE7 because the capital letter in Pages

# July 14, 2009 2:29 PM

Tyson said:

If you want to use this with disk caching on godaddy and aren't afraid of using your disk quota, change the following in album.ashx.

Line 209

_imageCacheDir = Path.Combine(HttpRuntime.CodegenDir, "_imgCache");

to

_imageCacheDir = Path.Combine(HttpRuntime.AppDomainAppPath, "_imgCache");

and surround lines 1973-1985 with an if block like so

if ((folder.Name.Equals("Album") || folder.Name.Equals("_hcc_thumbs")) == false) {

// code from lines 1973-1985

}

# July 14, 2009 3:25 PM

Steve said:

Difficult to implement dependency injection.  

Most of the time, the biggest complaint I have is that developers use the code behind as a place to put a ton of code.

Too much viewstate.  Sending all that data with heavy controls with viewstate.  Complex scenarios with postbacks.  Outside of demos, pages get complex in a hurry.

Difficulty using javascript.  ie. id mangling.  With mvc using something like jquery or ms ajax is a breeze in comparision.

# July 14, 2009 7:54 PM

Steve Sheldon said:

I don't think your question is clear... People are responding regarding WebForms as a framework, and not just the view engine.

Personally I guess I'm at a point where I don't really care.  Perhaps I should look at these other view engines to see why they might be better.

# July 15, 2009 11:40 AM

Duane Taylor said:

The bit about not supporting overloading was a big help, I wanted to put a function in a .js file which was brought in by a bunch of pages, but some of them may already have it defined locally and didn't know what the behavior would be.  Thanks!

# July 15, 2009 5:23 PM

Bilal Al-Soudi said:

Just Dandy! ..It worked .. Great post

# July 15, 2009 5:24 PM

Brian J. Cardiff said:

bracket mess! I would like better syntax for if/for, maybe something like Genshi genshi.edgewall.org/.../xml-templates.html .

# July 16, 2009 9:21 AM

will1968 said:

I have downloaded the latest zipped copy and got it working on my website. It looks good and google has accepted it.

Is there anything I should be worried about?

If not, thank you very much for some very useful code.

Will

# July 16, 2009 4:01 PM

Chris said:

Page LifeCycle and "dynamic" data requiring run time creation of a variable number of controls. The more you have, the more page lifecycle has to be juggled to get things to just work.

# July 17, 2009 1:04 PM

ram said:

hi, In my masterpage I am having a devexpress treelist and each time I click a node it will create a different user control in the content page based on the node I clicked during a callback of my focusednodechanged clientSideEvent of my treelist. When I click the treenode which I have already clicked before, I want my usercontrol to maintain its viewState. What is the best way to do it. I don't want to load all usercontrols on page load. Thanks, Ram.

# July 19, 2009 12:05 AM

Bertrand Le Roy said:

@ram: you should read this post: weblogs.asp.net/.../truly-understanding-dynamic-controls-by-example.aspx and the one before it.

# July 19, 2009 12:49 AM

Bill Bosacker said:

Hey Bertrand,

I had a fully functional master page system working from a PageBase object way back in November, 2001, so I guess that I predate him.  One I guys that I was working with said that it couldn't be be done, so I just had to prove him wrong.  The pisser back then is that the editor would always remove the runat attribute from the head tag, but it worked.  BTW, I need to send you an email about AddHistoryPoint().  The title parameter doesn't seem to work.

Take it easy,

Bill

# July 20, 2009 10:49 PM

Tom said:

Can't install hotfix on Vista SP2?  Says update is not for machine...

# July 20, 2009 11:43 PM

Evgeni said:

Remove this from your .aspx

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/.../xhtml1-transitional.dtd">

And menu starts working. (at least for me)

# July 21, 2009 2:48 PM

Bertrand Le Roy said:

@evgeni: sorry but that is a bad idea. By removing the doctype, you're switching the browser into quirks mode, and all kinds of stuff will start breaking unpredictably. You will also enter a whole new world of pain getting your code to look consistent cross-browser.

# July 21, 2009 3:20 PM

evgeni said:

Bertrand: of course is not good idea but as a qick fix may work.

Other option is to replace it with

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

which is slightly older standard

# July 22, 2009 5:18 AM

Bertrand Le Roy said:

@evgeni: that second one won't help: browsers actually don't really care what doctype you use. They care whether there is one or not. So the client rendering will be exactly the same with this doctype. What will happen though is that the document may stop validating against W3C validators because ASP.NET controls continue to emit XHTML markup.

# July 22, 2009 12:54 PM

Rick Strahl said:

The Web Form View Engine for MVC is pretty decent IMHO but then I'm biased towards Web Forms in the first place :-}. Personally I *like* the fact that the engine has a lot of power to do at least conditional logic and some basic logic for accessing existing components via code if necessary for rendering content which is missing from some of the other view engines.

One thing that I think should be fixed is Intellisense for <%= %> tags inside of quotes/attributes which doesn't work and for me ends up being the 80% use case for expression tags.

I guess it depends on philosophy. Purists will hate it, but if you're trying to reuse existing functionality ability to access it with minimal logic is a big plus in my book.

# July 23, 2009 3:50 PM

Daniel Hodgin said:

I just came across this issue today when a customer phoned me about their menus appearing white.  Thanks for the info !

While investigating it here I noticed that on IE8 on my laptop it works fine but I am not logged in as administrator.  

When logged in as a local admin or as a domain admin it gives me a white popup menu. However when logged in as a local user account it works normally. I tested this on 4 computers and got the same results on all of them.

The CSS fix alone hasnt solved the problem for me i still get the white menu setting the z-index to 100.

# July 24, 2009 10:24 AM

Bertrand Le Roy said:

@Daniel: that may be a security trimming problem in the site map. You can make sure by trying other navigation controls such as treeview or sitemappath.

# July 25, 2009 1:21 AM

Tiendq said:

Thanks a lot, it's exactly what I am looking for to unit test a class that uses Application variables.

# July 27, 2009 5:52 AM

marco hokke said:

Thanks for this post. Together with Delay's Blog (which pointed me to yours) and Damian Mehers' (which pointed me to the location of the MicrosoftAjax.js) I managed to get our .Net 2.0 ASP.Net with the Ajax Toolkit working properly in an iFrame on our company's site.

# July 27, 2009 10:56 AM

Zoro said:

The problem not solved completely  when page contain scroll , try this solution and scroll page down you will find  this solution buggy on IE6

good luck

# July 28, 2009 7:04 AM

Aaron Powell said:

I gather you're only hiring US based devs, Australia might be a long commute :P

I'd apply otherwise ;)

# July 30, 2009 6:21 PM

Rafael said:

Can I apply if I don't live in the USA. :P

# July 30, 2009 8:35 PM

Jeff said:

Applied! This sounds like my kind of gig, as I've got a million ideas around forums, photos and other such tools the PHP guys get to use, and doing it as one guy is hard. Plus it has an evangelism angle to it, which I'd be into.

# July 30, 2009 9:56 PM

Peter said:

Maybe not related to your (vague) question, but why can't I write this?

<asp:TextBox runat="server" Text="<%# "abc" + someint %>" />

I have to actually write this:

<asp:TextBox runat="server" Text='<%# "abc" + someint %>' />

Notice the single quotes for Text. But what if I need to use a single quote inside the <%# %> block? I can't write this:

<asp:TextBox runat="server" Text='<%# "abc" + someint + 'x' %>' />

So I'm stuck on alternating quotes... Why in the world can't the parser just say "whatever is between <%# and %> should be a "unit" and don't look inside for the ending quotes that wrap the thing... Ohh, and there's zero Intellisense when you have an expression for a property, but that's a VS issue.

# July 31, 2009 12:22 AM

toakhtar said:

this link in not opened....

careers.microsoft.com/JobDetails.aspx

Plz email me the correct Link

thanks

Muhammad Akhtar

toakhtar@hotmail.com

# July 31, 2009 12:23 AM

Peter said:

No being able to compile the view or at least VS to tell me there's something wrong with it before I test it out in the browser. It's like you have this nice static, compiler-checked code (c#, vb, etc) and then you have this dynamic, flaky code in the view that may or may not work...

# July 31, 2009 12:27 AM

Bertrand Le Roy said:

@Peter: you can omit the quotes around the <%# %> block, they will get added for you in the rendered markup.

# July 31, 2009 12:53 AM

Bertrand Le Roy said:

You can always apply even if not in the US. It's always harder but not impossible.

# July 31, 2009 12:59 AM

Me said:

Just so you know careers.microsoft.com is horrendously slow, to the point of being unusable.

# July 31, 2009 12:59 AM

danludwig said:

I tried applying, but I have to create a resume. After entering the title of the resume and clicking "Next", I get the error:

"Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled."

The site is also very, very slow. When would be a good time to try again?

# July 31, 2009 1:21 AM

Saurabh said:

Hooraay!!!!!!.........I just luv to learn and develop new techs, I m going to apply,

bad luck ..... the link is not working

# July 31, 2009 1:23 AM

MisterFantastic said:

Sounds good. But I am in India .What to do ?

# July 31, 2009 3:05 AM

Bertrand Le Roy said:

All of you who are experiencing problems with the careers site, don't let that stop you. You can send me e-mail instead, we'll get you in the system. Apologies about the inconvenience.

# July 31, 2009 4:59 PM

Slawek said:

If Microsoft wants to compete the LAMP stack please first resolve hosting availability problems.

The price is no barrier here but accesibility, aspecialy here in Europe(Poland) it is difficult to find windows hosting at desired location. If I just could lease Windows server let's say per quarter basis (paying online price that hosting providers pay) and install it on my machine without all this certification/partnership crap it would be much much much easier for all of us to develop, deploy and sell asp.net solutions .

# July 31, 2009 6:02 PM

Seeqa said:

Using @mhildreth css fix and @Rob Karatzas Vb code on the page load....

Now I am having asp:menu that works in all new browser(IE8, Firefox3, Chrome3, Safari4)

Thanks guys that really helped me a lot.....

# August 1, 2009 1:11 PM

Kenny said:

I'm using a custom session object class called "UserSession" to manage my session data (I can send you the sample code if you need to see it). It seems to work fine if I never have to change any of the session values. But once I try to update the session object values, it goes twilight zone on me.

Example: If I select job #1 from the job listing page, I set the UserSessionObj.UserInfoObj.JobID to the selected JobID, so as they browse around the site to the any of the 300 forms, I always know exactly which job they are trying to view. On each page load, I get the UserSessionObj.UserInfoObj.JobID value and do my SQL calls to load the form data.  After a user has selected and viewed a few jobs, the current session values appear to randomly get mixed up. It's a roll of the dice which job loads when I visit the pages. It's not as if the JobID session data disappears, because it's not blank, it simply reverts back to session data values I selected earlier in my session. Sometimes it feels as if I'm not updating the session object correctly and I'm inadvertently creating more instances of the same object, so the browser gets confused as to which instance to load. Does any of this make sense? Any help would be greatly appreciated. I need to get away from my http cookies.

# August 3, 2009 2:02 AM

Bertrand Le Roy said:

@Kenny: hard to say, but I'd guess static variables in your code.

# August 3, 2009 2:43 AM

Kenny said:

But I have no static variables. I have noticed something though in the past 30 monutes or so. I created a page called "test.aspx" and it does nothing but display the session data to a label. After I hit the refresh button a few times (usually 3 times), it errors out and says the session object doesn't exist. What would cause the object to disappear?

# August 3, 2009 3:03 AM

Bertrand Le Roy said:

@Kenny: no idea then, sorry. Web farm?

# August 3, 2009 3:19 AM

Kenny said:

No, a single server running two websites. I don't know. I'm just tired of looking at the same code for 45 straight hours. A million websites using session variables without incident, and mine is being a pain in the arse. I have to have this running by morning and it's getting worse, not better!

But thanks for your help! :-)

# August 3, 2009 3:27 AM

Bertrand Le Roy said:

@Kenny: you should probably contact support. contact me if you don't know how.

# August 3, 2009 12:22 PM

Ray said:

Do we have to relocate to Seattle for this position?  I'm Arizona right now.  Thanks.

# August 3, 2009 1:27 PM

Bertrand Le Roy said:

@Ray: preferably yes.

# August 3, 2009 1:55 PM

bmains said:

FYI, links no longer work...

# August 3, 2009 3:57 PM

Bertrand Le Roy said:

Fixed.

# August 3, 2009 4:16 PM

Dale Wilken said:

I applied this KB 962351 and it solved the menu problem until now.  I have a ASP.NET 3.5 Web site.

My XP computers with IE 8 and latest updates/patches view the menu fine but my Vista Ultimate comptuers with SP2 and all of the latest automatic updates/patches as of 5 Aug 2009 now have blank text for the sub menu items.

If I force the IE 7 compatibility mode then it works correctly.

When they applied the Visual Studio emergency update last week did they break the System.UI.WebControls.Menu control?  I would prefer to run in IE 8 mode so please let me know when they fix it again for Vista Computers with IE 8 so I can continue to run just in IE 8 mode, which is what I prefer.

# August 5, 2009 3:57 AM

Scott said:

@Andy - NPR is good old fashioned journalism? You must be joking.  Yeah, their stories are longer than the 30 second blips you see on the 4 majors but that doesn't make them unbiased. Over the decades I have learned that the best way to know the truth is to pay attention to what is said and what is NOT said.  Too often I hear only 1 side of stories from NPR.  Even when they do give both sides they do so only half-heartedly.  In addition, most stories have 5,6,7, or even 11 different angles and sides but they only report 1 or 2.  Of course, no one reports every side of a story - but please, don't refer to NPR as unbiased old fashioned reporting.

# August 5, 2009 8:27 AM

Bertrand Le Roy said:

@Dale: I don't know. I would suggest you contact support to get an answer to that. Contact me at bleroy at microsoft if you don't know how.

# August 5, 2009 1:18 PM

Nealio said:

I just moved this website to Godaddy. Of course the photo album was working own my own 2003 server no problem. Now its not showing thumbnails. I adjusted the album.ashx to use memory instead of disk but no luck. Can anyone help fix this? This is a great photo album and it seems from this post that some people may have gotten it to work at GoDaddy but maybe I missed something.

Also I did change permissions on the IIS mgmt at GoDaddy and create and application for that folder. Its running IIS7

# August 11, 2009 2:40 PM

Nealio said:

Actually, Tyson's post worked great. I must of had something wrong. Its working great now

If you want to use this with disk caching on godaddy and aren't afraid of using your disk quota, change the following in album.ashx.

Line 209

_imageCacheDir = Path.Combine(HttpRuntime.CodegenDir, "_imgCache");

to

_imageCacheDir = Path.Combine(HttpRuntime.AppDomainAppPath, "_imgCache");

and surround lines 1973-1985 with an if block like so

if ((folder.Name.Equals("Album") || folder.Name.Equals("_hcc_thumbs")) == false) {

// code from lines 1973-1985

}

# August 11, 2009 9:02 PM

jamie_dixon said:

I am getting

Error Creating Control - Album1Type 'System.Web.UI.UserControl' does not have a public property named 'FolderModeTemplate'

when trying to view Templated.aspx in design view.  

MetaDataExtractor is referenced

Templated.aspx, Default.aspx, album.ashx and Album.css are all in the same directory.  

In addition, the Default.aspx page works fine until I move the album.ashx file into a subdirectory and change the control path.  In this case:

<%@ Register Src="album.ashx" TagPrefix="photo" TagName="album" %>

to

<%@ Register Src="~/Images/album.ashx" TagPrefix="photo" TagName="album" %>

# August 12, 2009 10:50 AM

jamie_dixon said:

I got the control to work - you need to set the HandlerURL and Register Src="" to the same amount

I have 1 question though

I see 2 other people asked about the images showing up in a column.  How do I change that so the control is only a shortcut image ot he directory where the album.asxh is located?  Is that in the .css embedded in the class?

# August 12, 2009 1:07 PM

Kunal Shah said:

Good to hear about the inventor of the MasterPage.

I love master page. It changed the way we develop older asp.net application with more effort.

# August 12, 2009 1:19 PM

Kunal Shah said:

I would also like to apply for Microsoft.

Can you please tell me, whether passing Microsoft Certification Exam will get me any benefit?

# August 12, 2009 1:24 PM

Bertrand Le Roy said:

@Jamie: not sure I understand your question. Do you want to follow-up offline with me (bleroy at microsoft)?

# August 12, 2009 2:33 PM

Bertrand Le Roy said:

@Kunal: not really, no.

# August 12, 2009 2:34 PM

Don said:

Bertrand,

I'm experiencing the same result as Dale.  Can you post a solution, if one is available.  Thanks.

# August 13, 2009 9:45 PM

chanva said:

Maybe we should make "for" and "if" as built-in tags.

# August 14, 2009 11:45 AM

Dale said:

Bertrand,

I contacted support and after a few days they posted that the problem was resolved when they hadn't done anything to resolve it.  I gave them a unsatisfactory review on their satisfaction survey.  I don't think they understood my problem entirely and closed it as an easy way out.

# August 14, 2009 4:14 PM

Bertrand Le Roy said:

@Dale: I would reopen the incident. That is not right.

# August 17, 2009 4:14 AM

Martin Bennedik said:

You should really read Anathem, if you haven't already.

# August 17, 2009 6:29 AM

Macario F. Pedraza said:

Awesome post, the subject has always interested me in a very layman sort of way and, although I read your blog for the .Net content, I really liked this article.

# August 17, 2009 11:52 AM

joechung said:

I have a question not necessarily just for you but for the community at large: why is NHibernate so popular?

# August 17, 2009 9:29 PM

Troy Goode said:

I highly recommend taking a gander at Fluent NHibernate - it manages to replace all that XML yuckiness with a beautiful fluent interface. Your Product.hbm.xml file could be replaced by something that looks a little like:

public ProductMap : ClassMap<Product>{

  Id(x=> x.Sku, "SKU").Length(50).Not.Nullable();

  Map(x=> x.SiteID);

  Map(x=> x.Name, "ProductName");

  Map(x=> x.BasePrice);

}

http://fluentnhibernate.org/

# August 17, 2009 10:50 PM

Andrei Rinea said:

Why on earth isn't there a visual tool to set up the mapping(s) for NHibernate? And to offtopic it a little, the same goes for the configuration of WCF services too..

# August 18, 2009 2:24 AM

Andrew Rea said:

WCF Does have a GUI for the configuration.  I am almost sure NHibernate has a query generator and I would not be surprised if there was also a GUI for the configuration BUT, inside Visual Studio, when on the mapping file, if you right click and properties you are able to add the schemas to the XML file, and this allows for autocomplete to popup and enables you to have a wander round the different attributes and learn more!

Another one to look out for is using a version of the UnitOfWork pattern, one of the them I use is the NHIbernateUnitOfWork.  I would also point out that you do not have to physically add the class to the configuration as it will automatically scan a location for these providing you state what assembly to use!!

:-)

Andrew

# August 18, 2009 3:32 AM

Dhivya said:

Thank u so much..

you saved my day...

i had two 'sys' undefined errors after patching the file...please make sure that you have placed all the JS files which you downloaded into the '~/Javascript/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js' path.

and i have added the following:

<asp:ScriptManager ID="ScriptManager1" runat="server">

 <Scripts>

 <asp:ScriptReference Name="MicrosoftAjax.js" Path="~/Javascript/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js" />

 </Scripts>

 </asp:ScriptManager>

then it worked well without errors.

# August 18, 2009 6:28 AM

Gurvinder said:

HTML Editor does not work in validation control

# August 18, 2009 10:27 AM

Mo said:

why not LINQ?

# August 18, 2009 11:34 AM

Dave said:

Would any sizable site choose NHibernate over custom data access code? Is the answer yes to all of the following.

1. I want to know nothing about how my data is stored.

2. I will never need to write reports.

3. I will deal with scaling at a later time.

# August 18, 2009 12:38 PM

Adam Aldrich said:

@Andrei Rinea NHibernate is open source and you are welcome to develop one :)

Most developers that use NHibernate (myself included) prefer not to have a visual designer. It just doesn't scale well in an enterprise application where you have lots of business entities.

I think you will find that using Fluent interfaces or even mapping files is really not bad and works better than the draggy droppy interfaces Linq to Sql or Entity Framework push on you.

# August 18, 2009 1:08 PM

Bertrand Le Roy said:

@Gurvinder: thanks for the report. Could you please file a bug here: ajaxcontroltoolkit.codeplex.com/.../Create.aspx ?

# August 18, 2009 1:45 PM

lucasbfr said:

@Dave: I completely disagree, the SQL generated by Hibernate is predictable, and can be overridden when necessary. Not using that kind of framework is most of the times a waste of time.

@Bertrand: Did you have a look at Castle's ActiveRecord framework? It encapsulates nHibernate and avoids the pain of maintaining xmls: www.castleproject.org/.../index.html

# August 18, 2009 2:11 PM

Michael Sanders said:

So, (at least from this example), it appears you still have to have very intimate knowledge of the data tables.  Is there not some tool, that can scan the database in question, and pre-populate a lot of these mappings?

# August 18, 2009 3:43 PM

Eyston said:

Dave:

1 - What do you mean?  You can define DB first and NH second (its what I have to do working with existing ERP system).

2 - Do reporting outside of NH, it isn't a reporting tool.

3 - NH gives me a smart and distributed cache from the get go.  Maybe you are a very good programmer, but it would take me a lot longer to engineer that cache myself in a custom system.  Not doing a query is going to be faster than a fine tuned query.

Also, if you want to fine tune queries, you can.  I haven't needed to.

But I think focusing on queries is missing the point.  It is like becoming the best at using a slide rule when calculators are invented.  If you want to scale you need to think at a higher level than NH.

# August 18, 2009 3:47 PM

Russ Kimball said:

I love the look and interface; works great with my site but only on my system.  When I upoaded it to my web host, I do not have permissions as you stated in your discription.  

How can I change the cashing?

# August 18, 2009 5:21 PM

Bertrand Le Roy said:

@Russ: do a search for "CacheLocation" in the code for the handler. Change the first line you find to:

private const CacheLocation Caching = CacheLocation.Memory;

# August 18, 2009 5:33 PM

Russ Kimball said:

Thanks so much that did it.  I have one more question; is there a way to point the image search to a selected folder?

I have multiple sites and it just makes for too many images.

Thanks again

Russ

# August 18, 2009 6:49 PM

Bertrand Le Roy said:

@Russ: not sure that's what you're asking, but you can put one handler in each of the folders.

# August 18, 2009 7:15 PM

Joe Chung said:

@lucasbfr, Castle's ActiveRecord looks interesting. How does it compare to Subsonic?

# August 18, 2009 7:23 PM

Greg-Muellerson said:

Hey, ok, I get it, I guess - but does this really work?

# August 18, 2009 8:41 PM

Russell Kimball said:

Sorry for not being clear; I have 4 other sites that I host for friends of mine.  They have pictures at appear on their site that I really do not want in my gallery.  All site folders reside in the same main directory each URL pointing to each sites folder; my site resides intact in the same main directory.  When the album is launched it shows pictures from all teh sites; I would like it to only search in the image folder.

Russ

# August 18, 2009 10:38 PM

Bertrand Le Roy said:

@Russ: why don't you put a handler.ashx in each of the image directories?

# August 18, 2009 11:56 PM

Vladimir said:

Castle's ActiveRecord is still in development phase. The latest release is 1.0 Release Candidate 2.

However, it is a very nice way to avoid XML files.

# August 19, 2009 4:04 AM

Lee Timmins said:

I prefer to use T4 templates to generate my entities and mappings.  One thing i don't like about NHibernate is that i'm not a big fan of the query language and would prefer to do it with linq.  Bertrand do you have plans to implement the model with linq to entities once v4 comes out?

# August 19, 2009 6:18 AM

jbland said:

Just FYI, but as of 2.1, NHibernate can run in medium trust - see blogs.taiga.nl/.../new-adventures-under-medium-trust

# August 19, 2009 10:23 AM

Russell Kimball said:

I hate to say this but I am just learning ASP.net; I usually work with Frontpage, I trying to learn.  I do not know how to put a handler.ashx on the image folders so that they are the only ones viewed.  Can you tell me or send me a link?

Russ

# August 19, 2009 10:57 AM

Bertrand Le Roy said:

@Russ: no problem, feel free to e-mail me at bleroy at microsoft.

# August 19, 2009 1:28 PM

Andrew said:

How would you access multiple databases with NHibernate?  We have some data in Oracle and some in SQL Server.

# August 19, 2009 5:53 PM

Matt said:

@Bertrand: thank you very much for this introduction. It gave me a great overview of what it is all about!

Looking forward to your next articles about NHibernate!

Matt

# August 19, 2009 6:14 PM

Fern said:

I have used NHib and I've use EntitySpaces (which is not Entity Framework from MS). I have to say EntitySpaces is way easier to setup and develop in. It's a VS plugin that you just point to a database and it generates everything you need to start working with data. No xml files to mess with, you don't have to type out the model. Check out the screencast off their home page... www.entityspaces.net/.../Default.aspx

# August 19, 2009 10:18 PM

Dave R. said:

@Fern - EntitySpaces is a commercial product (from $300). I'd certainly expect autogen when I have to spend that sort of money!

# August 20, 2009 7:07 AM

lucasbfr said:

@Joe Chung: Unfortunately, Castle ActiveRecord was a technical choice before I came on my current project so I haven't had the opportunity to look at Subsonic closely.

AR is built on top of NHibernate, which made it more appealing at the time.

(Fluent NHibernate looks nice too)

# August 20, 2009 9:01 AM

Eyston said:

@Lee Timmins: NH Linq is released.  It lets you do Linq syntax (from Bertrand's query):

var products = from p in session.Linq<Product>() select p;

ViewData.Model = products.ToList();

@Andrew: Each session factory is responsible for a database, so you would need multiple factories.

# August 20, 2009 3:17 PM

Joe said:

Thanks for these posts!  Keep it up.

# August 20, 2009 10:04 PM

whuili_2006 said:

I am using the Windows server 2003 and would like to fix this problem now. However, when I use code.msdn.microsoft.com/.../ProjectReleases.aspx ,

I get "The specified release was not found."

When I go to support.microsoft.com/.../962351

it lets me go to 969612 hyperlink. When I go to this page, it lets me go back to 962351 hyperlink .

What is wrong?

Does anyone have a patch for Server 2003? Please give a direct hyperlink so that I can download it.

Moreover,  Hong Li at Microsoft, after I download and install the .net 2.0 sp2, the problem is still there.

Thanks a lot. Now this problem is urgent for me.

# August 21, 2009 1:59 AM

mpeterson said:

I think this is going to be a great series of posts... I am especially interested in the transition from the custom datalayer.

Thanks!

# August 21, 2009 9:28 AM

roberta said:

amazing! exactly what a n00b like me was looking for, thanks!

# August 21, 2009 1:39 PM

achu said:

thanks for the post.

if i create a project with new database design i won't use NHibernate; my choice would be Linq2SQL or EF.

achu.

# August 21, 2009 1:47 PM

dave _ M said:

Thanks.  That is a good look at what is needed to start using NHibernate.  I have been tasked with calling a sproc through NHibernatve.  Any tips?

# August 21, 2009 5:25 PM

MR said:

When I try to set the Path, I get this error:

Line 1562:                    }

Line 1563:

Line 1564:                    if (path != _requestDir && !path.StartsWith(_requestPathPrefix)) {

Line 1565:                        ReportError("invalid path - not in the handler scope");

Line 1566:                    }

# August 21, 2009 5:54 PM

Bertrand Le Roy said:

@MR: the picture directories have to be "under" the directory where the album handler sits.

# August 21, 2009 6:22 PM

Bertrand Le Roy said:

# August 21, 2009 6:24 PM

Eyston said:

I have been using NH and wow reading this makes it look complicated :).  It definitely doesn't feel this complicated, but everything you said is right so it is hard to argue that it isn't!

Random question: is there a negative to another dependency?  I initially hated dependencies, but now when I start a new project I probably copy 8-10 dll just to get started.  I would have thought that was crazy before, but now I don't care.  Should I, or is it more a personal preference thing?

# August 21, 2009 7:26 PM

dave _ M said:

@Bertrand

Thanks.  I took a look at that same site yesterday.  My current problem is that I am getting "Parameter does not exist as a named parameter".  Maybe I will does add this to the asp.net C# forum.

# August 21, 2009 7:59 PM

Bertrand Le Roy said:

@Eyston: not necessarily. It should be clear that the number of dependencies is a (mild) issue for us, but that may not be the case for you. For us, it is in a large part a legal issue, as one more dependency is one more thing the legal folks must scrutinize. Fortunately, not everyone has to go through these kinds of hoops.

There is a small overhead in having more dependencies in terms of memory pressure (esp. for bin-deployed dlls) and that's stuff you need to manage (do I get this new version? Is it going to break stuff? Is it going to fix stuff? Do I have time to do the testing or should I stick to what I know works? Do I need it?).

@Dave: I'd ask on StackOverflow or somewhere there are real experts.

# August 21, 2009 8:23 PM

Russ Kimball said:

I got the album to work and only show the image folder that I want it to; only issue now is that when I put it on the server and open the album I only get icons that read "click to display".  This is the album location.

kimball-web.com/.../album.ashx

Thanks Russ

# August 22, 2009 2:32 PM

Russell Kimball said:

Got the ablum working on my home system but but once I upload it to my hosting server it reads "Click to Display" any ideas?

Russ

# August 22, 2009 10:36 PM

Bertrand Le Roy said:

@Russ, I can't access your server for some reason, but you probably need to configure the handler to use memory caching instead of disk caching. See some of the previous comments.

# August 22, 2009 11:42 PM

Justin said:

Firefox 3.6 will support the hashchange event, just like IE8.  See developer.mozilla.org/index.php

# August 24, 2009 1:34 PM

Frank said:

I can't figure it out, but as Zoro points out, there's a case when, on scroll of the main window, the select appears in front of the iframe. And then when you perform some action that requires rendering (e.g. drop down the select, or show an unrelated div, it returns to normal (i.e. iframe on top).

I'm trying to isolate the cause in this js I've been given, but if you know of any reason why this might happen (why a scroll would cause the select to be rendered on top of an iframe), it would be mighty useful.

Thanks.

# August 26, 2009 2:58 AM

Tiendq said:

So cool, I just applied successfully in first time :)

# August 26, 2009 11:29 AM

Bertrand Le Roy said:

@Zoro: you need to handle the scrolling event and reposition the iframe.

# August 26, 2009 2:04 PM

Frank said:

@Bertrand - I found the cause of the scroll problem, in case you're interested. Apparently it happens when you have background-image, with background-attachment=fixed. To verify, add this to your css, :

body{

background-image: url(weblogs.asp.net/.../pumpkin-title.jpg);

background-attachment: fixed;

}

Weird, huh?

# August 26, 2009 8:39 PM

Gauthier Segay said:

Nice article, here are some points of interest:

- when using Guid keys generated from the application layer, it's advised to use GuidComb strategy, as explained here:

nhforge.org/.../using-the-guid-comb-identifier-strategy.aspx

- when using hql, you could benefit from named queries which will check validity (against the parser AND the mapping) during session factory initialization:

ayende.com/.../NHibernatesStoredProceduresNamedQueries.aspx (for plain nhibernate)

www.kenegozi.com/.../using-nhibernates-named-queries-with-activerecord.aspx (with active record)

I hope you'll enjoy using NHibernate

# August 27, 2009 6:37 PM

eyston said:

I'm wondering your take on views in MVC?  To me, this is where I spend 95% of my frustration.  I am able to write domain code I am happy with, but the view seems to fight with doing domain properly (domain is behavior/event focused, view is property focused, etc).  I am considering the idea of splitting them, but I don't know if I'm smart enough :p

ASP.NET MVC is the only framework I have used at work (not even WebForms!) so maybe my confusion is from my limited exposure not seeing what Rails or Django are like...

# August 27, 2009 9:50 PM

Bertrand Le Roy said:

@eyston: that is a somewhat wide open question. My take would be that the view will often be written by someone who is not necessarily a developer. That consideration alone guided much of the design we put into the theming engine that Kona is using. I'll talk a lot more about this in future posts and when the new code is available but let's just say that we tried to lower the concept count to a minimum in view code. We also have some ideas around the separation of layout from actual content rendering. Stay tuned.

# August 28, 2009 12:32 AM

paul.vencill said:

Bertrand,

Sad news about Rob leaving MS, but glad that they made a smart choice on having you pick up Kona.

A colleague and I have been tinkering with a similar concept to your revised Kona plan for a while now, and just yesterday posted a call for ideas on the forums (forums.asp.net/.../1464120.aspx).  

We have both been working with the framework since the first preview, and have tried out a number of the concepts relating to pluggability and extensibility of ASP.Net MVC and the above post was intended to be the first step to consolidating them all into the sort of application-level framework you describe, to compete w/ the likes of Joomla or Drupal, but ideally with better scalability & provider (e.g. db) agnosticism.

Our intent at this point (like you) is to use NHibernate as the persistence provider, and we were considering the use of Billy McAfferty's S#harp Architecture, though we aren't set on that yet.

Bottom line, I'm excited about your vision for Kona and would like to collaborate!

Paul  

# August 28, 2009 6:17 AM

Eyston said:

yah... I don't know what I'm looking for.  I guess just seeing more ways of doing things so I look forward to your examples.

I know Rob had a screencast awhile ago where he had "this.Customer.Name" or something similar.  I'm not sure if that means you create a strongly typed ViewPage where the model is part of the ViewPage properties? (honestly I was looking forward to more Kona screencasts and it seemed to disappear... is there even code out there?)

The idea of having the view appreciate that a designer could be the one crafting is appealing, even if I'm that designer :).

# August 28, 2009 8:37 AM

chanceusc said:

"Where is my Django-style application-level framework for ASP.NET? But that may sound like I’m downplaying the great efforts that many people are putting towards exactly that. I clearly am not. Actually, if you are working on something like that and we’re not already talking, I would love to know about it. I want to know how we can help.."

Paul Vencill and I have planning and spiking such a system for over a year. For the most part, we feel that we've reached the point where we are mostly satisfied with the design and are capable of putting our numerous sketches and spikes to the test. With the recent launch of MVC 2 CP1, we've decided to start the project completely fresh and placed an invitation for developers on the asp.net mvc forums.

The post can be found here:

forums.asp.net/.../1464120.aspx

# August 28, 2009 9:05 AM

davethieben said:

It sounds very exciting to me, even though there a lot of OSS offerings in .NET, I don't think it's anywhere near as comprehensive as the LAMP offerings.  however, you have got to be careful not to try to be all things to all people (CommunityServer?).  for me, simplicity counts a lot in what framework I end up using.

# August 28, 2009 10:07 AM

Bertrand Le Roy said:

@Paul: that sounds great and very much in line with lots of our thoughts and technical choices. Feel free to contact me at bleroy at microsoft.

@Eyston: the this.Customer was an experiment that Rob tried. It was very nice in many ways, but it also came with a number of hidden strings attached and a few things that were less than clean (such as hacking the global namespace). We decided to use regular strongly-typed views instead, which actually works well enough and is much cleaner.

@Dave: absolutely.

# August 28, 2009 1:54 PM

Peeyush said:

Hey, thanks for that wonderful article.

Also, can you post something about configuring TFS?

# August 29, 2009 1:51 AM

vasireddybharath said:

Excelent article...!

# August 31, 2009 4:44 AM

Brett said:

Hey, wanna say thanks - this helped me modify my code and it's workin great. I have an ajax-based page which shows and hides different div's, and one is a chat div. So I setup the function that polls the database for new chat messages to run once, and from inside that function it does a check to see if the chat div is visible, and if so, runs a setTimeout to rerun the check message function in 5 seconds.

If the user moves away from the chat and on to something else (therefore hiding the chat div) the setTimeout doesn't trigger and the script stops polling the database for new chat messages until you click on the "chat" button again to reactivate it.

Works perfectly! I was using a setInterval but much happier now.  

# August 31, 2009 8:59 AM

Navin said:

Betrand,

Thanks for this new release. However, I'm facing a problem.

This link www.asp.net/.../Default.aspx says that one of the new controls provided in this new release is HtmlEditor. I downloaded the toolkit & added the controls in my toolbox. However the HtmlEditor control is absent.

Am I missing something here?

# August 31, 2009 9:01 AM

Bertrand Le Roy said:

@Navin: are you sure you downloaded the right release? The most recent one is:

ajaxcontroltoolkit.codeplex.com/.../ProjectReleases.aspx

# August 31, 2009 2:02 PM

Jason Barile said:

In Visual Studio 2010, Team Explorer is now installed by default along with the client bits.

# August 31, 2009 10:34 PM

Navin said:

Bertrand,

Thanks for the prompt response. The problem's solved though. The release that I had downloaded yesterday was indeed the latest one.

Problem was, the link that I mentioned in my previous post, refers to the new control as 'HtmlEditor'. However, the actual name of the control is simply 'Editor'. I sorted the controls in the toolbox alphabetically(always do that) and looked up only the items starting with 'H'. Naturally, couldn't find it...

Ran a quick eye through all the controls in the toolkit today and found what I wanted. :)

# September 1, 2009 1:49 AM

OmariO said:

I like this case of not having a choice )

# September 1, 2009 2:44 PM

kangax said:

Squeezed it down to 216, but still not quite #tweetcode small (damn it) :)

(function(d){d=document,a=d.styleSheets[0]||d.createStyleSheet();this.select=function(e){a.addRule(e,"f:b");for(var l=d.all,b=0,c=[],f=l.length;b<f;b++)l[b].currentStyle.f&&c.push(l[b]);a.removeRule(0);return c}})()

# September 1, 2009 4:08 PM

Jeff Hegedus said:

Nothing new on this thread in a while.  Has anything changed?  Is it possible now to subclass ScriptManager without loosing intellisense?

# September 3, 2009 8:25 PM

Bertrand Le Roy said:

In 4.0, you don't need to subclass ScriptManager to do that sort of thing. I t's handled natively.

# September 3, 2009 8:30 PM

Nicholas C. Zakas said:

Very interesting approach. Not that I want to introduce another query engine, or try to over-optimize what ultimately is a losing approach, but I was wondering if this approach could be further optimize your approach by limiting the elements to check. Perhaps by taking the last part of the selector and looking just for those tags, so "a.foobar" results in you calling getElementsByTagName("a") and checking just those.

Anyways, thanks for sharing, I love hacky stuff like this. :)

# September 3, 2009 10:51 PM

NoBuddy said:

NaN stands for Not-A-Number, but internally you can also assume it to be infinity. So 0/0 should churn out NaN

# September 4, 2009 3:50 AM

Jesús López said:

I use Virtual clone drive (freeware) to mount iso images:

www.slysoft.com/.../virtual-clonedrive.html

# September 4, 2009 3:58 AM

axsbrad said:

From a learning standpoint I was interested in Rob's implementation of Workflows.  Even though it may be overkill in some situations I would like to use it.  Do intend to add it to the Kona project?

# September 4, 2009 11:25 AM

Bertrand Le Roy said:

@NoBuddy: not exactly true. JavaScript actually has positive and negative infinities, which you can get by doing 1/0 or -1/0. 0/0 does give you NaN though because it can't determine the sign, but isNaN(1/0) returns false. So infinity is a number as far as JavaScript is concerned...

# September 4, 2009 11:34 AM

Bertrand Le Roy said:

@axsbrad: I'm not sure. The plugin logic is certainly staying.

# September 4, 2009 11:35 AM

Bertrand Le Roy said:

@Nicholas: yes, you could, but doing so, you are starting to implement jQuery... Plus, I'm not even convinced that walking the DOM is the slow part: with a very simple DOM, you'll see that you can't get very much lower than 25ms per query (where jQuery wouldn't even take 1ms). That makes me think (although I haven't checked) that what takes time is actually that IE reflows the DOM whenever you touch the stylesheet, even though it shouldn't for unknown properties like we're using here.

# September 4, 2009 11:59 AM

Bertrand Le Roy said:

@Jesús: yes, there are plenty of options. 7zip is another one that you can actually keep installed after you've used it...

# September 4, 2009 12:10 PM

Avinash Joshi said:

thanks......used CTRL+I or ALT+I then type any word and then for incremental search type for that word press CTRL+F3 and For Backword Search use SHIFT+F3

# September 5, 2009 3:19 AM

Jesús López said:

Yes, but extracting the files from an iso image is not the same as mounting an iso image as a drive letter. Mounting is inmediate, however extracting takes time and needs more space. Additionaly, some installers don't work when extracted into an arbitrary folder.

# September 6, 2009 4:12 AM

Bertrand Le Roy said:

@Jesús: well, extracting the iso took me less than a minute, and I didn't have to unmount the image afterwards. The extraction time is also present when you mount, it's just that you're spreading it across the installation time. That some installers don't work once extracted is not a concern here as I'm showing how to install Team Explorer, which definitely works. In any case, this is a very minor point that is probably not worth discussing.

# September 7, 2009 12:52 AM

Leon Gosslin said:

The dropdown list part of my combo box appears about 6 inches below the combo box.  I am assuming it has something to do with my css, but can't figure it out.

# September 9, 2009 10:42 AM

Mohib Sheth said:

@whuili_2006

Download it from here. You should read the whole article and not just look for links :)

code.msdn.microsoft.com/KB969612

# September 14, 2009 7:33 AM

Mike said:

"Note that the outer node of the template, the UL, won’t actually get rendered into the target ul (tree). It is only a container."

To me that seems counter-intuitive.

# September 14, 2009 2:36 PM

Bertrand Le Roy said:

@Mike: that enables you to have more than one top-level element in your template. It's also easier to write valid markup this way.

# September 14, 2009 3:11 PM

InfinitiesLoop said:

I gotta ask -- what's your take on how the picture is related to the article? :) Previous ones I can theorize, but on this one I'm stumped. :)

# September 14, 2009 8:35 PM

jack.niu said:

lots of preview is given, i do hope the beta and release version will have less difference

# September 14, 2009 8:38 PM

bradwils said:

Right on. My thoughts exactly!

# September 15, 2009 3:26 AM

bodar77 said:

Hi Bertrand, do you know when the final release of Ajax 4 will be out? How many more previews are left?

# September 15, 2009 9:48 AM

John West said:

For one-way binding, is there a way to re-render an item if *any* property changes, instead of only re-rendering a property that has been bound?  The problem I'm running into is when I have a code-if statement, where a property in the code-if statement has changed.  I can't force an update to the rendered output.  Right now I'm actually removing and re-adding the object at the same index to force it to be re-rendered.  

Does this make sense?

# September 15, 2009 11:21 AM

vladc said:

Same here, GH is "has been" in my home, and stil using the LesPaul. :)

I finished RB Beatles in one day and will have a do-over with friends on Friday night.

Awesome game, and so much fun to play, I just hope to see Activision pull their head out and take a hard look around.

# September 15, 2009 12:42 PM

InfinitiesLoop said:

John, you can call dataview.refresh() to force a re-rendering. If you'd rather that only the individual thing updates, I'd consider creating an object that represents it in the view, and using a {binding}. Then whenever the conditions change, you simply use Sys.Observer to modify that object.

# September 15, 2009 2:02 PM

Erik said:

Finally figured out a way to document member variables for Intellisense: a param tag is needed along the field tag.

myClass = function() {

   ///<summary>MyClass comment</summary>

   ///<param name="field" type="string">Dummy not visible.</param>

   ///<field name="field" type="String">member variable comment</field>    

};

# September 15, 2009 2:19 PM

shaolin77 said:

Will this work with ASP.net 3.5?

# September 15, 2009 5:19 PM

Bertrand Le Roy said:

@shaolin77: yes.

# September 16, 2009 12:43 PM

Alex Simkin said:

Is it possible to use this type from VB.NET 10.0 ?

# September 18, 2009 9:25 AM

Phil Harvey said:

I did a quick calculation:  A 500 MW tidal power station would have to operate for 300 million years to slow the rotation of the earth by 1 second.  So at this level, I wouldn't say it was a problem.

# September 18, 2009 11:21 AM

Bertrand Le Roy said:

@Alex: which type?

# September 18, 2009 1:09 PM

petersga said:

These fixes still do not correct the border-style issues seen in ie8, correct?  

I implemented the z-index with the hotfix and the menus are working correctly, but my panel border styles (groove, inset, outset, etc) have all gone to solid.

Any idea on how to resolve that?

# September 24, 2009 6:10 PM

Bertrand Le Roy said:

@petersga: I don't know. Does it work outside of the menu?

# September 24, 2009 6:13 PM

petersga said:

Border-style issues are a known bug in IE8.  Groove, inset, outset, etc are not currently supported in IE8, only work when Compatibility mode is turned on.

I have several panels in the main body of my page, all set with border-style of groove.  When compatibility is turned off they all show as solid borders.  With it on they show up as groove.

When I implement the z-index style and hotfix, the blank menu items issue goes away, but the border-style issues do not.

Is there any fix for the border-style issues in IE8 yet?

# September 24, 2009 8:32 PM

Bertrand Le Roy said:

@petersga: the hotfix is patching ASP.NET, not IE. You'd have to ask someone from IE, I suppose.

# September 24, 2009 8:53 PM

sleepydog said:

I think that versioning will be one of the biggest rewards since it will make working with multiple versions (plug-ins) very easy.

ExpandoObject is one such application:

blog.codinglight.com/.../introducing-systemdynamicexpandoobject.html

# September 26, 2009 4:56 PM

Eclipsed4utoo said:

Well let's hope this one was tested better than the last release.

# September 30, 2009 9:46 PM

kristofera said:

Great to see that the control toolkit is still alive.

It would be neat with some release notes, or a summary of fixes and changes in this release.

I tried to figure out how to extract a fix list from the 'top voted issues' thing you have linked to but it is not totally clear to me which ones have been fixed and which ones are just popular bugs...(?)

# October 1, 2009 12:19 AM

Fabien said:

C'etait notre ballade au Mt. Pilchuck ca :) Cool!

# October 1, 2009 2:45 AM

Mohamed Meligy said:

Great news, especially Async File upload.

But I can see the samples website is not updated. Clicking on the control names goes to 404 page and browsing the samples page list does not show them in it.

Can you check ?

Thanks.

# October 1, 2009 6:41 AM

Town said:

These look great, although the links to the control pages are giving 404s and i can't see the new controls listed on the Live Demos link.

Also, are these 3.5 only or is there a 2.0 version? Ta :)

# October 1, 2009 7:53 AM

maxp said:

AsyncFileUpload demo page is erroring.

# October 1, 2009 10:59 AM

nmreddy83 said:

nice to see new additions on ACT. I do not think www.asp.net/.../Seadragon.aspx is working

# October 1, 2009 12:44 PM

Stephen Walther (Ajax Team) said:

@kristofera -- I posted a list of the bug fixes in the following blog entry:

stephenwalther.com/.../new-ajax-control-toolkit-release.aspx

We made some significant fixes to the Calendar, Tabs, and CollapsiblePanel controls. We also fixed a nasty bug related to positioning with IE 8.0.

# October 1, 2009 12:47 PM

Bertrand Le Roy said:

Thanks to all who reported the 404s on the sample pages: The sample site has not yet been updated.

@Town: ACT has been 3.5 and up for more than a year now, sorry. In principle, it should still be possible to compile to 2.0, I suppose, but I cannot promise it will work.

# October 1, 2009 1:44 PM

Bertrand Le Roy said:

Update: the sample site has been updated and the live demos of the upload and deep zoom controls are now available.

# October 1, 2009 4:41 PM

bodar77 said:

I have been programatically instantiating the templates using $create(Sys.UI.DataView, ... etc. is there a way to do this with the recursive templates e.g. not decaring them inline e.g. sys:attach="dataview" dataview:data="{{ getChildren($dataItem) }}"

# October 7, 2009 6:44 AM

Bertrand Le Roy said:

@bodar77: you can probably handle onItemRendering and instantiate the inner dataview from there.

# October 7, 2009 1:26 PM

CraigG said:

I can't get the AsyncFileUpload demo to work - as soon as I select a file, it returns a 404 error.  This happens both in my app and on the official demo page at www.asp.net/.../AsyncFileUpload.aspx.  Using IE 7 and Firefox 3.5.

# October 7, 2009 4:17 PM

carloT said:

This is lovely code. thank you so much!!!!!!!!!!!!!!

# October 8, 2009 10:26 AM

Bertrand Le Roy said:

@CraigG: yes, the live sample site has a dummy URL as the upload address. That it happens in your app is more curious and probably a misconfiguration. Hard to say without seeing your code. You can contact swalther at microsoft if you need more assistance.

# October 9, 2009 3:10 PM

Justin James said:

The Microdata stuff has been around for a while. The basic gist of it is it make up their own tags (or reuse existing tags) to define miniature little data chunks, such as address book entries or calendars. The problem is, they've been kind if piggybacking on the existing spec, making it do things it wasn't meant to do. In the HTML5 efforts, this is probably the most contentious topic, other than accessibility. Many people are pushing hard for a mechanism that allows HTML authors to arbitrarily create their own tags/attributes as needed, and many folks are pushing hard for this not to happen. Both sides have merit, in my opinion. I see the need for allowing authors to extend the language, but it's a real trick to get the language to be extensible without causing chaos and confusion, it seems.

J.Ja

# October 10, 2009 9:00 AM

JesusR said:

Thx for the info:

In Vb.Net

Public Shared Sub Include(ByRef Pagina As TemplateControl, ByVal Archivo$)

Pagina.LoadControl(Pagina.ResolveUrl(Archivo)).RenderControl(New HtmlTextWriter(Pagina.Page.Response.Output))

End Sub

Usage:

Include(Me, /MiControl.ascx")

# October 11, 2009 7:03 PM

Justin said:

Hi, I have build a website with asp.net and would like to implement this album in it... I tried to add the ablum files (templated.aspx etcc files) by using the add existing item in the visual studio but when i build the solution it give me an error something about metadata... "com" missing. can someone please help me solve this problem? as i'm not a pro in asp.net

# October 13, 2009 2:38 PM

Bertrand Le Roy said:

@Justin: you need to copy the dll that comes with the release into the bin folder of the application.

# October 13, 2009 4:53 PM

Richard Ayotte said:

Try this.

var date_string = '/Date(1233323754523+0100)/'

var d = new Date(parseInt(/\/Date\((\d+).*/.exec(date_string)[1]))

# October 14, 2009 3:51 PM

bodar77 said:

This is great, I have been using the other versions imperatively but with a lack of tutorials using the imperative way, I was stuck using Fire Bug to decipher the method names and what they do. Now I imagine all the examples will be imperative, good news.

It is so much better having the code separated from the html.

# October 16, 2009 5:03 AM

Joe Chung said:

The markup, while unobtrusive in the sense of not introducing weird, non-standard syntax and clutter, fails to degrade gracefully in "no script" scenarios. Nothing useful is rendered when script is disabled. Script should strive to enhance Web content, rather than replace it completely.[1]

Having unobtrusive markup with optional script is important not only for accessibility and script-disabled browsing but also for search engine indexing.  

Google's indexer doesn't index content contained in script.[2] I don't know if Bing's indexer can run script or not.

An appealing visual user experience is great, but bad  accessibility is not. Just ask Target.[3]

[1]

en.wikipedia.org/.../Progressive_Enhancement

[2]

www.google.com/.../answer.py

[3] www.dralegal.org/.../nfb_v_target.php

# October 16, 2009 5:35 AM

Sanjeeb said:

Dear Bertrand,

I have this in my web.config:

<customErrors mode="On" defaultRedirect="Forms/GenericError.aspx"></customErrors>

And this in my Global.asax:

void Application_Error(object sender, EventArgs e)

{

   Exception ex = Server.GetLastError().GetBaseException();

   HttpContext.Current.Session[“LastException”] = ex.Message;

}

And this in my GenericError.aspx:

protected void Page_Load(object sender, EventArgs e)

{

   object lastException = Session[MNPSessionConstant.LastException];

   if (lastException != null)

   {

       this.lblErrorMessage.Text = (string)lastException;

   }

   Session[“LastException”] = null;

}

Now when I get to the Page_Load of the error page for the first time I always get the session variable as null. But if I click the back button and go to the previous page and the do the same exception throwing activity again, I get to see the session variable value in the error page.

Could you please help me understand why this is happening?

Regards,

Sanjeeb

# October 16, 2009 5:56 AM

WMA4432 said:

The # symbol is used in the Sys.create.dataview("#destinationDiv",  {data settings} )

Why was the $get("element") replaced with #element when used as a parameter to the Sys.create.dataview ?

How to set the Events,References with Sys.create.dataview?

Does Sys.create.dataView   and $create(Sys.UI.dataView) create the same exact object?

Does the Sys.create.dataview expose any new properties, methods or new functionality?

And is it the same as the Object created with Preview 5?

Thank you,

William Apken

# October 16, 2009 9:53 AM

William Apken said:

WOW! Very nice.

# October 16, 2009 11:56 AM

Bertrand Le Roy said:

@WMA4432: $get still takes a plain id. Sys.get takes a CSS selector, hence the #.

In create.dataView, you can put properties, fields and event in the same parameter object. For example, to wire up the command event, just do command: function(sender, args) {...}.

Sys.create and $create create exactly the same objects, but Sys.create can be used even if the script defining the component hasn't been loaded yet: it will then load it, and when it's done create the object.

# October 16, 2009 12:19 PM

Regis said:

Question for you, might interest other devs around here...

I have a process that generate and publish JS widgets, and right now it goes thru a JVM to minify the output. Is the code of your minifier shared? Can I include it in my publish?

Thanks,

Regis.

a couple of random notes: love the pic, pre.code not really comfortable to read in chrome, font too small :)

# October 16, 2009 12:22 PM

Bertrand Le Roy said:

@Regis: no, the code for the minifier is not shared.

I use Chrome myself. If you find the font too small, I recommend a CTRL +.

# October 16, 2009 1:03 PM

Fran said:

i tried to apply this patch to the Windows SBS 2003 and doesnt works, any special patch for this OS ?

thanks

# October 16, 2009 1:43 PM

Bertrand Le Roy said:

@Fran: I don't know. You should contact support.

# October 16, 2009 2:33 PM

Bertrand Le Roy said:

@Sanjeeb: I don't know but I'd suspect the error redirect is not using the overload that doesn't terminate the response. You might want to consider storing the error in another container than session.

# October 16, 2009 2:37 PM

Bertrand Le Roy said:

@Joe: this is a sample that only makes sense if JavaScript is enabled (it's browsing the *client-side* object model). It is not made to be indexed by search engines.

If you want something that is SEO, there is no going around the solid fact that you need to do the rendering on the server-side. So if you need your contents to be indexed, move over, this is the wrong rendering technology. Always has been.

Now if you hold the opinion that if it can't be indexed by Google, it's useless, that's fine, but some people have different views and use cases.

On the point of accessibility, it's been a few years now since assistive technology embraced script.

# October 16, 2009 2:56 PM

OmariO said:

The framework keeps maturing.

One more scripts loading optimization I'd like to see in MS Ajax is the one used by Gmail for mobile team.

"When the resource first loads, none of the code is parsed since it is commented out. To load a module, find the DOM element for the corresponding script tag, strip out the comment block, and eval() the code.

...

On an iPhone 2.2 device, 200k of JavaScript held within a block comment adds 240ms during page load, whereas 200k of JavaScript that is parsed during page load added 2600 ms."

googlecode.blogspot.com/.../gmail-for-mobile-html5-series-reducing.html

# October 16, 2009 4:55 PM

Bertrand Le Roy said:

@OmariO: that's interesting, I will forward it to the team. This goes against all measurements we have done on the desktop, where parsing is pretty much instantaneous even with large files. This being said, this would only help for mobile applications that also have large script files, which is a relatively small subset of applications. Barring putting it into the framework, it may be interesting to see how such a hack could be grafted on top of the existing script loader.

Another thing to consider is that the script loader works cross-domain, which the code in that post can't do as it is (it uses XHR to load the script). Their code also has a few scope problems in the way they eval the code. Nothing that can't be worked around though. Thanks for the pointer.

# October 16, 2009 5:43 PM

BrianOConnell said:

I take the point that this is client side only but using the word unobtrusive is simply wrong here. Unobtrusive scripting is used to enhance an already working html page. I make that twice now that microsoft have mentioned unobtrusive scripting. It's a good sign but lets use it where it correctly applys.

# October 16, 2009 11:33 PM

praveen.prasad said:

hi

every thing  ajax team is doing is really appreciable

but i think visual studio is still missing one thing that's support for js files. At least it should have code folding. Nowadays the size of  js files is really large.

# October 17, 2009 2:06 AM

AZ said:

The ASYNC Fille Upload example demo is not working on IE8 and FireFox 3.5

# October 18, 2009 6:13 AM

Speedbird186 said:

Has this actually made it into 3.5 SP 1? The futures download doesn't exist anymore, but I can't seem to figure out how to find it if it is built into the latest Framework release?

# October 18, 2009 3:16 PM

Bertrand Le Roy said:

@speedbird186: it has not, but the source code is still available. It's attached to this post.

# October 18, 2009 3:43 PM

Marwan said:

niiiiiiiiice

# October 19, 2009 9:27 AM

Mike Flynn said:

Good solution, but this would work for say a paging solution when you would need to use the template over and over.

# October 19, 2009 12:25 PM

Bertrand Le Roy said:

@Mike: absolutely.

# October 19, 2009 1:43 PM

Kelly Stuard said:

I assume "isDetails" translates to "?jedi=all" in the query string?

# October 19, 2009 1:58 PM

Bertrand Le Roy said:

@Kelly: the server-side code, which I didn't detail here but that you can check out in the project zip, sets isDetails if "jedi" in the querystring is not empty. It can be "all" or the name of a jedi. In non-JS mode, the app has three states: initial (no list, no details), list expanded (but no jedi selected: "all"), and list expanded + details (jedi name on the QS).

# October 19, 2009 2:07 PM

Joe Chung said:

"Never mind that ‘unobtrusive’ is a perfectly well-defined word that actually existed way before JavaScript. ‘Unobtrusive JavaScript’ has a very specific meaning that people feel strongly about."

I was just going off the definition of "unobtrusive JavaScript" on Wikipedia - en.wikipedia.org/.../Unobtrusive_JavaScript - which is the first search result if you Google (or Bing) it.

"Which in turn triggered some unpleasant comments on the post: this was not really unobtrusive JavaScript in the full sense of the term."

I apologize if you thought my comment was one of the unpleasant ones. It wasn't meant to be.

# October 19, 2009 4:39 PM

Bertrand Le Roy said:

@Joe: understood, and that's also the definition I've been going with.

# October 19, 2009 4:45 PM

InfinitiesLoop said:

This isn't the comment you're looking for.

# October 19, 2009 6:56 PM

Andrew Davey said:

I've also been thinking about reusing HTML templates server and client-side. I'm using VB.NET as a view engine and so can do some interesting stuff with expression trees containing XML literals.

Check it out:

www.aboutcode.net/.../GeneratingJavascriptTemplateFunctionsFromExpressionTrees.aspx

# October 20, 2009 5:30 AM

DBJ said:

If it proceeds like this C# will become JScript.NET ...

Why not just making JScript.NET a "first class citizen"?

If we would have comprehensive Visual Studio support for JScript.NET , same as C# has, world would be a different pleace ...

But then, the question will be: Why C# ? ;)

Regards: DBJ

# October 20, 2009 5:53 AM

Bertrand Le Roy said:

@Andrew: nicely done. This is really interesting. It would be interesting to see how far you can go with complex expressions and also if you can generate template functions that are compatible with the Microsoft Ajax DataView.

# October 20, 2009 2:04 PM

Bertrand Le Roy said:

@DBJ: you're preaching to the choir. I would really really like to see a fast, modern JavaScript implementation on .NET.

But C# is still a very different beast, and your question sounds a little to me like "why is there more than one programming language?" Curly braces are about the only thing JavaScript and C# have in common.

# October 20, 2009 2:48 PM

DBJ said:

I may be sound by I am not ;o)

C# is bloated beyond repair. I like F# or IronPython (for example) and I would love D# to be a .NET programming language, and not a "guitar chord", when Google-ing it up. (Or is it Bing-ing ;o)

The misterious life of JScript.NET, is it seems complicated by someone or something even more misterious? It is always present in .NET but never present in VisualStudio. It is the only .NET language which has no VS support. For example.

F# comes with a Microsoft Visual Studio language service that integrates it with the IDE. With the language service installed, Visual Studio can be used to create F# projects and the Visual Studio debugger used to debug F# code. In addition, it comes with a Visual Studio-hosted interactive console that executes F# code as it is being written.

Why is there no this kind of support for JScript.NET ?

JavaScript is a programming language of the WWW. MicroSoft is fully supporting it, including active involvement on the ECMA and HTML5 comitees. But. JScript.NET is "nowhere to be seen". Why ?

# October 23, 2009 3:36 AM

Bertrand Le Roy said:

@DBJ: as I said, I'd love to see a good JS for .NET too. But I totally disagree with what you're saying about C#. Which is fine, I'll continue using it and you can go your own merry way while still targeting .NET.

# October 23, 2009 3:56 AM

Carp said:

Have a 4700 and the same problem, running Vista and want to rid myself of the redundant Error on the Windows Media Player.

# October 24, 2009 2:15 AM

subha said:

hai,

 when the page is postback,navigated or revisited The ASYNC Fille Upload is not clear.can u give idea

# October 26, 2009 7:18 AM

Bertrand Le Roy said:

@subha: you should file a bug here: ajaxcontroltoolkit.codeplex.com/.../Create.aspx and/or ask your question on forums.asp.net/1022.aspx

# October 26, 2009 1:58 PM

DBJ said:

But ... you/we already have "a good JS for .NET".

It is called JScript.NET ... this is all I am saying.

Why don't we use it ?

DBJ

# October 26, 2009 4:41 PM

Bertrand Le Roy said:

@DBJ: JScript.NET is not JavaScript and I would not call it a "good JS for .NET". It's slow, it has almost zero support in VS, it has issues with global scope and dynamic evaluation of code.

# October 26, 2009 6:03 PM

DBJ said:

Not a problem. Let's start with providing full and real VS2010 support, for JScript.NET.

After that let's pull it through several major iterations, just like C#.

This would be a real robust start, me thinks.

If there were resources for F#, there surely will be for something as commercially important as "javascript server side"?

It will also go head-to-head with the likes of AIR and Rhino. Etc ...

Let's just do somethign with it. Or dump-it. Why this strange JScript.NET limbo?

--DBJ

# October 26, 2009 7:14 PM

Bertrand Le Roy said:

@DBJ: While I would love to see that happen, I'm in no position to make it actually happen. All I can do is push for it (which I did) but then the different teams make their own decisions.

BTW, you keep saying "C# is bloated beyond repair". What feature(s) would you remove?

# October 26, 2009 7:23 PM

DBJ said:

Let us not forget how the whole .NET/C# started. From the need to produce an answer to Java+JVM. Remember J# ;o) How much the technical excellence, was the part of original requirement? It all started in a rush, unfortunatelly. Then "features" pile-up stage, which is still going on. Together with more "features" which have to be added when older "features" render themselves not so well thought through. Exsmple: generics. I will say it here, why not: C# generics are the most hilarious implementation of Ada templates, ever concieved...

I am "damaged beyond repair", with C++, I am affraid. Which is also too complex by now ;o) And ECMAScript of course.

Whenever I had to do something in C#, I feel like swiming with one hand, when compared to the two others above mentioned.

PS: D looks very promising. For "us" old C++ hands.

# October 28, 2009 9:22 PM

Bertrand Le Roy said:

@DBJ: I do remember J# and J++, which had some fantastic features that Java didn't have, thanks to Anders (delegates to name one). What evidence do you have that it "all started in a rush"? The first demos were given in 2000, so the work must have begun before that, and the 1.0 version was released in 2002. The Java lawsuit having begun in November 1997, they seem to have had ample time to design the platform and language.

Generics is the last thing I expected you to cite. Their implementation is actually pretty good (no idea what you find "hilarious"), especially when compared to, say, the Java implementation.

Never could stand C++ myself. The number of different representations for a string, for example, now that's hilarious. Talk about bloated. At least in .NET there's only one sort of string.

But I guess at this point, this discussion is pretty much a religious one.

# October 29, 2009 12:04 AM

noonway said:

@Bertrand: You were telling Russ...

@Russ: why don't you put a handler.ashx in each of the image directories?

I am attempting to do this - using as a user control - with the following Directory Structure:

Main Photos (album.ashx here, main.aspx with the @register src of ~/Main Photos/album.ashx, secondary.aspx with the @register src of ~/Main Photos/Secondary Photos/album.ashx, and tertiary.aspx with the @register src of ~/Main Photos/album.ashx)

|

|__ Secondary Photos (album.ashx - HandlerUrl changed to ~/Main Photos/Secondary Photos/album.ashx)

|

|__ Tertiary Photos (album.ashx - HandlerUrl changed to ~/Main Photos/Tertiary Photos/album.ashx)

But when I drop the handler in the subdirectories, modify the HandlerUrl and compile the code I get the following errors in each of my .aspx pages as well as the compiled DLLs.  

Error 38 The type 'Bleroy.Photo.Album' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\photos\d81285ef\ee16f919\App_Web_lsjmicgf.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\photos\d81285ef\ee16f919\App_Web_plpl094z.dll' c:\Projects\company\main.aspx 10

I've never used .ashx files before so I feel like I may be missing something easy here... I tried renaming the namespaces to no avail.  Any other suggestions?

# October 29, 2009 10:04 AM

Neeta said:

You can use -

eval('new' + dateStr.replace(/\//g, ' '));

this returns a Date and then use format function format the date as desired

# October 29, 2009 11:58 AM

noonway said:

@Anke: I found the answer to your problem and wanted to post here in case someone else is having a problem publishing their website from VS.  After you click on "Publish web site" the "Allow this precompiled site to be updatable" option will be checked.  Just uncheck this option and it will publish your website correctly toy our target location.

See here for more information as to why: msdn.microsoft.com/.../377y0s6t.aspx

Hope that helps someone else...

# October 29, 2009 12:01 PM

Bertrand Le Roy said:

@noonway: right, Web Application Projects are not something I've considered. On the other hand, if you're using it as a control, I'm not sure you need two copies. Pointing both controls to the same url should in principle work.

# October 29, 2009 1:42 PM

noonway said:

@Bertrand: But if I point both controls at the same URL I get the full Gallery list instead of just a particular gallery.

What I'm trying to do is build a menu called Gallery that shows all the sub-galleries on one .aspx page but then if the user selects a particular Gallery from the menu it would only show that secondary gallery and not the main or tertiary galleries.  I could probably recode the handler to take an argument with the directory I want to show, but I don't really have the time to delve that deeply into the code.

Oh well, I guess I'll just use the single gallery and let the users select which sub-gallery they want to use directly from the main.aspx.

Great work here, by the way.  I never would have thought to use caching the way you did and appreciate the tutorial.  :)

Thanks!

# October 29, 2009 1:56 PM

Bertrand Le Roy said:

@noonway: well, that's not a scenario I had in mind. There is a new version on the way though and I can try to see what I can do, but I can make no promises about when that's going to be out.

# October 29, 2009 1:58 PM

Throstur Jonsson said:

This article explained a lot. However after I applied those rules to my ASP.NET application it is running slower. I'm connecting to an Informix database via ODBC. When I trace the connection session at my Informix server I notice (after the changes) that no connections are keept open at the server from the IIS server. So it seems to be that whenever I issue a Close(), IIS drops the connection with the database server. Establishing a connection to the database server is expensive. How can I tell IIS to keep some connections to the database server in the connection pool?

# October 30, 2009 7:31 AM

Andy said:

OpenSocial Templates (wiki.opensocial.org/index.php) are perhaps also showing that rendering of the same templates client side and server side will increasingly become the norm, for HTML layouts at least.

I'd be interested to see if shared templates in ASP.NET could also follow the External Tag Libraries type packaging support they have (wiki.opensocial.org/index.php_Developer's_Guide#External_Tag_Libraries).

Or build on conventions from MVC 2 like having /DisplayTemplates/EntityType.shared.ascx (RIA services uses a "shared" naming convention for reuse across client and server), rather than having these reused templates inline within a view.

I did wondered about using the Spark View Engine as a basis for a template parser that could process {{bind}} type elements on the server. So a stop-gap could be a flexible extensible View Engine.

Thanks for the continued Previews and interesting blog posts.

# October 30, 2009 8:29 AM

Bertrand Le Roy said:

@Throstur: The only explanation I can see is that you're using an antiquated database driver that doesn't support pooling. Maybe you should contact the Informix support.

# October 30, 2009 2:16 PM

Bertrand Le Roy said:

@Andy: Thanks for the link. I don't see from this link what this has to do with the server. Also, OpenSocial templates suffer from a number of issues:

* templates are stored in script tags, which is abusing the script tag and prevents authoring and validation tools from working over them.

* the expression language, strangely, is JSPEL, whereas JavaScript is perfectly fine as an expression language. Choosing an arbitrary server technology (Java) over the existing client standard when building a client technology looks like a very weird choice.

* it uses non-namespaced custom tags and attributes for conditional rendering and loops.

* it has no hooks to enrich the created markup with script (to add event handlers and components for example).

* no live bindings

But yes, the template libraries are a neat idea. We've been thinking about something similar, closer to user controls. Maybe I'll post about that soon.

# October 30, 2009 2:38 PM

RichardD said:

This works in IE, but not in Firefox. The first two versions (default.htm and declarative.htm) work in both. I don't get any script errors, but I don't get any UI either.

# October 30, 2009 2:42 PM

Bertrand Le Roy said:

@Richard: thanks, this is now fixed.

# October 30, 2009 3:31 PM

Andy said:

>  I don't see from this link what this has to do with the server

Data Pipelining and OS Templates can be evaluated on the server (not covered very clearly in those links), as is the case for gadgets on Profile views. The Shindig implementations currently do this server processing (which are of course, Java based, hence using Java conventions in the templates).

I'm definitely going to be using Microsoft Ajax templates in projects, but OpenSocial Templates suddenly made me consider a change of heart, with their promise of easy distribution of ajax/templating to multiple social type sites, and even now corporate portal products (like Atlassian products). And it's less of a fudge, they should work exactly the same on the server side.

Lack of hooks is an issue, but is a by-product of this goal of wider distribution with OS Templates.

On another note, I was very excited today to get two-way binding to work with Extjs controls with Microsoft Ajax Library. Not too much hacking, and doesn't need to wrap the controls really, just a few events and added methods. It would be interesting to see on Codeplex or somewhere, hints on how to fit the binding into common frameworks.

var textField = new Ext.form.TextField({});

textField.on('change', function() { this.raisePropertyChanged('value') }, field);

Sys.bind(textField, 'value', dataContext, 'title', { mode: Sys.BindingMode.twoWay });

Ext.form.Field.prototype.set_value = function(value) {

this.setValue(value);

}

Ext.form.Field.prototype.get_value = function() {

return this.getValue();

}

Ext.Component.prototype.add_propertyChanged = function(handler) {

   Sys.Observer._addEventHandler(this, "propertyChanged", handler);

}

# October 30, 2009 3:55 PM

Bertrand Le Roy said:

@Andy: "which are of course Java based": how is it obvious that the server must use Java?

What would prevent you from using Microsoft Ajax templates in an OpenSocial widget?

# October 30, 2009 4:08 PM

dbj said:

http://dbj.org/dbj/?p=427

I am not religious. I am language agnostic. My experiences are coming from (very large) commercial projects. Of which I was leading some.

I actually used MS Java (before J#) commercially, not just for fun.

UN or not unfortunately, C++, still is the undisputed king... Religion or not.

And, more than one C++ "celebrity" agrees with me: D, might be that next step we have been all waiting for.

--DBJ

# October 31, 2009 5:00 AM

Joe Chung said:

Great example!  I wasn't getting how the jQuery integration worked from previous things I've read and seen about the new Microsoft Ajax library, but now I get it.  Thanks!

# October 31, 2009 4:00 PM

Abel Braaksma said:

Very simple and just brilliant. Couldn't have though of this myself. I used it in <a href="stackoverflow.com/.../parameterising-dllimport-for-use-in-a-c-application">this generic-delegate-to-pinvoke approach</a> where it seemed the only way out and it works like a charm.

# November 2, 2009 9:55 AM

Henry Lee said:

Very useful. Thanks.

# November 2, 2009 11:53 AM

gummadi sri ramulu said:

we design a website using as.net 3.5

menu is working fine in mozilla but in ie8 it is not work ing

1) gaps are appearing between menus and shade colour is comming between menu tabs

# November 3, 2009 5:52 AM

Monalisa1 said:

Hi Bertrand,

None of these work with preview 6 of same files. Please let me know if there any significant changes in syntac and what could be going wrong here.

# November 3, 2009 7:55 AM

Bertrand Le Roy said:

@gummadi sri ramulu: if tweaking your CSS doesn't work, please contact support.

# November 3, 2009 2:51 PM

Greg Vestal said:

I have what appears to be a unique issue which I have pretty much written off to the user's system setup.  We have an apartment application here that works fine for 1000s of users without this problem.  Also works in production with anybody else here loggin into their profile.  It seems that a session variable is changing between page posts.  Basically we have a customer they login, they choose a property and the next page is a list of units in that complex.  Well what is happening is the units that come up on the next page are from a different complex.  I have never heard of the session variable changing like that.  I haven't checked the system set up yet but was wondering if you have any idea what might be causing this??  This is VS 2002 written in VB.NET.

# November 3, 2009 3:27 PM

Bertrand Le Roy said:

@Greg: I'd bet for caching. Probably too aggressive.

# November 3, 2009 3:35 PM

Bertrand Le Roy said:

@Monalisa1: I updated the post to use Preview 6.

# November 3, 2009 5:01 PM

SteveG said:

@Neeta,  That just ignores the timezone adjuster +0100.  Be careful with daylight savings time if you are using a server in a different timezone to the target country of your site.  I use a 3rd party JSON API which is hosted in GMT-700 SF, USA.  However the target audiance is worldwide and I am testing in UK.  Dates I added earlier in the year during BST (British Summer Time) but before SF went back an hour were an hour out though the time zone adjuster always showed -700!

# November 4, 2009 9:12 AM

Schubert said:

I downloaded and install it to Windows 2008, but still the same thing. The asp:menu works fine in IE7 but in IE8 the asp:menu not work well the same as before installation of the patch.

# November 4, 2009 1:33 PM

Bertrand Le Roy said:

@Schubert: if you're still seeing problem after applying this patch, please contact support.

# November 4, 2009 1:59 PM

etam said:

I'm getting the same problem on production server.on  localhost it is working fine . do you suggest to use server.transfer instead?

# November 4, 2009 2:21 PM

Bertrand Le Roy said:

@etam: no, except if transfer was the right thing to do to begin with. They are not interchangeable.

Do a redirect (with the right overload) when you want the URL in the browser to reflect the change, and do a transfer if you want to delegate the processing of the current request to another handler or page without it being reflected in the URL. Those are two very different use cases and one should not switch just to work around a bug. Fix the bug instead :)

# November 4, 2009 2:31 PM

michael said:

Does Sys.Serialization.JavaScriptSerializer.deserialize() account for the timezone adjuster?

# November 5, 2009 1:50 PM

Chriss said:

How do you whitelist, I'm trying to link into spotify but with no luck at the moment.

# November 5, 2009 3:07 PM

Bertrand Le Roy said:

@Chriss: the two protocols that are whitelisted by default are http and https, but you can push a new one into Sys.UI.Template.allowedProtocols.

# November 5, 2009 3:37 PM

sayed_mohamed_Darwish said:

"CS0246: The type or namespace name 'com' could not be found"

I'm sure that the MetaDataExtractor.dll is loaded to the Bin directory .

What is the problem ?

# November 7, 2009 1:04 AM

Bertrand Le Roy said:

@Sayed Mohamed: I really think that is the problem. Are you sure the bin directory is directly under a directory that is configured in IIS to be an application?

# November 7, 2009 1:25 AM

KiT said:

Thanks. It works great.

However, it works on .aspx and .htm(l) files but not .js file.

Is there any way to make it work on .js file?

# November 10, 2009 1:59 PM

Bertrand Le Roy said:

@KiT: you mean even after you added the reference tag?

# November 10, 2009 2:12 PM

KiT said:

Do I need to add a reference tag in the .js file? How?

Sorry for asking such a naive question.

I am still new to this area.

What I have done is I put the -vsdoc.js in the same folder as jquery library file and add a reference to the jquery library under the <head> section of an html file.

It seems like the -vsdoc.js is loaded automatically since I can see from its intellisense.

However, when I tried to see the intellisense in an external javascript (.js) file, it doesn't appear as expected.

Thanks :)

# November 11, 2009 7:34 AM

Bertrand Le Roy said:

@KiT: yes, there is an example of that in the post. You just add a comment like this:

/// <reference path="jquery-1.2.6.js"/>

No need to reference the vsdoc file directly, VS will find it from the path you provide.

# November 11, 2009 3:12 PM

KiT said:

@Bertrand: Wow! Thanks a bunch. That does the magic. However, it takes time for the intellisense to show the expected functions. (I'm using Resharper - doubting if it could be the cause of the delay.)

# November 12, 2009 10:37 AM

Bertrand Le Roy said:

@KiT: yes, the speed is not optimal in 2008 (although still very usable imo). In VS 2010, you don't even feel it, it's immediate. And much better as well, it does amazing things.

# November 12, 2009 2:04 PM

mschiv said:

I have a Ipaq 3950 and Vista on my computer. I to get that horrible meessage that states my handheld is to old ot sink with the computer. Is there really no way to fix this? I love my Ipaq, and I know it is old, but it works great.

# November 12, 2009 11:58 PM

lkempe said:

Excellent post Bertrand!

# November 14, 2009 5:05 AM

WaltB said:

One heck of an article for an early Saturady morning. You made my brain function way before it usally does on the weekend. I especially relate to the lst few paragraphs, thanks

# November 14, 2009 7:56 AM

Alessandro said:

nicely said. I agree that tools can help reduce the overall maintainence costs one will eventually endure in the long run.

Unfortunately the illusion you mention about one knowing the code they write better than any tool can is a tough challenge to overcome.

Also the learning curve of yet another tool to master is a demotivator and will most certainly hold you back. Thanks for the tip. NDepend indeed looks good. I'll keep a look out for it.

# November 14, 2009 5:12 PM

Julien said:

Nice post! It kinda sounds like a bait and switch advertising for NDepend at the end there but that made me check it out...

# November 14, 2009 6:18 PM

Billy Mays said:

That's the longest, most scientific, and graph-adorned info-mercial I've read in a long time, leading up to ... a sales pitch for a commercial product.

The more I see on the internet,  the more it looks like paid programming on TV. At least TV sets have a "brightness" control. The internet just keeps getting dumber and there's no knob to make it brighter.

Now, isn't the government taking action against paid bloggers, Bernie????

# November 14, 2009 8:16 PM

Bertrand Le Roy said:

@Billy, that's a serious accusation you're making here. No, I'm not getting paid to write this. Not by Patrick at least.

# November 14, 2009 8:20 PM

someguy said:

Not sure if this has been answered, but a find/replace to replace ".jpg" with ".png" enabled support for png's. So yeah, that can be done.

# November 16, 2009 9:42 AM

Matt said:

Excellent article!  An exquisite representation of applied physics!

# November 16, 2009 12:10 PM

OmariO said:

Bertrand, is it too late to implement in ASP.NET 4 what I call "script descriptors combining"?

omari-o.blogspot.com/.../combining-aspnet-ajax-component.html

# November 19, 2009 7:08 PM

LVS said:

@rajbk

I do not believe setTimeout "waits" the CPU during the timeout period. It instead schedules it with a timer running in the background. This might cause it to take slightly more than the expected timeout period to start executing.

# November 22, 2009 10:30 AM

Bertrand Le Roy said:

@OmariO: I don't know. I forwarded your post to Dave just in case.

# November 23, 2009 3:11 PM

alberto said:

Would you consider non-US applications?

# November 23, 2009 4:17 PM

Bertrand Le Roy said:

@Alberto: we'll consider all applications, although it is always more difficult for non-US because of visas.

# November 23, 2009 4:21 PM

koistya said:

Resume sent.

# November 23, 2009 4:23 PM

Jesse Squire said:

Are you considering remote candidates at this point, or must the developer be on-site in Redmond?

# November 23, 2009 4:46 PM

Indy said:

If intellisense doesnt work for jquery-1.3.2-vsdoc2.js

get rid of the "2" after vsdoc.

code.msdn.microsoft.com/.../View.aspx

# November 23, 2009 7:33 PM

Bertrand Le Roy said:

@Jesse: we usually prefer to move people to Redmond, but you can always apply and negotiate.

# November 23, 2009 7:48 PM

Greg Brewer said:

Funny, I was just looking at ASP.MVC CMS applications on codeplex last night.

# November 23, 2009 9:46 PM

deepu.mi said:

Would you consider H1 Visa status

# November 23, 2009 11:37 PM

Bertrand Le Roy said:

@deepu.mi: I think I answered that already.

# November 23, 2009 11:55 PM

bobby said:

Nice post. It would be great if you can provide running sample of this. Thanks.

# November 24, 2009 12:22 AM

lucasbfr said:

This looks like an incredible job :)

Damn!

# November 24, 2009 8:28 AM

Eric Newton said:

I'd like to throw my hat into the ring... I've worked with CMS's several times over the past year and I've had to deal with their shortcomings.

I've sent my resume in, and we'll see, eh?  :)

# November 24, 2009 8:39 AM

Mandeep said:

not able to open https://careers.microsoft.com

very slow and after lot of time throwing error, details not given by site.

# November 24, 2009 11:04 AM

Danny said:

Mr. Le Roy,

FYI.

N2 CMS - These guys have an MVC template that's not quite ready for prime time. The ASP.NET version has some pretty cool stuff.

KooBoo - Their entire app is built on the MVC framework. Again some cool stuff.

Will there be a call for volunteers at some point ?

Are we looking at something similiar to Drupal ?

Thanks

# November 24, 2009 7:28 PM

Bertrand Le Roy said:

@Danny: thanks for the pointers. Yes, there will be a call for volunteers shortly.

# November 24, 2009 7:33 PM

alexandershapovalov said:

I have experience in development CMS based on MVC and MVP patterns (not asp.net MVC, but normal ASP.NET) and will be happy to work in this team.

I will apply today evening on career site. The only problem I am in Russia :)) but willing to relocate ;)

# November 25, 2009 4:32 AM

Jm6 said:

AsyncFileUpload doesn´t work with the opera 10  browser yet... (25Nov2009)

# November 25, 2009 1:14 PM

Bertrand Le Roy said:

@Jm6: did you file a bug?

# November 25, 2009 1:45 PM

Paco said:

I am having the same problem as Martin Dolphin (September 9, 2005) and Greg (on March 5, 2009) previously reported.  That is, the default page background is not black and the photo stacks are in a single vertical line down the page.  Since I just downloaded the package today, I would have thought that the CSS would be the correct version.

Please help.

# November 25, 2009 8:26 PM

Bertrand Le Roy said:

@Paco: it's not just CSS. I know the update is long overdue but it will come. In the meantime, I'm afraid your only option is to go into the code and fix it yourself.

# November 25, 2009 8:49 PM

Paco said:

@Bertrand:  thanks for the quick reply.  

I'm surprised that it is not yet fixed.  Given the long delay and few reports of problems, I thought that it was my problem.  I'll see what I can do to help.

Happy Thanksgiving.

# November 26, 2009 8:35 AM

bidware said:

I've applied to jobs in the USA, but for some reason americans are not aware of the free trade agreement, which allows Canadians and Mexicans to work in each other's country with relative ease.  So for a Canadian to work in USA, there is almost no difference between an american and Canadian candidate.  it's NOT the same as an H1B visa which is for all countries OTHER than Canada and Mexico, so you should definitely not group Canadians into the same as other countries, as there would be absolutely no issue with getting a Visa to work in USA.

# November 26, 2009 2:56 PM

Lee Timmins said:

Hi do you plan on using The Entity Framework?  I'm currently using ASP.NET WebForms as i started from a reliable starter kit which implemented common best practices.  We really need a best practices starter kit for ASP.NET MVC 2.0.

# November 26, 2009 6:34 PM

Valerie said:

Yes, NPR has a built-in bias.  They receive a lot of their funding from large corporations such as General Electric and Archer-Daniels-Midland, the result of which is you'll never hear a critical word about their large sponsors.  They've been bought off to assure they will NOT SAY anything negative about corn ethanol or nuclear power.  (among others)

# November 27, 2009 10:15 AM

Ulf E said:

I do have huge problem in 2010, not getting intellisense to work ok at all.

Often not getting intellisense at all.

Hope things get better

# November 27, 2009 4:58 PM

Bertrand Le Roy said:

@Lee: no, we do not plan on using EF. If you're looking for a best practices starter kit, Orchard is entirely the wrong place to look: it's neither a starter kit nor intended to show best practices.

# November 27, 2009 8:56 PM

Bertrand Le Roy said:

@Ulr E: try deleting your VS settings and restarting.

# November 27, 2009 8:58 PM

Bertrand Le Roy said:

Valerie: you might want to read section IX of their code of conduct (www.npr.org/.../ethics_code.html). According to their annual report, NPR is a non-profit organization and about 20% of their funding comes from corporations. You can find the list of donors here: www.npr.org/.../NPRSponsorsDonors08.pdf but I couldn't find General Electrics or Archer-Daniels-Midland. I did find Fox though, so should we fear a right-wing bias because of it?

Doing a search on one of their most important real sponsors, General Motors, I quickly found this quote: "by all accounts, GM was a mess before the bankruptcy". I would tend to call this a "critical word about their large sponsors".

I also did a search on "corn ethanol" on their site and looked at the first results (www.npr.org/.../story.php) that contains the sentence "so far in the real world, the cures — mostly ethanol derived from corn in the United States or biodiesel derived from palm oil, soybeans, and rapeseed in Europe — have been significantly worse than the disease".

Searching "nuclear power" yields mostly news about Iran, but it didn't take me long to find www.npr.org/.../story.php which says "Lawyers discovered evidence that government scientists falsified some of their research" and numerous other stories on both sides of the nuclear issue.

Conclusion: not a single one of your assertions resist five minutes of scrutiny and verification.

# November 27, 2009 9:43 PM

Bertrand Le Roy said:

@bidware: thanks for the tip, I'm sure our HR department is fully aware of immigration law, which is why I'm encouraging anyone to apply no matter where they currently live.

# November 28, 2009 12:31 AM

Steve Gentile said:

Resume sent.

I've been working an asp.net mvc project since it came out (previously was using Monorail) and using it today on a asp.net mvc 1.0 project.  Absolutely love the technology.

I look forward to working my next project using asp.net mvc 2.0.

I love open source, working with NHibernate, JQuery, Spring.NET, etc...and enjoy branching out to learning over cool stuff (like Groovy and Grails)

I would be interested in working at Microsoft on a good team.

Sounds great - resume filled out and sent  :)

# November 29, 2009 12:11 AM

Marcel Popescu said:

It is so annoying when I see science taking credit for good old engineering. Our God is awesome, they say. (Well, they say science, but there's really no difference in their minds.)

Oh well. This too shall pass.

(Oh, and the idea of a planet revolving around its Sun every 3.5 days is... mind-boggling. I'm pretty sure it would have to be within the Sun corona, which leads to all kinds of contradictions.)

# November 30, 2009 4:15 AM

Christopher Rannow said:

I took your class and converted it to VB using an online conversion tool. When I add the tags as you outline in your post I keep getting a Namespace or type Specified in the imports 'Bleroy' doesn't contain any public member or cannot be found.....error can you offer any suggestios?

# November 30, 2009 2:22 PM

Bertrand Le Roy said:

@Marcel: WHAT??

# November 30, 2009 2:47 PM

Bertrand Le Roy said:

@Christofer: you are SO on your own on this one :)

# November 30, 2009 2:50 PM

Marcel Popescu said:

"The Rube Goldberg device that enables us to see that big ball of gas from so far away is a mix of optics, electronics and knowledge, the latter being the really awesome part. Science is awesome."

The part that actually works in that Rube Goldberg device is old-fashioned engineering. The part that invents planets revolving in a Sun's corona is science. Science is stupid, usually - it proves that rocks can't fall from the sky, airplanes can't fly and trains going faster than 30 mph will kill their passengers.

That doesn't mean I'm not with you on NDepend, btw :P

# December 1, 2009 2:32 AM

Bertrand Le Roy said:

@Marcel: so you are saying that there is no planet there if I'm following you? What are your objections based on and what's your alternative explanation?

I'd like to see good references for those claims you're making about what science allegedly proved. Even if those weren't the assertions of people who thought they knew more than they did (and thus were largely out of the strict bounds of science), you seem to be forgetting about one essential quality of science that many other disciplines could learn from: it is self correcting and knows its own limits.

Your claim by the way that there is no difference between God and science in the minds of scientists is so outrageous and wrong on so many levels that I don't even know where to begin.

# December 1, 2009 2:46 AM

Marcel Popescu said:

So... you want references to something that you've already decided you're going to ignore? Why would I bother, then? I'm not objecting to people clinging to their faith (I do it with mine), just to the reification of science (Firefox proposes "deification" here... funny).

As for the last statement... I find it so amusing I myself don't know where to begin. (Honestly? You know of scientists who don't treat science as God? Maybe you haven't tried to publish something that disagrees with current dogma.) I'll try this great quote from Lewontin:

---

Our willingness to accept scientific claims that are against common sense is the key to an understanding of the real struggle between science and the supernatural. We take the side of science in spite of the patent absurdity of some of its constructs, in spite of its failure to fulfill many of its extravagant promises of health and life, in spite of the tolerance of the scientific community for unsubstantiated just-so stories, because we have a prior commitment, a commitment to materialism. It is not that the methods and institutions of science somehow compel us to accept a material explanation of the phenomenal world, but, on the contrary, that we are forced by our a priori adherence to material causes to create an apparatus of investigation and a set of concepts that produce material explanations, no matter how counter-intuitive, no matter how mystifying to the uninitiated.

---

[I really don't want to hijack your blog - I subscribed to it because I generally like the subjects you choose to write on - so, if you prefer to take this offline, just delete this reply. If you want to continue it, email me at mdpopescu at gmail.]

# December 1, 2009 10:23 AM

Bertrand Le Roy said:

@Marcel: not at all, don't assume I'm going to ignore what you have to offer. It would go against who I am. I care a lot about this sort of thing. I think this debate is relevant to this post so it's ok to have it here.

Some people may be confused about what science really is, but that only tells you something about these people, not about science itself.

I, and all real scientists, treat scientific methods for no more and no less than what they are: methods to find out stuff about the natural world. It is always clear that any knowledge found using these methods is only valid within a margin of error (which can be quantified) and within a set of assumptions. So actually no, I don't know any scientist who treats science as God.

Anyone can challenge any assumption and provide a better explanation for any new or existing phenomenon, but there are conditions that proponents of pseudo-science usually forget: the new explanation has to work better than the previous one in that it needs to explain more observations or to explain existing ones with better precision or in a simpler way. It also has to be falsifiable which is oh so important and so often overlooked by enemies of science.

So there is no dogma in science, nothing that can't be challenged, as long as you do so within the boundaries of scientific methods. If you want to challenge a scientific idea *outside* of the boundaries of scientific methods by the way, that is perfectly fine. What you can't do is call it science or expect the scientific community to adopt it. Or teach it in science class.

The current consensus is challenged all the time with great enthusiasm: Darwin challenged the consensus, as did Gallileo, Newton, Einstein, Heisenberg, Dirac, de Broglie, Zurek and so many others. In my own time and without the genius of those, I published a few articles in scientific journals that were proposing a different way of understanding quark confinement that was going against the relatively complex current consensus which relies on quantum chromodynamics. It may not have been very successful as far as scientific ideas go, but I can tell you I didn't face any dogmatic opposition from any scientific "establishment" because of it. Getting those paper published in major peer reviewed journals was absolutely easy.

Sooo, can you please provide specifics:

- "patent absurdity of some of [science's] constructs": what constructs?

- "[science's] failure to fulfill many of its extravagant promises of health and life": what promises?

- "the tolerance of the scientific community for unsubstantiated just-so stories": what stories?

And for the punchline: "we are forced by our a priori adherence to material causes to create an apparatus of investigation and a set of concepts that produce material explanations, no matter how counter-intuitive, no matter how mystifying to the uninitiated". Well, nobody is forcing you, but what Lewontin is omitting to mention is the predictive power and the unparalleled precision of scientific results. We don't just accept a scientific discovery because it's flattering to whatever view of the world we have (scientists actually have all sorts of those when they don't do science). We accept it because it matches verifiable observations.

Also, you haven't answered my previous questions.

# December 1, 2009 3:29 PM

Bertrand Le Roy said:

Coincidentally, Ars has an excellent article today on how scientific consensus emerges: arstechnica.com/.../the-complicated-truth-behind-scientific-findings.ars

# December 1, 2009 4:34 PM

Marcel Popescu said:

Ok, I appreciate your permission, I'll try to take them in order. (Again, deleting my replies is just fine, I realize this is YOUR blog and I really DO appreciate your patience.)

1. No, I don't believe there's a planet, based on the 3.5 days periodicity you mention. As I said, such periodicity would seem to put the planet inside the star's corona, which would melt the alleged planet.

2. www.mysteriousnewzealand.com/.../featart_meteorites.html

---

The idea that stones can fall out of the sky was scornfully denounced by the Académie as an unscientific absurdity. Antoine Lavoisier, for example, the father of modern chemistry, told his fellow Academicians, "Stones cannot fall from the sky, because there are no stones in the sky!" The concept of meteorites was thus condemned as nothing but medieval illusions and old wives' tales. Embarrassed museums all over Europe, wishing to be seen to be part of this enlightened 'Age of Reason', hurriedly threw out their cherished meteorite collections with the garbage as humiliating anachronisms from a superstitious past.

Although the last two decades of the eighteenth century saw scientists such as Peter Pallas and Ernst Florens Chladni, risking ridicule by the scientific community through the serious investigation of meteorites, most scientists shared Isaac Newton's view that that no small objects could exist in the interplanetary space. An assumption that left no room for rocks or stones falling from the sky.

---

3. www.nasa.gov/.../fg_kitty_hawk_12.17.03_prt.htm

---

Lord Kelvin, the President of the Royal Society of England made a forceful declaration. "Heavier than air flying machines are impossible,"

---

4. I remember reading the stuff about trains when I was little, but unfortunately I cannot find anything related to it on Google, so I'll give up that point.

5. Of course, the pre-emptive response you made to this is "scientists can be wrong, but that's not the fault of science". Besides the fallacy of reification (science is whatever scientists do, no more and no less), that's exactly what I was pointing out: science can never be wrong, it's a god. (Even when it "self-corrects" - again, reification.)

In other words: science can be shown to HAVE BEEN wrong, in the past, but the current science is always right. This IS how science is treated by its apologists - including yourself. How could it be otherwise? How could the scientists' ex-cathedra pronouncements have any force if they would preface them with "I could be wrong, but I believe that..."?

6. Ahhh... real scientists, so called because they only exist in books and movies. In this world, as can be seen from too many examples to count, the latest being the climategate fiasco, scientists are only interested in clinging to dogma at the expense of anything else.

7. "... the new explanation has to work better than the previous one in that it needs to explain more observations or to explain existing ones with better precision or in a simpler way." Heh. You do know that Ockham's Razor was used by a monk to prove that God created the Earth and everything on it, that being the simplest explanation - right?

Let's take another example dear to me (astronomy is such an easy target): in order to account for problems with their experiments, astronomers invented dark matter AND dark energy, which are allegedly more than the known matter and energy by a factor of 100 (I think), and which - pretty much by definition - can never be experimented upon. You were saying?

8. The consensus CAN be challenged. (Darwin didn't challenge anything, but points for trying.) However, doing that will get you cast out of the scientific community - to use a less politically-charged example, ask the cold fusion guys. In fact, try publishing a paper supporting - or even RECOMMENDING FURTHER STUDY ON - any of the forbidden fields: cold fusion, the electric theory of the universe, intelligent design, problems with the theory of relativity, psi phenomena, Velikovsky's theories... Anything that you're already dismissing as pseudo-science. (Of course it's pseudo-science, because scientists refuse to study it. Once they are forced to do so, it becomes science, which again proves science to be always right. Weird how that works.)

Your last questions should be directed to Lewontin (a scientist), not me :) Well, the "verifiable observations" part was absolutely rich (re-read the parts about astronomy above).

# December 1, 2009 5:03 PM

Marcel Popescu said:

"Coincidentally, Ars has an excellent article today on how scientific consensus emerges:"

Yep, "lies for children" really sums it up :)

# December 1, 2009 5:08 PM

Bertrand Le Roy said:

@Marcel: you did understand that "lies for children" is only used in the article about "how we use simplifications to gently approach underlying scientific principles", not about the much more complex underlying scientific principles in question, right?

1. If you had followed the link on the graph (www.iop.org/.../995832.html), which I admit wasn't discoverable enough, you'd have seen that this is addressed by the authors: "[...] the effective temperature of the planet is Tp  1400(1 - A)1/4 K. This implies a thermal velocity for hydrogen of vt  6.0 km s-1. This is roughly a factor of 7 less than the calculated escape velocity of ve  42 km s-1, confirming that these planets should not be losing significant amounts of mass due to the effects of stellar insolation." Not sure what you mean by "melt" anyways, seeing this planet is made of gas. So you haven't provided a good reason to doubt the conclusions of the article nor have you provided a better explanation for the observed data.

2. Ah, a truly remarkable story of science actually that led Lavoisier to do the first chemical analysis of a meteor even though he was refusing its heavenly origins. While he was a brilliant chemist, this shows that even the most brilliant minds can be mistaken and make wrong assumptions. It took about ten years to the scientific community from the first publication of the idea that meteorites were rocks from space to the acceptance of the theory by most of the scientific community under the influence of Biot, also a member of the Académie. Ten years is not very long for such a revolutionary idea at a time when most still believed that the skies were just the site of heaven and the permanent residence of God. It took longer for Einstein's relativity and for quantum mechanics to reach acceptance...

3. Yes, that is one more example of lack of imagination from a brilliant scientist. But his assertion although undeniably short-sighted, was more understandable when one knows the limits of the steam engines of his time and how you'd have to scale it to power a flying machine big enough to lift a man into the air. The internal combustion engine (ironically invented around the same time Kelvin uttered that sentence) is one of the innovations that enabled the Wright brothers to prove him wrong shortly thereafter. Still, he was wrong, sure.

4. You don't need to concede that one. It is true that there was fear that the speed of trains would cause blindness or madness, but this had nothing to do with science whatsoever. Quite the reverse, it was superstition and fear of progress. www.histoire-image.org/.../etude_comp_detail.php

5. I did not write that exact quote but you are right that these anecdotes don't prove anything beyond that scientists can be wrong. You got how science and scientists relate to each other backwards though: a scientist is anyone who does science, but science is not whatever scientists do. For example, when a scientist brushes his teeth, that's not science.

Then you do a wonderful syllogism: "science can never be wrong, it's a god". Allow me to paraphrase: "science can never be wrong" (by the way, your words, not mine, I actually forcefully disagree with such an absurd assertion), "God is never wrong" therefore "science is a god". Science is actually often wrong, and it is always incomplete. It has therefore little in common with a god. Actually, it's the first time I hear about a "self correcting god": if God is never wrong, why would He need to correct himself? So if I follow your drift, I accept to be proven wrong and to correct myself, therefore I'm a god?

Then you say "the current science is always right". Again, your words, not mine. This is of course very wrong and a gross carricature. No, this is not how I treat science. I have no idea what could have led you to think such a thing.

It's actually quite stunning how you constantly use religious vocabulary to paint a deformed picture of science. "Ex cathedra" originally applies to the teachings of the Roman Catholic pope, who was until recently declared infallible and of absolute authority, whereas one of the basic principles of science is *not* to rely on arguments of authority. You'll also be hard pressed to find any scientist who declares himself infallible. They do declare that they could be wrong all the time: again that's one basic principle of science that an idea can only be declared scientific if it's falsifiable.

6. Climategate? Enlighten me.

There is an immense variety of motivations that push people to do science. I'd be interested in having the name of even one who does it to "cling to dogma at the expense of anything else". Not that there aren't horrible people in science, I really want to know.

7. Ah, but you seem to assume that Occam's razor is the only principle used in science. As if using it and nothing else ensured a scientific result. It is actually debatable (and debated to this day) that God creating everything can be described as simple. And of course that seemed to be the simplest of the explanations available at the time because there wasn't much competition for it...

Let me borrow an example from Feynman: to explain the movement of planets, you can hypothesize that they have a natural tendency to motility, a tendency that you could call "oomph". It would be difficult to find a simpler "explanation", except that it's not an explanation at all. The real explanation (at least the one that is the most accepted today) is that all forms of energy curve spacetime in such a way that what is the closest analogue to a straight line becomes the elliptical trajectory that we observe. That's hardly simple, but as far as we know it's the simplest explanation *that works*. The difference is quite subtle, and you could easily argue that there is some oomph-ness in there (why do objects naturally follow straight trajectories for example?). What makes the huge difference is that it works, by which we mean that it matches the observations to a great precision and that it can be used to make predictions that can be confronted against new observations. Oomph? Not so much.

About dark matter, this is an example of a place holder in science. It's one case where what scientists are really saying is that they have some observations that don't match the current theories and they don't know what's causing it but it's *as if* some unknown form of energy was causing it. But there is lots and lots of debate, and there is no consensus today on the true nature of the phenomenon. So there you have it: an example of the scientific community accepting data above the currently accepted knowledge and freely debating all ideas to explain it.

The consequence of this is not that everything we knew until now becomes false. What we knew still works and is still predictive at the scales and under the conditions where it was tested before. It's just that we now know for sure that our knowledge was incomplete (not that we didn't know it was, but that's evidence now) and doesn't apply on the scales where we observe "dark energy" or what looks like it. But "dark energy", like "black holes" and "big bang" are actually good examples of "lies for children" that we use as oversimplifications of what we know is a lot more complicated and subtle.

To close on dark matter, why do you think this can never be experimented upon? I think you're showing the kind of lack of vision that Kelvin showed in his time...

8. What do you mean Darwin didn't challenge anything? Didn't he challenge the consensus of his times that all species had been created as they are today?

You are right that evolution has become politically charged but the creationist and intelligent design communities are largely responsible for that. It doesn't prevent almost all of modern biology to be based on evolution theory and to make amazingly useful discoveries every day while ID proponents are still looking for a compelling challenge against the mountain of evidence in favor of it. I'm guessing that you are referring to Ben Stein's Expelled movie, which is well analyzed on this site: www.expelledexposed.com

The example of cold fusion is also quite good: the scientific community has actually very enthusiastically embraced the idea at first. That is, until nobody succeeded in reliably replicating the claimed results. Nothing to build a conspiracy theory on really. Your claim that it can't be investigated and that you can't publish on it doesn't resist scrutiny: see en.wikipedia.org/.../Cold_fusion for some references. Can you please cite names of people who have been thrown out of academia for investigating something like that?

The electric universe hypothesis has been examined and it just doesn't match observations. See for example www.tim-thompson.com/electric-sun.html.

Intelligent design? What exactly is there to debate? Seriously, because I'm pretty sure that for any ID claim you can find, I'll be able to find a peer-reviewed paper dispelling it honestly and scientifically. Notice that I'm saying pretty sure, not absolutely certain, just because that it happened flawlessly in the past doesn't prove it will continue to happen. And of course there is the "god of the gaps" problem with ID...

Problems with the theory of relativity? Again, I'll ask you to be more specific, because there are many such problems, some of which are real, and some of which are imaginary, but all of which to my knowledge have been addressed or are currently being studied. Its incompatibility with quantum field theory for example is very real, very much studied. Vibrant field. Guaranteed Nobel prize for whoever solves the problem in fact.

Psy phenomena: extraordinary claim, so first prove there are such phenomena. You can make a million dollars if you do by the way. This has been studied ad nauseam actually and continues to be studied, if only because it would be so exciting if it worked. So far it just doesn't under controlled conditions. It could mean two things unless I'm missing something: that there is nothing to study, or that controlling the conditions somehow kills it. If there is an objective phenomenon going on, there has to be a way of objectively observing it and distinguish it from any other known natural explanation (that's what we mean by objective). The guy who finds that way is guaranteed instant glory within and without the scientific community. He will not only have made an extraordinary discovery, he will also have advanced the set of scientific methods, which is sure to lead to other extraordinary discoveries. And I can tell you, there is nothing that could excite a scientist more: you seem to think scientists are extremely conservative people whereas in reality what most commonly drives them is the excitement of finding something new.

Velikovsky: I had to look that one up, to great shame. It looks interesting (cataclismic events that have evidence in the geological record, sure, that sounds reasonable) exept that the claim of planetary collisions within humanity's time on Earth doesn't match what we know of celestial mechanics to my knowledge even taking into acount chaotic effects and the known margins of error. But I could totally be wrong on that. Then again, where is the extraordinary evidence for those extraordinary claims? How does it work better and how is it simpler than other explanations for the origin of myths? It does look very much like a bunch of crazy ideas and desperate attempts to make cherry-picked factoids confirm them. Again, I know nearly nothing about Velikovsky but it seems like illustrious scientists have spent the time to examine the claims, while Velikovsky himself doesn't seem to have made the effort of submitting his work to normal scrutiny by his peers, so what exactly is the problem? Actually, I will concede gladly that ad hominem attacks, even against the author of questionable theories, are just plain wrong.

Can we agree that some hypotheses are just not worth pursuing after careful examination and confrontation with observation, before we start examining whether it's fairy dust that makes birds fly?

But mmmh, what exactly did I call pseudo-science in my previous comments? What exactly are scientists "refusing to study"? I think the community is actually spending disproportionate amounts of time examining outrageous claims despite the usual rule that the burden of proof is on the person making the extraordinary claim.

About your quote and the questions I had on them, why did you make that quote if you don't know what he meant by that or don't stand behind what you think it means?

I absolutely stand behind the thing about "verifiable observations". Including in astrophysics. I can explain if necessary but this comment is already way too long.

Would you mind my extracting my comments and yours into a post once we are done arguing?

Cheers and thanks for the honest debate, I really appreciate it even though I realize I may sound harsh at times.

# December 2, 2009 3:13 AM

Marcel Popescu said:

No, I absolutely would not mind if you write another post on the subject :)

Let's see if I can answer again...

1. By "melt" I mean that a planet within a Sun's corona, at 10 million kelvin or more, will melt even if it's not a gas giant.

2 - 5. So, scientists can be wrong. Let's see what happens then - next point is perfect here.

6. Really? You haven't heard of climategate? Weird that. blogs.telegraph.co.uk/.../climategate-the-final-nail-in-the-coffin-of-anthropogenic-global-warming

So - what happens when scientists are wrong? Well, as common sense tells us, they falsify data. (I'll add another example later.)

7. The curvature of spacetime does NOT work as an explanation. Why so many people accept something so obviously wrong beats me. As an obvious counter-example, take two ships in the same orbit, one a few kilometers ahead of the other. Pull a rope between them and tension it - is it straight or curved? If the "straight" line is supposed to be curved, you shouldn't be able to get a straight rope.

Dark matter / energy - this is exactly what Kuhn explained: science does not falsify theories, as Popper claimed; instead, scientists keep adding ad-hoc explanations to support obviously false theories (false = they don't match observations) until the old generation of scientists dies out and the new one can replace the incorrect theories. (This doesn't always happen, of course - sometimes it takes more than a generation.)

8. There are half a dozen theories of evolution, some of them thousand of years old. Darwin did not challenge the consensus of *scientists* that species were pretty much unchanged, that was the layman's opinion. The current scientific consensus tended towards metamorphosis - a theory from ancient Greece.

I've been a creationist for about 20 years... let's not go there, I've studied this subject too extensively and it would be boring for me to recap it all.

Cold fusion: so, experiments cannot reproduce the initial claims. Ignoring the fact that the theories in astronomy don't work, so they had to be propped up by dark matter / energy - a very similar situation as far as I can tell - US Navy researchers seem to disagree: www.eetimes.com/.../showArticle.jhtml

Electric universe - if you think that pitiful page addresses the wealth of articles on http://thunderbolts.info/ and the books they published... well, as I said, to each his own (faith) :)

ID - nothing to debate, as far as I'm concerned. The idea of something from nothing, and of complex from simple, is so extraordinary that extraordinary evidence is required. Weirdly enough, we don't even have *ordinary* evidence - there is absolutely nothing in that column. No abiogenesis, no real speciation, no solution to Haldane's dilemma, no solution to the No Free Lunch theorem... nothing. However, ex cathedra, as I said, rules the day.

Theory of relativity: gravity has a speed calculated to be at least 10^10 times higher than c (see van Flandern). Black holes make no sense. (Infinite density is something that can be expressed mathematically, but physically it makes no sense.) GR says that you can't synchronize watches moving in different non-inertial frameworks... yet GPS does that all the time. The space-time curvature is used to explain gravity by positing an infinite rubber sheet on which you place a planet... and as a result the sheet curves down. (Why? Because gravity pulls things down, of course! Some things are so ridiculous I can't stop but wonder if I'm the victim of a hoax.) I won't even go into the QM contradictions.

Psi phenomena: yep, I know about Randi's one million dollar prize. How weird that he's the sole judge of the claims, then. How weird that he's a known liar according to one of his former colleagues - cura.free.fr/.../14starbb.html (this is the second example of scientists falsifying data)

Velikovsky - I strongly recommend that you read www.webscription.net/p-60-catastrophes-chaos-and-convolutions.aspx for more on this and other subjects. If you're not willing to pay $5 for it, let me know and I will, if you want to read it.

Some hypotheses not worth pursuing - you must be unfamiliar with the Ig Nobel prizes, then. en.wikipedia.org/.../Ig_Nobel_Prize - yea, those scientists do a lot of important research, can't bother them with trivial stuff.

"About your quote and the questions I had on them, why did you make that quote if you don't know what he meant by that or don't stand behind what you think it means?"

Because it was a scientist candidly explaining scientists' position - they will accept anything, no matter how absurd, just to cling to dogma. (He said "to refuse to accept the supernatural", but that's not the only case, as can be seen from Climategate for example.)

Oh, and I just remembered something about the electric universe. If you read through the archive at thunderbolts.info, you will discover that scientists are surprised EVERY FREAKING TIME by the results of their experiments. In other words, they have no clue on what's going to happen, or why. So much for verifiable observations in astrophysics.

# December 2, 2009 6:33 AM

Mark said:

For classic asp guys....Max solution from October 2007 and confirmed by Jim in 2008, has worked for me in 2009.

That is SessionIdNumber=Session.SessionId at top of page.

The gift that keeps on giving.

# December 2, 2009 10:17 AM

Bertrand Le Roy said:

Just found some fun ammo for you, @Marcel ;) my.athenet.net/.../SkepticQuotes.html

# December 2, 2009 4:17 PM

Matt said:

@Max, @Jim, @Mark

Simply accessing the Session property of the Page instance creates the session store for the current user. You should find that accessing the Session property also  enables your desired behaviour. Note I haven't actually tested this.

Please note that in doing this you are relying on a side effect and not actually addressing the root problem! I suggest you listen to Bertrand's advice!

# December 2, 2009 4:28 PM

Marcel Popescu said:

Heh, cool, thanks :)

# December 2, 2009 4:32 PM

Christopher Rannow said:

  Though I don't know why, it worked after I saved everything, exited visual studio and reopened my project. If you'd like I can e-mail you the VB version to post if you think others would find it useful.

# December 2, 2009 4:54 PM

Marcel Popescu said:

Just to check... you did receive my *previous* post - the huge one :) right? I ask 'cause I posted it before you wrote the "some ammo" post above, and it hasn't shown up. (If you decided to stop the discussion and delete it, that's fine, I just want to make sure it wasn't stopped by some spam filter or something.)

# December 3, 2009 7:24 AM

Bertrand Le Roy said:

@Marcel: mmh, no I did not. That sucks. The spam filter has done that in the past, so I'll try to find it... You wouldn't have a copy by any chance?Found it. It was marked as spam.

# December 3, 2009 11:59 AM

Bertrand Le Roy said:

Sorry for the spam filter incident. Believe me, if I was to unilaterally stop this discussion, I would leave you the last word, and I would certainly not silently delete a message you obviously took considerable time to write.

1. My question was more how do you melt a gas? Isn't melting the change of state from solid to liquid? But I think I get what you were trying to say. The corona extends for more than 10 million kilometers, which certainly includes that planet, seeing that according to the data in the article and Kepler's third law it should be less than 7 million kilometers away from the center of the star. Now the thing is that "in spite of its high temperature, the corona yields relatively little heat because of its low density" (www.britannica.com/.../corona). What really counts here is the energy flow from the star onto the planet, and as the authors of the article show, it's not enough to counter the escape velocity from the surface, ensuring relative stability. It should also be pointed out that many objects in the universe exist in unstable states.

6. This is not a subject I know especially well so I avoid talking about it until I have time to look at the science and make an informed opinion, but from what I've seen it seems to have morphed into an arms race of exaggeration and blatant lies from both sides. It looks very difficult to dig out all the dirt and find where the real science is if you're not a specialist on the topic so I won't comment because I just don't know. Ars has an interesting view on the topic:

arstechnica.com/.../climate-docs-lead-to-investigations-at-cru-penn-state.ars

From that it seems like fraud is not proven on closer analysis. Even if it was there are other piles of evidence from other sources that reach similar conclusions.

But sure as a general rule, data falsification and cherripicking, manipulation & suppression of evidence, ad hominem attacks: bad, bad and unscientific behavior. The nice thing is that they do get caught and discredited eventually. Again, I see only scientists having unscientific behavior. When there is proof of that, there should be consequences (their careers should be ended).

Now jumping from that case (which implies how many people by the way?) to the conclusion that there is a global conspiracy and that science doesn't work, isn't that a little excessive? Time will tell, but that should be an interesting case of observing how the scientific community can or cannot work under considerable political pressure.

7. I'm sorry to say that, but you do not understand what a four dimensional geodesic is. The geodesic is not the three dimensional trajectory in space, and the 3D trajectory is not a 3D geodesic. You're also neglecting something very important here: except if the ships were spending fuel on keeping the tension on the rope, the rope would pull at them (just by virtue of what tension is) and change their orbits. I can recommend some general relativity books if you want to really understand it.

On dark matter, you're mixing two things. The claim that it takes a new generation of scientists to adopt a new theory is true to an extent and it maybe it should be taken into account more in the scientific process, I don't know. But there are young new scientists entering all fields all the time, and they do publish, which is what really counts.

The second thing is the claim that we're piling up ad-hoc explanations until they crumble under their own weight. When you look for a new theory, you try many things. How far you should push exploration in any given direction before abandoning it is tricky to figure out, but for all we know, the explanation might actually be complicated and messy. So you explore until you find. The science on this subject is just not done. You can't on the one hand blame scientists for refusing to explore any crackpot theory out there and on the other hand blame them for exploring in all directions.

Oh, and actually there was a third claim in there, which was that scientists were trying to support theories that obviously don't match observations. I've addressed that before.

First they don't match observation but only at the galactic and bigger scales, but they do match with great precision at the solar system and smaller scales, so there is no need to drop them at those scales: they work and have predictive power.

Second, scientists *do* try to replace the "incorrect" (as if there was a final correct theory) theories with new ones that would scale better to the galactic scale.

8. I stand corrected, this actually reminds me of how Einstein built Relativity on top of the works of Lorentz, Poincaré, Michelson and many others. But it still seems like even though the idea of transformation of species was relatively accepted in the scientific community at the end of the nineteenth century, explaining it by natural selection wasn't the consensus before Darwin and Wallace, was it?

On cold fusion, I don't understand what you're saying but that link is very interesting. That's actually great news: if they are right that instrumentation was to blame for the lack of reliable reproduction of the experiment's results so far, it should now be easy to reproduce those new results and great science will come out of it (see portal.acs.org/.../content for another report from the ACS). It's also proof that you can reasearch the topic and publish on it. Thanks a lot.

Electric universe: pitiful how? (other than the background color, which I will concede is pitiful) What specific argument does it not address?

To save me hours going through thunderbolts.info, can you point me to one of those experiment results that are sure to surprise me? I love surprises.

ID: Who is talking about "something from nothing"? The theory of evolution does not deal with the appearance of the first form of life (and even that was not "from nothing"). The science on that is still very far from done (which is fine), but it is being very actively investigated. It might actually remain relatively out of reach forever: even if you propose a credible mechanism, proving that's what really happened will be very hard. This being said, jumping from that to concluding that God did it seems a little premature. Can't we say that we don't know (yet)? I certainly don't.

Speciation: www.talkorigins.org/.../CA520.html

Haldane: www.talkorigins.org/.../CB121.html

NFL: www.talkorigins.org/.../CF011_2.html

van Flandern: arxiv.org/.../9910050.pdf

"Black holes make no sense": I'd be more open minded than you are here, but again any theory has a range of validity beyond which we just don't know or where another one may start to work better. As you approach Planck scales, we just know that we need something better, if only because there are fundamental incompatibilities with quantum field theories. What happens at the center of a black hole (or whatever name you choose to give to large stars when they have burned all their fuel and collapse) is simply not known. We have ideas, but we don't know. My opinion is that the singularity is never effectively formed and that yet unknown quantum gravity effects are what prevents it. But if it is one day proven that there is a singularity (which might happen because even GR allows for naked singularities under some conditions), it's fine by me. What defines a black hole by the way is not the singularity, it's the event horizon. Do horizons make sense to you?

The sync thing is a little ridiculous, sorry: GPS actually work reliably *because* they integrate calculations based on GR (precisely, the dilatation of time because of the Earth's gravitational field). See www.astronomy.ohio-state.edu/.../gps.html for details. GR does not exactly say that you can't synchronize clocks, it actually explains how observers in different frames can reach an agreement and translate their perception of time to each other's frame, and it predicts when any given event will be perceived from each frame. It is actually meaningless to define two events as *exactly* simultaneous but you can say for each event exactly when it happens in each frame.

The rubber sheet stuff is one of those lies for children. It's hard to visualize 4-dimensional space but the math is not that hard. Try it.

What QM contradictions?

Randi: what proof do you have that he falsified data? Plus, there's a lot more to win than Randi's million in showing paranormal activity under controlled conditions, as I've said.

Velikowski: can you give me a hint on why I should read this book? From the sample chapters it looks like some kind of SciFi novel. How is it relevant?

Yes, I know about Ig Nobel prizes. They're lots of fun. I'm not justifying funding those programs. But by what stretch of logic does the fact that people got funded to do ridiculous research on creating diamond film from tequila justify funding ridiculous research on recent collisions of Earth with Jupiter?

Your quote: So that was actually an argument from authority. If that guy is a scientist, his opinion on science must be the Truth?

I'll say it again. If there was objectively verifiable observation of a "supernatural" phenomenon, it would immediately stop being supernatural, it would become natural and an object of scientific investigation. Now if a phenomenon cannot be objectively verified, either it doesn't exist or it is not an object of scientific investigation. Which is fine: science doesn't need to have an answer to everything.

# December 3, 2009 8:55 PM

marius said:

hehe! Sys.UI.DataView

i like this soooooo much...

too many requests with Sys.loader... let's say 5 up to 10 small  files (5 up to 10 kb) and we don't really gain anything... (see firebug's net tab)

But there is also "the" ajaxmin ;)

so my preferd way is to use the Sys.loader for DataView or Watermark or Whatever microsoft extended but keep my own j plugins in a directory where i can minify them all at buildtime...

# December 3, 2009 11:41 PM

Bertrand Le Roy said:

@marius: your comment got eaten by the spam filter again. If it continues that way, I'll have to ask people to send me e-mail when they comment. <sigh>

You are right that like with any performance tool, you need to measure and adapt. If you exhaust the browser's pool of connections, you may end up with no perf gain. In those cases, combination can help if done responsibly.

Build time minification is *always* a good thing that the script loader in no way replaces. Did I seem to imply otherwise?

# December 4, 2009 12:11 AM

Daniel said:

It's important to me because it's important to my customers. Also, several cloud services require medium trust. You have to think around certain problems, but ultimately, it's a good exercise in "liberating constraints" to run all of your web sites in medium trust, and compile all of them on .NET and Mono.

# December 4, 2009 12:22 AM

donkiely said:

It is critical, for a variety of reasons. Most important, Web sites are more secure when running in medium trust (or a custom trust level with medium trust as a starting point). For this reason, many hosting companies wisely only allow medium trust, and some of my Web sites have to run in those environments.

# December 4, 2009 1:39 AM

PNasser said:

1. All of our sites (internal only) are run on medium

2. Need File and Environment Permissions

3. Internally hosted / servers can't get past the firewall in either direction

# December 4, 2009 2:11 AM

HeartattacK said:

1. Mostly full trust.

2. Mostly don't have a compelling reason to do meium trust.

3. The sites that are on shared hosting are hosted with different hosts. A few clients' hosts don't allow full trust. We're forced to do medium trust then. If the hosts allow it or if we're hosting on dedicated servers, we use full trust almost all the time.

# December 4, 2009 2:40 AM

Joannes Vermorel said:

I have been asking about the purpose of Medium Trust in the Windows Azure forums too just a few days ago.

Actually, since very basic .NET parts such as BinaryFormatter requires higher trust, we end-up using virtually everything running in full trust.

Although, I do understand the technical constraints of Medium Trust, I have never really seen the benefits for the app itself (I do understand the benefits for the shared hoster, but cheap VMs, this point is becoming moot).

For example, I think "User vs. Admin" under WinXP, I can see many benefits of not running as Admin for the end-user. Yet, for an ASP.NET app, I am not to see any clear actual benefits of medium trust for the app itself.

# December 4, 2009 2:46 AM

Andrei Rinea said:

I used to regard it with respect but now, since I develop larger and larger sites that run on VPSes or dedicated servers it is no more important to me.

However for very small businesses or personal sites it could be a thing to take into account.

# December 4, 2009 3:01 AM

David James said:

1. None

2. It's the default; all code is either trusted third party libraries, or developed in-house; hosting is customised with dedicated Windows accounts per-application and use Windows access controls.

3. Hosted on colo/dedicated servers we manage ourselves, so no.

# December 4, 2009 3:33 AM

mattbrooks said:

My comment didn't show up either. Sys.UI.DataView is immense! The AJAX Minifier is great too. Now we just need a CSS cruncher and have the two rolled into VS as standard :-)

# December 4, 2009 3:33 AM

Stephen M. Redd said:

Microsoft has done a poor job really explaining the concepts around code access security in general. The information is out there of course, but the entire system is simply too complex and convoluted to really grasp unless code access security is a prime focus of your job.

I'm sure at large shops this isn't much of a problem, but for smaller shops and independent developers, developing for medium trust can be difficult. Also, a LOT of third party code and components break at restricted trust, and the vendors (not understanding code access any better than the rest of us) don't document which exceptional permissions you need to setup.

So you can either muck about for hours on end trying to identify specifically which custom policy you need to setup to get the thing to work, or you can flip the trust level to full. After getting our backsides handed to us a the first few times trying to do the right thing with medium trust, we just stop bothering to try it anymore.

While code access security and all of the associated complexity is nice to have for the few shops that REALLY need it, I see little to no evidence that the majority of developers care about the topic at all. The defaults of full trust are expected to be reasonably secure (and they are in my opinion) so only those organizations with the resources on staff to care about code access will bother to use it.

Also, to date I have not seen a server or app hacked because the app ran in full trust. In every case I’ve heard of or seen myself, the application exposed the vulnerability through a necessary feature or function. In those cases, had the application been in a restricted trust level, the vulnerable component would have still necessitated an exception rule to the trust policy in order to function normally; and thus the exploit vulnerability would still have been present.

Most of the dangerous things a compromised application can do (send emails and read files and such) are things that it can also do in medium trust anyway... so targeting medium trust doesn't even seem to reduce the potential impact of a compromised application very much.  

Security conscious shops will put more effort into just making sure the web server isn’t too dangerous should it get compromised by restricting the server at the OS and network level. That’s far simpler than trying to understand CAS, and in the end probably a much more effective use of time and money.

Trust levels below medium aren't practical at all for any but the most trivial of applications.

The 4 different hosting providers I've used have all provided full trust. Most do tighten a few screws internally (like restricting IO to the hosted apps virtual directories only) but otherwise they let you have at it and just pray you don't host something stupid.

Mostly this works for them and holds down their tech support costs. The few hosts I've heard of running at medium trust get hammered with customers having problems getting their hosted apps to actually run. So in the end they either have to Swiss cheese their configurations on a customer-by-customer basis (expensive overhead on their part) or they lose a lot of customers to less restrictive hosting providers that don't limit the trust level so much.      

# December 4, 2009 3:34 AM

Marcel Popescu said:

Hmm... something weird is happening when I try to post an answer (I get redirected to the home page). I can email it to you, or we can call it a draw :)

# December 4, 2009 3:44 AM

mjm2 said:

1) We run all our apps in medium trust.

2) Bcoz shared hosting server we use allow medium trust

3) Yes

# December 4, 2009 4:10 AM

Vasudeva. S said:

Medium Trust with a few modifications should be good enough for any site.  The File I/O is not supported in medium trust, so if you are creating a Captcha image then the application without File I/O permission will fail.  I guess it would be same to any file creation on the server as it requires I/O operation.  

# December 4, 2009 5:08 AM

Igor Latyshev said:

I run 50% of my sites in medium trust, hosted using external providers. All of my host providers constrain .NET environment to be in medium trust. It's quite important for me that existing libraries and frameworks run in medium trust unaffected.

Regards,

Igor Latyshev

# December 4, 2009 5:15 AM

Frederic Hallot said:

1. yes

2. external hosters

3. yes , yes

# December 4, 2009 5:25 AM

alexandershapovalov said:

My project at work are all in Full trust, because it's anyway intranet, so there is a small risk. And it's no problem with some popular frameworks such as NHibernate.

My personal websites are in medium trust because GoDaddy provides medium trust hosting. I can change hosting but for me there are no problem with medium trust. The only problem is Lazy load in NHibernate (I have to switch it off).

# December 4, 2009 7:26 AM

Frederico B. Emídio said:

1.I never use medium trust, only full trust.

2.I choose to use full trust ‘cause I normally use some reflection, Activator or CodeDom and other things like this.

3.The hoster I use nowadays uses full trust, but I had some problems in the past with other hosters

# December 4, 2009 7:37 AM

Garry said:

Internally I do not.

My hosted accounts are all a slightly customised version of medium trust(My ISP will not move on this). This gives me issues with the DNN framework and around relection.

I understand the reasons behind it, and it would be good if Visual Studio allowed for targeted deployments in a similar way it does for the version of the framework.

# December 4, 2009 8:08 AM

labilbe said:

As a user of NHibernate I need a fulltrust configuration.

# December 4, 2009 8:19 AM

alessandro said:

1) All in medium trust

2&3) Yup, externally hosted. This is the comfort zone trust level almost every webhoster out there has chosen to take apparently.

You simply end up giving up quite a bit to satisfy this trust level. Reflection for one is a big no no.

It's quite common or rather clever, to develop with the trust level set to medium trust explicitly in web.config ( just to ensure that your final product wont break when you up it to your webhost).

# December 4, 2009 8:20 AM

Mike said:

We design, code AND host sites for our clients. Some features of our CMS can't work in medium trust. But even then, we decide not to change the trust, but not to use those features. Precompilation allows us to do things in the dev-cycle that are not possible on the server in medium trust.

I guess the question becomes more urgent in .NET 4 when we could possible see a CMS offer dynamically compiled templates/plugins using script languages that run on the DLR. I have no idea how that would be impact by trust.

But the short story is that we don't change trust level. Seems like the right thing to do, because should we ever move the site to a different host, there might be a problem if we relied on a different than normal trust level.

Thanks!

# December 4, 2009 8:31 AM

joelvarty said:

Personally, I think medium trust is a waste of time and effort.  I've had external hosting providers turn it on without notifying us, or change the actual setting of what is enabled in medium trust, such as binary formatter for serialization.

It's my hope that better virtualization implementations on cloud platforms like Azure will make the notion that medium trust is more secure just go away.

# December 4, 2009 8:42 AM

Sébastien Ros said:

1. I run all my web sites in full trust

2. I deploy only my own web sites on them, so I don't want to bother with unconfidency

3. I think a CMS should be able to work in medium trust, because it targets a different user base, if that's what you mean

# December 4, 2009 8:50 AM

Craig said:

For internal development for my company, everything is done with full trust, simply because we're the only ones with access (hosted internally), and anything we do is easily traceable to who did it.  Medium trust would just cause complications that we would have to resolve on a case by case basis.

Obviously, it's invaluable to a hosted environment, though.  You never know who you're going to share a server with...  If I had anything important on a hosted site, I would want it protected.  The trust level just depends on what it is that needs protecting.

# December 4, 2009 9:13 AM

marius said:

Did I seem to imply otherwise? No.

... In those cases, combination can help if done responsibly....

Its just exactly what i think. For real jHeads your advise was acurate, implied by using jQuery.[fn].xx.

We can see a lot of posts these days about "how"

to use the loader but almost none about "when and why"...

Most of time using jQ people do not write "global like"  fn.xx. Not everyone is a plugin writer.

Also loading jQ.ui and jQ.effects from CDN is not the best choice for me. They still have some minor bugs in the animation engine wich i like to override. (to get rid of NaN..)

# December 4, 2009 9:23 AM

Joe Audette said:

On a dedicated server with only apps I have installed myself I never use medium trust. Most shared hosting environments do enforce medium trust or some custom variation. Presumably this protects the server and protects your site from mischief that other rogue apps on the server may try to do. I will say in those cases where I have had sites hosted under full trust in shared hosting I've never known of any problems (not that this means there never are any).

To me as a web developer Medium Trust has always been a hassle that I have had to deal with so that my apps can run in environments where it is enforced. So many things I've implemented only to find it doesn't work in Medium Trust and then have had to change the implementation or put in a workaround to support medium trust. Very glad that VirtualPathProviders will work in medium trust in ASP.NET 4 for one example. Other challenges under medium trust are Serialization where there are challenges with Binary or Soap Formatters and only Xml Serialization works easily, use of Reflection is very limited, supporting alternate databases is challenging unless the host installs the ado drivers in the GAC, etc, etc.

# December 4, 2009 9:56 AM

Erick Stubbs said:

1. no

2. we dont

3. externally hosted, not constrained.

# December 4, 2009 11:11 AM

Bertrand Le Roy said:

All good points, yes.

# December 4, 2009 11:54 AM

Michael Johnson said:

My team currently is in the process of deploying our first ASP.NET website. We are deploying to Rackspace Cloud, which requires we run in medium trust.

This has caused problems for us. It means we have custom builds of NHibernate and Castle Windsor, which I personally would prefer not to have. But medium trust makes things different. My personal preference would be for the different trust levels to go away and just have everything work. But my guess is that will be easier said than done.

# December 4, 2009 11:54 AM

Milan said:

My hoster chooses to have medium trust enabled for all sites, and it is a little bit annoying. I usually do not hit wall, but when I do, I'm doomed or I have to do some havy workarounds.

# December 4, 2009 12:25 PM

Bertrand Le Roy said:

@Marcel: feel free to send me your comment in e-mail (bleroy you know where). I have no idea what happened here: redirection to home is a new one.

# December 4, 2009 1:54 PM

joelvarty said:

Binary Serialization / Reflection

System.Diagnostics (Tracing)

Custom Configuration (workarounds are available, tho)

# December 4, 2009 2:24 PM

Joe Enos said:

My personal sites are in medium trust, because I go through GoDaddy's standard hosting, which doesn't allow full trust.  I really don't like having to use medium trust, because it stops me from doing a lot of things, like ASP.NET chart controls or other similar charts, Anti-XSS, or several other things that should be straightforward in a web application, but are simply denied in medium trust.

After my contracts are up with GoDaddy, I may switch over somewhere else because of this.

# December 4, 2009 2:57 PM

Joannes Vermorel said:

+1 Stephen M. Redd

+1 joelvarty

# December 4, 2009 3:16 PM

Lenny Reed said:

1. All sites are required to be run in medium trust or a custom level derived from medium.  

2. Frankly, I dont wish to grant 100% control over my server and file system to some wannabe hacker.  Think of the damage that could be done just exploiting the System.IO namespace alone.  That in iteslf was enough of a case for me.

3. We dont usually have any externally hosted sites.

# December 4, 2009 4:15 PM

dc said:

I prefer full trust.  I do not like medium trust for these reasons:

- Medium trust seems to break seemingly 'normal' things you can do with asp.net.  There is no warning saying that something won't work in medium trust.  In other words I don't really know all the things medium trust does not allow so it's difficult for me to develop against it.

- A lot of 3rd party library do not work in Medium trust and that is out of my control.

I understand the benefits of medium trust as far as it is supposed to make a host safer and more secure, but I still do not like developing under medium trust.

# December 4, 2009 4:16 PM

aroberts said:

Custom Configuration

ASP.NET Charting (although 4.0 fixes this)

Reflection Permission

Web Permission

# December 4, 2009 4:20 PM

Matthew Martin said:

I work at an organization that never met a security feature it didn't like.  So when there is a security feature that exists, the server admin can turn on at any time and that feature is essentially broken, this is a significant project risk.

If there is even one line of 3rd party code which can't be GAC'd (because my sys-admin doesn't let me GAC assemblies) or modified to use API calls that aren't forbidden by Medium-Trust, then the whole web application needs Full Trust.

I like the way System.AddIn solved the problem by creating new AppDomains with custom policies defined by the host app at run time, although System.AddIn is a pretty heavy solution just to be able to restrict some semi-trusted code.

# December 4, 2009 5:56 PM

Roger Martin said:

Medium trust does not allow progress indicators of file uploads in an ASP.NET app. This seems to be an unnecessary restriction that is not appreciated by users of my open source gallery web app Gallery Server Pro.

# December 4, 2009 10:55 PM

Krunal said:

MySql.Data is not working in medium trust...

i think it requires some web permission.

# December 5, 2009 3:26 AM

jeremyh said:

It would be good if all the starter kits from the asp.net site ran in medium trust or had clear steps on how to get around the issues. As this would help alot of people just starting out with asp.net.

# December 5, 2009 4:50 AM

Derek said:

Hello, I am trying to set this up on my home server. I have created the Root Web App, copied all of the files and folders to my photos directory and hav a link pointed to the virtual directory.

I am receiving the following error: Server Application Unavailable

The web application you are attempting to access on this web server is currently unavailable.  Please hit the "Refresh" button in your web browser to retry your request.

Any help would be greatly appreciated.

PS - I am trying to get this running on Windows Home Server the directory for the photos is a UNC path to the WHS shared Photos folder.

Thanks again

# December 5, 2009 6:36 PM

Marcel Popescu said:

Ok, I just *had* to give you this link... I haven't laughed so hard in a while.

www.youtube.com/watch

Sorry about the off-topic (or is it? :P)

# December 5, 2009 6:40 PM

Bertrand Le Roy said:

@Derek: never seen that happen with this app. Usually that happens when an app gets killed by the server because it went over some memory or stack limit. I suppose it could happen if you had some insanely big pictures in there. Try again with few small pictures, just to see.

# December 5, 2009 8:19 PM

Bertrand Le Roy said:

@Marcel: that is truly epic! Thank you so much for that link.

# December 5, 2009 8:34 PM

Dave said:

I've had one major hang-up with medium-trust. I have never been able to get NHibernate to work under medium trust. From my own "research", it seems that most common 3rd party ORM packages do not support medium trust.  

# December 5, 2009 11:36 PM

mjm2 said:

OleDbPermission

# December 7, 2009 1:49 AM

Tsvetomir Tsonev said:

I agree about ReflectionPermission (with the RestrictedMemberAccess flag) and WebPermission. Those will be very useful.

# December 7, 2009 6:44 AM

Tom Wang said:

I am sorry i am not familiar with asp. But I want to get absolute coordinate from C# System.Windows.Forms.HtmlElement. How can I use (Sys.UI.DomElement.getLocation) in my code because I can't find namespace "Sys".

# December 7, 2009 6:56 AM

Mark Hildreth said:

We require full trust because we use the BinaryFormatter.

# December 7, 2009 9:30 AM

mariner said:

I'm trying to use medium trust with a custom role provider but it is not that easy. Don't want to deploy anything to GAC so trying to use application's /bin folder. Have enabled allow partial trusted callers and strongnamed the assembly but still getting security errors in IIS7.

I think Microsoft need to make this easier to run with limited trust.

# December 7, 2009 11:32 AM

Bertrand Le Roy said:

@Tom: Sys is a JavaScript namespace introduced by ASP.NET Ajax. You seem to be two technologies away from where you need to look. I'd ask on a Windows Forms forum, for example windowsclient.net/Forums

# December 7, 2009 12:07 PM

Stephen M. Redd said:

It might be easier to just ask what needs to be tightened in full trust to make it a reasonably secure default.

The answer is --Not much.

Full trust is reasonably secure already. Shops that REALLY care to tighten security will likely use a custom policy anyway.  

The big things full trust can do to make it more secure without breaking too much stuff is:

Take away EventLog

Restict IO to the virtual directory

Take away registry access

There just seems to be little point in pre-defining more than one "default" policy. Make a single default that is as secure as possible without breaking "normal" or "common" things web apps are likely to need.

For anything else, just make it easier for admins and developers to create and manage custom policies and do away with the other pre-defined levels.    

# December 7, 2009 3:38 PM

Steve said:

UnmanagedCode permission. Exports to pdf from every single reporting product requires this ..

# December 7, 2009 3:42 PM

guoqizheng said:

At Kooboo, we have to ask user to add the reflection permission and ability to create and manipulate an appdomain.

And due to a MS bug, we have to add "UnmanagedCode" flag to SecurityPermission.

See trust level section at: www.kooboo.com/.../kooboo12_installation_guide

# December 8, 2009 3:44 AM

Devesh said:

Encryption and Decryption are not allowed

# December 8, 2009 4:51 AM

Tim said:

Steve said:

UnmanagedCode permission. Exports to pdf from every single reporting product requires this ..

I'm using SSRS to generate a PDF and I don't need UnmanagedCode permission.

# December 8, 2009 4:25 PM

JE Ashton said:

Regarding the syntax around inclusion of javascript in the template markup, I definitely prefer '<script type="application/ms-template">'.  While more verbose, it is also much clearer in its intent.  

# December 10, 2009 2:39 PM

Bertrand Le Roy said:

@JE: there is a number of problems with this approach. First, it's not script, it's markup. It contains script but so can ordinary markup (leaving aside the discussion on whether it's right). Second, it's killing all tool support on the markup in the template, and you're also not going to get free parsing from the browser, validation, etc.

# December 10, 2009 3:00 PM

foobar said:

YES!  Thank you for this.  Resizing using GDI+ was never really acceptable.  This is great.

# December 10, 2009 9:22 PM

Jerry said:

Nice writeup Bertrand.  Thanks!

# December 10, 2009 11:17 PM

Robert said:

Great article!

Too bad that WPF Fant doesn't look as good as GDI HQ Bicubic, so your benchmarks are not exactly comparing the same thing.

# December 11, 2009 3:27 AM

Mukesh said:

Really this is great solution. Thank you...:)

# December 11, 2009 3:48 AM

Joe Chung said:

I don't think that a fully managed code image manipulation library could ever compare to native code (for performance) until there were managed code equivalents/aliases for SIMD/vector instructions.

Anyways, beautiful pictures!

# December 11, 2009 5:30 AM

Adam Tibi said:

I am actually maintaining a GDI+ resizing solution, when that needs to be updated, I will definitely use WPF.

Thank you for the highlight.

# December 11, 2009 8:59 AM

Miguel de Icaza said:

The WPF approach will not work on platforms other that Windows.

# December 11, 2009 10:19 AM

alessandro said:

ahh fantastic. I use GDI+ too. Time to switch I suppose.

Thanks

# December 11, 2009 10:20 AM

Bertrand Le Roy said:

Ah, @Miguel, great that you chimed in, I was wondering about that and didn't have time to try it on Mono yet. So why is that? I thought that with the great work you've done on Moonlight, you'd have all those APIs implemented as they seem pretty fundamental for WPF/Silverlight?

# December 11, 2009 1:02 PM

Bertrand Le Roy said:

@Robert: Good point. Here's a list of perf results for each quality:

GDI Nearest neighbor: 6.7s (still 2x as slow as fast WPF but ugly)

GDI Low: 7.9s

GDI HQ bilinear: 11s

GDI HQ bicubic: 11.8s

GDI High: 10.1s

GDI Bilinear: 8.2s

GDI Bicubic: 8.6s

GDI Default: 8.4s

WPF Nearest neighbor: 6.6s

WPF Low / linear: 6.5s

WPF High / Fant: 8s

WPF Unspecified: 6.9s (this looks the same as nearest neighbor and linear in terms of quality)

Additional note: fast WPF is spending about 9 billionth of a second per pixel of the original image on a dual core 2.66GHz machine with a Mobile Radeon HD 3650, which I find pretty amazing.

# December 11, 2009 2:28 PM

Klaus Graefensteiner said:

Great research! This article saves me a ton of time in my current Silverlight project.

Klaus

# December 12, 2009 2:02 AM

Matt Sherman said:

Do you have any way of knowing if the the processing is going to the GPU? If so, a GPU on the server would be interesting...

# December 13, 2009 1:35 PM

Matt Sherman said:

And one more question -- I don't see where "Fast WPF" is specified as an option in the code. Do all the examples get the advantage of Linq-y deferred execution?

For example, when calling photo.Width, how much of the image is read off disk at that point? Just metadata? That would be great, I'd love to do a bit of math prior to resizing the image without incurring the I/O overhead.

# December 13, 2009 2:09 PM

Bertrand Le Roy said:

@Matt: I'm not sure. CPU usage is a little lower during WPF resizing but not much, so I'd be surprised if the GPU was involved. I didn't measure GPU usage though.

Fast WPF is what's used in the handler. If you want to see all usages, look in the benchmark project.

When reading width or height, you are only reading meta-data, which is super-fast.

# December 14, 2009 1:06 AM

Gerhard Schneider (WPF) said:

WIC Decoders/Encoders and the RenderTargetBitmap pipeline are not using the GPU.

# December 14, 2009 1:02 PM

Bertrand Le Roy said:

Thanks Gerhard.

# December 14, 2009 1:26 PM

Sel said:

Any idea what happened to the Visual Studio 6 (vb) CTRL+I that showed the value of the constant?

# December 15, 2009 8:50 AM

Jens Christian Mikkelsen said:

Originally, I was pretty scared when you mentioned the System.Drawing warning. But then I found this blog post by cherylws, who wrote the documentation:

blogs.msdn.com/.../what-does-not-supported-mean.aspx

She was asked to add this statement, because no-one had tested the ASP.NET scenario and MS didn't want to support it. (For free.) So there are no known issues with using System.Drawing from ASP, as I understand it.

Are there any guarantees that WPF will work from an ASP.NET application? Is it a supported scenario? :-)

# December 15, 2009 9:23 AM

Bertrand Le Roy said:

@Sel: no, but you could either "go to definition" or name your constants with an explicit name ;)

# December 15, 2009 2:22 PM

Bertrand Le Roy said:

@Jens: thanks for the link. It does help to know it is just untested in this context, but as pretty much anything untested, there are real problems caused by it. Cheryl doesn't say by the way that there are no known problems. Granted, problems are very very rare and I consider it safe enough to use System.Drawing on the kind of application I build. And if you only have medium trust, you don't really have an alternative.

Now for some developers, it is a necessity to have support backing what you do, even if it works.

And of course, there is the performance, which in my book is reason enough to move to WPF.

Yes, you can call support about that and they should help you. To be clear, *any* API in .NET is supported on the server unless specified otherwise.

# December 15, 2009 2:31 PM

Bertrand Le Roy said:

For some reason, Marcel's latest comment won't get accepted by Community Server. It's not that it's marked as spam, it's just that it disappears. Proof of the existence of black holes?

So I'll include his comment myself, and I'll answer inline...

I'd like to make a number of meta-points before I begin going through the details though...

0.1 Intuition and common sense, on which you rely a lot to counter scientific results, are very poor guides. They are very easy to fool consistently (many people actually make good living out of it), and are systematically wrong on plenty of very real, very reproducible effects that scientific theories explain in a much more reliable way.

Not to say that intuition is not useful of course: I doubt any scientific breakthrough could be done without it, but it just can't be the final judge of what's true or false.

0.2 You seem to imply that when something works, it's engineering, not science. That is so convenient. Yes, when a scientific theory is successful, of course it's likely to be picked up and applied by engineers. That doesn't magically make it non-science. Science is knowledge that was found using a scientific method. It may or may not be used in enginering, that doesn't change anything.

0.3 Showing that this or that scientist -even famous and respected- committed fraud or the sin of not being omniscient doesn't invalidate scientific methods or scientific results and theories. It's just a form of ad hominem attack: attack the man instead of the ideas. It's also implying that if they've been wrong sometimes in the past, they are always wrong now and forever. This is an argument that is both insidious and wrong.

0.4 It's a well-known technique to introduce controversy where there's none, and to repeat arguments even after they've been discredited, in the hope that some uninformed listeners might be confused and believe arguments on both sides of an issue are equally relevant. It's just plain FUD.

0.5 Your insistence that science is a form of faith is another attempt to establish a form of relativism where all ideas are equivalent so you can just choose any system of thought and not be wrong in any absolute way. But unless you don't believe in an objective reality, this can't be right, by the very definition of science.

0.6 Strange how gods of the gaps work: if some phenomenon has not yet been explained by [pick the theory you love to hate], then your own favorite attempt at an explanation must be true.

Marcel:

1. I'm not writing a scientific treatise :) Melt = sublimates, evaporates, whatever. I don't care how slow the transfer is - something immersed in a 10 million K thermostat gets to 10 million K eventually. The *speed* of the energy transfer can be low, but it's happening, and there's nowhere to lose that energy to (you cannot radiate heat into a hotter environment).

Bertrand:

Well, you might not care how slow the transfer is but it's important. And you *can* radiate heat into a hotter environment. I think you're trying to say that the balance will be positive and that the planet will have to heat up sooner or later. Temperature is an expression of the microscopic kinetic energy of matter. It represents that energy and nothing else. With extremely low densities comes extremely low conductivity. In other words, the corona can't transmit significant heat to an object as dense as even a gas planet over any reasonable period of time to bring it to its temperature.

Consider this: to find one particle in the densest parts of the corona, you'd need on average to explore 1E16 cubic meters. On the surface of a gas giant, the density is about 5E25m^-3, in other words the planet is about 5E41 times denser than the corona. Take two gases, one 1E41 times denser than the other. The densest one is, say, at room temperature, and the least dense is kept at a few million degrees. And let's assume that the system is closed (which it isn't in our stellar case). How long do you think it will take for the dense gas to be heated by even a few degrees?

You can also view it in terms of kinetic energy being transferred (because that's what it boils down to in the end). There is energy (radiation and matter's kinetic energy) being radiated by the sun, and a part of that flux hits the planet. Whether the planet is within the arbitrarily defined limits of the corona or not, if it radiates less than it receives (for example by trapping infrared because of too much greenhouse gases), it will heat up until it reaches a new equilibrium. At this new equilibrium, the thermal kinetic energy can be lower or higher than the escape velocity. It it is higher, the planet starts losing significant matter to its environment.

To get back to the corona, the energy amount it represents is about 1/40000 of the total amount of energy the Sun radiates. In other words, it just won't affect the temperature of the planet significantly. It's the total flux of energy that will count and that will determine, together with the albedo of the planet, what the temperature at the surface will be.

Of course, you also need to take into account that the energy flux for a planet of a given size decreases with the square of the distance. So if you receive X watts where the corona is hottest (about 500km above the photosphere if I'm not mistaken, which puts it about 1.4 million kilometers from the center), the flux of energy you'll receive at 7 million kilometers is going to be about 25 times smaller.

Our intuition of temperature is a very poor guide to understand what happens both with extremely high temperatures and with very low densities. So when you have both, it's better to rely on scientific models. Looking at the energetic exchanges is the right way to look at the problem.

Marcel:

2-6. So, as I said: when experiments disagree with the theory, scientists lie. I do not know of a case where this did NOT happen. Do you have an example where a long-accepted theory was disproved by experiments and the scientists said "oh, ok, we were wrong, let's cancel all the papers we've already published and start from scratch"?

I do know of many cases where they lied - I pointed out two.

Bertrand:

Maxwell cancelled all we knew about electricity, magnetism and light. Relativity cancelled all the work that had been done on aether. Quantum theory cancelled all we knew about the atom. More recently, Zurek's theory of decoherence may well cancel the Copenhagen standard interpretation of quantum mechanics. Just to take a few examples, but I'm not the one making the broad claim here, you're the one claiming that scientists always lie. That's claiming that millions of people always lie, based on a few cherry-picked examples.

Marcel:

"Now jumping from that case (which implies how many people by the way?) to the conclusion that there is a global conspiracy and that science doesn't work, isn't that a little excessive?"

Given that, in the cases we DO have information about, scientists will lie when experiments contradict accepted dogma, why exactly am I supposed to believe scientists about stuff I don't have information on? (Of course, this will generally happen on politically-charged subjects. I expect it to happen when it comes to vaccines and diseases, for example, but not when it comes to the melting speed of gold.)

Bertrand:

As I said, you are generalizing from a handful of cherry-picked debatable examples to millions of people.

Marcel:

7. Your argument was: planets have the orbits they do because "all forms of energy curve spacetime in such a way that what is the closest analogue to a straight line becomes the elliptical trajectory that we observe". In other words, planets follow a straight line, but from the outside it can be seen that the line is curved (because spacetime itself is curved). As I have shown, that cannot work, because in the same spacetime conditions we can obtain a *real* straight line (that can be seen as straight both locally and from afar).

Bertrand:

No, as I said in the previous comment, what's a geodesic is the four-dimensional trajectory, not its 3-dimensional projection. The math is not very complicated and unambiguous. You should check it out. I've addressed your real straight line objection before as well. You have not shown anything except that you did not understand general relativity (which is fine, not that many people took the time to study it, and it's never too late).

Marcel:

I have encountered the "4 dimension" pseudo-explanation before. I'm fine with it. The problem is, that "the spacetime is curved in 4 dimensions, not 3" idea is now unable to explain why planets have an elliptic orbit *in 3 dimensions*. If the curvature is in 4D, and 3D is either unaffected or has a different shape, then why is the 3D orbit curved?

Bertrand:

It's not a pseudo-explanation, it's a model that works remarkably and verifiably well. Check out the math and you'll understand it. I did not say that spacetime is not curved in 3 dimensions: it is, just not the naive way you extrapolated. Just do the math. And check out the orbit of Mercury: it works where Newtonian mechanics fail.

Marcel:

Personally, I find the idea of different densities of aether (aka spacetime) being much more acceptable, and I can easily find out through experiment that light will bend when going through a material that has variable density.

Bertrand:

I can see how that may seem seducing and variations of density can indeed bend light, but aether just doesn't work. Different "densities of spacetime" is actually not very far from what general relativity is expressing, but if what you mean is variations of density of matter of any kind in an absolute background spacetime, there's plenty of evidence that it's wrong. And what kind of matter are we talking about that it works away from quasars an stars? Dark matter?

Marcel:

In fact, I have read an article claiming that all the "bending" effects that have actually been observed can be very easily verified / predicted by such a theory (variable density of the spacetime continuum). I'm not a scientist (yuck), so I cannot verify the theory, but I find it plausible. When choosing between plausible and magic (energy somehow warps something that doesn't really exist), I always go with plausible.

Bertrand:

Reference please? Plausible is not enough. Magic? Somehow? Space doesn't exist? Again, WHAT?

Your assertion that you "always go with plausible" against "magic" is contradicted by your adherence to creationism and to the belief in recent collisions of the Earth with Jupiter.

Marcel:

"You can't on the one hand blame scientists for refusing to explore any crackpot theory out there and on the other hand blame them for exploring in all directions."

I'm not blaming them for exploring, exactly for the opposite. Most scientists do not explore anything; they, in the words of Kelvin if I'm not mistaken, look for the next decimal. It doesn't rock the boat, so it's safe.

Bertrand:

I've consistently given you examples of scientists "rocking the boat" and you've systematically dismissed those with your selection of crackpot theories that you choose to believe against all evidence. But true or false, the theories I've cited *have* effectively overturned the previous consensus.

When was the last time a Nobel prize was awarded for "following dogma"? I see quite a lot on the other hand rewarding scientists who revolutionized their field.

I think you misunderstood Kelvin on this one.

First, he might have been a genius, but that doesn't make everyting he said true.

Second, what was true at his time isn't anymore: computers have been invented since then and have freed an army of scientists from pushing numbers and finding the "next decimal," allowing them to turn their attention to more profund things.

Finally, for all we know, the next decimal might actually be the one that disproves the current version of quantum field theory, or general relativity, or whatever. So it might actually seriously rock the boat.

Marcel:

Finally, I don't have a problem with theories where they can be verified (solar system scales), but where they are obviously contradicted by facts (galactic scales). We didn't receive GR from God, so I can't figure out this insistence that GR applies everywhere in the Universe, at all scales. Say "GR applies locally, in our system, we don't yet have a theory for galaxies".

Bertrand:

GR applies locally, in our system, we don't yet have certainty on what is the right theory on a galactic scale. Not sure where I ever insisted "that GR applies everywhere in the Universe, at all scales". I certainly never thought that was the case.

Marcel:

8. "But it still seems like even though the idea of transformation of species was relatively accepted in the scientific community at the end of the nineteenth century, explaining it by natural selection wasn't the consensus before Darwin and Wallace, was it?"

If you call that explaining then you're correct :)

Bertrand:

I do.

Marcel:

Cold fusion: you still can't publish anything on the subject. The fact that the US Navy says it works is one thing; try publishing a paper saying you verified the experiment in your basement, see how far that gets you.

(Apparently the US Navy doesn't care about getting funding from the NAS, I guess.)

Bertrand:

I gave you a link to an article on that on the web site of the freaking American Chemical Society, which is just the largest scientific society in the world. And there's not a trace of antagonism to the findings. To cite the first sentence of the article: "researchers are reporting compelling new scientific evidence for the existence of low-energy nuclear reactions."

How much more do you need to stop denying that you can publish on the subject?

Here are a few for 2009 alone (took me about five minutes to find those):

arxiv.org/.../0901.2411v1

arxiv.org/.../0912.0867v1

arxiv.org/.../0909.1089v1

arxiv.org/.../0906.5081v1

arxiv.org/.../0901.0901v2

arxiv.org/.../0904.2994v1

arxiv.org/.../0909.5561v1

arxiv.org/.../0909.3469v1

arxiv.org/.../0901.0470v1

More here: lenr-canr.org/LibFrame4.html

There's also apparently an international conference on the subject with an advisory board composed of scientists working in renowned institutes: iccf-14.org/international_advisory_committee.html

So if there is a conspiracy to suppress research in that field, it's being extremely inefficient...

Marcel:

Or, are you saying that only approved scientists should be allowed to challenge dogma? I think the saying was, there's nobody as blind as those who just won't see.

Bertrand:

Err no, never said anything of the sort. A scientific dogma is an oxymoron by the way. But you are right on your quote. Back at you.

Marcel:

Electric universe: here are some articles about scientists having no clue:

thunderbolts.info/.../091125bigproblems.htm

thunderbolts.info/.../080526predictions.htm

thunderbolts.info/.../080516spaceweather.htm

thunderbolts.info/.../080506holmes.htm

Bertrand:

More vague assertions, hand-waving, outright lies and quotations without references.

All these links contain that is specific are phenomenons that were unpredicted, some of which remain unexplained. There is a difference between surprising, unexplained or unexpected and impossible to explain.

There is also a difference between an unexplained phenomenon and one that is incompatible with the currently favored theory. The articles cites plenty of the former, none of the latter. "We have to come up with some new scenarios" is not the same thing as "we have to come up with a new theory". Not that it wouldn't be perfectly fine to do so. It happens frequently.

To paraphrase the falsifiability article: there are phenomenons in the universe that are yet unexplained, therefore the universe is not electrically neutral. Uh?

I did not deny that the current theories have problems: they do have problems (of which dark matter is just one manifstation), but you have to know that astrophysical plasma theories have been studied and not only did they fail to make useful predictions that the currently standard model do, they had their own fudge in the form of cosmic-scale plasma currents that were never observed. So it's a good thing these hypotheses were formulated, it's a good thing they were considered and studied and it's a good thing they were abandoned because they didn't work.

See Astronomy and Astrophysics, Volume 495, Issue 3, 2009, pp.975-978 for more plausible explanations of the Holmes comet thing.

See www.iop.org/.../723 for PSR J1903+0327.

And of course, see the reference above about the claims of an electrically charged sun in general (you'll find references in this one).

All this is too bad because there is plenty of electromagnetism and plasma physics to be made on an astronomical scale (and it's beig done) but this stuff is deliberately misleading the public with pseudo-scientific mumbo-jumbo. Deliberately because they ignore the legitimate objections being made to their hypotheses. The goal of this site is not to create new science but to discredit science. And it fails.

Marcel:

This is quite interesting too:

thunderbolts.info/.../080403phobos.htm

Bertrand:

Well, the giant plasma flame hypothesis is quite grandiose. The whole thing is just wild speculation based on vague misunderstood observations. And of course not even an attempt to provide an actual model, just finger-pointing at real or imagined gaps. To paraphrase again, we don't know exactly how Phobos ended up there, so there must have been a huge plasma flame from wherever. Uh?

Marcel:

ID: I'm not jumping to "God did it", I start from there :) Hence the reason for requiring extraordinary evidence (not stories) for the contrary.

Bertrand:

Well, at least you admit that you start from unfalsifiable principles. I'm all for evidence and there's plenty. It's just that you choose to ignore anything that challenges your central dogma, whereas it is the duty of a scientist (and, dare I say, to a gentleman) to consider all reasonable challenges to the currently best accepted theory and to leave it without looking back if a new one accounts for observations better than it.

Contrast that with some creationists publicly taking oaths that no evidence could ever change their dogma: www.answersingenesis.org/.../faith 4.6

Marcel:

The link for the Haldane's dillema is quite ridiculous. (Again, only someone with an apriori allegiance to the theory would not laugh reading it.) Here's how they "solve" the problem:

"would probably"

"would have"

"many mutations affect more than one codon" ("more than one" would have to be "a few thousands" to account for the discrepancy) "let's double the difference" (yea, 'cause that's the problem, the difference between 3k and 1.5k, not between 1.5k and 10 million) "the computer simulations contradicting us are bad, ours are good"

Bertrand:

Skipping the fake quotes that you just made up.

I know how unsettling it must be for you to find scientists who don't speak "ex-cathedra" and express, like they should, that no thoery is final and absolutely certain. For good memory, who said "How could it be otherwise? How could the scientists' ex-cathedra pronouncements have any force if they would preface them with 'I could be wrong, but I believe that...'?"?

To get to specifics, you're not addressing Haldane's numerous invalid assumptions: when correcting those, you don't need "a few thousand" (oh, by the way, did the claim just shrink from 4E7 to a few thousand all of a sudden?). Just read www.gate.net/.../haldane1.html to see in just how many ways Haldane was wrong (as he was well aware he might be).

Marcel:

Honestly? This is the best they can do? I mean, this is not even making an effort.

Bertrand:

Oh no, there's a lot more where this came from.

Marcel:

NFL: "Evolutionary algorithms work. They find solutions to many problems that are intractable with other methods."

To anyone with ANY knowledge on the subject, the above is a blatant lie. For one thing, the issue was never about *working* - brute force will always work; the issue was about finding a "good enough" solution in a short enough time. For another thing, there are MANY heuristic algorithms, evolutionary ones are just a small part. (One I recently read about simulates an ant colony leaving "traces" behind as they search the space.)

Bertrand:

Sure there are other heuristic algorithms. Who claimed otherwise? The claim from creationists is that because evolutionary algorithms don't work better than brute force without injection of information, they can't explain complex information seen in life. See point #6: the environment is providing that information. That's natural selection.

Marcel:

Hmm. People lie. News at 11.

Bertrand:

True, especially to themselves.

Marcel:

(The whole page is as bad as the one about Haldane's dilemma. Honestly -if you just don't want to accept something, wouldn't it be more sincere to just say so, instead of making up these ridiculous excuses?)

Bertrand:

I'm perfectly willing to accept any real (as in not Oomph-like) theory that accounts for observations better than the current theory or what I currently think is the most plausible explanation to any phenomenon. I've done so numerous times. Are you?

Marcel:

van Flandern: I know about similar claims from Carlip; as far as I know, Flandern answers them here - www.metaresearch.org/.../speed_limit.asp .

Anyway, no biggie, I was just enumerating subjects :)

Bertrand:

Nice, I happen to have known the second author of this paper, Vigier, in my previous life. I won't talk about the very weird things van Flandern used to believe, that would be ad hominem, but let's just say it doesn't inspire the greatest confidence in this one a priori. That the paper has been cited zero times, for good or bad, is also not a good sign. But let's ignore that as well for the sake of argument.

I'm not married myself to a geometric interpretation of gravity and would accept anything that works better. Something that is compatible with quantum field theory for example. The problem with this article is that it contradicts what little measurements we have of the speed of gravitation, which so far indicate that it's close to the speed of light. We'll probably have to wait a few more years to have better data.

There are indirect confirmations of gravitation propagating at the speed of light, for example the evolution of the orbits of binary pulsars: arxiv.org/.../0307468

But to be fair this doesn't seem to be absolutely incompatible with van Flandern's theories.

Interesting thread on this here: www.bautforum.com/.../6498-tom-van-flandren-gravity-faster-than-light-3.html

And here: infao5501.ag5.mpi-sb.mpg.de/.../archive

Still, even if the conclusions of this article were correct (which they don't seem to be to me, but then again my GR is a little rusty), how does that make black holes impossibilities (that was your initial argument)?

Marcel:

Black holes: "My opinion is that the singularity is never effectively formed and that yet unknown quantum gravity effects are what prevents it."

I'd go with common sense, myself. As I said, since infinite density doesn't make sense - it is self-contradictory - it means it doesn't exist. No need for unknown quantum gravity effects :)

Bertrand:

Infinite density is not self-contradictory: GR on its own would do quite well with them without losing consistency. My opinion is that it never happens but that's just an opinion.

Marcel:

"Do horizons make sense to you?"

Absolutely none. Time is supposed to slow down the closer you get to the horizon, and stop once you touch it. (Or, from the other point of view, if you fall towards a horizon you see the universe moving faster, until it moves at infinite speed when you touch the horizon.) The conclusion is that nothing can EVER go past a horizon, so the black hole cannot actually ever gain mass. Since black holes are supposed to *lose* mass (Hawking evaporation), it follows that even a horizon would form, it would disappear pretty quickly.

Bertrand:

Well, horizons exist in other branches of physics and can be observed so I guess you're just lacking imagination here.

No, time doesn't stop when you touch the horizon, and there is no infinite speed anywhere. From a stationary external reference frame, it seems to take infinite time to reach the horizon, but from a frame of reference that falls into the horizon, it takes finite time. I know it hurts your intuition but there are no contradictions here as doing the math would show you.

But all this will soon be resolved as we are just about to resolve the surface of a couple of black hole candidates in the millimeter wavelengths. If horizons exist, you'll be able to see images of the dark disk, surrounded with characteristic mirages of the accretion disk.

Marcel:

Weirdly enough, I found an article saying that GPS and relativity are totally unrelated: www.physicsmyths.org.uk/gps.htm . If he's right, that would be a wash :)

Bertrand:

Yeah, well, he's wrong: relativity.livingreviews.org/.../lrr-2003-1

Marcel:

Randi: I linked an article showing not that he falsified data (others did that), but that he lied about it (as I said).

Bertrand:

According to hearsay from one guy.

Marcel:

Velikovsky: sorry about that, my bad. The correct link would be www.webscription.net/p-236-kicking-the-sacred-cow.aspx

Bertrand:

A Holocaust denier? Really? Not sure I want to spend time researching what this guy has to say or to give him money. I did find this exceprt: www.jamesphogan.com/.../info.php

Is that what you're referring to? Which of the assertions in there show something that is only explained by Velikovsky's ideas?

Marcel:

I especially like the first phrase, since it duplicates my position:

"Science really doesn't exist. Scientific beliefs are either proved wrong, or else they quickly become engineering. Everything else is untested speculation."

Bertrand:

That some scientific knowledge becomes engineering is undeniable but what does it prove exactly, if not the success of those ideas?

Marcel:

"But by what stretch of logic does the fact that people got funded to do ridiculous research on creating diamond film from tequila justify funding ridiculous research on recent collisions of Earth with Jupiter?"

I was just pointing out that the excuse that "scientists don't have the resources to research ridiculous ideas" doesn't actually work.

Scientists research ridiculous crap all the time. It would be more useful, in my opinion, to research potentially *useful* ridiculous crap.

Bertrand:

Mmh, again you totally made up that quote. What I said was: "I think the community is actually spending disproportionate amounts of time examining outrageous claims despite the usual rule that the burden of proof is on the person making the extraordinary claim."

So I said quite the opposite of that quote you attribute to me. I won't even elaborate on the splendid strawman you built there.

Marcel:

"If that guy is a scientist, his opinion on science must be the Truth?"

I don't know. If a banker tells me that bankers are thieves, should I believe him? If a shrink tells me all shrinks are nuts, should I believe him? In general, my answer tends to be yes :) If someone tells me something that puts him / his group in a bad light, I tend to believe him (because it appears he has less reasons to lie).

Bertrand:

Well, you're wrong. In any large group of people, you'll find people who loathe the group they belong to. Or at least parts of it. There are many reasons for that.

Marcel:

Of course, if you have any evidence that Lewontin was incorrect, by all means, let it out :)

Bertrand:

What is there to prove or disprove exactly in that quote? There is no reference to anything specific.

# December 16, 2009 5:12 AM

mcm said:

What syntax does Ajax Library 0911 Beta use?

<!--* if (condition) { *-->

Or from msdn.microsoft.com/.../cc546561.aspx

<!--% if (condition) { %-->

Does not appear to work for me.

# December 16, 2009 5:43 PM

Bertrand Le Roy said:

@mcm: the comments are gone. The example in the post would now read:

<img sys:src="{{ 'Images/' + Photo }}"
    sys:if="Photo"
    alt="{{ FirstName + ' ' + LastName }}" />

http://www.asp.net/ajaxlibrary/HOW%20TO%20Perform%20Conditional%20Rendering%20in%20an%20Ajax%20Template.ashx

# December 16, 2009 6:15 PM

Michael A. Cochran said:

There is a big problem with GDI+ if you are trying to modify images, say for redaction or to add a stamp.

The problem is that GDI+ can only modify 32-bit bitmaps.  If your image is not a color image - like most scanned images in an ECM repository - you have a whole conversion process to go through.  WPF does not seem to have that same requirement and it is much easier.  I did a quick prototype this afternoon and I can easily modify a 1-bit per pixel CCITTG4 TIFF with multiple pages with no conversion to 32-bpp.

As a bonus WPF is supported in a web application.

NICE!  Thanks for the quick start!

MAC

# December 16, 2009 7:45 PM

Ferdy said:

Perfect !!

The iFRame covers my DropDownBox under de (popup div)

Thanks a lot !!

# December 17, 2009 3:57 AM

plblum said:

ReflectionPermission

My commercial web controls have optional features that use reflection. It impacts about 1% of my customers.

# December 17, 2009 10:23 AM

Nikolay Simeonov said:

Actually arrays can be simulated via XML at least in MSSQL. Check this article: msdn.microsoft.com/.../ms345117(SQL.90).aspx

Here's an example from a project where I used this approach (MSSQL 2000):

SELECT * FROM ITEMS WHERE ID in ( SELECT ID FROM OPENXML (@CHOSEN_ITEMS, '/LIST/X',1) WITH (ID int) )

Supplied XML looked like this:

<LIST><X ID="12" /><X ID="15" /><X ID="24" />...</LIST>

# December 17, 2009 10:46 PM

John said:

Good fix Bertrand.

This fixed it for me with ASP.NET 2.0 app in Sharepoint 2007 Web Page Viewer Web Part. So for anyone reading this - unless you are using an ASP.NET 3.5+ web app of course in web part do exactly what he says and save yourself a lot of hastle.  

# December 18, 2009 9:24 AM

Aamir Hasan said:

yes this will work i have used it _target

# December 20, 2009 6:22 AM

Aamir Hasan said:

imgPhoto = ScaleByPercent(imgPhotoVert, 50);

imgPhoto.Save(WorkingDirectory +

   @"\images\imageresize_1.jpg", ImageFormat.Jpeg);

imgPhoto.Dispose();

....

static Image ScaleByPercent(Image imgPhoto, int Percent)

{

   float nPercent = ((float)Percent/100);

   int sourceWidth = imgPhoto.Width;

   int sourceHeight = imgPhoto.Height;

   int sourceX = 0;

   int sourceY = 0;

   int destX = 0;

   int destY = 0;

   int destWidth  = (int)(sourceWidth * nPercent);

   int destHeight = (int)(sourceHeight * nPercent);

   Bitmap bmPhoto = new Bitmap(destWidth, destHeight,

                            PixelFormat.Format24bppRgb);

   bmPhoto.SetResolution(imgPhoto.HorizontalResolution,

                           imgPhoto.VerticalResolution);

   Graphics grPhoto = Graphics.FromImage(bmPhoto);

   grPhoto.InterpolationMode = InterpolationMode.HighQualityBicubic;

   grPhoto.DrawImage(imgPhoto,

       new Rectangle(destX,destY,destWidth,destHeight),

       new Rectangle(sourceX,sourceY,sourceWidth,sourceHeight),

       GraphicsUnit.Pixel);

   grPhoto.Dispose();

   return bmPhoto;

}

# December 20, 2009 9:54 AM

Bertrand Le Roy said:

@Aamir: yes, that's GDI+ resizing. Not sure what your point was, seeing that you didn't write a comment besides the code.

# December 20, 2009 2:41 PM

Vladimir Kelman said:

Hi Bertrand!

ScriptManager injects JavaScript inside <body> section of HTML page. Isn't it considered a good style to include JavaScript files inside of <head></head> instead?

Is there or is it planned to be some way of allowing ScriptManager (or just injected <script src="jquery.js" ></script> blocks) to be located inside <head></head>?

# December 23, 2009 2:37 PM

Bertrand Le Roy said:

@Vladimir: no, script tags block the execution of the page, so if you put them in head, you are blocking the rest of the page from displaying until they have loaded, which is usually not what you want. It's nice and tidy to put the script tags in head but it's usually not the best option in terms of performance. Plus, script tags are valid pretty much anywhere on the page. For script manager, it's actually not possible the way it's built currently as it relies on the form runat=server to display, which is after the head tag. The best option is actually to use a script loader like the one you can find in ASP.NET Ajax 4.0.

# December 23, 2009 4:54 PM

Markus Daehn said:

Is there possibility for part-time?

Thanks.

# December 23, 2009 6:36 PM

Bertrand Le Roy said:

@Markus: I don't think so.

# December 24, 2009 1:39 PM

Kungen said:

This battle is really entertaining to read. But not as informative...

Bertrand Le Roy: It would bee much easier to beleive what you are saying if you had a less aggressive and insulting attitude. (Like just saying to "Parag" that he's got your name wrong...)

Anyone who's looking for information on ASP.NET or PHP or both (like me) will, after reading this, conclude that the Hull article is probably very biased and that the Bertrand Le Roy one probably is too. Nothing more than that, unfortunately...

# December 26, 2009 10:49 AM

Andre said:

ah nice one. if only we could rid computers of ie most of our compatability issues would be solved!

thanks for this

# December 28, 2009 6:29 AM

microgen said:

# December 30, 2009 3:14 AM

sking said:

Hi Happy 2010!

I was able to convert your .cs file to .vb with the exception of: return (o == null) ? 6 : (int)o;

public class SiteMapView : WebControl {

       [DefaultValue(6)]

       public int MaxDepth {

           get {

               object o = ViewState["MaxDepth"];

               return (o == null) ? 6 : (int)o;

           }

           set {

               ViewState["MaxDepth"] = value;

           }

**********************************************

Here's my VB code of the above:

<DefaultValue(6)> _

           Public Property MaxDepth() As Integer

               Get

                   Dim o As Object = ViewState("MaxDepth")

               Return If((o Is Nothing), 6, CInt(o))

               End Get

               Set(ByVal value As Integer)

                   ViewState("MaxDepth") = value

               End Set

           End Property

********************************************

The word If is underlined in my visual studio saying expression expected. That syntax looks strange on the if statement. Any idea how to fix?

# January 1, 2010 12:57 AM

Bertrand Le Roy said:

@sking: not sure what the point of translating it to VB is, but you may use iff instead of if.

# January 1, 2010 2:59 AM

Binod NP said:

I have been using many different programming languages and PHP was the one I was consistent with for several years. Since I learned CSharp, I fell in love with it. I am very excited to learn many new things in ASP.NET platform.

ASP.NET introduces excellent project development lifecycle and everything is well-managed and more disciplined than PHP. ASP.NET also provides a better mechanism to handle database applications with connection pooling.

ASP.NET has a powerful backend of IIS, Sharepoint, and Team Foundation Server. With these, your team will be concentrate more on business logic.

PHP really needs many many vital improvements in order to get compared to ASP.NET.

# January 1, 2010 2:39 PM

Chris Willis said:

Thanks for sharing.  I’m considering working up a media center in Windows 7 once again.  I used Media Center a few years back, and liked it, but it couldn’t record HD from satellite or cable, so dumped it in favor of a satellite DVR.   Now with internet streaming, I think it’s worth another shot at trying to save the $100 a month I pay for the dish.  As for blu-ray, I luckily found a $60 player at Wal-Mart that has played every blu-ray that we have rented from Netflix, so I may just skip the headaches of blu-ray on a PC and use this $60 box.   The Xbox 360 has disappointed me on video playback (over LAN from a WHS I have in another room), as it can’t play the 3 video formats that my 3 cameras produce.  Media Center on Win 7 can play all of them.  I’m thinking about getting the HD Home Run too, so I can record 2 OTA HD streams.  Or maybe two of those newer little HD USB tuners would work just as well?

# January 1, 2010 6:07 PM

Alex said:

What model of keyboard you are using? Is it wireless?

# January 2, 2010 12:00 PM

Bertrand Le Roy said:

@Alex: it's this IR keyboard www.amazon.com/.../B000AOAAN8

# January 2, 2010 4:10 PM

Luis Abreu said:

Fantastic post :)

oh, I guess mine is plain simple: tv connected to iomega screenplay disk :) (sorry to disapoint you, but that's it really!)

# January 3, 2010 10:28 AM

Yisman said:

Hi

The links to the patches dont work.

My Menu has 2 problems.

#1 background turns white for no reason

#2 some filler space is added above the titles for no reason

the problem is only in 1.1 strict doctype. i don not want to go backwards to 1.0 or transitional

the problems are only in ie8 and only from my hosting company (on my local machine its fine. in FF its always fine.

so where do i get whichever patches that i need, and how do iget them to my hosting company. are they iis patches? or windows? or can i put them in my bin folder?

thanks

# January 4, 2010 3:59 AM

Bertrand Le Roy said:

@Yisman: yes they do, and they should lead you to this: code.msdn.microsoft.com/KB969612, which is the patch those updates were rolled into. Please follow the instructions that come with the patches to install.

For any problems not solved by these patches, please contact support.

Note that 1.1 strict has never been supported though.

# January 4, 2010 4:05 AM

shane said:

What are you using to rip the dvd before encoding them with handbrake?

# January 4, 2010 1:12 PM

Bertrand Le Roy said:

@Shane: DVD Shrink. I must have tried them all and this is the only one that worked consistently. Also neat that it allows you to rip only parts of the DVD.

# January 4, 2010 2:02 PM

Laurent said:

With the ps3 slim you can now use hdmi-cec to control the ps3 with the tv remote(bravia sync). I also use my ps3 to read everything from tversity(or ps3mediaserver) installed on my desktop. The best thing with tversity or ps3mediaserver is transcoding on the fly if needed.

# January 5, 2010 8:01 AM

nickk said:

Do you have issues with the 360 being too noisy - I am using mine(a first gen)as an extender (when not using it for games) and the fan so too loud.

# January 5, 2010 3:10 PM

Bertrand Le Roy said:

@nikk: I'm actually wondering if noise varies from box to box. The fan noise exists but is barely noticeable in my setup and is actually quieter than the Media Center's (which is not itself super-noisy). The DVD drive is the noisy part, but I almost never use it (I install games and stream video).

# January 5, 2010 3:18 PM

Rajesh Singh said:

Hello friends,

I only wanted to know that, here anybody got success after submitting this sitemap to google webmaster.

Means, Google webmaster has accepted this sitemap.

Please reply,

Thanks

Rajesh Singh

Asp.net Developer

www.indianic.com

# January 6, 2010 6:28 AM

Shoriful ISlma said:

Still this position opened?

# January 6, 2010 8:32 AM

Gilad Kapel said:

Thanks..

I've made changes in my code to use WPF functions for previewing the manipulated image and use GDI+ only when saving. Now working with the images it twice as fast.

Too bad the quality of WPF isn't good enough.

Gilad.

# January 6, 2010 8:58 AM

Bertrand Le Roy said:

@Shoriful: yes, but probably not for long.

# January 6, 2010 2:09 PM

Bertrand Le Roy said:

@Gilad: I'm surprised by what you're saying about the quality. Do you have a sample photo that I could look at?

# January 6, 2010 2:11 PM

Scott Galloway said:

It's not quite true to say that GDI+ just wasn't tested. There are some pretty bad memory leaks and handle leaks that can (and often do) happen when using GDI+ in ASP.NET. I did a fair bit of investigation into this when on the team. Really WPF is the only safe way to go.

# January 6, 2010 8:02 PM

ludovic said:

My 360 is also too noisy, but the other problem is that I need to wait for it to boot up. A media center PC would typically be always running so it's faster to watch things there.

Here's my own bragging: ludovic.chabant.com/.../my-home-media-entertainment-setup

# January 8, 2010 1:32 AM

Jeppe said:

I am curious about your wireless network setup with regards to streaming HDTV using the HD Homerun. Or did you wire everything?

# January 8, 2010 3:37 PM

Bertrand Le Roy said:

@Jeppe: yes, everything is wired with gigabit Ethernet, except for the laptops.

# January 8, 2010 3:46 PM

Cory said:

In one of your replies, you mentioned that Orchard is "neither a starter kit nor intended to show best practices." I'm wondering why Microsoft wouldn't want to take advantage of the opportunity to provide the community with best practices when developing MVC applications.

# January 9, 2010 10:22 PM

Bertrand Le Roy said:

@Cory: because best practices imply universality: it assumes that what we do would apply to any application. We already have many important goals to focus on without piling that one on. We are doing our best to apply best practices but we're going to avoid the kind of arrogance that would be to pretend this is how you build any MVC application. It couldn't be anyways because a CMS is a very peculiar type of app. In many places we have to architect things in a way that would be absolutely mad over-engineering in almost any other application.

# January 10, 2010 12:45 AM

Craig said:

I've made a super simple high performance template engine that allows you to insert values anywhere.

code.google.com/.../csharptemplates

# January 10, 2010 5:50 PM

Baskar.S said:

evgeni said:

Remove this from your .aspx

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/.../xhtml1-transitional.dtd">

And menu starts working. (at least for me)

Baskar said: Thanks evgeni its working fine

# January 11, 2010 4:41 AM

InfinitiesLoop said:

HD DVD player counts, it's great as an extra slot :) Non-BR movies go there, games in the console.

# January 11, 2010 5:21 PM

Bertrand Le Roy said:

@Dave: yes, I use the HD-DVD player to play regular DVDs too, so the the main optical drive lasts as long as possible...

# January 11, 2010 5:30 PM

nonym said:

John Resig's blog is at http://ejohn.org not .com

# January 11, 2010 6:48 PM

Hemant said:

Respected sir,

                   what is SEO . i never heard about this and how it works?

# January 13, 2010 3:40 PM

Bertrand Le Roy said:

@Hemant: Search Engine Optimization, S.E.O. Bing it.

# January 13, 2010 4:41 PM

Justin Toth said:

I was excited to try out the SEO Toolkit but after installing the Web Platform Installer, it says that it doesn't support my OS. This makes no sense because I'm running Windows XP SP3 and it's on the list of supported OS's. Lame...

# January 13, 2010 5:10 PM

Meltdown said:

yup!...won't run on WinXP SP 3...my experience as well :-(

# January 13, 2010 7:12 PM

williams rodriguez said:

Hi, this work with BING?

# January 14, 2010 1:12 AM

Bertrand Le Roy said:

@Williams: yes, it helps with all search engines.

# January 14, 2010 1:34 AM

assafg2 said:

can it run on sherhosting ?

# January 14, 2010 2:56 AM

TaoYang said:

Great,I've used it on my server!

# January 14, 2010 3:05 AM

Pieter said:

Is it possible to install it without the Microsoft Web Platform Installer? We like to hear from you.

# January 14, 2010 3:15 AM

Cristian said:

I try it and I love this toolkit. As developer it makes my life easier.

# January 14, 2010 7:09 AM

defaultexp said:

Hello, You should Google it, Bing is not good

@Bertrand Le Roy: as you can see, many people don't know what is Bing. ha ha

# January 14, 2010 10:45 AM

grettir said:

That's in fact interesting tool and it does produce sometimes shocking results. It can be very useful in detecting issues a developer will not be able to detect otherwise (like some broken link buried in the depth of your pages). It definitely should be in the arsenal of any web developer.

Couple of things though to mention.

1. It will not work with IIS 6 - I tried.

2. It will not make your website significantly better SEOed, it will merely point to the errors you have to fix. But it will not tell you what you need to do make it significantly more spider-friendly.

But it is a good tool nevertheless. Whoever was developing it at Microsoft - thank you guys.

# January 14, 2010 12:24 PM

Bertrand Le Roy said:

@assafg2: I suppose you mean "shared hosting". Yes, can't see why that would matter. You can point the tool at any publicly accessible web server.

@Pieter: no, you can't, but how is that a problem?

@grettir:

1. to be clear, *the tool* won't install on IIS6, but you can point it to a server running on IIS6. Or Apache. Or ObscureWebServerThatNobodyKnowsAbout 2.0.

2. For each violation, there is a "recommended action" so I'm not sure I'm following what you're saying.

# January 14, 2010 2:21 PM

grettir said:

@Bertrand:

Thank for letting me know that it can point to IIS6.

You right, there are recommendation there after error is detected. They are usually pretty useful.

# January 14, 2010 4:58 PM

Rusev said:

what about if property is of type object? In medium trust type converter fails just before convertto because instancedescriptor requires full trurst. Any comment on this? Thanks!

# January 16, 2010 3:42 AM

Bertrand Le Roy said:

@Rusev: not sure what you're asking. Can you give precisions and maybe a repro. You can contact me at bleroy at you know where.

# January 16, 2010 3:48 AM

Victor said:

I'd like to use WPF for just this purpose, but the one thing that's holding me back is the file size. Just decoding and encoding a PNG file adds multiple kilobytes to its size. Comparing the original file to the re-encoded file in a hex editor suggests that the PngBitmapEncoder class applies no compression (DEFLATE) whatsoever.

I hope I'm overlooking something, because the image quality is great with WPF, but the resulting file size is just unacceptable for use on the web.

# January 18, 2010 6:04 AM

Bertrand Le Roy said:

@Victor: Are you sure? I tried to save the same image from Paint.NET and here are the results:

- WPF PNG:        30kB

- Paint.NET PNG:  39kB

- Paint.NET TIFF: 38kB

- Paint.NET BMP:  44kB

- Paint.NET JPG:   9kB (95% quality)

It looks to me like the uncompressed size would be around the same as BMP but it's less than 70% of that size, and it's also smaller than what Paint.NET is producing with PNG.

For size, no widespread format comes close to JPG anyways, even with high quality settings. I used PNG in the article because it's lossless and I wanted to show quality differences with as few variables as possible, but now this is done, I can probably make a follow-up post that looks at JPG compression.

# January 18, 2010 2:20 PM

Victor said:

@Bertrand: I've checked with Paint.NET, which seems to go wrong in the same way. It too increases the file size of the original file (created in Adobe Fireworks CS3) by a few kilobytes. In fact, just like WPF, it doesn't apply DEFLATE compression to the IDAT chunk of the PNG file. Then, in addition, it adds various metadata which would explain the even larger file size. Perhaps it even skips the pre-compression stage.

It's a real shame, as PNG can be quite a powerful image format if used correctly. I think I'll have to apply the compression myself if I'm to use WPF.

# January 19, 2010 10:36 AM

Bertrand Le Roy said:

@Victor: I'll follow-up with the WPF team and get back to you. I'll also write that follow-up post using JPEG. Thanks for investigating.

# January 19, 2010 3:03 PM

setiri said:

Too bad there isnt a 5 meg tfs client available. the 400 meg install is pretty dang big if you only need a source control client...

# January 20, 2010 4:16 PM

Abe said:

I have an iPAQ 3115 with the same problem.

# January 20, 2010 4:51 PM

Chris Houston said:

Hi,

I just wondered if you have managed to get this to work in Medium Trust mode as I've been told by a friend on twitter (@drobar) that it won't work under medium trust.

Cheers,

Chris

# January 22, 2010 5:02 AM

Bertrand Le Roy said:

@Chris: no, it won't work, which is utterly stupid as the equivalent APIs using GDI+ will work just fine under medium trust.

# January 22, 2010 1:49 PM

Ryan Smith said:

Looks like your cache check conditional is backwards...I had to set nocache=true in order for it to use the cache.

Or I'm drunk.

Ryan

# January 22, 2010 6:06 PM

Bertrand Le Roy said:

@Ryan: I'm afraid you're right. I mean, you might be drunk as well but that doesn't make you wrong. Fixing the code.

# January 22, 2010 6:14 PM

tomb said:

When I have myself in the same scenario I go to services and just turn off the 'Automatic Updates' service. It will resume when you reboot if you don't mess with the settings.

That popup warning is the most annoying thing ever.

# January 23, 2010 12:20 AM

Bertrand Le Roy said:

@tomb: yes, well, if your enterprise policy doesn't allow you to do that... But thanks for the tip.

# January 23, 2010 12:38 AM

Damien Guard said:

I've lost more work to Windows Update than I ever have to a compromised system...

Oh the irony.

[)amien

# January 23, 2010 1:20 AM

Joannes Vermorel said:

There are OS where it has been possible to do update for years without reboot ... at least as long you don't recompile your kernel.

# January 23, 2010 3:42 AM

Bertrand Le Roy said:

@Joannes: well, the problem is that those OS can run none of the software I need to work (and play). Plus, I've tried them all and I prefer Windows. There are OS where it has been possible to work for years without having to recompile the kernel ;)

# January 23, 2010 4:17 AM

Steven said:

My favorite is when it happens to me on a production server :)

# January 23, 2010 9:40 AM

Anonymous Coward said:

The first thing I do after installing Windows is go into Control Panel, Windows Updates, and change the blasted thing to download updates but let me decide when to install them. I got fed up waking up on Wednesday mornings to find that Windows had killed everything (especially that require hours to complete and have to restarted from scratch) in the holy name of updates.

Of course, you may have to learn to deal with all the crapware complaining your computer is at severe risk of catching on fire and being attacked by mutant ninja space aliens if set to anything other than "Let Microsoft have full control of the restart button on my computer."

It would be nice if there was another option to automatically install updates but remove the reboot nagware dialogs.

# January 23, 2010 7:10 PM

mareek said:

Why are you still using windows xp ? this annoying "feature" has been removed in vista.

# January 25, 2010 2:32 PM

Ryan said:

This is awesome stuff Bertrand.  Where might I start looking for examples to add say a textual watermark or something to the image during the resizing?

Drunk? Don't mind if I do! (glug)

Ryan

# January 25, 2010 4:10 PM

Bertrand Le Roy said:

@mareek: errr, I don't know where you got that info, but I'm running Windows 7, so if it ever went away, it's back.

# January 25, 2010 4:45 PM

Bertrand Le Roy said:

@Ryan: I'd love to blog that next. But it is, let's say, not optimally easy... Which is one more reason to blog it ;) I doubt you'll find that sort of stuff anywhere yet. Amazingly, very little has been written so far about using WPF on the server. Here's to hoping these posts can start a trend...

# January 25, 2010 4:48 PM

Ryan said:

I've been searching around...you're right...not a lot.

I'd be willing to advance as much as one American dollar to the cause if it would help. :-)

# January 25, 2010 6:12 PM

Bertrand Le Roy said:

@Ryan: Thanks. No, I don't think $1 will help much currently. Euros?

# January 25, 2010 6:27 PM

Tom said:

I recommend being VERY careful about using WPF on a production server.  According to people at MS, it wasn't designed for that role.  While fixes have been made, I really wonder if the scenario ever really graduated to supported (i.e. really tested by MS) status.  Don't just take my word for it:

forums.asp.net/.../1299963.aspx

blog.galasoft.ch/.../converting-and-customizing-xaml-to-png-with-server-side-wpf.aspx

connect.microsoft.com/.../ViewFeedback.aspx

But here's my own anecdote, since this was just so much fun:

In early 2009 I helped fix an ASP.NET based site that was working fine in a dev environment but failing in a production environment with real traffic.  The site would periodically be taken offline by IIS (due to too many repeated failures), requiring a manual restart of IIS!  (Or maybe just a recycle of the web application?  Can't remember for sure.)  It didn't take long to trace the problem to parts of the site that used WPF to render XAML to PNG.

We tried some fixes but ultimately the problem was fully resolved by banning use of WPF on the server.  Funny you should mention GDI+ being unsupported on the server, because the dev responsible for the WPF usage on the server rewrote his code to use System.Drawing (GDI+) instead, and stability problems disappeared completely.  I had suggested there might be a way to more safely use WPF on the server by isolating its use in a separate server-type process, maybe even on a separate machine eventually, but in this case he insisted on using System.Drawing instead...

It's risky to use a desktop-oriented technology in a server environment, no matter how convenient it may seem at first.  There are often nasty gotchas that WILL kill you (eventually) if you aren't totally on top of the situation.  Other examples include Office automation and desktop-intended SAPI (text-to-speech and/or speech recognition) APIs/engines.

Btw, if anyone has any links that more strongly suggest that server-side WPF is officially supported than the ones above, I would love to see them.

# January 25, 2010 9:25 PM

Tom said:

Er, read through your previous post about this and the comments...  I guess my comment still stands, I would just add a "really?" in response to your comment "*any* API in .NET is supported on the server unless specified otherwise" ... :)

# January 25, 2010 9:32 PM

Bertrand Le Roy said:

@Tom: I did not write these posts in isolation but have worked with people from the WPF team.

The links you provided all seem to use the part of WPF that would have to run in an STA thread, which is pretty much a non-starter for server use. What we're doing here is quite different and I'm certainly not saying you can or should use all parts of WPF on the server. I can and will triple-check with the team that what we're doing here is OK and supported.

Yes, really, any API on .NET is supported unless specified otherwise. There may be oversights (in which case the docs should be fixed), but you can call support and get help on any API, yes, really.

GDI+ is one of those APIs that is explicitly called out as not supported in the docs. We *know* of very real cases where it fails. Same thing for Office automation: support.microsoft.com/.../257757. As for SAPI, it's not managed code.

# January 26, 2010 12:56 AM

lucasbfr said:

I completely agree. There used to be a "prevent applications from stealing the focus" on Windows but I can't find it anymore.

Funnily enough, I have the reverse problem with the UAC: it often fails to steal the focus and I can wait for long seconds before I understand the system is waiting for me :)

# January 26, 2010 6:06 AM

Tom said:

Bertrand, thanks for the reply.  It does make sense to me that what you're doing here could be safe even if other uses of WPF may not be.  I still worry about developers coming to wrong conclusions about the safety of using different parts of WPF in a server environment, but I realize that's a tough problem to solve and happens with other APIs too.  I'll be following this issue with interest.  Thanks for writing about it!

Btw, when it comes to being supported, I think different people are probably interested in different aspects of that.  Personally I care very little about being able to call support and get help.  I care that whatever MS or third-party code I'm using works - now and more importantly in the future - and it seems more likely to work if someone at MS spends time thinking about it and making sure it works.  Thinking a little about how I've gotten this info in the past, beyond docs, blogs, and forums, samples have probably been the most useful way.  Imagine if WPF shipped with one or more samples showing how to safely use it in a server environment!  That would be a pretty strong indicator.  Of course, even samples can be wrong or get broken/deprecated. :)

# January 26, 2010 11:10 AM

Tom said:

I agree with the previous comment about configuring Windows Update to let me decide when to download and install the updates, and feel bad for those who are prevented from setting it that way.  I only give it the go-ahead once I'm prepared to stop everything I'm doing, watch it, reboot, and make sure my system still comes back up ok.

# January 26, 2010 11:25 AM

Bertrand Le Roy said:

@Tom: all good points. I may follow-up with a post clearly delineating the supported from the unsupported.

I understand what you're saying about what supported means to you. In its time, GDI was marked unsupported exactly because that testing had not been done. And sure enough, problems were discovered. In principle, supported means that it's been tested and also that you can call support. No matter what amount of testing is done, there are always unforeseen scenarios. In those cases, you can call support and they will work on finding you an acceptable workaround, or in some cases the product will get patched. In some cases the patch is private until the next version, in some cases it's public.

In any case, support is a pretty expensive thing, and the declaration that something is supported already is a strong indicator that we're committed to make it work for you.

I hope this helps.

# January 26, 2010 1:53 PM

jmorris said:

I _hate_ that 'feature'...drives me crazy. I can live with the icon in toolbar, but to suddenly have a window popup like that is invasive and particular annoying.

# January 26, 2010 4:50 PM

MowGreen said:

In Windows 7 it's rather easy to set Windows Update to " Check for updates but let me choose whether to download and install them " ?

Then one can download and install updates when one is ready to and not complain about a Default setting that was put there to protect those who are technologically enabled.

# January 28, 2010 4:16 PM

Bertrand Le Roy said:

@MowGreen: as I said in a previous comment, your enterprise policy may prevent you from touching those settings. In which case you're screwed. Plus, it doesn't change the fact that the default behavior is not acceptable: you just do not steal focus, especially if catastrophic data loss can result from it. Telling users that it's their fault and that they should just know how to change the default behavior is not an acceptable answer.

# January 28, 2010 4:48 PM

PA Bear said:

Why not avail yourself of one of the other Automatic Updates options so that updates aren't installed unless & until you're ready to reboot?

Windows Update and Automatic Reboots

blogs.technet.com/.../windows-update-and-automatic-reboots.aspx

# January 28, 2010 5:32 PM

Sam Spade said:

What is so important that you can't save your Wiki post, and then spend a couple of minutes (if that) rebooting?  You say you are using Windows 7, yes? That means you're using a new machine, not some slow Win98 clunker that takes 10 minutes to reboot.  The fact that you complain about potential "catastrophic data loss" makes me shake my head even more.  Being a Microsoft employee you of all people should know that not rebooting after patches are installed is asking for trouble - system instability and weird errors being just two of the potential side effects until you finish the update process and reboot.

# January 28, 2010 5:59 PM

Bertrand Le Roy said:

@PA bear: see comment above.

@Sam: Wowowowow! Again, blaming the user for the feature's faults. The catastrophic data loss is not caused by the user but by that dialog stealing focus, which results in it misinterpreting a keystroke that is not destined to it. The user in that case did not do anything wrong. That you can defend this behavior just boggles my mind.

What's so important you ask? Are you saying the user can't possibly be doing something that is so important that he can't reboot immediately? Let's not forget that the user is the owner of that machine, not you, not Microsoft. As such, he is the sole judge of what's important. He also is the sole judge of when is the best time to close the fifteen windows he has open and stare at his rebooting machine. I just can't stand the suggestion that the user is at the service of his computer.

"System instability and weird errors"? Again, that would be the feature's problem, not the user's. If what you say is true, which is highly questionable: I thought the whole point was to prepare the updates so they are installed during the next reboot, not putting the machine into a half-updated state, in other words an update should be transactional and should never cause instability of the system, even transitionally.

# January 28, 2010 6:19 PM

Sam Spade said:

Everything that happened occurred because you did not want to reboot after patching.  But if you don't have the ability to change your WU settings (thereby removing the cause of your complaint) because your *employer* has decided not to give you that choice, then you don't own the machine and you should be respecting your employer's implied wish that you reboot as soon as possible after patching - 15 windows open and a few minutes inconvenience notwithstanding.  Just get it done.  

In the end, Windows Updates occur *once a month* unless there is a critically urgent out of band patch issued, so let's get this back into perspective - its not a big slice out of your life.  And I would expect your system's security to be more important than the inconvenience of having to close those 15 windows and reboot.  Heaven forbid you should accidentally open a web page that exploits a vulnerability that has not been properly patched because you haven't rebooted - you'll have a lot more to worry about than closing 15 windows then.

Also, leaving the option "download and install" enabled means that we must assume that the "owner" of the computer *wants* it to be patched as quickly as possible - that implied wish must be respected.  Allowing the prompt to reboot to remain hidden behind whatever other program is running until the user happens to notice it is there is a breach of that wish.

To protect you from accident data loss whilst at the same time respecting the implicit "patch as soon as possible" requirement that is "download and install", WU ensures you are given 10 minutes warning before reboot.  That is more than enough time for you to close those 15 windows and prepare for a reboot.  Yes, you may be away from your computer for more than 10 minutes, but if you are at risk of "catastrophic data loss" then it is your responsibility to ensure that your work is being saved automatically in case anything from electricity failure, to system crash, to WUs being applied, happens.  WU cannot protect you from all eventualities.

In closing, the choice you made vis a vis WU settings comes with certain trade-offs - and the download and install option comes with the tradeoff that you may have to reboot at a time that is not convenient to you.  Such is life.  

If you don't have a choice vis a vis WU settings, then you must abide by your employer's wishes and reboot as soon as possible - again, such is life.

# January 28, 2010 7:46 PM

David Taylor said:

It's OK for very simple stuff Bertrand - but obviously will not allow you to do anything interactive with a forms based ASP.NET page - where you are better creating the content within an iframe.

Dave

# January 29, 2010 3:44 AM

Bertrand Le Roy said:

Ah, but iFrames are fixed size and a lot less flexible. For interaction, you could use JSONP calls.

# January 29, 2010 3:54 AM

Town said:

"It’s now impossible but you’re on your own to implement it." - I hope you mean "not impossible", otherwise there hardly seems much point! :)

# January 29, 2010 6:30 AM

me said:

This is very interesting. I hate the fixed size of iframes. Thanks

# January 29, 2010 6:49 AM

Harry Waldron said:

Hi Bertrand - Yes, I can relate to the lock down of settings due to corporate group policy security controls.  Likewise, I have seen WU gain focus as the primary Windows task when reboots are delayed (I believe it repeats reboot requests every 10 minutes or so).  And if you miss seeing the pop-up, you can indeed keying an "R" on your wiki page would start the reboot process.

I see your experience as a valuable "lessons learned", as what I usually do is to:

(1) Reboot ASAP - so that the new settings can take place immediately and you avoid instability issues that Sam Spade wisely noted.  Still, I've been there and done that in delaying a reboot due to time sensitive work I had to accomplish.  However, where possible always reboot right away.

(2) When you see the Microsoft Update shield or prompts to reboot, SAVE, SAVE, SAVE right away to prevent lightening from striking twice again.  I also start shutting down anything that's non-essential in preparation for a reboot.

In the corporate world, reboots can take 3-5 minutes before your system is "usable" sometimes due to the many things that may get automatically loaded that you don't have start-up control for.  I've learned to work with the system over the years  

# January 29, 2010 8:22 AM

mhildreth said:

Question about the xml namespace inclusion- I've tried this a couple times, but the document won't validate with the W3C validator. I'm using xhtml transitional, so I would think this would be ok, but I don't understand why.

I saw in the futures package, that the client-side templating engine uses similar syntax with the sys:stuff, so I'm sure this was a consideration for the team. Can you offer any insight as to the implications of adding the custom namespace and attributes?

# January 29, 2010 9:07 AM

Nick Mayne said:

Are you still looking? Or have you guys already hired?

# January 29, 2010 9:21 AM

Nick Mayne said:

Oh and if you are... when are you looking for them to start? as that could stop me applying :(

# January 29, 2010 9:37 AM

OmariO said:

the only problem is possible interferencing between script and css of the two pages.

If only MS had developed the idea of viewlink element behaviors :(

# January 29, 2010 12:07 PM

David Jacob Jarquin said:

Yes, you can append a script dinamically.

var script = document.createElement("script");

script.src = "mydomain.com/service.aspx

script.type = "text/javascript";

var head = document.getElementsByTagName("head")[0];

head.appendChild(script);

function CallBackJS(json){

 alert(json.length);

}

---------------------  service.aspx ------------

string cb = Convert.ToString(Request.QueryString["callback"]);

Response.Write(cb + "([1,2,3,4]);");

-----------------------------------------------

# January 29, 2010 1:07 PM

Bertrand Le Roy said:

@Harry: I get that, but I think it's beside the point. This is a lesson that users should not have to learn. The feature should be designed so that it never puts user data at risk. That could be accomplished by simply not stealing focus. Extremely simple fix.

# January 29, 2010 1:20 PM

Bertrand Le Roy said:

@Nick: sorry, the position has been filled. Thanks for your interest and don't let that stop you from considering contributing ;)

# January 29, 2010 1:21 PM

Bertrand Le Roy said:

@Town: thanks for the heads up. I fixed the post.

@mhildreth: yes, the validity of namespaced attributes has been in a fuzzy state for a while but it's now clearer (from HTML 5 for example) that it's not valid and that the W3C folks are firmly opposed to it. They are pushing their HTML 5 data-* attributes as a replacement, which I think is wrong as they don't offer the kind of application-level re-basing of attributes that XML prefixes allow. It's a shame if you ask me, but that's the way it is. I still like it because I find it very clean.

This being said, it's a very valid concern and it would be easy to change the syntax so that it uses the new HTML 5 data-* attributes, or even a JSON blob inside of the script tag. I can prototype that if you're interested but it should be easy enough to do.

@OmariO: yes, that's true, and it can actually be an advantage in some cases. If you do need isolation, yes, you may want to consider an iframe instead. And if you need the isolation without the bounds of the iframe, you can try CSS isolation (weblogs.asp.net/.../css-isolation-there-has-got-to-be-a-better-way.aspx) or a script sandbox (http://websandbox.livelabs.com).

# January 29, 2010 1:50 PM

Bertrand Le Roy said:

@Sam: I am the judge of what "as soon as possible" means for my work. I will reboot eventually if I get a notification and I try to not start anything new. I just want to finish what I'm doing.

What if, for example, I'm on a remote meeting or in the middle of a presentation? Should I just tell my audience that sorry, but it's important that I reboot right now, just in case I accidentally browse to a compromised web site in the middle of my Powerpoint presentation? They can wait 3-4 minutes, can't they?

Oh, and this long-running task that has been going on for 2 hours in the background? That's fine, it can start over.

I'm sorry, those apologies just don't stand scrutiny.

And as you point out, I may actually not be in front of my desk and if the applications I use do not auto-save (like a wiki or almost any web app), forcing the reboot is not acceptable. "It is your responsibility to ensure that your work is being saved automatically" you say. How is it my responsibility that the application I'm using does not auto-save?

And if I am at my desk, stealing focus from me is not acceptable either.

Sure, there might be an electricity failure, which is why we have laptop batteries and UPS. And are you saying that the OS behaving as a power failure is acceptable?

Blaming the user for a badly-designed feature is not the right answer.

# January 29, 2010 2:08 PM

Hans Gruber said:

You didn't have time for a reboot but you had time to ignore it for a few hours?  Really?

It sounds like you chose to ignore the reboot prompts for hours and didn't save your work.  It was human error, but you want to blame your operating system for your own actions.  

Blaming the designers for not bothering to reboot is not the right answer either.

Just out of curiosity...is your machine locked down via corporate policy that does not permit you to change your Windows Update settings or you have just not bothered to change it?

# January 29, 2010 4:24 PM

A said:

Badgers, what badgers?

# January 29, 2010 5:31 PM

Bertrand Le Roy said:

@Hans: and more user blaming... I've answered all that several times. Please read above comments.

# January 29, 2010 6:09 PM

Edward said:

@Bertrand - re Karl Seguin's comments. I totally get where you're coming from on this. With regards to Karl, I'm afraid he's just jumped on the Scott Bellware Not-Invented-By-Microsoft bandwagon that's so vogue in certain cliques. The problem is, whilst he tries to ride the smarter than thou high horse for not using the MS toolchain, he's nowhere near as talented or as interesting as Scott, who's a real pragmatist.

# January 29, 2010 6:12 PM

Harry Waldron said:

As a follow-up I wanted to share that I agree that WU/MU gaining control (focus) might be something worth improving.  In our corporate email and calendaring systems at work, popup reminders also work the same way (changing app focus).  I can definitely empthasize, as it's another example of interupting work as you've described.

I'm guessing that MS implemented this notification technique because many folks leave their PCs on all the time and fail to reboot their systems daily. Still, it'd be nice to have a little more flexibilty to maybe allow one notification with an option to shutdown further re-notifications (in case you are working on something critical).

As Sam Space wisely shared earlier, MU/WU is trying to tell users that they absolutely need to reboot ASAP.  There are partially updated services that Windows can't restart.  They only way they can be relaunched is through a reboot.  

Ignoring a reboot for a long period of time will leave one unprotected.  For example, only after rebooting after MS08-067 were users protected from Conficker. I worked with some companies and users during that outbreak.  Many thought they were okay in installing the patch -- but there were still vulnerable until they rebooted.  

Secondly, there's even a chance that stability errors could be introduced for a highly involved update that might create comprimise Windows integrity.  This is rare though as usually most postponed updates still work out okay.

Mainly wanted to share that there is a highly beneficial purpose to rebooting asap.  If you can't, try to save critical work and work toward that goal soon.  I plan for an immediate reboot each Patch Tuesday or when out-of-band releases occur.  It gets them out of the way and I know my system is protected and the new changes are now affected.

Your post provides good awareness and constructive advice for the need to potentially improve the process further.  Security protective changes aren't always fun, easy, or even accurate processes.   They indeed interrupt out work, but help us in a very dangerous world as well.

# January 30, 2010 11:04 AM

Nick Mayne said:

Oh it was my fault... i took too long concidering if it would fit in after i came back from travelling. nevermind... that will teach me.

I will still contribute, but iff your hiring again - keep me in mind. :)

# January 31, 2010 11:45 AM

mhildreth said:

I agree that using the namespace prefixing is a cleaner solution. This is the third or fourth thing I've heard about HTML5 that sounds like a step backwards, but I'm interested to know more. Do you have any recommendations for information sources?

Also, can you provide more information on the JSON blob approach? I'm not sure what you mean by that.

# January 31, 2010 4:11 PM

Bertrand Le Roy said:

@mhildreth: I wouldn't say a step backwards because it was never valid in the first place, but failure to move forward certainly in this case. Information sources include the W3C mailing lists.

Using a JSON blob, you'd do something like this instead:

< script type="text/javascript" src="AspNetBootstrap.js">

"Remote.aspx": {

 bar: 42,

 baz: "glop & co"

}

</ script>

# January 31, 2010 7:57 PM

nulty said:

Couldn't read every word but I'm currently learning PHP as my first programming language. I got the impression from a few comments that its a good way to introduce yourself to scripting. I've finished a web design course and figure I'd be better suited to developing. Any pointers on entering the industry?

# February 1, 2010 9:47 PM

Tom Gröger said:

Bertrand,

Thanks for this very interesting article, it has finally given me a reason to brush up my knowledge of transversal waves and how everything is connected ...

# February 2, 2010 5:05 AM

Thanigainathan said:

Nice article. There are more advantages of using this over IFrames .

Thanks,

Thani

# February 2, 2010 6:54 AM

Chris Quirke said:

I also advocate and use "download updates but let me decide when to install them" but it doesn't really work as you'd expect.

What I want to do, is download updates as soon as they are available (in case an exploit blizzard makes it impossible to do so later, in a worst-case scenario) and then later decide to initiale the install.

What actually happens, is that installation is merely postponed until the next shutdown.

I found out about this accidentally in XP.  I'd UNchecked every pending update, and yet still saw the Shutdown button changed to Shutdown and Install Updates.  

If I'd deselected all updates, what is being installed at this point?  Yup, everything that I'd explicitly set to NOT install - as judged by repeating the "yellow shield" UI and noting that everything I'd deselected, was selected again.

The shutdown UI is woolly, too - in XP, there's a link to override the visibly-modified Shutdown option, but what happens if you choose Restart instead?  The UI doesn't indicate updates will be installed, nor is there a UI to avoid that if that is to be bypassed.  

Same applies to system shutdown or restart that is mediated via other UIs, e.g. Ctl+Alt+Del Task Manager.

I now read that Windows 7 has (by design) broken the ability to shutdown without installing updates.

Then again, at least we're better off than we would be under Google, who silently push updates whenever they see fit, with no user control, and boast that as an advantage.  

Mind you, Microsoft has already pushed that far with file system auto-fixing, NTFS bad sector remapping (duplicating what hard drive firmware tries to do already) and forcing compatibility settings after auto-detecting what it thinks is an application failure (even when this is not so, e.g. a user-cancelled install).  

In all these cases, changes are automatically applied, poorly logged, and there is no ability to Undo.  We know these things are bad practice... unless the user is considered so trivial or stupid that the code is "smarter" and should override them.

# February 2, 2010 10:52 AM

Leon said:

It's like the Load method in JQuery API.

# February 2, 2010 5:46 PM

Bertrand Le Roy said:

@Leon: jquery.load won't work cross-domain, which is kind of the whole point.

# February 2, 2010 6:25 PM

Abhinav said:

Really Good Article

# February 3, 2010 12:29 AM

Martin said:

Hello, this was a old blogg post but i give it a try anyway.

We have a similar problem at our production servers. We can't recreate the problem in our test environment so we are fumbling in the dark here. The thing is that our problem only occurs to some customers. They log in and after the redirect they are logged out right away. Seems to be some kind of session problem. I have 2 questions.

1. It seems like the problem started when there was an upgrade on IE8. Could the IE-client affect this in any way?  

2. In the past we had a problem that the memory on the servers disappeared and the application crashed. After a while we found that it was the response.redirect that was causing the problem. The solution was to rethrow the ThreadAbort exception to the framework (we catched it before). After this workaround was applied the memory problem disappeared. But if we use Response.Redirect("~/default.aspx", false); don’t we get the same problems with threads that are not aborted correctly and eating our memory?

# February 8, 2010 4:59 AM

Bertrand Le Roy said:

@Martin: I have no idea how IE8 would affect this, but it seems like you're programming by coincidence here. The point of aborting the thread is not to force the framework to clean up after you. The point of the thread abort exception is to stop the lifecycle of the request where it happens. It's rather heavy-handed and is mainly there for back compat with classic ASP. You should use the override that doesn't abort the thread and figure out what in your code is leaking memory. Tools you can use for that include debuggers and profilers.

# February 8, 2010 1:36 PM

narendra said:

i am facing the browser compatibility with asp.net menu control. menus are well working with IE6 but with IE8 and like chrome menus are not working properly.

# February 9, 2010 4:22 AM

Bertrand Le Roy said:

@narenda: what kind of problem are you seeing? What doctype are you using? Did you apply any custom styles?

# February 9, 2010 2:08 PM

narendra said:

Bertrand Le Roy:

 In IE8 the text of root menus are displayed but the text of child menus are not displayed. and in google chrome the root as well as child menus are not displayed. It totally get disturbed. I have applied autoformat provided by microsoft

# February 10, 2010 3:25 AM

Bertrand Le Roy said:

@narenda: what about the doctype? If you are using a supported doctype, then you should contact support.

# February 10, 2010 3:50 AM

narendra said:

i am using original doctype thst asp.net uses.

but if i remove that doctype and add following code then it works.

Context.Request.Browser.Adapter.Clear() 'vb.net

Is this way fine to use?

# February 10, 2010 5:15 AM

Bertrand Le Roy said:

Ah, I see. That is actually a different issue, which is that when that version of ASP.NET was built, these browsers didn't even exist, and the choice that was made was a little too conservative: the assumption was that it was unlikely to work on unknown browsers so it is being rendered downlevel. This was not a good choice, and certainly not one that is valid now that all browsers have more reasonable standard compliance.

So in those cases, by default, a downlevel adapter is used to render the menu. The menu should actually work, but using postbacks instead of client-side JavaScript: when you click an entry that has children, the page posts back and shows you the submenu in place of the top-level menu. Not a good experience I agree.

What you're doing here is a little brutal (you are removing all adapters, not just the one for Menu) but you are in essence applying the right fix. If you want to be a little less heavy handed, just remove MenuAdapter. This can be done with a browser file: msdn.microsoft.com/.../ms228122.aspx

Also, the Menu was completely redone in ASP.NET 4.0 to use semantically correct markup and to work in all modern browsers reliably.

# February 10, 2010 2:39 PM

Maulik and Chaitali said:

It is posible to display submenu using

remove your old !DOCTYPE

and add <body scroll="no"> insted of <body

# February 11, 2010 1:42 AM

Bertrand Le Roy said:

Please stop advocating removing the DOCTYPE: bad, bad bad idea.

# February 11, 2010 1:48 AM

Kevin Pang said:

I tend to use ctrl + shift + escape for this particular reason (I can do it with one hand). It's not the exact same thing as ctrl + alt + delete, but usually when I use either command it's to kill a process off so it works just as well.

# February 14, 2010 3:51 AM

Kevin Pang said:

I tend to use ctrl + shift + escape for this particular reason (I can do it with one hand). It's not the exact same thing as ctrl + alt + delete, but usually when I use either command it's to kill a process off so it works just as well.

# February 14, 2010 3:51 AM

RichB said:

It's called the Secure Attention Sequence. There would be no sequence if it was just a single key.

# February 14, 2010 4:18 AM

Ludovic said:

How would that help you login with one hand if the next screen is going to ask for your password? Unless (*gasp*) you either have a weak password that doesn't require the SHIFT key, or you have no password, or some kind of automatic login?

And more importantly... what are you doing with the other hand anyway? :)

# February 14, 2010 11:05 AM

Damien Guard said:

It was deliberately chosen as something you couldn't press by mistake given that it's original task was to soft-reboot the system.

You *can* press it with one hand, just use the ctrl and alt on the right side of your keyboard...

[)amien

# February 14, 2010 11:50 AM

Aaron said:

The tablet/laptops given to PDC 2009 attendees has a CTRL+ALT+DEL button. :)

# February 14, 2010 11:57 AM

Jim Wang said:

While we're at it, let's add an "any" key :)

# February 14, 2010 2:51 PM

Bertrand Le Roy said:

@ludo: Two keys I can do with one hand, three, even on the same side of the keyboard is more difficult and frustrating. And what about people with a handicap? (I'm sure (at least hope) this has been considered but really, I don't know how it's handled)

And what I'm doing with my other hand is none of your business.

@Damien: yeah, that's pretty obsolete now though, isn't it?

@Aaron: is that so? Sweet! I need one of those.

@Jim: actually, all joking aside, I think you're absolutely right, just add an "any" key and be done with it. Why not? Seriously.

# February 15, 2010 12:53 AM

Anna said:

Thanks a lot - it helps!

# February 17, 2010 10:12 PM

Maddie said:

WOW!!! is this really that interesting......no I don't think so...I love school projects its wht got me to this site because I have to do a project on waves(tidal)....someone help(specifically: Bertrand Le Roy)

# February 18, 2010 9:32 AM

Scott Nettetlon said:

Hi, I dont want to apply the patch as I suspect many of my users to the site will not have. So I need to make sure it's going to work in a non-fixed version of IE8.  (does this make sense?)

So I set the Z index to 100 and that solves the IE8 issue.

It has always worked in FF but not in Chrome.

Any idea why setting the z index does not fix the Chrome issue?

# February 18, 2010 2:22 PM

Bertrand Le Roy said:

@Scott: this is a *server* patch. Your users don't need to be patched. This is *not* patching IE, it's patching ASP.NET.

# February 18, 2010 2:43 PM

Bertrand Le Roy said:

@Maddie: I'm sorry but I think I would be helping you more by telling you to do your own research. It's the whole point of school projects. :)

# February 18, 2010 2:45 PM

Bertrand Le Roy said:

I updated the post to reflect the current supportability of this.

# February 18, 2010 7:57 PM

Joel @ MMCC said:

You state:

“The fastest way is to create a BitmapImage from the file on disk and to specify the target width and height as part as image decoding:

[code]BitmapImage bi = new BitmapImage();

bi.BeginInit();

bi.UriSource = photoPath;

bi.DecodePixelWidth = width;

bi.DecodePixelHeight = height;

bi.EndInit();This is very efficient because the codec can scale while decoding and render only those pixels that will be in the final image.[/code]

“Unfortunately, this won’t do here because in order to compute the size of the thumbnail, we need to know the dimensions of the original image: we want the thumbnail to have the same aspect ratio as the image it represents. So we need to read the image — or at least some of the image — before we can determine the size we want for the target.”

This is [i]not[/i] true! You don’t have to specify [i]both[/i] the [b]DecodePixelWidth[/b] [i]and[/i] the [b]DecodePixelHeight[/b]! You [/i]only[/i] have to specify [i]one or the other[/i] to do auto-resizing in WPF on image decode! If you specify only one, [b]the other will [i]automatically[/i] be set to whatever value is needed to [i]preserve the aspect ratio!![/i][/b]

So, if you need your thumbnail to be, oh, say, 160 pixels wide and you don’t really care how tall or short that makes it so long as the aspect ratio is preserved, just do:

[code]bi.DecodePixelWidth = 160[/code]

and [/i]don’t[/i] set [b]bi.DecodePixelHeight[/b]! [i]Voila!![/i]

Conversely, if your layout requires a consistent height but the width can be anything, set [i]only[/i] the [b]DecodePixelHeight[/b] but [i]not[/i] the [b]DecodePixelWidth[/b]!

As for why WPF is so much faster than GDI+, I’m pretty sure that it’s because WPF leverages your GPU, including Pixel Shader up to 2.0 if using .NET Framework 3.5. .NET Framework 4.x and up will leverage Pixel Shader 3.0 if your graphics card or integrated motherboard graphics chipset supports it.

With these in mind, it would be interesting to do benchmarks showing the use of the first WPF technique (BitmapImage with setting just DecodePixelHeight or DecodePixelWidth), and also how different graphics cards affect the results on all of the WPF techniques as opposed to GDI+.

I find it fascinating that a reasonably modern gaming graphics chipset can now have a measurable impact on the performance of a [i]web server![/i] Even if no monitor is connected to it!

# February 18, 2010 9:51 PM

Bertrand Le Roy said:

@Joel: you misunderstood me. You are right that if you specify only one of the two dimensions, the other will follow to keep the aspect ratio. That does not solve the problem at hand though, which is to constrain the thumbnail to a square of predetermined dimensions. I do care that it's not too tall AND not too wide.

For example, if the original image is 200 * 1000 and I set the resized width to be 150, the resulting thumbnail will be 750 pixels heigh and will destroy my layout.

If you want to do a benchmark using dimensions that are only constrained in one direction, sure, please do. I'm not super-interested in that case but apparently I'm not representative of 100% of the possible usage of these APIs. I suspect you'll find that WPF in that case is even faster (and dramatically so as it can apply the resize when _loading_ the image instead of loading it and then redimensioning it in memory, saving processing power and memory).

About hardware acceleration, I asked the WPF team, and their answer was that those APIs do NOT use hardware acceleration. Unfortunately.

# February 18, 2010 11:58 PM

Bertrand Le Roy said:

Oh, and one more thing. I remember when the first managed APIs for Direct 3D came out, I had the exact same thoughts as you: it would be fascinating that a graphics card could dramatically improve a web server's throughput. Unfortunately it never really happened, which is puzzling to say the least.

I guess somebody could build a graphics library for ASP.NET using DirectX, at least in principle. That would rock.

# February 19, 2010 12:00 AM

Piyush said:

I have a JSON object and i want to display it- the timezone i want is the IST - rite now its showing UTC - can anyone tell me that how can i get the time in IST from the JSON object

Thanks

# February 19, 2010 5:22 AM

Bertrand Le Roy said:

@Piyush: unfortunately, there is no direct support for that in JavaScript or in the Microsoft Ajax library. One thing you can do is add the offset yourself, like this: date.setTime(date.getTime() + timeZoneOffset) where timeZoneOffset would be 5 hours and a half.

# February 19, 2010 2:17 PM

Bertrand Le Roy said:

@Piyush: if you're going to show the date in IST for all users, you might want to consider sending down a string instead of a date in JSON. That is, unless you actually need to manipulate that date client-side.

# February 19, 2010 3:15 PM

Gauthier Segay said:

You can actually do it on original pc at keyboard (without thoses windows keys, expletives removed), it require just two fingers.

I actually find scroll lock pretty usefull in excel and pause sometimes usefull in text console.

Old thinkpad layout (no windows keys) and model M keyboard FTW!

# February 22, 2010 2:53 AM

PS3 Controller said:

It is true that with the PS3 slim you can now use hdmi-cec to control the PS3 with the TV remote. This is quite an interesting and comprehensive posting I must say.

# February 22, 2010 5:59 AM

Bertrand Le Roy said:

@PS3 controller: yes, it's true: www.avsforum.com/.../showthread.php That is, if you have the right tv, etc. But yes, if you have a TV supporting that, I guess the Harmony remote should even be able to take advantage of it...

# February 22, 2010 2:15 PM

Aejaz Ahmad said:

what should i do ?

I am making a website in Asp 2008 and I want to specify two buttons on the master page which are back page(should be going on back page)and Next page(should be going to next page)in all aspx page of my web site so please help me ang tell me the exact code which can easily work on my whole website by masterpage.

# February 23, 2010 2:51 AM

Bertrand Le Roy said:

@Aejaz: I recommend you ask this question on the ASP.NET forums: http://forums.asp.net/139.aspx

# February 23, 2010 3:31 AM

Tim Hardy said:

I agree with you Bertrand.  Windows Update has caused me a tremendous amount of frustration over the years.  It is a perfect example of a lack of user focus in design.  The user becomes a stumbling block or annoyance in a process that places the machine first - a common theme in many MS UX designs.

There is no good reason whatsoever for a machine to ever decide to reboot itself while it's being actively used by a user, PERIOD.  I've been in the middle of rendering videos, playing competitive games online with friends, writing difficult emotional emails to friends, and had all of the above violently ripped out of my hands by the stupidity that is windows update.  

Sure, there's an option to slightly improve the experience, but, as you've stated, why the heck do I have to do that?  Even with the alternative, I've still had bad experiences where I was forced to wait for it to finish installing on shutdown when I absolutely had to get on a plane or something.  I repave machines, get new machines, etc and often forget to change the update options until it bites me.  To restate what you've already championed, why is a good experience the responsibility of the user?  Who the heck is writing this crap?  And MS wonders why people are moving to the Mac in droves.  I was recently on a 15 member development team where over half the developers (pure MS shop, Visual Studio, the whole nine) are using Macs now.

I love the quote from one of the above posters - "WU cannot protect you from all eventualities."  It would seem it's woefully inadequate at protecting the user from itself.

# February 23, 2010 5:48 PM

Kenny said:

Geez, the reference type combined with the 0-based month index just caused me to lose an hour of my life that I'll never get back. Thanks for the post!!!

# February 23, 2010 9:44 PM

Matthew Chaboud said:

Contact you for any bigger-scale use of the idea?

Really?  It's not particularly novel.

I found this post because I wanted to see if anyone was yet marketing 2D glasses made exactly this way.  

Perhaps super-anaglyph/circular-polarized/diffraction-grating/active-shutter all-in-ones could be marketed to people who want to make sure that they never see any stereoscopic 3D?  People would have to eye-patch for lenticular array 3D, or do the '80s flip down thing for one eye.

To be fair, Avatar was one of the best executions of theatrical stereo 3D that I've seen, but it still bugged me.  Until we have projected holography, we'll be stuck with having to do our best to figure out (from apparent focus) where we should be looking to avoid getting a headache.

That said, with references to "unobtanium" and lines like "where's my god-damn cigarette,"  maybe the Avatar headache had nothing to do with the 3D...

# February 24, 2010 5:19 PM

Bertrand Le Roy said:

@Matthew: do you have a reference to another implementation of this?

# February 24, 2010 5:24 PM

wagneripjr said:

I agree with Bertrand. It's a total disrespect to the user when system steals focus, it's the worst thing I've saw in an OS.

The blinking task bar, is the good way to notify the user that the system needs his attention, and if the user decide to ignore it forever, it should stay there forever.

Humans not computers, should ever have the last word.

How about we start a campaign to make our voices heard!

# February 25, 2010 1:03 PM

Hannah said:

Hi Hi,

I have a really strange problem to do with session variables.

I have an asp.net page that sets a few session variables. On my development machine (localhost),  I do a postback and the session values are still populated.

When I Reload the page by clicking on the url bar and pressing enter the session variables are still there.

However when i deploy this page to a webserver, the page still retains the session values when doing a postback, but as soon as i click the url and press enter the session values are lost (where the ispostback = false)

But when i press the refresh button the session variables are present (but i do get a popup warning me that the page data needs to be resent!)

i am running IE 7, and the webserver is iis6 what am i doing wrong?!

please help x

# February 27, 2010 10:57 AM

Bertrand Le Roy said:

@Hannah: that sounds a lot like you're getting a cached version of the page. The easiest way to be sure what you're getting when refreshing comes from the server and not from the browser's cache is to use CTRL+F5. But even then, you might get the page from a proxy's cache or from server cache. For that, I'd check the caching policy on the page.

# February 27, 2010 1:36 PM

andrew said:

"not supported for use within a Windows or ASP.NET service." YES, but "ASP.NET service" == Webservice, so it's 100% to use it in asp.net application/website.

And i don't care if wpf is supported or not, if it works i will use it, great job!

# February 27, 2010 7:18 PM

Bertrand Le Roy said:

@andrew: well, they mean ASP.NET in general, not just web services.

# February 28, 2010 1:32 AM

Rubén Aláez said:

Hi, we have a similar problem. We have some session variables, but when the page redirects to Mastercard page to make the payment, all session variables are lost.

After the payment, Mastercard page redirects to our page (I don't know what kind of redirect are they using) and we lost all the session variables.

Is there any solution for us?

Best regards and thank you very much.

# March 2, 2010 6:30 AM

Bertrand Le Roy said:

@Rubén: are you using the overload with false as the second parameter?

# March 2, 2010 2:42 PM

Rubén Aláez said:

Yes, I've tried with parameter "false" but I get the same result, all session variables are lost.

We're doing something like this:

Response.Redirect("migs.mastercard.com.au/vpcpay + URLParams, false);

At this point the customer makes payment and this page redirect to our page (one of the parameter that we send is the next page "&AgainLink=http:\\www.OtherPage.aspx"). When our page tries to read session variables we get an error because all session variables are null.

# March 3, 2010 11:27 AM

Bertrand Le Roy said:

@Rubén: then I don't know, sorry. You should probably contact support.

# March 3, 2010 1:21 PM

MysteriousJohnny said:

This is an interesting discussion which I found after searching the net in an impotent rage after losing unsaved work to a sudden involuntary shut-down for mandatory updating.

What those who blame the victim seem to miss is that whilst you might have a deep interest an understanding of the workings of Windows 7 (or what have you), it is a mass market product. Thus, there will be users who do not understand (or care) what boxes need to be checked or files updated. They just want to write an email to their aging father or describe school fete for a newsletter.

When the computer shuts down without notice and they lose their information are they to blame? Are they at fault for not being the right kind of user?

Windows (and Microsoft) survives for reasons of encumbrance alone. Say what you like about OSX - it makes the user feel like they deserve to be using the software.

# March 7, 2010 9:34 PM

Joannes Vermorel said:

Very interesting. CodePlex would be really nice if it's not too much a bother for you.

# March 10, 2010 4:44 AM

Henri said:

Please create a CodePlex project for it. It makes it easier to get the source.

# March 10, 2010 4:54 AM

Andrei Rinea said:

Pretty slick.. :)

# March 10, 2010 5:02 AM

shapper said:

Hello,

This is great.

I often use System.IO when managing files on a CMS in my MVC project.

I think you should create a Codeplex project.

I think it is easier for everybody to follow and contribute with suggestions, code, etc.

Any plans for that?

Cheers,

Miguel

# March 10, 2010 8:43 AM

Alex said:

Definitely put in codeplex! This is really a cool idea!  

Also the more examples/scenarios and documentation you can put in the code plex documentation tab, the better and easier for users to grasp it who are not as familiar with fluent and lamda expressions (like me).

Any plans to tackle other .NET APIs and make them fluent as well?

# March 10, 2010 9:06 AM

Aaron said:

Codeplex.  ALWAYS!

THanks, nice work..

# March 10, 2010 9:36 AM

Paul Knopf said:

That is so cool! I wonder how many other set of APIs can benefit from a fluent api. stream readers/writers?

# March 10, 2010 9:47 AM

vishwaraj1 said:

I have installed setup.exe. and after that do i will have to install vs_setup.msi also as somebody have told me. i tried it many times but nothing happens and the installation window closes after 1 min. what may be the reason. Please guide me.

# March 10, 2010 9:50 AM

Pete Blair said:

Very cool, sure makes working with System.IO nicer and maintains continuity with the other code. Every time I needed to work with System.IO I feel like I am back coding in .net 1.1

I would say toss it up on Codeplex, you will get more feedback if people don't always have to come back to this post and put up a comment.

# March 10, 2010 10:11 AM

Justin said:

This is seriously cool, working with System.IO is always such a beat down, nice work.

# March 10, 2010 10:58 AM

Chris said:

Great post .... we are experiencing the odd IE6 behaviour where the select control shows thru if the page is scrolled. There are no background images on the page however. Setting the iframe size to 100% W and H or trying to set the iframe offset to match the scroll offset makes no difference. anyone come across other fixes?

# March 10, 2010 11:52 AM

Hightechrider said:

Nice.  

Any reason you called it .Select() instead of .Where() or perhaps Find()?  Looks more like a LINQ Where() operation than a projection.

Instead of throwing InvalidOperationException for null arguments,  ArgumentNullException might be more appropriate.

Also any reason for using HashSet<string>() instead of List<string> or even instead of IEnumerable with lazy execution?

e.g.

public PathCollection ChangeExtension(Func<Path, string> extensionTransformation)

{

  var result = _paths.Select(path => new Path(path)).Select(p => p.ChangeExtension(extensionTransformation(p)).ToString());

   return new PathCollection(result, this);

}

When dealing with very large directories it would be nice if it didn't enumerate the whole structure unless it needs to.

# March 10, 2010 11:58 AM

michael herndon said:

I like Fluent Interfaces for the readability

would it be possible to do the following for the code sample above?

var exts = List<string>() {

     ".avi",

     ".mv4",  

     // etc

};

Path.Get(args[0])

       .Select(p => exts.Contains(p.Extension));

# March 10, 2010 12:03 PM

Bertrand Le Roy said:

@Chris: setting to 100% won't work. The whole point of the frame is that it should be the exact right size. What you need to do is capture the scroll events and move the frame with the page.

But at this point in time, it might be a good idea to drop IE6 support altogether if you can afford it.

# March 10, 2010 12:40 PM

Bertrand Le Roy said:

@vishwaraj1: looks like you have a corrupt file somewhere. Try re-downloading the files. If that fails, contact support.

# March 10, 2010 12:41 PM

Jeff said:

Why not Ms-PL? BSD makes this hard on agile product teams,

# March 10, 2010 1:27 PM

Peter Strong said:

Apologies if I'm missing something obvious but I can't figure out how to use a client template with an input such as a SELECT drop-down, ie where there's no "value=" attribute on the tag. I would like to bind data to a mix of inputs so the user can then edit the data, including SELECTs. I can't find any examples on the net of using templates with this sort of input field. Thanks in advance.

# March 10, 2010 1:51 PM

Joerg Battermann said:

Awesome! A Codeplex site would be nice!

# March 10, 2010 2:06 PM

Phil said:

Interesting and I hope it catches on fire in the community.

# March 10, 2010 4:03 PM

JeroenH said:

I second Hightechrides's suggestion. Select() should be called Where(), because you're really filtering here.

# March 11, 2010 6:42 AM

Sean Kearon said:

Like it a lot!  (+1 for CodePlex too.)

# March 11, 2010 7:51 AM

christolo said:

CODEPLEX!!

# March 11, 2010 11:30 AM

The Dude said:

I don't know about anybody else but this works just fine for me:

I have a WebForm (Form1.aspx) that is redirecting to Form2.aspx.

In Form1.aspx I have:

protected void Button1_Click(object sender, EventArgs e)

{

Session["ID"] = 24;

Response.Redirect("Form2.aspx");

}

In Form2.aspx I have:

protected void Page_Load(object sender, EventArgs e)

{

int id = Int32.Parse(Session["ID"].ToString());

}

The id variable sets to 24 in WebForm2.aspx.

So all I can say is... "It works for me."

# March 11, 2010 11:35 AM

Henrry said:

Excelent

# March 11, 2010 2:47 PM

Bertrand Le Roy said:

@Dude: yeah, that's the point, it *seems* to work, but it doesn't always. It works when you already have stuff in session, because your already have the session cookie. When it fails is when the session is getting created right before the redirect. That example of yours should definitely use the overload.

# March 11, 2010 7:25 PM

Bertrand Le Roy said:

@Peter: I wrote a post that hopefully answers your question... weblogs.asp.net/.../binding-a-select-in-a-client-template.aspx

# March 12, 2010 2:32 AM

Matt said:

I just love this new ASP.NET AJAX functionality.

# March 12, 2010 3:51 AM

davethieben said:

how about just a fingerprint scanner?

passwords in general are so 20th century.

# March 12, 2010 10:46 AM

Bertrand Le Roy said:

@Dave: in some companies, such as mine, fingerprint readers are forbidden because they are easier to fool than a strong password. There's one on my laptop but I can't use it.

# March 12, 2010 1:05 PM

Bertrand Le Roy said:

Thanks for all the kind comments. I made some updates, more to come later.

First, I'm actively looking into putting it on CodePlex but it's not going to be easy.

I renamed Select, but not to where, because that would indicate filtering the current set. I renamed and refactored it to be overloads of GetFiles, GetDirectories and GetFileSystementries, which is what it really is.

I did rename the Filter method on the collection class to be Where though because that is much closer to the existing Where semantics.

I updated the sample after Michael's suggestion.

@Hightechrider: I'm using a HashSet because I don't want duplicates in the sets. Now any lazy version of this would require some more work. Maybe later.

# March 13, 2010 3:16 AM

Bob Cravens said:

I appreciate that the wrapper makes the System.IO methods more fluent. The problem that I have with System.IO is that it is very common to need to test code that serializes to disk. It is easy enough to create an interface so that these methods can be faked. Because your wrapper calls directly to the System.IO methods, it will make testing more difficult. Would love to see your wrapper use an instance of an ISystemIO interface instead of the real System.IO.

I do appreciate the fluent nature of the work.

# March 13, 2010 8:48 AM

VbNetMatrix said:

I would say that:

if (SomeObject.foo) {

IS a common mistake in Javascript.

when your object is numerical and take the value ZERO,  if (SomeObject.foo) would return FALSE.

Consider this for exemple when trying to position the mouse in Opera versus Internet Explorer:

if (window.pageXOffset) {  //All browser except IE

} else { //IE all version up to 8

}

in the case where window.pageXOffset got the value 0,

this would fail.

instead we should always use [typeof] when trying to find "undefined" or non existent property

like:

if (typeof(window.pageXOffset) != "undefined") {

} else {

}

and don't forget, != is always faster then ==

# March 13, 2010 8:41 PM

Bertrand Le Roy said:

@Bob: totally agree :) With an already done mock version was what I was thinking.

# March 14, 2010 12:14 AM

Bertrand Le Roy said:

@VbNetMatrix: yeah, which is why I said "the shortest way to deal with this, and also the one that best expresses your intention of checking if an object is safe to use is [...]", I even emphasized "object" to make it obvious you should only do this with an object. That is also why I added the !== example afterwards and warned about implicit conversions such as "" == 0.

I also wrote a post on using typeof with undefined: weblogs.asp.net/.../Define-undefined.aspx That was in 2006.

# March 14, 2010 12:35 AM

Peter Strong said:

That's great. Many thanks for taking the time to write a post to explain it.

# March 15, 2010 11:13 AM

Peter Strong said:

Thank you for this Bertrand. Where should I be looking to see this kind of thing explained in some documentation?

# March 15, 2010 11:17 AM

Bao Tcheng said:

Hey, don't you work for Microsoft.  Microsoft probably paid people millions dollars to think how to ensure people don't accidently reboot their systems or otherwise yuk up what the are working on, which is a pretty good idea to me.  Microsoft created CTRL+ALT+DEL.  Not every machine is a windows machine so hardware manufacturers like to support as many machines as possible.  Stop your belling aching and tell your peers at Microsoft to get work on mapping those keys to useful functions instead of creating new "useful" keys like windows and menu buttons keyboards. But then, Microsoft can't charge hardware manufacturers for the privilege of using those useless keys so I guess that probably won't happen. Talk about glass houses.        

# March 16, 2010 10:23 AM

Mr. Pingo said:

I downloaded and installed, but no "Connect to Team Foundation Server" option appears under the Tools menu of VS2008.  Please help.

# March 16, 2010 3:33 PM

Bertrand Le Roy said:

@Bao: newsflash: CTRL+ALT+DEL hasn't been rebooting the machine for a few iterations of Windows. The Windows and Menu keys (which I find really useful and use all the time) are not "new", they date back from 1995. That was 15 years ago. Overall, I have no idea what you're talking about but it looks like you're reading this from the past somehow. If that's the case, I would advise you invest in Google and Apple stock.

# March 17, 2010 12:29 AM

Bertrand Le Roy said:

@Peter: couldn't find it. Hence the post.

# March 17, 2010 2:29 AM

Steve said:

Thanks...really helpful post!

I haven't needed to use a multiple select element (aka listbox), but how would this work for that? I tried binding sys:value on the select element to an array of values but nothing was selected on render.

# March 17, 2010 12:59 PM

Bertrand Le Roy said:

@Steve: I think in this case you'd need to do it the hard way. Bind the sys:selected property of the options instead. To read selected items, scan the options collection and add to an array as you find selected options.

# March 17, 2010 2:07 PM

Elvin said:

So is WPF supported in ASP.NET or not?

# March 20, 2010 9:33 PM

Bertrand Le Roy said:

@Elvin: no, it's not (see update 2)

# March 21, 2010 12:06 AM

Lee Richardson said:

Pingback from Client Side AJAX Applications in SharePoint 2010 - Part 3 rapidapplicationdevelopment.blogspot.com/.../client-side-ajax-applications-in_3617.html

# March 21, 2010 10:32 PM

Angus said:

Eric Lippert's blog is excellent - but I don't see any JavaScript (at least not on page 1)

# March 23, 2010 7:20 PM

Joannes Vermorel said:

Thanks for taking the time to make it "more" available to the community!

# March 26, 2010 3:34 AM

Ben said:

Nulty, unfortunately it is extremely hard to enter the industry as someone who only knows PHP.  For some time now, PHP programmers have been a dime a dozen.  The only work you will find for "PHP only" these days are low-paying two-week hack jobs on Craig's List.

You'd be better off learning ASP.NET and VB.NET (or C#) with Visual Studio and then entering the industry that way.  Instead of $12 an hour with PHP, you'd be making at least $25 an hour with the .NET Framework (or Java for that matter).

PHP is going to ingrain a lot of bad habits as a programmer... I'd recommend starting with VB.NET and ASP.NET instead.  The route is more rewarding to learn as a beginner, and easier to monetize as a real career than PHP.

# March 26, 2010 2:24 PM

Axel said:

Hi folks!

You can add support for many additional formats (about 30, including most camera raw formats) though my WIC-enabled Codec Pack:

www.fastpictureviewer.com/codecs

All codecs are free-threaded (so they will play nice in Win7 and 2008 R2 server environments, Windows Services, etc) and most are also multi-core and SMP aware, so they are quick.

# March 26, 2010 9:50 PM

Rob Conery said:

Hey you could always use Mongo and NoRM :). Shoot I would be happy to commit if Bradley would let me :):). Oh the irony...

You hit the nail on the head - NoSQL is about prying brains of the DB as "where to put the data". SQL is great for answering questions - not so great and marshaling heavy write environments.

NoSQL rocks at that - it's what Cassandra is really good at - heavy write environment that scales out almost literally with the flip of a power button.

I would give anything to be in the meeting when you and Renaud discuss this...

# March 29, 2010 4:59 AM

paul.vencill said:

100% Bertrand, I couldn't agree more that querying and storage are two separate things, and should be treated as such.  I think that in most cases, it's a convenience for folks to try and use one solution for both.

One approach, I think, could be to do something similar to the Command-Query Separatation thing that has been getting a lot of press lately.  If Orchard simply separated the interfaces for querying vice storing, then the 1.0 impl. could use a single solution, but consumers could use the IoC container to swap that out later for separated solutions, e.g. an object db for storage and something like Lucene for indexing and querying.  

# March 29, 2010 10:09 AM

lucasbfr said:

Funny, we're precisely working on a CMS here, and this is one of the many open questions at this time :)

# March 29, 2010 10:29 AM

Morten Nielsen said:

You're supposed to spell it "NOSQL" (o capitalized) because it's not about "no SQL" but really "not only SQL". Unfortunately they chose an unfortunate abbreviation and the "no" part really caught on.

# March 29, 2010 10:29 AM

Mitsu said:

Codeplex of course ! and nice job Bertrand :)

A few comments:

- I like the mix of multiple informations in a single class: File, Directory, Attributes, etc.

- A lot of static methods are wrapped in property getters (like CreationTime for example). This new property syntax is great but it gives me the feeling that the property is stored and will not move. Calling GetCreationTime() makes clearly understand that the value is retrieved at each time. Maybe you should keep it in cache or make a clearly visible Update feature. Personnaly I would prefer to have all informations retrieved once during constructor call for example and then remain immutable.

- Why a PathEnumerator class instead of using yield return ?

- If I am right, the PathCollection is based on an IEnumerable<string> and never stores "children" of the collection... Actually, if it's not a collection, maybe you should rename it. Why don't you write PathCollection methods like CreateDirectory() in a Linq way ? You are internally using a HashSet<string> that makes your transformation result being stored in memory. If you are using a Linq query instead, and then pass it create the new PathCollection(q, this) you will get a real deferred execution of your pipeline and that's what we think it is when using your FluentPath syntax. (well that's what I thought is was :) )

# March 29, 2010 10:59 AM

DBJ said:

There is one little "devilish detail": RDBMS-es can not handle the ammount of traffic todays RIA are faced with.

Rest assured, there is plenty of people that will "die trying" to prove the opposite of NoSQL movement. Who will in essence try and implement two-tier systems using browser+cloud. They do represent a lot of big customers and they can force into existence things like "SQL Azure" ;o)

Thanks: DBJ

# March 29, 2010 11:03 AM

Bertrand Le Roy said:

ALL: I managed comments in my sleep this morning and it's just possible that I deleted a few by mistake. Apologies and don't hesitate to re-post if that's the case.

@Rob: yeah. There are two ways you can move a hive. You can kick it and run, or you can put a protective suit on, sedate the bees with some smoke, and then move the hive. The former approach sure is fast. If you follow my drift ;)

@Morten: I stand corrected. Thanks for the tip.

# March 29, 2010 12:51 PM

Laurent Kempé said:

Funny to read about that Bertrand! Cause that's exactly something we did in our whohive project which should be announced very soon. It uses a separation between the querying and the storage.

# March 29, 2010 4:53 PM

Bertrand Le Roy said:

@Mitsu: thanks for the excellent comments.

The mix of multiple types under a single class is just monkey see monkey do from jQuery and the HTML DOM itself.

I think I disagree about keeping what's under the properties immutable. Seems to me like that would be the  most surprising of the two. Is there a rule that a property should return the same value if got twice without sets?

I started with yield return but if you try it I think you'll see why it doesn't quite work with the fluent pattern. Didn't try that hard though.

I agree I should rename as it's not a collection. Pure laziness on my part: I started building it as a collection and then walked back and didn't rename.

Deferred execution would be really cool, I agree. Not something I'm very likely to have time for anytime soon though.

# March 29, 2010 6:09 PM

Rob Conery said:

@bertrand unless there's an even bigger hive that is expecting you to move the hive in question for them...

# March 29, 2010 7:57 PM

Bertrand Le Roy said:

@Rob: you seem to be deluded that a hive can expect anything. Oh well, I guess this great analogy just broke down.

# March 29, 2010 8:03 PM

Mitsu said:

Cool !

No, there's no rule on properties :)

But if you look at the IO Api returning FileInfo for example, we have loading methods and then classes that are keeping data. File information are shared and can be very accessed extremely concurrently, that's also why, in this case, I prefer having a snapshot of it.

Moreover, if the property is accessed many times just because of the code or maybe the data binding of a list, you could have some data refreshed while scrolling the list. You can consider it to be an advantage..or not.

# March 30, 2010 4:13 AM

rbirkby said:

All this talk of Hives reminded me that you missed the Windows Registry off your list :-)

# March 30, 2010 5:25 AM

John said:

Add one more file type - the serialization dump.  I recently seen a project where the authors take a very complex/composite object, serialize it, GZip it, and then store the resulting lump in one field of a SQL Server table.  

# March 30, 2010 9:27 AM

Bertrand Le Roy said:

@Mitsu: fair point about concurrency. Maybe you could address both scenarios by having a lock method of sorts on the path class. Or yeah, maybe you're right and it should just be purely immutable from the start. Yeah, I'm beginning to think you're right.

Actually, adding file monitoring events might be an interesting extension to the API, which could be a solution to the rare cases where you want the info to remain accurate.

# March 30, 2010 1:39 PM

Bertrand Le Roy said:

@rbirkby: yeah, the list wasn't supposed to be exhaustive. But yeah, you're right, we all use that every day without knowing it.

@John: ew. I hope they didn't have to access it frequently.

# March 30, 2010 1:42 PM

Dusan said:

Right now I do think this is an meta pattern. Which always is an "gratuitous mind-bender" indeed ;)

An concept, on which family of concepts can be based.

And each member of this family provides base for some particular design and implementation.

I am sure you are thinking of next "FluentPath" release, exhibiting a new interface mechanism, based on a new design, that is based on the CallStream concept ;)

--DBJ  (aka : Dusan)

# March 30, 2010 9:13 PM

davidebb said:

A little crazy, but interesting; I hadn't seen that!

Here is a completely different approach that would support square brackets instead of parenthesis (why?  I don't know, why now?!)

class CallStreamFactory {

   TextWriter _dump;

   public static CallStreamFactory CreateDumpCallStream(string dumpPath) {

       var dump = File.AppendText(dumpPath);

       dump.AutoFlush = true;

       return new CallStreamFactory() { _dump = dump };

   }

   public CallStreamFactory this[string s] {

       get {

           _dump.WriteLine(s);

           return this;

       }

   }

}

and then:

var ignoreMe = CallStreamFactory.CreateDumpCallStream(@".\dump.txt")

   ["Wow, this really works."]

   [DateTime.Now.ToLongTimeString()]

   ["And that is all."];

Ok, the ignoreMe part is funky, but you were supposed to ignore it... :)

# March 31, 2010 1:45 AM

Bertrand Le Roy said:

@david: your version is interesting because it's less convoluted, and also because it does allow one thing that is also allowed from JavaScript: having other methods hanging off the call stream object.

# March 31, 2010 1:58 AM

Bertrand Le Roy said:

@David: oh, and there's no good reason in your version to keep stuff static. Rename that factory to CallStream, make the Create method the constructor and you've got something a lot saner than my version...

# March 31, 2010 2:03 AM

shafaqat309 said:

Hi

I did the same steps but still not working.

I have downloaded, patch for vs 2008, vsdoc.js file and also i have referenced it on aspx page but still no success.

# March 31, 2010 2:10 AM

Bertrand Le Roy said:

@shafaqat309: I'd contact Jeff King on his blog post (linked) or contact support.

# March 31, 2010 2:27 AM

Roland said:

A few days ago I came across the Eric White's post about functional programming. When I was reading your code, I said to myself "This kind of notation leverages functional aspects of C#".

Just a thought: I ignore what f# offers, but does f# not offer a more natural approach for that kind of notation?

To me, that pattern should be included at the core of the MS framework.

blogs.msdn.com/.../FP-Tutorial.aspx

# March 31, 2010 6:12 AM

Dusan said:

For the C# variant of the CallStream Bertran has provided the key implementation idiom :

   public delegate CallStream CallStream

   (Action<object> action, object options = null);

Which is the closest one can get to the CallStream  "functional" nature. No classes, please ;o)

--DBJ

# March 31, 2010 9:52 AM

Mikhail said:

I am not a functional programming expert but it seems to me that you are re-inventing monads.

stackoverflow.com/.../help-a-c-developer-understand-what-is-a-monad

# March 31, 2010 1:34 PM

Bertrand Le Roy said:

@Roland: yes, that should be pretty natural in F#.

# March 31, 2010 2:51 PM

a guy said:

I somehow lost the sessionstate configuration line in my web.config and found that to be the problem in my case

# March 31, 2010 3:47 PM

Dusan said:

@Mikhail : Please proceed to http://dbj.org/dbj/?p=514,

for the main article, and yes monads are mentioned in the comments too. And, no, I am not reinventing monads ;)

Some people like the "very monad like syntax" that CallStream, gives them while using JavaScript. I would not be suprprised to see some "monadic blogs" using CallStream and JavaScript, very soon ...

--DBJ

# March 31, 2010 7:07 PM

workmad3 said:

@dbj: It's your form of unsubstantiated and generic comments that are what really detract from the NOSQL ideas currently. And the fact that the comment is wrong doesn't help your case :P relational databases that are constructed properly are just as scalable and capable of handling the data volume as any other solution. It's just that properly constructing a relational database is HARD, and requires that you are modeling relational data (not hammering some other form of data into a vaguely relational schema)

@bertrand: nice article. I've been really enjoying the current crop of NOSQL articles that are promoting hybrid systems and analysis of what a data store actually requires over the 'use NoSQL!1 RDBMSs aren't scalabel!!1!' form of comments that initially plagued the uptake :)

# April 1, 2010 3:38 AM

hanvo said:

Couldn't get ConfirmButtonExtender/ModalPopupExtender/Validation to work together. Luckily, I found this site. Anyway,

This works great but lyon IE. On FireFox, the message box doesn't show anything but the word "undefined" How can I can fix this? Thanks.

# April 1, 2010 1:57 PM

Bertrand Le Roy said:

@hanvo: this is a very old project that would be done completely differently today. Feel free to use an modify the code, but I'd encourage you to use the ACT controls instead, and file bugs there for issues you find.

# April 1, 2010 2:33 PM

paul.vencill said:

Nice tip, Bertrand.  I knew about the serverside comments, but I usually forget about the regex-based search and replace capability in VS. Thanks!

# April 2, 2010 7:26 PM

Phil said:

This is a nice post. I knew that HTML comments are sent to the client but I never thought much about the effect of HTML comments on page-size until now. Yeah, HTML comments should be considered bad practice unless you specially need it like for proof-of-concept.

# April 2, 2010 8:56 PM

David Taylor said:

Funny Bertrand that I have been using ASP.NET for almost 10 years (since July 2000 preview) and completely missed this feature.

You are more of a hero than you know by posting this.

One of my biggest frustrations is when I insert a comment or just temporarily comment something out using the <!-- --> syntax and get this type of message:

Literal content ('<!-- test -->') is not allowed within a 'System.Web.UI.WebControls.DataGridColumnCollection'.

However the <%-- test --%> syntax works in these situations!

Thank you so much!

David

# April 2, 2010 9:17 PM

Richard Spiller said:

Thanks. Great tip. I actually had no idea there was such a thing as server comments. This is sort of a peripheral comment but maybe it will save some mouse clicks. CTRL+SHIFT+H gets you straight to Replace In Files. The same pattern works with CTRL+F/CTRL+SHIFT+F for Find/Find In Files. Hope this helps.

# April 2, 2010 9:44 PM

Dave Ward said:

I've actually had a post like this one sitting in my drafts for awhile; glad to see someone posted it.

The reason I held off is that I was unsure how much (if any) performance impact the ASP.NET comment tag has at runtime.  I wanted to be sure I wasn't suggesting to reduce the payload size at the expense of equal or greater penalty in HTML rendering time.

Have you tested that, or know if it's significant?

# April 3, 2010 1:24 AM

Bertrand Le Roy said:

@Dave: I haven't tested it but I'm pretty sure you only pay an extremely small price at compile time. All the parser has to do is skip those guys. And the parser is going to run on your page anyways. So...

# April 3, 2010 1:41 AM

barney ruble said:

I had no idea. Thanks for the tip

# April 3, 2010 1:54 AM

Mehmet Latif Uzunel said:

Thank you for your tip. I'll use server comments more often when I need to comment anything.

# April 3, 2010 2:40 AM

atagaew said:

Thank you for your tip.

In my opinion, during development process you should never leave commented tags or code whichever important they might to be.

Its ok, if you commenting your code with some nice explanation.

But if you want to save something for the future and commenting it out - its a wrong way.

Much better to store everything in the source control system. This will let you always return to the working version and make your code cleaner

# April 3, 2010 5:17 AM

outcoldman said:

Thanks... I didn't know it... Very usefull.

# April 3, 2010 1:23 PM

Bertrand Le Roy said:

@atagaew: I'd actually encourage server comments: they're harmless. Plus, many people don't know to look in source control.

# April 4, 2010 12:52 AM

fmorris0 said:

It sure would be nice if the built-in chord CTRL+K/CTRL+C that I use after highlighting a set of lines I want to comment out would produce the type of comments you recommend instead of the ones it does now.

# April 4, 2010 9:16 PM

Bertrand Le Roy said:

@fmorris0: errr, it does: I just tried it in VS 2008, and the code I selected got surrounded by <%-- --%>...

# April 4, 2010 11:35 PM

ramin said:

using code betwin tag head

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

# April 5, 2010 1:13 AM

joss said:

hi, but what is that rare case it does not work. i also tested with framework 1.1 and 2.0 and it works fine. using the thread aborting redirect() does not cause the session cookie lost.

# April 5, 2010 12:14 PM

Bertrand Le Roy said:

@joss: it seems to work in a development environment because most of the time, if you don't delete your cookies, you already have a session cookie, so it doesn't manifest itself (a redirect won't make you lose existing cookies, it will just prevent new ones from getting created during that request). In other words, your users are likely to hit it before you do, which is the worst situation. Just use the non-aborting overload.

# April 5, 2010 1:57 PM

Daniel said:

This kind of talk can only com from someone who has not used the iPhone a lot.

Talk to Chris Sells and see what he has to say.

The iPad will change everything, and I am surprised that you (who I consider a bright guy!) don't see it.

# April 5, 2010 3:57 PM

Henrik Nystrom said:

Just remember to avoid replacing any IE conditional comments that you might be using!

# April 5, 2010 4:50 PM

Bertrand Le Roy said:

@Henrick: yes, one more reason to run the replace occurrence by occurrence. I guess you could have a more elaborate regex that handles it...

# April 5, 2010 4:55 PM

Saratoga Sam said:

An iPad is not a large iPhone, it is a large iPod Touch!

# April 5, 2010 6:10 PM

Dave said:

Troll bait indeed!  Most of the critique is about the iPhone and not specific to the iPad.  Also make sure the comparisons are valid:  You are complaining about size yet the iPad is roughly the same size as a netbook.  A good complaint about the iPad is the missing (front) camera which netbooks often come with - do I have to buy another device in a year to get that?  

# April 5, 2010 10:16 PM

Rick Strahl said:

I'm no Apple fan, but where are these fabled netbooks that are feature rich AND cheap that you're talking about? Most that are in the iPad's price range are still underpowered, barely able to handle video much less HD video (even the ones with newer non-integrated video cards). I would love to buy a small, lightweight Win7 machine under $500 that has decent video support and touch screen but there are not many options out there that I can find except a rare fire sale or boxes that are WAY more expensive...

# April 5, 2010 10:21 PM

Steve said:

I don't get how because 'you work for M$' that you have to take an anti-Apple stance

As someone in technology I welcome innovation.  How about you learn to judge on merit, useability, what people enjoy to use because it's innovated instead of some 'I work for M$' in some sort if drone like response?

Truthfully (and I like Microsoft), I have seen much 'copying' disguised as 'innovation' that lacks innovation - many clones coming from more innovated minds.

Again though, why take shots at companies taking chances and being innovative?

I personally hopes MS learns to take a page out of Apples playbook and make products that are positive user experiences for a change

# April 5, 2010 11:53 PM

Bertrand Le Roy said:

@Daniel: I appreciate that you'd consider me bright, but you're doing it in a way that seems to imply I'm suffering from some kind of mental illness here.

@Dave: I'm not complaining. Thanks for pointing out the lack of camera, I had somehow missed that one. Please realize that you do not have to buy anything, now or in  a year.

@Rick: straw man. If you read carefully you'll see I'm not claiming the good netbooks are cheaper than the iPad.

@Steve: it seems like you didn't understand the spirit of that post, and sadly I think I need to explain. Scott posted a very one-sided piece where he dissed netbooks but was willing to be very forgiving for the iPad's faults. That looked like double standards to me. So I facetiously took the systematic counterpoint to that, which should be clear from the fact that the text is almost a search and replace of Scott's text where iPad and netbook are swapped (I even used the word "plagiarize" to refer to it). The last sentence hammers that point by jokingly asserting that such an opinion is necessarily one-sided, which should not be surprising according to the cliché opinion that Microsoft employees are drones. Smiley face should have been an additional clue.

My real opinion is much different. I think the iPhone was a fantastic innovation that changed the game profoundly and shook a stagnant market into an entirely new phase. I also think Tablet PCs were a great idea that came too early. Kudos to Jobs for waiting and figuring out what the exact right time was, and double kudos for preparing the market to it through the iPhone. That is precisely what he is brilliant at. Finally, I think that Win7 did take a page of Apple's playbook and did focus on a positive user experience. And it worked. Expect to see more of that.

Now no matter how good I think the iPad or iPhone are (and I do think they are nice innovative gadgets), I do not like the mass hysteria surrounding them, I do not like to be told that I'm an idiot for not buying a product, and I know for sure that I do not need those products. I'm professionally interested by them and check them out, but I don't buy them because I have better uses for that money. I apologize for that.

# April 6, 2010 12:40 AM

Chandra said:

I couldn't agree more. I myself use iPhone, and have LOTS of disappointment during the first week of using it. Sometimes, I feel like to put back my SIM card to my 4 year old WM 5. Can't wait for Windows Phone 7, hope it can be a serious competitor to iPhone OS.

# April 6, 2010 12:57 AM

Laiq Ahmad said:

I want to check that is the div display is block or none with css anybody can help me

# April 6, 2010 2:58 AM

Bertrand Le Roy said:

Ah, forgot an important one: I'm quite puzzled that what they are trying to do by having arbitrary dictatorship over all app store content looks like your worst nightmares about Microsoft, but because it's Apple, nobody seems to care that much.

# April 6, 2010 3:01 AM

Daniel said:

Bert, Your last comment is indeed a good point. But not related to the iPad product itself.

As to what Rick also wonders; could you please point to any decent netbook that does things anything near as good the iPad does?

# April 6, 2010 3:22 AM

Bertrand Le Roy said:

@Daniel: I think it is. Whereas on the iPhone you could blame the phone operators for the lock-down and excessive control: it's business as usual coming from them, if the iPad is a computer, that excuse goes away. Please note that there are examples of app stores that do not suffer from such limitations.

I especially like the peer-review system of the Xbox indie store: nice, innovative and decentralized but still allows quality to float to the top.

It's clearly deliberate from Apple and their behavior towards Adobe and Google only confirms that they are after control and elimination of their competition with this tactic.

As for decent netbooks, http://tinyurl.com/yaxokq6. Personally, I liked the PDC laptop www.netbookreviews.net/.../aspire-1420p and friends who have it seem to like it too. I don't own one myself, because I'm more a full laptop guy myself. I like my screens and my keyboards large.

# April 6, 2010 3:51 AM

joss said:

i am clearing cookies from browser. check the following code. session is never lost. may be those rare cases are coming out because maximum compilations for restart.

- sessiontest.aspx

       string cookieVal = Request.Headers["Cookie"];

       Session["var"] =

           "<br>Previous val: <i>" + Session["var"] + "</i>" +

           "<br><br>Time: " + DateTime.Now +

           "<br>IsNew?: " + Session.IsNewSession +

           "<br>SessionID: " + Session.SessionID +

           "<br>Cookie: " + cookieVal;

       Response.Redirect("sessionredir.aspx");

- sessionredir.aspx

       string cookieVal = Request.Headers["Cookie"];

       Response.Write("<br>Session Var: <b>" + Session["var"] + "</b>");

       Response.Write("<br><br>Time: " + DateTime.Now);

       Response.Write("<br>IsNew?: " + Session.IsNewSession);

       Response.Write("<br>SessionID: " + Session.SessionID);

       Response.Write("<br>Cookie: " + cookieVal);

# April 6, 2010 3:52 AM

Andrei Rinea said:

Not only do HTML comments make your HTML fatter but they can also leak sensitive business information to possible hackers.

# April 6, 2010 8:51 AM

joss said:

i have tested a lot of scenarios and could not come up with one that session is lost after redirect that ends the response(aborts thread).

i have cleared cookies from the browser before testing each scenario.

i have used iis5.1 + ie6 and iis7 + ie8.

so you should review the article and point out what are those cases (if still exists) that causes session lost?

at least response.redirect that ends the response do not cause session lost. so, please clarify your assertion to avoid confusions.

thanks in advance

# April 6, 2010 9:00 AM

Daniel said:

Bert: You forgot to publish your test scorecard:

tuut.atdt.nu/.../b352a1d6af672df394ba59adcd7d9ad8-480.jpg

;-)

# April 6, 2010 9:04 AM

Marty McPadden said:

I have an Asus netbook I will be looking to unload as soon as my 3G iPad arrives. I am an Apple fan and own multiple Apple products including a 27" iMac, 15" MacBook Pro and iPhone. I'm also expecting a new AirPort Extreme Basestation to arrive today to replace my old NetGear 802.11g router. Although Apple does charge a premium for their products, it's money well spent, IMHO. The stuff just works. While I don't expect my iPad to replace my MacBook Pro, I do expect it to be able to handle about 80 to 90 percent of my routine mobile computer needs. I'd rather have something that works over something with every feature under the sun and works intermittently. The key to the iPad is apps and Apple does that part really well.

# April 6, 2010 11:48 AM

Mike S said:

With a little cash to play with, I looked at the iPad, the new Dell mutli-touch notebook, and the new HP Touchsmart laptop.  I've got to say - no USB and not being able to run more than one app were absolute iPad deal-breakers for me.  I ended up with the HP (which runs Win7) and am absolutely thrilled.  And, I still got it for under $1000.  I'm more than happy to pay extra for the 500GB hard drive, user accounts (it's a home machine), a robust chipset, and my 4GB of ram.

Disclaimer - I'm a .Net architect/developer by trade

# April 6, 2010 1:49 PM

Bertrand Le Roy said:

@Daniel: :)

@Marty: Wow, that is so impressive!

# April 6, 2010 1:58 PM

Bertrand Le Roy said:

@joss: I wasn't making that stuff up, it came from actual verified support cases. But you are right that I didn't verify it since I wrote the article 6 years ago. Thanks for pointing it out. I just did verify, and it seems like the cookie is now being set even when redirecting with the thread abort. Something must have changed in the code. I'm investigating and will update the post accordingly.

# April 6, 2010 2:07 PM

KYankee said:

After digging for hours, I found that the worker threads in the app pool was set to 4. I set it to 1, and now it works fine. My issue was that my web page would find the session variable, and sometimes it wouldn't. By hitting F5 it would almost be every other time it would have the session var, but with only having 1 thread, it's there every time. Makes sense to me. Just took a long time to figure that out.

# April 6, 2010 2:18 PM

Bertrand Le Roy said:

@KYankee: ah, but that's session affinity in a web garden, that's a whole different issue. When using a web garden or web farm, you need to switch to a different session store than the default in-memory one.

# April 6, 2010 2:23 PM

Alex Lowe said:

Bertrand - seriously, you are puzzled that people have a negative perception about Microsoft and not about Apple? Right or wrong, Microsoft has not done much for public perception in the last 10-15 years. I mean...anti-trust, security issues galore, sub par products like Windows ME, etc. I won't even go into the negative perception no one talks about (scorched earth policies on licensing in the enterprise circa late 90s/early 00s). As they say, perception is reality (even if it is outdated).

Microsoft could do the same thing (draconian app store) if it had the perception that Apple has.

# April 6, 2010 3:12 PM

Bertrand Le Roy said:

@Alex: uh? Err, no, I'm not puzzled by that. Amused yes, puzzled no: I quite understand how the manipulation works. What I am puzzled about is your comment, which looks like it justifies the following logical fallacies (but maybe I misunderstood you):

- Microsoft did it, so it is OK for Apple to do it too.

- because some shady acts from Microsoft have been exposed in past years, everything Microsoft does is suspect.

- they say "perception is reality" so it must be true.

- Microsoft could do the same thing if it had the perception that Apple has, so it follows that they would and that Apple is justified in doing it.

# April 6, 2010 3:48 PM

joss said:

thanks for your attention Bertrand. so it is a good practice to not abort thread (there are bugs around, blogs.msdn.com/.../subtleties-of-c-il-codegen.aspx) but what if required? what if we do not want the rest of events in the page not fire? so a feature like response.end becomes a bad practice in that case. hope its deprecated in next versions of framework... :S

# April 6, 2010 5:06 PM

Bertrand Le Roy said:

@joss: depends on what you're trying to achieve, but you can usually refactor to eliminate the need to abort the thread. The easiest (but not necessarily the cleanest) is to set a flag to neutralize further treatment.

I don't see that being deprecated. It's still there for classic ASP compat.

# April 6, 2010 5:15 PM

p.o.d. said:

I can see the truth in the topic above. I am iPhone user more than 1 year and completely satisfied with this gadget but if I want more than a phone, I don't think I'd move to iPad. Only for show off I think. Besides I'm crazy for touchscreen technology and like iphone's elder brother.

# April 7, 2010 2:50 AM

Alex Lowe said:

@Bertrand - You said

"Ah, forgot an important one: I'm quite puzzled that what they are trying to do by having arbitrary dictatorship over all app store content looks like your worst nightmares about Microsoft, but because it's Apple, nobody seems to care that much."

so I took that to mean exactly what you said. It sounds like you meant that you were amused from your response to my comment though.

I'm not saying this line of thinking is correct or ok. Perception is reality for many people though so right or wrong - it is. Perception doesn't justify anything but it definitely is a factor in how people respond to the action or inaction of an entity. I wouldn't want Microsoft to do what Apple is doing with regards to the AppStore nor would I think it is ok.

My whole comment was a reaction to you being puzzled by the fact that someone would treat two different entities differently based on how they behave. Sounds like you weren't puzzled but found it amusing so my comment is what now puzzles you. =)

# April 7, 2010 9:16 AM

Ryan Heath said:

Or use something this: omari-o.blogspot.com/.../aspnet-white-space-cleaning-with-no.html

While removing unneeded whitespace you could perhaps remove unneeded comments as well ...

I have not tried it, but its on my 'todo-research-list'.

// Ryan

# April 7, 2010 11:40 AM

Bertrand Le Roy said:

@Alex: yeah, you got me. :) No offense meant by the way, just being playful with this whole thing.

# April 7, 2010 12:39 PM

Bertrand Le Roy said:

Scott responded to my response:

scottw.me/.../ipad-vs-netbook-rebuttal

His main argument is that an iPad is "simply an alternative to a compromised computing experience".

That is true, but more accurately it's a differently compromised alternative to a compromised experience.

Choose your compromise I guess. Again, this post was just meant to humorously provide the opposite point of view (which is not necessarily mine) to restore some balance.

# April 7, 2010 5:36 PM

Roland said:

As I was reading along, I must admit I was a little bit scared: "My God, so many stuff to handle in order to expose feed :|".

However, the most usual case seems easy to achieve. Does it mean you provide a default implementation of IFeedBuilderProvider, IFeedQueryProvider and IFeedItemProvider?

# April 8, 2010 2:40 AM

Laurent Kempé said:

Hi Bertrand

I guess when you say "declare that you want your content exposed as a feed and you’re done." that you also have the need to IFeedItemProvider for your data model. Otherwise how does the mapping works?

Cheers

Laurent

# April 8, 2010 2:42 AM

Bertrand Le Roy said:

@Roland and @Laurent: I suppose I could have been more explicit. We provide at least one default implementation of each interface. All you have to do is Register in most cases.

The cases where you'd have to do your own mapping would be for unusual content types.

Most of the times, you won't have to do that because your content type will be built from basic parts, such as the body part, which the default implementation should be able to handle just fine.

# April 8, 2010 2:59 AM

Bertrand Le Roy said:

(and that's work you'd have to do anyways if you didn't have Orchard to help)

# April 8, 2010 3:04 AM

Dusan said:

http://dbj.org/dbj/

There are CallStream parts 2 and 3 posted.

If anyone is interested ...

Thanks: Dusan

# April 8, 2010 6:11 AM

Laurent Kempé said:

@Bertrand: Ok, I got the idea of mapping now. Thanks

# April 8, 2010 8:40 AM

NoFear said:

I get a "Viewstate failed MAC validation" error in firefox (works in IE) after I add one or more history points and click on a link that does a response.redirect in the server-side click handler. I can provide sample code to anyone willing to assist.

# April 8, 2010 1:47 PM

Bertrand Le Roy said:

@NoFear: that's probably because of that weird behavior of Firefox regarding the hash URL encoding. It would require some investigation but it's possible that they fixed it and that broke code that was counting on the wrong behavior. I'll investigate.

# April 8, 2010 2:01 PM

Bertrand Le Roy said:

No, they still haven't fixed it and show no intention of doing it under the dubious excuse that it would break the code that works around their bug.

Ah, actually are you still getting that error if you don't create the history points?

# April 8, 2010 7:56 PM

nmarun said:

Bertrand, simply brilliant. Tried and did see the comment not getting to the end user.

Arun

# April 9, 2010 2:21 AM

Stephen said:

This is a great post.

It got me thinking about all those comments in css files.

Any suggestions on how to keep them visible locally, but not when they get downloaded?

# April 9, 2010 10:39 AM

RichardD said:

Nice tip, but the pattern's not quite right. Try it with this comment:

<!--

My super-secret password - don't let anyone see this:

12345

-->

# April 9, 2010 12:36 PM

Bertrand Le Roy said:

@Stephen: you can always serve your CSS from an aspx file, the browser won't care, but you'll lose all IntelliSense and stylesheet smarts from VS if you do that so I would recommend against it.

What I would recommend is to use a minifier such as the Ajax Minifier (aspnet.codeplex.com/.../40584) as a build task to create comment-less and minified versions of your script and CSS files.

@RichardD: Easy: "". This is not a security feature. You'd be crazy to put super-secret anything in a comment or source code. Super-secret stuff belongs in an encrypted blob.

# April 9, 2010 1:54 PM

RichardD said:

I wasn't suggesting that you should put secrets in a comment; I was just pointing out that any comment containing the "-" character would be skipped by your regex pattern.

# April 9, 2010 2:18 PM

Bertrand Le Roy said:

@RichardD: ah, yes, sorry I misunderstood. Yes, that expression is simplistic and fails on several occasions, but it worked fine for me: I do a search on <!-- after doing this to double check for stuff that it missed.

# April 9, 2010 3:10 PM

ancalagon said:

Very Cool. Thanks for Posting

# April 9, 2010 4:38 PM

Chance said:

While I seriously dislike the IPad for reasons related to both the device and the company behind it, I do not believe it is appropriate to compare slate computers to netbooks.

Having said that, Bertrand, please go tell the guys responsible for Microsoft Courier to hurry up so that they can dominate the IPad for creative and everyday users.

It, in my opinion, is a truly revolutionary device (way more so than a giant IPod Touch)

# April 11, 2010 12:40 PM

Priya said:

Hi,

   am getting status 404 tomcat server error,when i followed what you have mentioned.Could anyone explain Why???

Regards,

Priya

# April 12, 2010 2:14 AM

aaaaaaaaaaaaaaaa said:

how to put links inside a grid that has been retrieved and build from an xml file

# April 12, 2010 4:21 AM

Mac said:

I'm sorry Dave; I can't do that.

# April 12, 2010 10:38 AM

Mac said:

Retina scanner. That way, if tech support needs to access your computer just tear your eyeball out...

Well, you do have two don't you?

# April 12, 2010 10:42 AM

RED said:

Awesome little script!

I need just one more thing and that is the file name (with or without extension) to be able to place it under the image..can someone show me the variable to use to pull that info?

Thanks!

# April 12, 2010 1:05 PM

Bertrand Le Roy said:

@Priya: well, if Tomcat is giving you an error, that means that you're using Java and thus you're completely off-topic here. You'll have a much better chance of seeing your problem solved if you asked your question on a Tomcat/Java forum and if you explained exactly what server error you're seeing and what you did that triggered that error. By the way, 404 means resource not found, so chances are you used a URL that doesn't exist.

# April 12, 2010 3:06 PM

Bertrand Le Roy said:

@a^n: I don't know, you should ask that question on a forum that has something to do with your question instead of doing it on random blog posts. For example, http://forums.asp.net/24.aspx

# April 12, 2010 3:10 PM

Faheem Ahmad said:

Excellent post. I do not know about it. Great work done. Thanks dude.

# April 13, 2010 2:18 AM

diadem_2k said:

i never knew this fact...

thanks for telling us the core concept of HTML rendering.

great work...

# April 13, 2010 9:17 AM

Andy said:

Does the toolkit provide insight on why SEO is easier to achieve on BING?

# April 13, 2010 12:49 PM

Bertrand Le Roy said:

@Andy: not that I know of.

# April 13, 2010 2:01 PM

Sylvain said:

Thank you for this article. I hate to work on IE6 bugs and I really would like people to definitely get rid of it.

Thanks again

# April 14, 2010 12:46 PM

Dave said:

Didn't buy an Mac, Ipod, Iphone or any other Mac but I bought an Ipad and love it. Reads well in bed. Surfs the net quickly and no lock ups. Long battery life with a HD screen works for me and see less of my PC or laptop ever since. Apple has opened a new line of media consumption hardware and I gotta believe this is just the begging.

# April 14, 2010 2:44 PM

Bertrand Le Roy said:

@Chance: well, I think it's a very appropriate comparison, and eh, Scott is the one who did it first :)

# April 14, 2010 3:37 PM

davidshq said:

Hmmm...I'm having a similar session issue, but it appears to be caused by telling a wizard what is the activeviewstep....is there a way to prevent this in the wizard control?

Dave (dmackey AT NOSPAMpbu.edu)

# April 15, 2010 8:24 AM

Jeroen Frijters said:

This isn't quite accurate. C# 4.0 optional parameter are like VB's optional parameters, not like overloads. When you compile against .NET 2.0 with Visual Studio 2010, the optional parameters are still encoded in the metadata and you can still use them from other languages (like VB) that understand them.

# April 16, 2010 1:21 AM

Bertrand Le Roy said:

Ha! Thanks for the tip. Didn't think of that.

# April 16, 2010 1:23 AM

VisualisUK said:

@Bertrand:

Re: SEO on Bing

I'll dig around and let the group know if I find out.

My main website has been much higher in BING than Google. It maybe because the site is only a year old and BING isn't using doamin age or backlink age.

PS: I changed my name (from Andy to VisualisUK to facilitate the Twitter ref.)

# April 16, 2010 8:30 AM

DanAtkinson said:

The problem with this though is for those people who convert their nullable types to optional parameters, they're now going to be required.

# April 16, 2010 10:08 AM

dbjdbj said:

Bertrand, as you know, I forked Your FluentPath and made a version which compiles with "old" C# ...

Although in there I have a (kind-of-a) solution , not just "feature cut off" ;o) It is based on "params".

And it works with unchanged tests and sample app of the FluentPath.

   /// <summary>

   /// Named paramaters handler, for "legacy" C# code

   /// </summary>

   /// <remarks>

   /// The documentation of the method where params   is used is the only source of information about its arguments.

   /// Be sure to provide it.

   /// </remarks>

   /// <example>

   /// To use provide : <code>params object [] argz</code>

   /// as the last argument in the method. Then instantiate this class with optional

   /// name,value,name,value ... arguments, providing string name and value for each optional

   /// argument you need. For example:

   /// <code>

   /// void method ( params object [] argz ) {

   ///    dbj.Paramz p = new dbj.Paramz(argz, "name", "Bertrand", "age", 14, "msft", true ) ;

   ///    // get the values by names provided, with indexing param

   ///    string name = p["name"];  // casting is not required

   ///    int    age  = p["age"] ;  // because indexing operator returns dbj.Implicitor instance

   ///    bool   msft = p["msft"];

   /// }

   /// </code>

   /// The code above simplifies implementation of "method()" that can be called with optional arguments.

   /// As in normal params usage the order of the argument in the params array is important. In the example

   /// above , if provided the first argument is "name", second is "age" and third is "msft".

   /// <code>

   /// // provide "name" but not "age" or "msft" arguments

   /// method ("Joe") ;

   /// // can not provide "age" only, first argument is always taken as a "name"

   /// method ( 42 ) ;

   /// </code>

   /// </example>

# April 16, 2010 11:22 AM

John said:

Wouldn't you want to wrap the overloads in version specific #if/#endif?

#define NET_Version3_5

#if NET_Version3_5  

// some overloads

#endif

# April 16, 2010 12:11 PM

dbjdbj said:

# April 16, 2010 12:49 PM

AndrewSeven said:

Thanks Jeroen, I was about to ask if that was the case.

Do you know if the optional parameters also act like that (compiled into the calling assembly) when compiling against 4?

# April 16, 2010 1:12 PM

Bertrand Le Roy said:

@John: that's definitely an option. Personally I avoid directives and like to have the same code compile to both versions without them.

@dbjdbj: it would have been nice to point to this post ;) What I don't like about your approach is that you can't have IntelliSense on the optional parameters, and there's a runtime cost to it. A little too JavaScripty.

# April 16, 2010 2:47 PM

Paulo Morgado said:

Optional arguments are not the same as overloads in any way - magical or not.

Public usage of optional arguments should never be encouraged, especially when omitting the perils – shame on you.

When in doubt, never ever use optional arguments: paulomorgado.net/.../c-4-0-named-and-optional-arguments.aspx

# April 16, 2010 8:56 PM

dbjdbj said:

@BLR : I have done the "back pointer" to this post.

Yes, my solution is of course having a runtime cost. But it requires no changes on the legacy callers side. It allows re-factored C#4 code to be compiled and used by legacy C#. Like (for example) my FluentPath fork "FP08", shows. FP08 can be used by everyone, not just  (lucky?) VS2010 owners.

# April 17, 2010 5:34 AM

Bertrand Le Roy said:

@dbjdbj: Thanks for the pointer. I've made available a 3.5-compiled version of

FluentPath, and you should also be able to compile it using MSBuild.

# April 17, 2010 1:39 PM

Steve said:

I have the Microsoft Natural Ergonomic 4000 keyboard, and it has a utility that allows you to disable the Caps Lock key.  This is a great feature, unfortunately the inept developers at Microsoft can't even get this feature to work right.  Somehow a fumble on the keyboard will trigger its activation anyway, and you then cannot change the setting back because the Caps Lock key is disabled!  So then you have to go into your keyboard settings dialog, re-enable the Caps Lock key, close the dialog, hit the Caps Lock key to turn it back off, and then go back into the keyboard settings dialog to disable the Caps Lock key again.  I don't know what kind of standards (if any) Microsoft requires of its employees, but I find it especially pathetic that they can't even get a feature as simple as this to work 100% of the time.

# April 18, 2010 5:49 PM

Steve said:

Part of the problem is that there are just far too many hotkeys in programs.  One minor slip of the finger and you can easily set off some command that you never intended.

# April 18, 2010 5:52 PM

jahjah said:

man, i have the same pro. i hate vista this is my last time buying this crap. go mac. plz lets us know if you find anything new. thanks.

# April 19, 2010 5:26 PM

TV Sheffield said:

Very impressive - right up until it crahed my Firefox.

Bertrand could you open a comment on Video CMS?

# April 20, 2010 7:25 AM

Mathew Robertson said:

I cant image MSIE is smart enough to cache the possible attribute for each element type so that it knows what should/shouldn't cause a reflow.

For example, if the document was using a non-standard DTD or a custom xmlns, then it would be possible to use attributes which may have a visual effect (but which are not part of normal html standard/formatting).

# April 21, 2010 7:28 PM

sluggo said:

@Alex Lowe: You want to talk about MS's sub par products and security holes, but your post insinuates that apple has never had any. Do you remember OS9? Do you remember how OSX was virtually unusable until OS 10.1? Have you noticed that the things that Apple has done in the last 3 years with regard to Adobe and Google are far worse than what Microsoft got nailed for in the Antitrust case?

I think the real problem is that a huge vocal majority of Apple users have bought into the mythos of Jobs, and drank so much of the koolaid that they'll blindly go wherever they're told.

Frankly, the iPad has some nifty features, but compared to my netbook it has a 1024x768 screen versus a 1024x600. Neither one plays HD video since 720p starts at 1280x720, and frankly the netbook plays 480p 'hd' content with no issues. I can install any software I want on the netbook from three versions of windows (XP/Vista/7), I can install linux, I have access to millions of applications and it has a huge range of uses that the iPad simply can't compete with. (Content creation & distribution, versus simply content consumption).

That being said I think the iPad will be a useful device for a lot of people who don't need that kind of functionality.

Anyhow, coming from a person who makes a living on Windows based machines, my opinion is probably biased, though I do have an iPhone and a macbook so it's not like I'm a mindless zealot for MS either ;)

I would have far fewer problems with the iPad if people stopped trying to talk about how much better it as at everything, when it's not. It's better at some tasks, and it should be, it's a quality device. It just doesn't have the power of a real computer (the crippled iPhone OS should be a clue) nor is it as easy on the eyes for ebooks as a Kindle, etc.

It's kind of like a nice swiss army knife in a way. Sure it's not as good at any of the tasks as a dedicated tool, but it does pretty good at some of them, and works  for others, and it's easier to only carry one thing around. *shrug*

I certainly wouldn't complain if they added a microSD or SD slot though- Which will never happen because they want to upsell you on the more expensive models to get that storage space for considerably more money.

# April 22, 2010 12:50 PM

Kyle Baek said:

Much appreciate on your posting.

At the first, I thought my code is not correct when use the menu control.

This site is very helpful to resolve this problem.

I wish more info can be available on asp.net.

Cheers~!!

# April 23, 2010 1:54 AM

Benjamin Howarth said:

I'm building a plugin based on this code for the Umbraco CMS - basically as an XML-powered CMS, people want to write XSLT extension methods, but don't necessarily want to have to write a full-blown compiled library. *But* <msxml:script language="c#"> doesn't work in Medium Trust. Solution? Abstract that into a .cs file and use this code to compile it for accessing through XSLT code. Works in Medium Trust a treat.

This code is brilliant, thanks for sharing it!

# April 24, 2010 8:16 AM

Michael Lang said:

If you need the date parts on the client, why not pass down the date as a json object.  The only drawback I can see is verbosity.  But how many dates do you need to return on json format where you need more than the text?

[

 {"Date":{"y":2010,"M":05,"d":23,"H":12,"m":11,"s":58}, "DateString":"May 23, 2010 12:11 PM"}

 {"Date":{"y":2030,"M":4,"d":25,"H":16,"m":28,"s":32}, "DateString":"April 25, 2030 04:28 PM"}

]

# April 25, 2010 5:31 PM

Mike said:

So what is Orchard? The description on http://orchardproject.net/ is way to generic for me to understand what it is.

"Orchard will create shared components"

Is it a 'factory'?

What is shared about them?

"components for building ASP.NET applications"

So controls?

"and extensions"

Extensions to what?

"and specific applications"

So multiple applications? 3? 25?

"to meet the needs of end-users, scripters, and developers"

So all stake-holders then?

Seems to me that this is a fairly accurate description of System.Web

# April 26, 2010 10:53 AM

Luke said:

Thanks guys like you, I hate ms ajax for absolutly no support and no library for that whats going on client side, there are just telling you how to implement the whole javascript and ajax stuff without all the javascript and ajax stuff. You know, for this guys who just want to write <html> <body>. Grrr, if you want to go deeper in, you have to first read all the source code to understand whats going on, and the problem is that im not the big programer, so that i remain decrypting all the source for days...

# April 29, 2010 7:06 PM

Mike Borozdin said:

Interesting!

I also wrote a tutorial on quality image resizing www.mikeborozdin.com/.../High-Quality-Image-Resizing-with-NET.aspx

# May 3, 2010 8:24 AM

Bertrand Le Roy said:

# May 3, 2010 12:22 PM

Mike said:

Hello thanks for the way, after the fix I started recieving errors, Sys is undefined, Type is undefined. Please see errors and HttpWatch attached. Thanks in advance.

www.glowfoto.com/.../glowfoto

www.glowfoto.com/.../glowfoto

# May 4, 2010 7:03 AM

Bertrand Le Roy said:

@Mike: very likely, you introduced a syntax error while patching the files.

Please consider upgrading to .NET 3.5SP1 or 4.0.

# May 4, 2010 1:43 PM

DBJ said:

On the first glance it seems that CallStream-ing kind-of-a interface would elegantly hide these complexities ?

--DBJ

# May 5, 2010 4:21 AM

Bertrand Le Roy said:

@DBJ: he he. Yes, a fluent interface (callstream or more conventional) for image processing would be nice...

# May 5, 2010 4:29 AM

ShadowChaser said:

I can confirm that this flat-out does not work on a production server. We used it for thumbnail generation and we would randomly have images show up blank - the WPF team confirmed that it's not supported.

Beware!

# May 5, 2010 12:22 PM

jahu_bluszcz said:

I have some problem with DataView.

Sys.setCommand in beta version was a function used to eg. attach "select" command of DataView to some input in imperative way.

Now (in release version of asp.net ajax)  function setCommand seems to be undefined in Sys namespace.

Maybe some of you know what happend with it?

Problably it was move to other namaspace or repalce by somethink else, but i need more precisely information.

Some advice?

# May 6, 2010 3:10 AM

Bertrand Le Roy said:

@jahu: I think you do Sys.query(selector).setCommand instead.

# May 6, 2010 4:31 PM

Java Architecture said:

IceFaces better than all .Net framework

# May 10, 2010 4:54 AM

jahu_bluszcz said:

Thanks a lot!

Could you give me a link to web side documentation or tutorials, because i couldn't find it at all.

# May 11, 2010 1:49 AM

Bertrand Le Roy said:

Ha! It happened again this morning. This time, the dialog hijacked focus with no warning at all and caught my keystroke on the first time. That means this is a case where none of the lame excuses in comments above apply.

# May 12, 2010 1:58 PM

Kevin said:

Thanks for all the info and sample code.  Just wanted to drop a note to let people know or see if they can help.  I'm trying to do this on a Windows XP SP2 machine with .NET 2.0, and the Windows Imaging Component

www.microsoft.com/.../details.aspx

installed.  I also have .NET 3.0 SP2 installed.  But I always get an error at the line:

outputFrame.WriteSource(scaler, rect);

Exception from HRESULT: 0x88982F0C

My sample program works on a Windows 7 machine.

Has anyone else gotten this to work on a Windows XP machine?

# May 14, 2010 4:10 PM

Bertrand Le Roy said:

@Kevin: The latest WIC is not available for XP.

# May 14, 2010 6:10 PM

Uly said:

I agree, i type numbers all day at my work, and it would be so much better to replace that bastard num lock key with a second backspace key. I think about it every day.

# May 17, 2010 6:03 PM

Alexander Gyoshev said:

Once the annonymous function grows larger than one screen, it's better to use local variables rather than aliasing, since they keep the alias and value in one place. It's annoying if one has to scroll to understand the meaning of an alias -- declaring them as locals is just as fast and keeps the pair together.

# May 18, 2010 12:06 AM

Bertrand Le Roy said:

@Alexander: comments are great for that too.

# May 18, 2010 12:56 AM

Anup said:

That's well put. I believe the other benefit can also be performance, as locally scoped variables are accessed more quickly than global ones (or less local ones!)

# May 18, 2010 4:16 AM

Scott Koon said:

We're running into an issue in our DotNetNuke installation where, at some point between the head and where our JS is loaded at the bottom of the page, the "$" alias is getting squashed by what looks like the MS Ajax library. I think one of the modules we are using is creating the alias. Haven't tracked it down because I use this exact pattern to avoid it in our JS. The jQuery object still exists in the page, so I can just pass it in to the anonymous function and re-create the "$" alias scoped to my function.

# May 18, 2010 1:02 PM

Bertrand Le Roy said:

@Anup: especially in the case of something like Sys.UI.DataView as you're also avoiding the two property lookups.

@Scott: That's not possible unless you're using an extremely old pre-alpha build of MS Ajax: MS Ajax Library is not using $ at all, anywhere. But yeah, whatever is doing it, this pattern fixes it. :)

# May 18, 2010 1:54 PM

mukesh mahajan said:

i very crazy about this

# May 19, 2010 8:34 AM

Thanigainathan said:

Hi,

This is very nice article.

Thanks,

Thanigainathan.S

# May 19, 2010 1:06 PM

Brian Brewder said:

Thanks for the info. This will come in very handy for us.

# May 19, 2010 2:03 PM

Keith said:

I found your post as a direct result of needing to show dynamic properties in a property grid. Unfortunately your code sample won't compile, I think due to changes in the RTM version of C#4.0.  Any chance you might know how to make it work?  Here are the 2 errors (both in DynamicHelper.cs):

1. 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo' does not contain a constructor that takes 2 arguments

2. The type or namespace name 'CSharpGetMemberBinder' could not be found (are you missing a using directive or an assembly reference?)

# May 20, 2010 6:56 PM

Cheryl said:

Thankyou this was so helpful.  Microsoft didnt give me any answers but now I can get my work done.

# May 21, 2010 7:49 PM

Mike said:

What a horrific solution.  It's completely unreadable to humans.  Why don't we just serialize everything to binary if you're going to take that approach?

An obvious solution would have been to work with ISO 8601.

"\/Date(2010-01-17 14:00:00)\/"

Something along those lines.

# May 26, 2010 12:05 PM

Rob Conery said:

Thanks for the links mon ami :) - I also did a freebie screencast on Specflow here:

tekpub.com/.../5

I go into the "flavor" of using BDD to build out your app and get into the bits and bolts of SpecFlow - something I really dig a lot!

# May 29, 2010 2:59 AM

Ludovic said:

Maybe I'm less "pure" in terms of TTD-ness but I don't see a problem with testing against System.IO. It's part of the framework, and I don't see people trying to abstract other framework things like collections or streams. Sure, you may want to abstract bigger framework APIs, but I guess it's a matter of personal taste whether you put System.IO in the "big stuff" or the "small stuff". And since I don't really think the side effects of the tests (manipulating the file system) are that bad, I'd consider it to be "small stuff" and I wouldn't lose sleep over it.

Now it's interesting that if you follow my opinion here, then unit tests and integration tests end up being exactly the same... which basically means that your library is unitary to begin with. And I think it's the case, so it's all good to me.

# May 29, 2010 3:33 AM

Bertrand Le Roy said:

@Ludovic: yeah, I don't want to split hair. The FluentPath integration tests run fast enough that testing against the actual file system is not a problem, but if I had a bigger system with hundreds of such tests, or if I was testing against a slower, non-mockable system (let's say something remote for example), I'd be in more trouble. All this to say that my silly little library may not expose the badness of the methodology, but more serious stuff will for sure.

# May 29, 2010 3:45 AM

DBJ said:

Testing System.IO ? RamDisk perhaps?

I reallly would like to see someone who is "inside" ;o) publishing the real life usage of ramdisk in W7 ?

Another approach perahsp would be a virtualPC on top of 64bit OS , ontop huge RAM ammount ...

--DBJ

# May 29, 2010 5:59 AM

Simon said:

Have you tried to use Moles to mock System.IO ? I never used it, but I heard it should make the job (the samples show how to mock things like DateTime.Now) for example.

# May 29, 2010 8:18 AM

Horses said:

Is there a way to stub/mock FluentPath?  Or is the technique you've outlined here the best way to write tests for code that uses FluentPath?

# May 31, 2010 12:27 AM

Bertrand Le Roy said:

@Horses: ha! Good question. I suppose as it is, it's just as testable as System.IO itself. Adding some interfaces in there would definitely help. I'll try to add them eventually.

# May 31, 2010 7:43 PM

Bertrand Le Roy said:

@Simon: Moles look interesting, thanks for the pointer, but from the manual it can't mock static methods, which is pretty much all  that we use in System.IO. It's not clear why static methods are out of the picture though: the way they do things (by rewriting the code), I don't see why you couldn't re-route static calls.

# May 31, 2010 8:02 PM

Bertrand Le Roy said:

Ah, never mind, static methods seem like they work too. Trying it.

# May 31, 2010 8:03 PM

segue said:

Thanks Rob for fixing the problem.

Now my site menu works in all browsers.

Context.Request.Browser.Adapters.Clear();

Cheers.

# May 31, 2010 8:14 PM

Bertrand Le Roy said:

@segue: my name's not Rob, but you're welcome.

# May 31, 2010 8:18 PM

James said:

We went with extracting operations exposed by System.IO.File and System.IO.Directory onto an interface.

All new code that accesses the file system goes through an implementation of this interface.

It's nice for speeding up tests of things which are file-system heavy (hundreds of tests at last count), as our test stub implementation is completely memory backed.

Another advantage is that you don't have to do cleanup, just let the stub be GC'.

And for integration tests, it can be useful to create strict mocks of this interface to trap unexpected file system access.

# June 1, 2010 6:39 AM

DBJ said:

It is also wise to use closure argument for robust, simple and ubiquotus existence of: undefined.

   (function ( global, undefined ) {

   }( this )) ;

And yes 'this'  as 'global' pattern above is a good thing. Thus above code is host-change resilient. In browser 'this' is 'window' but in WSH 'this' is global object. Same as in WSC as WSF.

And, also for v.long source code (> 1 page) I use local object to cluster local aliases. Makes code more readable and intelissense friendly too.

   (function ( global, undefined ) {

       var local = {

          mbox : global.alert ?  global.alert : global.Echo

       }

      global.msgBox (m) { local.mbox(m); }

   }( this )) ;

--DBJ

# June 1, 2010 12:32 PM

Bertrand Le Roy said:

@James: yes, and hopefully one day FluentPath can play this role as well as improve the experience of working with the file system in .NET.

# June 1, 2010 1:57 PM

Haacked said:

You could argue that *success* is the necessary ingredient in evolution and failure is a byproduct. After all, it's the successes that drives things forward, not failures. If every lineage of a species fails, then that line dies off and does not succeed.

On a macro level, this involves a lot of failures of course, but at some point there must be a success.

I think the more interesting point is the need for *imperfection* and variability. If we build self replicating robots, but add in genetic algorithms for how they learn and reproduce, they may well end up being quite successful.

I for one welcome our new overlords with a can of WD40.

# June 1, 2010 11:01 PM

Bertrand Le Roy said:

@haacked: what fails is the replication: it just fails to be a perfect replica of the original, and that's the source of variability. Now you're introducing your own definition of success into the mix here, and yours is subjective whereas mine was objective. What is it by the way? Is it that the lineage survives for more than one generation?

Introducing variability? Yes. My point exactly :)

# June 2, 2010 1:34 AM

Thilaga said:

I am also really fed up with Session variables(in localhost itself). I have changed my code from Redirect to Server.Transfer, then session value will be retained. But the url path , flow and navigation is wrong.

Finally i am planning to go for Global variables instead of session.

What is your advice?

# June 2, 2010 9:17 AM

Bertrand Le Roy said:

@Thilaga: don't. Global variables come with all sorts of problems (thread safety being one of them). My advice is in the post: don't use Transfer but use the overload that doesn't terminate the thread instead.

# June 2, 2010 10:17 AM

Kris said:

It would be very nice if Visual Studio recognized jsdoc toolkit style comments in it's intellisense.  The old xml style comments are very time consuming to type by hand.  The only reason they were usable in C# was because when you type three slashes it autocompletes a comment structure for you.  Having to type that by hand just isn't going to happen.  The Jsdoc toolkit comment style has become pretty much the defacto standard.  They are significantly easier to type by hand.

# June 3, 2010 1:42 AM

Matthew Aguilara said:

OMG. I was writing a article for a forum I frequent. I was writing for over an hour and lost everything. uploaded images to a third paty image hosing site and lost all of the url's.

When I purchased my computer it came with windows 7 pre-installed, I was not givin the opertunity to read any type of TOS. therefore It is not out of the realm of possibility to start a clas action lawsuit for people like me who have lost a peiece of intellectuallity that I may never ever recreate becuase of microsofts need to control every aspect of a persons PC.

The tactics employed by MS are not unlike the tactics of a communist dictatorship.

What uopdate is so important that the os needs to cancel and destroy any thing in its way of completing?

The worst part about this is I never recieved any type of warning.

When xp used to force reboot the dialog would pop up but the program you were using would never lose focuas and you could always prolong the shutdown by atleast 10 minutes by simple choosing the option in the dialog box.

I am up for starting a class action lawsuit. How dare microsoft charge a ridicalous price for there os and then treat you as iff you dont even own the computer that the os runs on.

my own mother wouldent dare turn of my computer without my permission, let alone turn it off when I'm sitting right in front of it working.

I know my spellling is horribly wrong and at times ?I may not make sense. thats just the type of rambling person MS can turn you into by screwing with your life and livley hood.

# June 3, 2010 3:38 AM

Matthew Aguilara said:

"I love the quote from one of the above posters - '"WU cannot protect you from all eventualities."'  It would seem it's woefully inadequate at protecting the user from itself."

Tim hardy. That statement is the equavilant of hitting a hole in one for the 100th consecutive time.

# June 3, 2010 3:45 AM

Bertrand Le Roy said:

@Matthew: while I totally understand you'd be upset (I was too) you obviously have no idea what a communist dictatorship is. Let's keep thing in proportion.

# June 3, 2010 4:07 AM

Classic Fred said:

Ha, Ive just been moved to a new job in my company... working on classic ASP pages !  Classic ASP lives.  (Its coming back as MVC).

# June 3, 2010 9:50 AM

Kushal said:

Hi ! I am new to developing application with Visual Studio 2005. Currently I have created a small login application (asp.net web application). I have publish the website.Login page gets opened whenever URL is started but I am facing problems in redirecting the user to a page after he successfully login into the account.Error "Page cannot be displayed" is displayed. Where may be the issue ? Pls help

Any help is appriciated. Thanks in advance.

Regards

Kushal

# June 4, 2010 3:59 AM

Bertrand Le Roy said:

@Kushal: it's impossible to say with what little information you provided. There probably is a bug in the page you're redirecting to, which you can see by setting customErrors in web.config. Then debug and learn I suppose. One thing to check would be whether that page works at all if you remove the requirement to be logged in.

# June 4, 2010 1:58 PM

Art Shayderov said:

I for one am quite concerned about you being obsessed with this ideas of benefits of failures would introduce random mutations into software you are working on. Would you like to perfect the copy command?

# June 5, 2010 8:30 AM

Bertrand Le Roy said:

@Art: :) don't worry, the software I build doesn't self-replicate. This being said, software viruses do mutate to evade detection.

# June 5, 2010 8:59 PM

InfinitiesLoop said:

I think of AI taking over as a product of it's intelligence. How it uses it to take over may not even involve replication. They won't build themselves. They'll build themselves better based on their amassed knowledge. And they only have to be a bit better at it than we are at evolving to quickly surpass us. Probably easily done once the ball is rolling.

# June 9, 2010 3:18 AM

Bertrand Le Roy said:

Yeah, my point being that that threat is more remote than that of dumb self-replicators.

# June 9, 2010 3:32 AM

Tom Karches said:

I find it humorous that people talk about all the great features that competing devices have, but Apple is making most of the money.

Remember all the talk about how stupid the iPod was?

I generally choose Apple devices because they find out what makes a device easy to use and eliminate everything else. If they made a device that included all the features that the "experts" considered essential, it would likely be unusable.

Having said that, I'm posting this from a Dell Mini 9 running Mac OSX :-). Which is awesome, BTW.

# June 15, 2010 4:12 PM

Bertrand Le Roy said:

Yeah, cause everything should be judged by how well it sells.

# June 15, 2010 4:19 PM

Steve said:

Seems rather complex with a whole new set of terms and languages I'm not familiar with.

Honestly I had a difficult time reading it - ie an object described as 'cheap' at first sounds good but then I'm left wondering what cheap objects really are.

I'm also trying to figure out how normal items we discuss like 'modules' - are they MEF? Are they 'Areas' ?  How does this differ from when we had Sharepoint zones, parts, sites, pages (note the familiar terms) and then previewing,authoring, validating content and how content is delivered ?

I'll go read through it again and see if I can wrap my head around the abstractness of the content.

Thanks

# June 15, 2010 9:05 PM

Bertrand Le Roy said:

@Steve: modules are MVC areas that are extending Orchard. I do not know SharePoint enough to be able to compare concepts.

No object in the document is described as "cheap", they are described as "cheap to create" which just means that instantiating does not consume lots of resources.

The topic is clearly very technical and is not aimed at end users or module developers but rather at core developers or people who want an in-depth understanding of the platform.

Understanding what's in there is in no way a prerequisite to working with Orchard.

# June 15, 2010 9:12 PM

JeroenH said:

This is a very useful article. It's what I missed in order to grasp the fundamental design of Orchard. Thanks for this!

I have one reservation at this point: why exactly do you have to inherit your interface from IDependency for injectable dependencies? It's not a very big problem, but still seems a limitation. Does this leak to module development as well?

# June 16, 2010 3:36 AM

Gauthier Segay said:

Very comprehensive description, hats off for such a nice framework that I will probably love to fiddle with.

A few nitpicks about the document:

in the architecture section, Castle should be replaced by Castle.DynamicProxy, maybe add Castle.Core.Logging.

Castle Windsor link is confusing (as AutoFac is used as the IoC container), link to www.castleproject.org/.../index.html instead?

MVC is a pattern name, better spell ASP.NET MVC

This sentence is not clear: "Similarly, we have route providers, model binders and controller factories whose work is to act like the singletons that MVC expects", I'm not sure ASP.NET MVC is expecting singletons here, although it exposes (not sure of the details) some helpers through the view context, a better wording

In "Anatomy of a content type", the handler description is a bit opaque starting from the second paragraph, although code samples are a good way to clarify, it's not easy to pickup, maybe explaining why you would implement them with real examples would help.

in Localization section, "in a call to T" maybe saying "T method" or provide an example: T("This is a localizable static content").

Logging, uses Castle.Core (Castle itself is really a bunch of frameworks and components, so it doesn't designate something precise)

# June 16, 2010 5:05 AM

Victor Kornov said:

Overall, the doc is pretty good ;) It asnwers the "how" but lacks on the "why" part.

E.g. Dependecny Injection. I'm not sure why the IDepency interface is required. I'm not familiar with Autofac yet the way Orchard requires to specify objects lifetime through IXXXDependency is a bit strange. Clearly, there are cases where an object assumes a certain lifetime to fulfill it's goal. In that case it's a good thing to explicitly specify it's lifetime through an interface. But for other cases where object's purpose doesn't depend so obviously on the lifetime? I.e. it's very much possible that the objects author at inception can't tell for sure the required lifetime. In that case it's better to leave that decision to external component. That adds flexibility (as mentioned above) and makes it less of a breaking change to change objects lifetime later.

# June 16, 2010 6:15 AM

Bertrand Le Roy said:

@JeroenH & Victor: you have to implement IDependency so that we can automatically discover your dependency, rather than requiring explicit registration with the system. It's clearly something that can be done differently but I'd say the reason for this choice is essentially that the ultimate goal here is to build something that has the robustness of modern IoC practices while enabling a layer of simplicity above it. Dependency injection here is the basis for our plug-in system, and we want that to be accessible on two levels.

First, you'll be able to implement strongly-typed interfaces and get your implementation discovered and used by the container and injected into the code requiring them. That's fairly classical and strongly-typed dependency injection.

Second, you'll be able to implement something much fuzzier that looks more like the type of plug-in you'd write in PHP. In that case, you just write something that matches the signature and name of the extensibility point. It's essentially the same thing, but it requires less concepts and is a little more flexible about the form your plug-in takes. It also removes the requirement of having a dependency on the assembly that defines IDependency.

Victor's point about lifetime is definitely valid and it's something we'll gladly address when the need arises. We went for relative simplicity of lifetime management as a first approach. Do you have a scenario in mind?

# June 16, 2010 12:57 PM

Bertrand Le Roy said:

@Gauthier: thanks for the great feedback. I applied most of it. Feel free to edit the document on the wiki if you want to improve some parts further :)

# June 16, 2010 2:30 PM

JP said:

Nice article, thank you.  A couple pieces of feedback.

You write ...

"Now this is a true to the definition Monad, including the weird naming of the methods."

I think here it would be good to explain how the methods on the monad map specifically to the metaphor of the conveyor belt and the boxes.

Also, when you write …

“That of course is seriously ugly. Note that the operation is responsible for re-boxing its result.”

How specifically is it doing that?

Thanks again!

# June 16, 2010 7:52 PM

Bertrand Le Roy said:

@JP: Unit is boxing, Value is unboxing and Bind is processing. The Identity class is the conveyor belt.

The operation is re-boxing by wrapping its result in a call to Unit: s => Identity<string>.Unit(s + " was processed by identity monad.")

# June 17, 2010 12:28 AM

Mark Rendle said:

Excellent post; very illuminating to see an explanation in my native language. Thank you.

# June 17, 2010 6:36 AM

DBJ said:

Hi BLR,

Good post. Couple of comments.

1 :: You had to resort to "stunt programming" to be able to implement concepts You are explaining. Which makes the explanation difficult to comprehend. Above examples written in Python or JavaScript would be much simpler but still would represent true usable implementation of the concept.

2 :: I personaly find much easier to explain monads, by using some simple code , for which the "pupil" is convinced it is a monad.  For example. Is the following code a 'monad', and if it is not, why is it not :

       static readonly  System.Globalization.CultureInfo cc_ = System.Globalization.CultureInfo.CurrentCulture;

       public static string format(this string argument, params object[] args)

       {

           return string.Format(cc_, argument, args);

       }

// usage:  "hello {0}".format("world")

Of course, I am glad that CallStream concept made you think "even more" ... I just hope "beer fest" is not the only way to "cool the brain overheating" ;o)

--DBJ

# June 17, 2010 6:37 AM

Justin Rusbatch said:

I've been trying to understand monads awhile. This post is the easiest to understand out of all the blogs, wikis, and articles that I've read so far -- so thank you.

A lot of my difficulty in understanding them stems from the fact that I can't come up with a situation in which they are the best (or only) solution. Until I see how I can use them in my code, I think I'll continue to struggle with the concept. Hopefully your next post will help me with that.

Thanks!

# June 17, 2010 1:35 PM

JD said:

Note that your state example illustrates why it's important that bind take a function from the base type to the monadic type. As written, operations on a state-enhanced value are unable to modify the state.

# June 17, 2010 3:26 PM

Marcel Popescu said:

Two things:

1. Like Justin, I just can't find a reason to care. This is a flaw common to all the articles I read so far: WHY am I supposed to care about monads?

2. Why keep using the stupid naming? Yes, after I understand the whole thing, it would be helpful to know that "boxing" is called "Unit" in monad-speak. You know, in case I want to read other articles. But until then, it's just additional noise.

Maybe the second article will help with this, but if you really want to teach "noobs" about this subject, I'd suggest thinking about the two points above.

[Note: I *am* a noob, monad-wise. I think I tried about 15 times to get over it, but I can't find any reason to. And I love lambdas and linq and C# 3.5.]

# June 18, 2010 8:46 AM

Si6arp said:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

Is Good Idea . Working Fine.

Thanks

Iranian Programmers

# June 20, 2010 5:27 AM

Gauthier Segay said:

Hi Bertrand, thanks for the head up.

I pulled a fork of orchard here, the solution works quite flawlessly, I was able to run the web site in a short time, nice work on this.

I'd like your team look at a slight change I did on the Orchard Page module codebase (the first one I've looked at), it seems that things could be kept KISSer, also I'm not sure the ViewModel name fits for what we are using these classes for.

One can look at the changes here: code.google.com/.../detail

any opinion on these?

# June 20, 2010 3:57 PM

Bertrand Le Roy said:

@Gauthier: thanks. Could you please submit a patch following the instructions on this page? orchard.codeplex.com/wikipage

# June 20, 2010 7:29 PM

Dave G. said:

Kind of late, I know...

But the correct answer is to implement IComparer<T> instead of IComparable if your objects are mutable, and pass an instance of the IComparer<T> to sorting functions when necessary.

Since the IComparer<T> is just a disposable object used for sorting at that point in time, your object can have any mutable semantics you desire. Furthermore, it doesn't require or even suggest using Equals, GetHashCode, or == - you're free to define it in any way you please.

Finally, you can define multiple IComparer<T>'s for your type for sorting on different fields or with different rules. This is much more flexible than being stuck with one definition.

In short: use IComparable for value types and IComparer<T> for reference types.

# June 20, 2010 10:37 PM

aefxx said:

Hi there!

You guys might want to consider jQote2 (a jQuery templating plugin). It's way more powerful than PURE or any other templating solution that makes use of an expression language.

Basically, jQote2 allows you to embed pure Javascript blocks of code in between your HTML markup which will give you total control over your templates (e.g. recursion within your templates, template chaining and the like).

See for yourself here:

aefxx.com/.../jqote2

# June 23, 2010 2:01 AM

Mark Paquette said:

Everyone here who claims that its' the user's fault that their machine rebooted when they were unprepared are, apparently, confused as to the purpose of these machines. Me? I almost NEVER reboot - and when my PC reboots, so do all my virtual machines. Now ... a cool feature, would be if Microsoft would automatically start ALL open applications and pages within them (like open emails in Outlook) on restart - like IE is beginning to do.

# June 23, 2010 1:30 PM

Mark Paquette said:

I've said repeatedly in the past that applications should never steal focus - that's just crazy.

# June 23, 2010 4:44 PM

miltongoh said:

Sorry, this may seems to be a post that was published long ago. However, currently I am working on a new project prototype that exactly require me to post my aspx file hosted on my server as a form of "Badges" to be embedded onto any website regardless of platform.

However, I would need remote server interaction such as a form will be included into this badges and then embed onto other website. Therefore, when user interact with the badges, they are able to send information back to the remote server, in this case will be the server that host the aspx file.

Any updated solution?

It really hard to find a similar solution that is purely done in .NET. :(

# June 24, 2010 10:12 PM

Bertrand Le Roy said:

@miltongoh: JSONP to a service on your server, and then client javascript to take the results of that and display them. The results can be JSON data or just bits of HTML to replace stuff in the badge.

# June 25, 2010 6:48 PM

Joerg said:

I have the same problem and already tried the overload version of Redirect, but it doesn´t work either. If have an application where the user has to fill out some forms. The application has 4 pages. The first Redirect works, the second one works when the user doesn´t wait longer than a few seconds. But when he waits for half a minute or longer, the session variable is not filled anymore. If have set the timeout in my webconfig at 300. The result is the same. It always works on localhost, but not on the server. Any ideas?

# June 28, 2010 7:32 AM

Bertrand Le Roy said:

@Joerg: you should contact support.

# June 28, 2010 10:58 AM

DBJ said:

I can't wait for the next post ;)

# June 29, 2010 11:44 AM

Justin James said:

Parallel.ForEach() != PLINQ

PLINQ is "Parallel LINQ". Parallel.ForEach() has nothing to do with LINQ. What they have in common is that they were both part of the "Parallel Extensions" package that eventually evolved into the new parallelism stuff in .NET 4.

J.Ja

# June 29, 2010 3:21 PM

Bertrand Le Roy said:

@Justin: I stand corrected.

# June 29, 2010 3:28 PM

Chris Eargle said:

Oh yea, an object is a monad: monadic.codeplex.com.

I think we have to be a little more formal with the definition of a monad or the pattern loses its meaning.

# July 1, 2010 10:55 AM

Cindy said:

Great job. Perfect match for my problem - some server side processing, then a confirm/alert box, followed by more server side processing. One question: how to remove "--Webpage Dialog" from the Title?

# July 1, 2010 1:38 PM

rjoyiii said:

I have created a webpart that switches between view, edit and create mode in AJAX.  

It uses several SharePoint server controls like PeopleSelector and DateTime.

So, it is easier for me to just house the building of the controls on the server and push out the innerHTML to replace the parts innerHTML.

However, the controls don't get properly wired when I do that.  All of the events are not longer configured including Validation, Cascading DropdownList...

Is there a way to rewire these events either on the client or on the server?

# July 1, 2010 4:25 PM

DBJ said:

V. good BLR. Although I would (perhaps) appreciate a more direct link to the CallStream inventor ;)

Also, my personal recommendation would be :

var p = stateful(3, "This is the state");

        (function (i) { return ++i; })

        (function (i) { this.state += " altered"; return i * 10; })

        (function (i) { return i + 2; });

// DBJ: no reason to "derail" the stream

(function () {

alert("Value: " + p.value + "; state: " + p.state);

}) ;

That is, an callback use to get to the value in the "back".

Good post, indeed, I am gratefull for your "evangelising" of the CallStream ;)

--DBJ

--DBJ

# July 4, 2010 3:31 PM

Mic said:

@aefxx Could you describe what makes jQote2 way more powerful than PURE?

Thanks,

# July 11, 2010 9:36 AM

Bertrand Le Roy said:

Ah, yes, you are absolutely right. I added a link.

My reason for "derailing" the stream was to illustrate the unboxing of the value and state from the monad.

# July 11, 2010 2:59 PM

DBJ said:

The subtle but unavoidable differences between 'value' and 'state', deserve a whole new post ;o) ?

--DBJ

# July 11, 2010 5:49 PM

Bertrand Le Roy said:

Not sure what you mean, but by all means go for it.

# July 12, 2010 6:31 PM

Jake said:

Thanks for your share.

Would you like to tell me

How can I permit user to upload image to current folder?

# July 25, 2010 4:09 AM

Jim H said:

I think medium trust is stupid.  It doesn't provide any better security in a shared hosting environment, unless all applications a forced use .Net and can't use any other language.  PHP, Classic ASP, etc.  don't run under medium trust, and therefore you can get around all of the trust issues if you wanted to by using another language.

# July 25, 2010 12:35 PM

Bertrand Le Roy said:

@Jake: use FTP, file copy, or whatever way you have to access the site's file system. The application won't allow you to upload.

# July 25, 2010 11:21 PM

Bertrand Le Roy said:

@Jim: PHP and ASP also run in a sandbox of sorts and what you can or cannot do can be restricted in similar ways. Plus, your hoster won't necessarily allow for classic ASP and PHP.

I'm not a big fan of medium trust myself but for the reasons you gave.

# July 25, 2010 11:23 PM

Lolo said:

Hi. get the same problem as Jackson. only I know it isn't an environment issue because as soon as i remove the asp code (<ms:Alert ID="ServerAlert"...) I can run everything as usual. Am I missign sometyhing here? Help is greatly appreciated..

# July 26, 2010 9:43 AM

pierre said:

Hi,

I've been looking for a solution but didn't wanted to use iframe.

I found that a div can appear over an input field on ie7, but the div has to come AFTER the input in the code.

That's what i done and it works ; then with css i made it appear on my page on its right place.

# July 27, 2010 7:36 AM

Bertrand Le Roy said:

@Pierre: the bug that the post is referring to is *fixed* in IE7. The problem in IE6 was that it was impossible without the iframe trick to put a div over a select.

In IE7, the behavior is correct. The order in which the elements appear determine the default layering, but you can override that in CSS using z-index.

# July 27, 2010 1:45 PM

Bertrand Le Roy said:

@Lolo: you're probably missing a @register directive on you page.

# July 27, 2010 1:49 PM

Carlos said:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> works fine, thanks ramin.

# July 28, 2010 2:01 PM

sasha said:

Can anyone help me with a menu on my site. I want to put teh menu above the image ...but even though I tried to change the index in various ways...will not work.

I want the menu to be overlaying everything.

Please email me at alexandra.hewardt.anderson@gmail.com

Thanks

Alexandra

# August 1, 2010 3:42 PM

Matt Davis said:

+1 for Basic on a TI-99/4a at age 5, followed by C64 Basic and 6502 assembly at age 8. Programming the TI's speech synthesizer was the real motivator (we didn't have Terminal Emulator, so I had to WORK at it to get mine to say four-letter words).

# August 3, 2010 1:28 AM

Rob Conery said:

I started coding on a RadioShack TRS something-or-other, and my first real class was in high-school, booting a machine similar to the one you describe using a cassette tape.

I also remember that there were no cell phones, no cordless phones, no internet (as we know it) a few billion less people on the planet.

DHH wasn't even born, and ScottGu was in elementary school.

I think I know what made you write this post :). But remembering the first "girl" or "boy" you (3rd person 'you')  doesn't make your marriage all of a sudden work - you made a commitment, and yes those halcyon days might be rife with excitement and discovery - it doesn't mean you can have them back.

In other words - it's easy to set the stage - a "remember when" and try to apply your experiences to the modern day. It's what my parents did - and it's what made them typical parents of the 80s: cocaine was something my friends did routinely, and it was something they saw on TV on Miami Vice and couldn't believe it.

You've managed to nail, almost precisely (but with different motive) precisely the anxiety many feel about the WebMatrix/Microsoft.Data stuff: it's a parental response - parental in the way my mom and dad might have sat me down when I was 15 to "talk about The Pot".

Do you, honestly and from the heart, believe that you and the rest of the ASP.NET team *really believe* you understand the motives and intentions of the "PHP Youth" today? You're not them, you're not in their circle, you're older than them, you have different values. You were raised in a different time. You were raised with different expectations - the world was a smaller, easier place.

I kind of think they are immune to your consultations, my friend.

# August 3, 2010 1:30 AM

Matt Davis said:

PS- Basic's DATA statement was total voodoo. Typing in those gigantic listings from the back of Compute! magazine where the last half of the program was DATA statements was pure black magic. Hated it when I lost hours of typing because I was too impatient to save to tape before running...

# August 3, 2010 1:33 AM

Bertrand Le Roy said:

It must have sucked to be you, Rob ;) Seriously, the engineers who built the TI99 were not my age, they were probably on average the age I am today.

I am *not* trying to apply what I remember from those times.

What I am trying to do is to get people to remember what it was like to start something really new.

I'm seeing all kinds of comments to the effect of "if you're not a professional programmer, you should not program". That is absurd BS is all I'm saying. Of course you should. Run with scissors!

# August 3, 2010 1:39 AM

Glenn Block said:

I love these walks down Memory Lana.

I started writing code on a Vic 20 and a TRS-80 model one. Back in those days fun was retwriting your character set (Fonts) which was how I started learning binary. You basically had to use binary in an 8x8 grid to lay out your characters and then figure out the decimal and poke it.

That was in between playing lots of Scott Adams adventures :-) Or in the case of the TRS-80 playing Mule.

# August 3, 2010 2:20 AM

Gene said:

TRS-80 / Basic in the late 1970s followed, after a 30+ year 'hiatus', by c# / asp.net. I loved, and love, the feeling of ignorance giving way to sudden comprehension, (and the immediate inability to remember what it was like not to know, or to sympathize with those who don't yet understand).

Of course, recommendations from scissor running survivors should be treated with statistical caution. No one who died after impaling themselves is around to caution against it. But, by all means, run with them. By a pool preferably. :-)

# August 3, 2010 2:24 AM

Rob Conery said:

Right - the thrill of the new - believe me I get it (it's Me, after all - I live for that thrill). I do believe that you're selectively filtering the responses you're getting, although yes, there are people who are taking the theory road.

It's not that "UR DOIN IT WRONG" - that's not what I'm saying *at all*. I'm trying to tell you that the audience you're trying to appeal to has already been appealed-to. They're just not that into you. They made their choice - and that choice is PHP.

It's PHP because of Wordpress, Joomla, Drupal, OSCommerce and 1000s of other apps they need to extend and support.

It's PHP because Microsoft needs/wants to exert control over the platform, suffocating CMS plays like DotNetNuke and Umbraco (Orchard... you know what I think about it).

It's PHP because C# isn't dynamic, and it's not easy no matter what you do to it - it's C#.

It's PHP because *it's not Microsoft*.

You know this already, so does ASP LT. Add marketing and LCS and ... boom: WebMatrix.

Blow my mind, Bertrand. Take me forward - that's where my WOW is. I already did my TRS-80/Apple 2c/thing.

# August 3, 2010 2:27 AM

Charlie Barker said:

My First programming experience was onthe BBC model B, I just hope that qualifies me to comment ;)

As a profession Programming has a huge number of people gainfully employed within it. The problem is not all of them are professional. The main problem that prevents the introduction of meaningful qualifications is the mind boggling pace of innovation. Within  the structural engineering profession in the house building industry the same materials have been used for a hundred years. In our industry your told that your skills will be out of date 3 years! In time through an evolutionary process I believe the pace of innovation will slow and this problem will ease.

Let me qualify the above by saying the size of the building you are constructing will dictate the level of expertise your structural engineers need and software is same. So how do we turn 'mud hut' devs into 'sky scraper' devs? I believe education is the answer kids attending CS courses need to leave college with a good understanding of principles and patterns. They need at least to be aware of these concepts before they can go about learning how to implement them in Z# or whatever the latest cool language is.

# August 3, 2010 2:40 AM

Bertrand Le Roy said:

@Rob: somebody who hasn't started has not already been appealed to, by definition. I am not filtering anything, selectively or not: I'm just running with scissors and having lots of fun doing it. I really believe, from the heart, that this is the key to appealing to *some* people. I'm not sure who they will be (I do have some ideas but I may be wrong and it doesn't matter).

And to be frank, the attitude I'm tired with is the Guardian of the Temple attitude. I want more people in the freaking temple. I want people to dig holes through the walls of the freaking temple.

And yes, you *are* saying "you're doing it wrong". All the time. Listen to yourself. (and I'm saying this as a friend, really, because I care).

And for what it's worth, you know how I feel about which language should be used for this kind of stuff, so your C# argument doesn't move me much ;)

# August 3, 2010 2:46 AM

AlexanderB said:

I've started with a qbasic under dos, in age about 12.. i liked it very much and my dad inspired me for programming :).. I had a book, something like "Basic for kids" that was all my computer literature :)

after I had a great pause in my development "carear".. back to programming near 20 then I was studing in university. I was also to start help my dad to do some computation of science problems he worked on.. that's there I met C++ :)

i remember it was hard :) understanding of OOP concepts, virtual functions, templates, exceptions.. wow, I've spent a lot of time with a Stroustroup book. But those efforst gave me a change to find a job as junior developer in one of the companies.

I'm no longer work with C++, but more with ASP.net/C#/JavaScript.. but that was a great time, when you studied yourself with programming :)

Thans for you post :)

# August 3, 2010 3:41 AM

Rob Conery said:

Love the fire :) - it's what I really liked when we started Orchard :).

Prove me wrong dammit! LOVE IT. Don't just tell me "all you do is complain" - bullshit to that! "Guardian of the Temple" is a load of crap :):):). I'm standing in your store - I'm rolling this thing around my hands and... I don't get it!

Who's wrong here? The person who doesn't want to buy "thing", or the shopkeeper who thinks customer is lame for not *wanting* to buy thing?

I have a post coming on this - believe it or not it will be positive :). I don't really think I deserve to be lumped into the "masses who don't get it" simply because I choose to question Yet Another Data Access Tool, and Yet Another Web Framework that's appealing to ... whom? Yes, I know - not me.

# August 3, 2010 3:48 AM

Louis DeJardin said:

Started with BASIC on the VIC-20, then on C64, eventually mucking around with a little bit of assembly. Almost same CPU as in Bender's head, now that you mention it.

And agreed - Mule and Scott Adams Adventureland are both classics. Remember to yell at the bear, kids.

Still remember learning as you go. Thought it was funny even at the time in BASIC the standard was to number lines by ten so you could always wedge more logic inbetween as you need it.

# August 3, 2010 4:04 AM

John Kerr said:

I guess I started on an ICL mainframe, but it's hard to say, I never actually saw it...

mycodehere.blogspot.com/.../security-101-part-1.html

As you can see in 1972 we were living in the future and working remotely!

# August 3, 2010 4:12 AM

Louis DeJardin said:

And for your viewing enjoyment, a tribute to everyone "doing it wrong". (via @codinghorror)

www.youtube.com/watch

# August 3, 2010 4:13 AM

Rei Roldan said:

Started with Basic on a Sinclair Spectrum at the age of 6 - 7, 23+ years later... I still have it :)

# August 3, 2010 4:14 AM

Ryan Heath said:

I started with BASIC on the C64 I think at the age of 12/13. I do not know what inspired me, maybe it was to desire to show off at the stores to leave a computer in a running mode ;)

10 PRINT "I WAS HERE"

20 GOTO TO 10

I also heard assembly was much faster than BASIC. In my attempt to create a fast prime sieve, I programmed it in assembly, but it was a complete failure awfully slow ...

Later I moved to Atari 1040ST because of its midi interface, my interest in music and Steinbergs Pro-12 was running on Atari. In GWBasic I created several programmes. One could record music played from the synth. When it was done I immediately started recording some beautiful song then suddenly it became clear I had forgot to program a save function ...

Another one was based on a then popular LINGO TV game. I literally took a dictionary and spent days inserting words into the program. One day I came from school I found out my little sis had erased the disc ...

Ah, those memories :)

// Ryan

# August 3, 2010 4:57 AM

David Taylor said:

Started bugging my father (a teacher) to bring home an Apple II from the school on weekends (age 8), and spend the week writing BASIC programs and running through them in my head waiting for the borrowed computer over the weekend.  Got my first computer (BBC Model B) at age 10 and started learning the much improved BASIC along with 6502 assembly language.  Purchased PASCAL ROM chips, and after getting an Amiga (6800 Assembly) and finally a PC, learned Turbo Pascal / Delphi.

Did some C/C++ and lots of Java in the 90s; but it was probably my Delphi experience that lead me to .NET when the first preview was released back in June/July 2000 (Anders influence on C#, Properties, etc).  To me Java was always missing something, and C# just felt 'right' immediately (reminded me of Delphi).

I did software engineering at Uni, but always was better at teaching myself.

You are correct, we did not start as experts and you are going down the right track.  Ignore Rob.  Sure a lot of the community just don't like Microsoft for no other reason than you are Microsoft - but you do not need to appeal to everyone.  WebMatrix and Razor are smart because you are allowing people who know only a little HTML and a little C# (or another language) to start playing.  If they keep playing and actually have fun we grow the industry and some of these people will be wonderful programmers in 10-20 years time and have fond memories of their first experience which you may have aided.

David Taylor

# August 3, 2010 5:27 AM

Hervé LEMAI (Cimail) said:

Sinclair ZX81 in basic  with 1ko memory.... atthe age of 10...

in french : www.youtube.com/watch

later on C=64... with peek and poke command.

# August 3, 2010 6:33 AM

ryanpeters said:

I started on an original Apple II with cassette tape drive. I started learning BASIC when I was around 5. I remember when we upgraded to 16K of RAM and a 5 1/2 floppy drive, we were living the high life. We still have the computer and I keep thinking about digging it out one day...

# August 3, 2010 7:33 AM

Paige Cook said:

Started with Basic on an Atari 1200XL around age 10. First program was making a ASCII art rocket that scrolled across the screen.

www.atarimuseum.com/.../1200xl.html

# August 3, 2010 7:55 AM

Bobby Dimmick (@kr4ster) said:

I started the same way: BASIC on a TI99/4A when I was six.

And not to necessarily throw-in, I understand where both you and @Rob are coming from.  After I melted my TI (never leave those things plugged-in overnight!), I didn't get to use another computer until Middle School.  Regardless, I quickly got into assembly, C/C++ and later perl (even though at school we were working in Pascal, ADA, C++, and Java).  I enjoyed the appeal of reverse-engineering -- doing things I wasn't "supposed to do".  I never really considered myself a "l33t haxx0r!", but nothing beat the feeling of giving myself unlimited gold and changing the screen colors and sprites in the gold-box games.

I tried to teach myself C early on, I really did.  But the rigor required and time spent with little-to-no-payoff just didn't appeal to me.  @Bertrand, I applaud what you are trying to do.  I've seen it on so many levels (C Robots, anyone?).  But putting it out there is the only way to reach those who want to learn.  But, @Rob has a point: the younger generation isn't motivated by money or building resumes -- they're out to have fun.  Write a tool that blows websites wide-open, or allows for quick and easy creation of games in Silverlight.  That's probably as close as you might get.  Conversely, where I think you will see a big win with Web Matrix and the like is with new professionals or those interested in moving into software development.  I have picked up very few skills that required a huge initial investment (in time or money -- at least at first), and providing the tools and guidance people need to get started is an excellent way to begin growing the community as a whole.

# August 3, 2010 9:00 AM

synapse said:

Basic on Russian BK-0010 PC 20 years ago.

# August 3, 2010 9:33 AM

KevDog said:

My high school (I graduated in 1982) had an IBM 360 that I wrote Cobol and Fortran programs for on punch cards. We also had a Sperry minicomputer with tape drive and platters that I typed Adventure into to play when teachers weren't looking. Those were the gateway drugs, along with going over to my friend's house and writing BASIC for a Commodore Pet.

From there, I saved paper route and pizza delivery to buy an Apple IIe.

Been writing code and connecting wires ever since.

# August 3, 2010 9:54 AM

V said:

Started with Borland Pascal 20 years ago (1990).

# August 3, 2010 12:00 PM

Sean Patterson said:

I'm another TI-99/4a with Basic guy. I was about 10 when I got the computer as a Christmas present from my aunt. I spent HOURS typing in the example code and making it do "cool" things like bounce a ball around the screen.

I then discovered the difference between in memory and on disk storage when I thought simply saving the program in memory stayed there after you shut things down. Sadly I had no cassette drive. 8^D

# August 3, 2010 1:24 PM

Francis Adu-Gyamfi said:

I started with Javascript (doncha know) in 1999, then worked my way up to Java and then back to AJAX powered web apps with PHP.

# August 3, 2010 1:28 PM

Bertrand Le Roy said:

@Rob:

> Don't just tell me "all you do is complain"

You know I'm a big fan of what you're doing with TekPub so I kind of resent the made-up quote ;). The educational work that's being done there is essential. You are lifting developers to the next level. Thank you for that.

So you should see what MS is trying to do with WebMatrix in general as a way to get more business in the future: new folks to educate!

The way we're doing it is of course debatable and I'm sure the team is getting the feedback loud and clear. I did not target you personally with this post and I certainly don't put you in the same category as some of the most vicious commenters on David's post.

> "Guardian of the Temple" is a load of crap :):):)

Again I don't think it is. This is exactly how some members of this community are acting.

> I'm standing in your store - I'm rolling this thing around my hands and... I don't get it!

That's fine, you're not the audience. You did a fine job telling me that I'm not one of the PHP kids. Well, neither are you.

> Who's wrong here? The person who doesn't want to buy "thing", or the shopkeeper who thinks customer is lame for not *wanting* to buy thing?

That is a great point, but I feel like a balloon guy hearing an old geezer tell him "I don't need no freaking balloons". Let's see if the kids want some of our balloons first and then we can discuss which color sells the best.

> I have a post coming on this - believe it or not it will be positive :).

Looking forward to it.

> I don't really think I deserve to be lumped into the "masses who don't get it" simply because I choose to question Yet Another Data Access Tool, and Yet Another Web Framework that's appealing to ... whom? Yes, I know - not me.

Don't play the victim now ;)

# August 3, 2010 2:53 PM

Jeff said:

I started with Microsoft.Data API ;)

# August 3, 2010 4:27 PM

Andrew Jacobs said:

I think the diatribe with Rob is the most fascinating part of this post.  I was just going to chime in with a "BASIC from the back of 3-2-1 Contact" note but I was intrigued.

Regardless of whether any of us understand the motives of "PHP Kids" we need to realize that none of us use the same technologies we started with.  If the only thing you learned while writing a COBOL program was COBOL syntax then I can guarantee you're out of a job.

If, on the other hand, you learned critical thinking, program structure, team communication, and how to get things done then you've got skills you can take to the next "generation".

# August 3, 2010 5:05 PM

Bertrand Le Roy said:

@Andrew: great points you're making.

# August 3, 2010 5:36 PM

JL said:

In 1970, APL on a special terminal with the APL characters, connected (through the cloud, mind you) to an IBM 360.

I fell in love ...

# August 3, 2010 6:21 PM

Steve Gentile said:

I'll probably be ignored here but here is opinion:

If I want to be a young dev your trying to attract you have to look at this: (1) financially not much dough (2) probably going to build something fun - ie a gaming hobby site let's say.

So I go sign up for a host with my gaming friends and we sign up ..  Oh let's say Bluehost for $6.95 a month right?

Next we look and see they have (1) MySql and (2) php, perl and ror .  Let's say they go off and create this site with php then.  And they have this nice MacBook their parents bought them for their sophomore term at State U.

I just set the ground work.  Betrand come to this world and not commodore64 world :)

So Microsoft has no place in this world because they only want you to run .net on Microsoft OS machines on IIS with MS SQL tools.

I don't think it's the 'tools' - you learned your first skills regardless of skills right?  I know I learned MySql because I certaintly can learn this on some expensive Oracle database right?  

What am I saying... It's not about the tools it's about accessibility.  If Microsoft wants to expand it's base then how about making it more accessible to devs outside of this 'it has to be built and run only on our OS and server' mentality!

I should be able to install VS 2010 Express on my Mac (just like I can install Eclipse on a Mac,windows,Linux box) and create a .net mvc 2.0 app using Linq that comes with a MySql database and then deploy my app through FTP to run on the Apache server.

Now if I can do that THEN maybe that person would find value in these novice tools and in this technology.

Maybe?

Right now the MS world is just constrained in the commercial world that I can't really see some young dev today be able to build a web app in .net and even have a place to put it.

MS has fostered this 'only on Windows' approach and I think personally it's not a good one.

# August 3, 2010 9:05 PM

kristofera said:

Atari 130XE - a 6502-based thing with twice the amount of memory addressable by the 6502 chip: http://bit.ly/a5LoW1

After buying it I realized that all software available for it was games so I had to learn how to write my own... ...I ran into the same language barrier as you, and ended up learning English from the manuals that came with the machine. :)

A few years later I moved on to PCs and by the time I finished high school I already had a programming job at a software company...

# August 4, 2010 1:31 AM

kristofera said:

...oh and Rob, I think Bertrand was trying to _avoid_ bringing that whole debate into his blog. There's plenty of space available in the rest of the intarweb to voice your opinions on Microsoft.Data... :)

# August 4, 2010 1:33 AM

Ryan Van Slooten said:

I started in 2nd/3rd grade with a summer programming class on an Apple II with Basic and then we bought a C64 and I continued with Basic reading magazine articles, POKEing and PEEKing locations, building sprites, and trying to make games. Since I had only seen Basic then, I didn't know there were programming languages without line numbers (how would you GOTO 1000 without line numbers!).

I wouldn't be surprised if the desire to build games fuels about 90% of all young programmers (<= 16 yrs). I can see it in my son (8 yr old) as well who tells me, "Dad, let's talk about my website..." When he really means I need to build a website for him with Flash (or Silverlight) games similar to clubpenguin.com, lego.com, or webkinz.com. Unfortunately my work schedule and deadlines aren't conducive to building games in my spare time! These young "go-getters" are often some of the best future programmers. As an aside, I wonder how many young programmers also grew up playing with Legos?

@robconnery, it seems your comments are getting more inflammatory all the time, even for people who occasionally read your material and know (more or less) what to expect. You completely hijacked this blog post in your own direction as well. This post was rather innocuous and apparently a Rorschach test where you jumped to conclusions and even postulated on Bertand's reason for composing the post which reveals more about your own opinions than Bertand's. That isn't to say you don't have good points or valid arguments, it just seems more subversive (negative) than provocative (positive) to the observer. Just an observation...

# August 4, 2010 12:21 PM

Bill Mild said:

I started in BASIC on a TI99/4A, too!  Then Extended Basic.  Then, my dad got me this computer which was supposed to be the next generation TI99/4A ("Geneva?  What that the name?).  But, turned out to be a bad move because everything went PC.

Then, learned Pascal in high school.  The school has Radio Schack TRS 80s and then they were upgrading to PCs.

Then, I went to seminary to study for the priesthood and, but the time I got out and back to computers, everything had changed.  I remember telling my dad (just out of seminary) that CD-Roms were a dumb idea.  So, he didn't get a CD-ROM on his computer.  1 year latter, there was no more software available on 3.5 inch floppies. Opps.

# August 4, 2010 1:18 PM

N. W. said:

Grr. This just happened to me, with no warning at all. Usually I get a tray notification but not this time! Lost about an hour of work (why doesn't make a shutdown call that allows you to save programs, like the actual 'shut down' command??)I thought Windows 7 had fixed this 'feature' of XP. And for those of you who blame the user, you obviously don't know what you're talking about. XP in particular overrides your Windows Update preferences after certain updates, making the process automatic again without your permission.

# August 4, 2010 4:49 PM

John said:

I've had only a couple of minor issues with developing sites for us in medium trust.  I can only think of one instance (PDF generation with Telerik reporting component) that required full trust.  I've used the DevExpress ORM and most of the controls in the Telerik ASP.Net suite with no problems in medium trust or Rackspace cloud hosting.

I agree with Stephen that MS has done a poor job explaining the differences in code access security.

# August 4, 2010 5:57 PM

AlexeyV said:

ZX-Spectrum BASIC and then Assembler 15 years ago. It was amazing at that time :)

# August 4, 2010 7:11 PM

Adham Shaaban said:

To answer the original post: BASIC on Spectrum ZX then TurboPascal on PC (what a rush getting those first "apps" to work :)

And to add my two cents to the on-going shitstorm, I think if Microsoft is serious about appealing to the "amateur web developer" camp then they should start with the very basics: CHEAP, ACCESSIBLE HOSTING.  Without that they won't get very far.  No one will EVER in their right mind say "it's ok, i'll take the more expensive hosting because I really love Webmatrix and can't see myself doing PHP".  By definition these "beginners" don't know or care about the difference between ASP.NET and PHP. But they do understand very well the difference between a $4/mo plan (for LAMP hosting) and the equivalent $10/mo Microsoft one.  So here's a suggestion to Microsoft: take a portion of your massive data centers and offer dirt-cheap (or better: free!) developer web hosting (you already offer up tons of free space with hotmail and skydrive).  Then you can bundle WebMatrix as part of the package and bonus if you can tell a good story around packaging and deployment (like dead-simple, one-click publishing from WebMatrix to your shiny new free web space).  Do that and you will go a lot farther than releasing simple tools alone.

# August 4, 2010 8:49 PM

Nicolas Roux said:

I also started with TI499 too ! I remember my first program:

10 LET I = 0

20 PRINT I

30 LET I = I + 1

40 GOTO 20

I was fascinated to see how we could manage some automatic work with just a few line of characters !

I started working with VB3, falling definitively into MS world, then VB4, VB5, VB6. I came to C++ later, found it really hard, but ATL and WTL was great. I started some web stuff with ASP, and as .Net was launched I moved to management job, and left Visual Studio for a while...

I restarted to code 3 years later when we launched our startup and today, I can build full Ajax .Net applications, knowing nothing about ASP.NET...

# August 5, 2010 9:52 AM

Bertrand Le Roy said:

@Adham: well, the problem is that this is largely a perception issue.

Go to http://asp.net and click on the big fat Host button on the top right. You'll see three offers for different hosting needs. Then click on "find more hosters" and you can find offers that are really tailored to your needs (and you can sort by price). It starts at 1.42 euros a month. That is less than 2 bucks.

It is possible (and easy) today to find super-cheap ASP.NET hosting. Unfortunately few people know that.

# August 5, 2010 6:07 PM

Chris W said:

Very much looking forward to this, as I'm getting hammered with customers requesting the php stack CMS's, and I don't really wanna go there.  

Scott GU mentioned the razor view engine will be used for Orchard, can you comment on that?  

Furthermore, do you anticipate the capability for end users to edit the 'master-pages' (or whatever the templates are called) without an app restart (and the corresponding loss of sessions)?

# August 5, 2010 6:14 PM

Bertrand Le Roy said:

Sure I can comment on that: yes.

For your master page problem, I'm not sure what you mean, as far as I know, changing a page (master or otherwise) does not usually restart the app. Furthermore, you can configure session to be resilient to that and I would argue that any application should be designed to be resilient to restarts: they can happen for a variety of reasons.

# August 5, 2010 6:19 PM

NC said:

When you put the blogging stuff in, your not going to copy Oxite right? Because Oxite was absolute crap.

# August 5, 2010 7:02 PM

Chris W said:

Re: app restarts - if you had an app with users editing live master page files, the app always restarts when you save the .master file.  

I've read that you can allow 'dynamic' master pages by implementing the virtual path provider, but this also restarts the app when compiling changes, so no gain there (I have not verified this myself).  I was hopeful the razor templating compilation might be able to get by without an app restart.

Very good point about coding the app to survive app restarts.  However, I'm imagining a case where app restarts could be frequent due to frequent live template edits.  For example, say you had content editor for the main site skin, with a preview.  Each edit and preview cycle would force an app restart.  I'd guess that restart would tax the server quite a bit, and app restarts do seem to make the site unavailable for a certain period of time as well.

# August 5, 2010 7:10 PM

Bertrand Le Roy said:

@Chris: yeah, first time I'm hearing this. I verified with one of the people who built the compilation in ASP.NET and it shouldn't be the case under normal circumstances: there shouldn't be a difference between master and normal pages and the compilation doesn't cause a restart until the 15th recompilation (by default, this can be increased through config). If you disagree, please send me a repro at bleroy at microsoft.

# August 6, 2010 2:22 AM

rblaettler said:

I'm wondering if I'm the only one, but what I am actually looking for is not a complete CMS or Blogging App, but more components that I could plug into my own exisiting app. Like, there is a View Component and maybe an Edit Component.

Would that possible with Orchard?

# August 6, 2010 3:30 AM

Roland said:

Bertrand, one thing the team should consider is to write a step-by-step tutorial to give a idea of how Orchard can be customized. The developer story is gone and it might be a good opportunity to deliver such a document. The underlying tutorial would be aimed at developers of course, not lambda end users.

What I am thinking of is to enrich the e-commerce step-by-step tutorial that Arnaud did a few months ago.

To me it would be a "get-go", which is of high interest before diving deep into the core classes.

# August 6, 2010 3:45 AM

Parag said:

In one of your presentation (or someone else) on Channel 9, they told us to point our Web Platform Installer to : orchardproject.net/.../orchardfeed.xml and we will be able to get latest builds.

However it still shows version 1.0, any plans to update that feed ? This CMS does looks promision. I would recommend to change to SQL CE instead of default SQLite storage (as it was in v1.0).

# August 6, 2010 7:42 AM

Webdiyer said:

Great, I'll check it out!

# August 6, 2010 9:41 AM

paul.vencill said:

@Bertrand,

I think @Adham's point was only partially about the hosting.  The issue is less about the tools to build on (your VS, your web matrix, your vim) and more about "the rest".  By "rest" I mean what he said (hosting, ability to code on any platform easily (I know, mono is available, but until it has direct, vocal MS backing many folks stay away & don't trust it to maintain compatibility) as well as things like familiarity, ease of finding help, and in many cases, existing free solutions (joomla, drupal, etc).  

A lot of it is also time-delayed, though.  PHP, et. al, have had a head start.  I really like the way that CodePlex has taken off, and how github seems to have more and more FOSS written in .NET every day, so maybe there is already a change in the winds, I don't know.  

OH, and to stay on topic...   BASIC on a Tandy 1000 from Radio Shack which sported a whopping 256 K of RAM which was, in my Dad's words, "More memory than we'll ever need"

# August 6, 2010 11:15 AM

Martin Bennedik said:

Is there a sample website, where I can get an impression about what is possible with Orchard?

(orchardproject.net says "Powered by screwturn wiki", not "powered by orchard")

# August 6, 2010 11:39 AM

Bertrand Le Roy said:

@Paul: well, what you say sounds an awful lot like "people want it to run on Linux and PHP, they are already using something else, don't bother, you lost."

We are doing the tools, we are doing the OSS apps, we even made sure PHP apps run well and install easily on Windows, we have cheap hosting, it goes on. I think one of our main problems is perception.

But seriously, how many developers do you know who develop on Linux (not where they deploy, where they develop)? MacOS and Windows yes. So that means that if you target Linux as your server OS, you are actually deploying to a different platform from the one you're developing on. I'm saying we have an advantage there (but I wish we were making more tools for Mac users).

# August 6, 2010 1:41 PM

Bertrand Le Roy said:

@NC: if you are expecting an answer to that (but I'm suspecting you don't), you'll have to be a little more constructive and specific. Otherwise, you will only succeed at one thing: looking like a troll.

@rblaettler: well, it's above all a modular architecture and a contents type system. It comes with an admin UI but you could build your own. I'd say that for simple things like a rich text editor there are already very good solutions out there (we use TinyMCE in Orchard) and you don't need a CMS (or anything above your web platform). Now if you're looking for something higher level such as something that dynamically builds editors for your custom types, you are either going to find something that is so generic to be unusable or it will come with more than you might want, such as the Orchard type system. You can give Orchard a try but I'm suspecting you're more looking for a component gallery.

@Roland: we added a lot of contents under http://orchardproject.net/docs. Can you give it a try and tell us what you think? There is also what Patrick wrote a couple of weeks ago: patrickyong.net/.../a-7-part-tutorial-on-project-orchard-based-on-the-latest-change-set

@Parag: I've deactivated that feed. You can find the current feed on this page: http://orchardproject.net/docs/Installing-Orchard.ashx As for SqlCE instead of SQLite, you'll be happy to know that this is already done.

@Martin: not yet but there are some videos that we'll make available shortly. We don't have a wiki module yet, which is why we have been using ScrewTurn.

# August 6, 2010 1:57 PM

John said:

This is great.

For anyone looking for an ASP.NET CMS why not go check out mojoportal. It's stable, been around for a while now and has been proven.

Umbraco is also a good choice.

I am not discounting this project but I would like to remove this misconception that ASP.NET doesn't have any viable open source CMS platforms.

# August 6, 2010 2:52 PM

Roland said:

Thanks Bertrand for the links you provided. The updated step-by-step is worth reading.

# August 6, 2010 3:30 PM

Bertrand Le Roy said:

@John: you are absolutely right.

# August 6, 2010 3:54 PM

Gregg said:

Related to John's comment regarding other viable, ASP.NET open source CMS platforms: is there a reason why MS chose to create yet another CMS? I'm not at all clear on why MS decided against participating in one or more existing ASP.NET CMS projects. I'd think that it might make more sense to engage in a community-based project (similar to MS' recent decision to formally participate in JQuery) rather than building something new that, if successful, is likely to overshadow community-started projects.

Was it a desire to build a CMS based on the MVC framwork (I think most viable frameworks seem to still be using standard ASP.NET Web Pages)? Or did MS look into supporting one of the existing MVC-based projects and simply decide it was feasible to create a new one? If so, why?

Thanks!

# August 6, 2010 5:37 PM

Bertrand Le Roy said:

@Gregg: that's a question that we're getting a lot from users but curiously not so much from the authors of said applications. Actually, we've been working with them to see how we can help them, in addition to promoting the platform with Orchard.

If you think about Microsoft's interest in this, we are not competing with them in the sense that our goals are different and compatible. Microsoft's interest is to increase its server market share and Orchard is one of several means to that end. Existing application authors on the other hand have their own set of goals that from our perspective contribute to that same MS goal of growing ASP.NET adoption.

Another thing to note is that in the PHP world, you have basically three big offerings, WordPress, Joomla and Drupal, that cohabit very well. There is ample room for everyone. We believe there is also ample room for ASP.NET applications. There is also more than one way to build a CMS and while we like what the other guys are doing, we hope we're bringing a different angle (MVC/Razor, the type system, dynamic compilation, that sort of thing), which in the end means more choice for customers and more opportunities to use ASP.NET.

# August 6, 2010 5:59 PM

NC said:

No, i'm serious. You have two of the guys who wrote Oxide on contributing to Orchard. Oxide was terrible. And one of the original roadmaps back when Orchard was first made publish stated that Oxide blogging would be integrated into Orchard. I want to make sure this DOESN'T happen because Oxide was terrible, and I seriously hope you actually sit down and spec out the blog functionality and write it properly and not try merge Oxides crappy codebase or functionality into Orchard.

# August 6, 2010 6:44 PM

Bertrand Le Roy said:

@NC: well, it's "Oxite", not "Oxide". We are not merging the codebases. But again you are not being specific enough. When you say "crappy codebase or functionality" I can't know what specifically you are referring to and thus can't infer any action to be taken to address any real problems.

Feel free to e-mail me your specific complaints at bleroy at microsoft.

# August 6, 2010 6:51 PM

Gregg said:

Fair enough, Bertrand. Thanks for taking the time to offer a thorough reply!

# August 6, 2010 7:53 PM

Roland said:

I was so focused on Bertrand's answer to my question that I didn't read the comments.

Orchard might not be a concurrent to other well-known MS-based CMS such as Mojoportal or Umbraco. True or not it is a fact that Orchard will strongly compete with the next version of Umbraco. Both will be MVC-based and embed NHibernate.

Learning a CMS is the way to go but, to be honest, I don't know which one to look into. Umbraco is fully documented and pushes by a vibrant community. A wrox book is to publish by the end of 2010.

Orchard is still a teenager but very promising. I wish MS could propose a strong support. Because struggling with real world scenario and no support to get by with lead to a disaster :o

Thanks to the Orchard team to be so devoted.

# August 7, 2010 5:14 PM

Bertrand Le Roy said:

@Roland: I think the right question is "compete for what?" What are the Umbraco folks after that is a limited resource and that we are also after?

# August 8, 2010 1:31 AM

Andrei Rinea said:

regarding perception MS should provide free or 1$/month shared hosting **AND** make that as public as possible.

I didn't know that you could find cheap hosting on the asp.net site.. and a lot of other people don't know it either.

Place a large banner somewhere..

---

A bit more on topic : @Rob : chill out man, why are you so nervous?

Even more on topic :

I started with interpreted BASIC on a HC-90 (ZX-Spectrum clone) back in 1990. Then went through Turbo Pascal, a bit of C++ (yuck!!!!), Delphi, Java and then .NET

# August 8, 2010 5:07 PM

davidebb said:

Might be worth mentioning the 'middle ground' approach, which is to take a strongly typed 'settings' object.  It has some positives from both approaches you cover:

- It's strongly typed (like default params)

- You don't need to recompile callers if you add params (like with dynamic)

Obviously, it's not perfect either, as it requires defining a new class, and the syntax is not as nice as with default params.

But it belongs in this discussion :)

# August 9, 2010 3:15 AM

Kishore said:

Betrand,

Before I answer... just want to say my response is just part of a healthy debate and stated in a "matter of fact" tone.

The answer to your question "compete for what" is the competition for CMS software market share. Here are a few notes/thoughts:

- I agree with Roland, if orchard succeeds, it will definitely "compete" with mojoportal, umbraco, blogengine.net for blogging/cms software market share.

- Yes, I agree there is "ample room for everyone" as you stated. However, it seems that there is an unfair advantage here, an MVC CMS system developed by a software company that is also developing the ASP.NET MVC framework( and yes I realize you might be on different teams/products, but i'm sure you still have considerable more information / resources / knowledgebase available to you). And also having additional resources for development, marketing and promotion. That seems quite unfair.

- The UI obviously is completely copied from wordpress. This might be cynical granted that Orchard is a "community project" but I would not be surprised to see Microsoft attempt to lead Orchard into the hosted CMS area to become a .NET version of wordpress. ( Again... competition for market share ), as well as another form of revenue.

- This is the problem w/ google, microsoft and other big companies, which is having the power and resources to monopolize after entering into a specific product area.

- It's possible that the primary goal of Orchard could be to help promote ASP.NET / MS rack of applications, but very likely at the expense of community projects.

- I think it's quite naive and sugar coated to say "... we are not competing with them in the sense that our goals are different and compatible". Really? Come on, so you only mention the remotely positive aspects and not even open to entertaining the conflicting and negative impact of orchard on the community cms systems?

-Kevin

# August 9, 2010 7:52 AM

Stefan said:

UCSD Pascal on Apple ][

Nobody could imagine ever need more than 64K RAM

# August 9, 2010 8:20 AM

Jens Fiederer said:

I started on Texas Instruments, but it was an SR-52: a calculator that was able to store its programs on magnetic strips (the "language" was essentially a machine language).  I had an independent study class in high school where I programmed it (it belonged to my Physics teacher/Calculus teacher/Assistant Principal) to solve Impedance problems in circuits.  I'm not sure there even WERE any proper computers on the island where I lived!

When I went to college I remember thinking that programming on real computers must be ever so much more difficult than programming on a mere calculator - I was amazed at how easy FORTRAN was (but then fell in love with Lisp).

# August 10, 2010 10:51 AM

Bertrand Le Roy said:

@Kevin: you seem to be assuming this is a zero-sum game. I think this is very wrong. The REAL competition today for ASP.NET CMS is PHP. What we hope to achieve with Orchard is not to take a bite of the existing pie of ASP.NET developers. We have no interest in that. Our interest is to grow the pie. Add new people and attract some from PHP. DNN, Umbraco and the others are trying to do the same. Everybody in the .NET community benefits from that.

Look at the PHP CMS market. There are three major actors there and a multitude of others. Why isn't there just one? Because there is more than one sort of people. Different people prefer different styles. Some people prefer the flexibility and smart architecture of Drupal, some prefer the ease with which you can enter and extend WordPress.

I'm convinced what we're doing with Orchard is different in spirit and style from what Umbraco and DNN are doing and thus will appeal to different people. I know for a fact from the e-mail I receive that what we're doing is appealing to some in a way that no other CMS on the market does. That's not to say we're better, just filling a niche: many people are telling us they were looking for a .NET CMS but didn't think the existing ones were good fits for their projects.

As for arguments of fairness, should Microsoft then stand there doing nothing while its market share erodes? You talk about monopoly but IIS has much lower market share than Apache, and Orchard market share is zero while Drupal, Joomla and WordPress (all PHP apps) share 90% of the CMS market.

That the UI is "copied from WordPress" does not seem that obvious to me, but it is a fact that the WordPress admin UI works well. There are worse sources of inspiration. But you should take a look at AtomSite ;)

Are Umbraco, Mojo, BlogEngine.NET and others complaining about Orchard?

# August 10, 2010 1:38 PM

John said:

I for one can validate Bertrand's claim. As an ISV, I was in the market for an open source CMS to ride atop our current product suite.  Up until Orchard, there simply wasn't an offering that fit our architectural style in the Microsoft ecosystem. We were seriously considering something from the LAMP stack.  Fortunately, we found Orchard a few months ago and are really happy with this project\CMS thus far.

# August 10, 2010 2:47 PM

Niels Hartvig said:

There's no such thing as one best CMS and with just a handful of open source CMSes on the .NET stack there's plenty of room for another one - some might even claim a need. So on behalf of the Umbraco team I welcome Orchard.

There's plenty we can learn from each other and while we might share mutual goals our methods and approaches are different. Just like the great diversity in the huge .NET community.

This will benefit everyone. Umbraco and Orchard as well as the developers, web developers, web designers and others in the .NET community. As "vendors" we'll inspire each other and get motivated to do our best. As a community you'll all get more and better products to choose from.

What's not to love?

Best,

Niels Hartvig

Founder, Umbraco

# August 10, 2010 7:44 PM

Bertrand Le Roy said:

@Niels: you're the man! :)

Actually, we haven't chatted in a while. How about a LiveMeeting one of these days? You know where to find me :)

# August 10, 2010 7:54 PM

Brendan Rice said:

Orchard looks very promising. I can't understand people complaining about having more choice. If you dint like Orchard choose something else, I think MS has learned from the mistakes made by Oxite and are doing a great job with Orchard.

Keep up the good work I am looking forward to 1.0.

# August 10, 2010 8:12 PM

Collin Yeadon said:

My first was the ti99 as well.  I shared a story on Jenson Harris' blog here ( blogs.msdn.com/.../483041.aspx )

# August 11, 2010 12:22 PM

john said:

@speednet........thats hilarious....factcheck.org is a leftist organization?

Well, reality tends to act that way......

# August 13, 2010 7:25 PM

wooncherk said:

@Kevin I am so sorry, but I think you are just too closed-minded. Why can't you see Orchard as a healthy competition, rather than an evil marketing step that MS is trying to take? Furthermore, as mentioned, Orchard is not directly competing with the rest, it's just doing its own thing to offer another type of CMS that .Net developers might need.

I've worked on a number of .Net CMS, and I must say none of them really suit my style, but I think Orchard is reall what I am looking for. I really hope Orchard can grow well in the future.

# August 14, 2010 8:10 AM

Kevin said:

@wooncherk :

Close-Minded? Not at all.. That's not my view on Orchard. All my bullet point statements were meant to answer one question:

Will Orchard compete / "overshadow" other open-source projects on CodePlex?

That's all.

If you're LOOKING for a CMS(like many other people), then of-course having more options is great. Who would disagree on that? But again, that's not the question I was debating.

- Kevin

# August 15, 2010 2:37 PM

Kevin said:

@bertrand:

Same thing.. I'm only trying to answer that one question as to the impact of Orchard on Open-source CMS Community projects!

However... I will give microsoft due credit and also point out the various things that are helping MS in their Market share( listed below ).

1. WebMatrix is a great way to cultivate open-source development on .NET. As an experienced c# developer and open-source developer, I was on seriously considering switching all my development work to ruby / scala,  postgres/mysql and linux. With the combo of SQL Express, IIS Express, Visual Web Developer Express, the MS Stack is looking a lot better these past few years.

2. C# Language Features, ASP.NET MVC / LINQ / Entity-Framework have been some of the best contributions from Microsoft in the past few years from a framework perspective. ( Even though almost everything has been copied from Python/Ruby, NHibernate, Rails ), excluding LINQ ( which rails has now copied in their latest Merb merge w/ rails 3.0 ).

3. Channel9.msdn.com videos to help keep end-users a bit more in the loop as the new developments at microsoft as well as instructional videos that are there.

4. C# on Linux. This has been another major factor to considering .NET as an alternative for other multi-platform solutions.( although I still believe it's going very slowly and not fully there ). Even though ASP.NET MVC can supposed run on linux, I've never tried myself.

These things in themselves are promoting .NET / Windows platform as an alternative of the LAMP stack. Now if microsoft would only create a express edition of Windows!

But I still stand by my words. If Orchard is successful, it will compete with and possibly very well overshadow all the open-source CMS community projects.

-Kevin

# August 15, 2010 2:54 PM

2piix said:

Marcel:  If you want to know why to care, it's because of the algebraic structure monads expose.  Their main function is to sequence "actions", by bind the result of one action to the next.  But this isn't as far as you can take the abstraction.  For one thing, every monad is a functor.  This means that a monadic action that returns a value can/should be interpreted as a "left value" attached  the value.  You can interpret this left value any way you'd like, and use the result to modify the "right" value.  In short, a monad is a custom made control structure for your specific problem.  There are some nice pre-built "monad transformers" that make monads that attach monads to values -- for example, state monads to custom monads.

It becomes extremely easy to organize code this way, without having to resort to ugly OO "patterns".

To get technical, every OO inheritance hierarchy is a meet semi-lattice, and so it's a monad.  Now, I am not suggesting that inheritance and monadicity are the same things, but inheritance is "monadic", in the sense that every meet semi-lattice generates a "monadic adjunction".  Some of the familiar OO patterns are encoded monadically.  For example, fmap encodes the OO factory pattern.  Monads encode patterns that run functions that depend on values, with a simple consistent notation.

# August 16, 2010 2:12 AM

Iian Neill said:

It all began for me when I was five or six with an Apple IIc.  The system disk was faulty so for years I didn't have ProDOS or any way of saving my BASIC programmes.  My programming education - if you can call simply having fun education - began with the Usborne series of teach yourself BASIC books, which took you through things like writing adventure games, kids' primers on 6502 machine code, etc.

# August 16, 2010 10:35 PM

Guy said:

Level-I Basic on a TRS-80 Model I

I still remember the manual with a cartoonized TRS-80 cheering up the pages...

# August 17, 2010 8:27 AM

Macario F. Pedraza said:

Interesting, reminds me of my PropertyTree class that I've been blogging about here mfpedraza.wordpress.com/.../welcome-to-the-machine-introducing-propertytree

# August 17, 2010 2:19 PM

Niels Hartvig said:

@Kevin: If Orchard overshadow all the open-source CMS community projects then it's because they weren't good enough. Period.

If that'll be the case then it's - with all respect - not the fault of Orchard but the fault of the various projects, including the one I'm involved in (Umbraco).

So far MS is actually helping community projects like Umbraco even though they're funding Orchard. We get promoted by MS, used by MS (on http://asp.net for instance), praised by ScottGu and ScottHa on Twitter, invited to speak at MS conferences along side Orchard, etc.

Why? Because any successful open source CMS means more SQL Servers and Windows Servers. That's big business for MS. The core of an open source CMS isn't.

"A life lived in fear is a life half lived".

Now, Dance!

# August 17, 2010 4:04 PM

asdf said:

Kinda true , of all the new games in the last few years , my highest expectations of fun is the new GH Warriors of Rock , I never played Rock Band ... the songs aren't  that good , I dont download songs anyway , I have GH 5 , GH Metallica , and GH 5 , what is the best guitar hero ?

# August 18, 2010 1:26 PM

InfinitiesLoop said:

The implicit casting (coin term: molding?) is brilliant and would seem useful for other scenarios too. For example, you've got an IDictionary<String,Foo> and you want to treat it as an interface that defines some properties that happen to be keys in the dictionary.

ISomething something = Clay.Proxy(dictionary);

something.Value1 = 1; // dictionary["Value1"] = 1;

For gets, it could also implicitly 'mold' the value, for cases where the value itself is also a dictionary:

Foo foo = something.PropertyOfTypeFoo;

// Clay.Proxy(typeof(Foo), dictionary["PropertyOfTypeFoo"])

This would be great for JSON deserialization from JavaScriptSerializer, where you've got a hierarchy of objects as dictionaries that all boil down to just simple values in the leaves. Currently you pretty much have to manually build the objects from the Dictionary.

# August 18, 2010 1:58 PM

srulyt said:

Awesome!

It would be cool if Clay would also allow access events that could be set like in jQuery.

so Person.FirstName() would return the first name and Person.FirstName(x => LogAccess(x));

or whatever other function you may want to hook in. This could allow the setter of the data to hook in and see who accessed it. Could be very useful in a CMS type environment where you may have multiple modules adding data and multiple partial views accessing it.

Besides all ofthis. How is performance?

# August 18, 2010 2:12 PM

yysun said:

This is cool!

My question is if Clay object supports data binding?

# August 18, 2010 3:26 PM

Bertrand Le Roy said:

@InfinitiesLoop: yep, that would be an interesting application. Actually, serialization/deserialization is something that would be interesting to add.

@srulyt: well, the good news is that this would be fairly easy to add as an extension. More on that in future posts. The bad news is that assigning a Lambda to a dynamic member is not as easy as it sounds: the C# compiler doesn't let you do it without some expression goo.

As for performance, we haven't looked at it yet, and it's using dictionaries internally but in principle it could use the same tricks that ExpandoObject is using and get quite fast. Anyway, for the moment we want to use that where performance is not a big issue and where convenience is way more important.

@yysun: not yet. What exactly do you have in mind?

# August 18, 2010 4:11 PM

Robin Debreuil said:

wait, I do get intellisense/serialization/compile time errors etc when I make classes for data...? Why is that the wrong way again?

# August 18, 2010 5:40 PM

Bertrand Le Roy said:

@Robin: it's not "the wrong way" if it works for what you're doing. But you need to create a new class for each shape and more importantly you can't graft new members after the fact. With this, you can have a multitude of agents contributing to building the same object graph and adding stuff that wasn't planned for initially.

# August 18, 2010 5:46 PM

Kevin said:

@Niels Hartvig

Niels... please provide a more appropriate quote so I can actually take it seriously. I was quite amused :-)

Before I continue, I'm well aware of Umbraco and let me say this with genuine sincerity...

Congratulations on the success on Umbraco. It truly is a good product with good support and it's great to see open-source projects such as yours and several others succeed. I may be presuming, however, it could very well be a testament to the age old thought of pursuing your passion and obtaining success without actively wanting it. That could be a somewhat poetic definition of "open-source". And I'm no poet mind you. Not every project/every startup/every person could be so lucky, so you should be grateful as I hope you are. As per your little quote, there are many men and women who will never fear or back down from any obstacle, yet there may be many obstacles that can never be overcome.

Again... for anyone just coming in. I'm answering one question:

"Will orchard compete with and possible overshadow other open-source .NET CMS projects" ?

Now... let me try my hand at some analytic reasoning.

1. From your own website: "umbraco is an open source project with roots back to year 2000 even though it wasn't released as open source until 2004"

   So basically you've got a CMS system with a) 6+ year headstart on Orchard. b) you've got a core dev team of 7. c) Again several years to spend on building it up.

2. I'm not that surprised Microsoft is a sponsor/supporter of your project( you've been helping the MS/.NET stack for the past 6+ years with your CMS before orchard ).

3. Microsoft Orchard team has a total of 12(coordinator/devs) on the project. ( I'm sure that some of the coordinators are devs as well )

4. The Microsoft Orchard team may work full time on the open-source project. ( In fact, I saw a paid job posting for Orchard on this site ).

5. Many open-source projects are developed part-time by developers after their normal job or start off as a one man shop ( mojo-portal as an example ), and less so as a multi-member team working full time.

6. It would take a VERY high degree of innovation / creativity / resources by a competing open-source .NET CMS project to overcome the physical man power, expertise, and resources of Microsoft and it's Orchard team.

7. One open-source .NET cms team competing with another open-source .NET cms team may represent a more or less fair competition than one competing with microsoft/orchard team.

   

@Niels

Yet... you brazenly mention that if an open-source .NET CMS gets overshadowed by Orchard, it's because the open-source CMS isn't good enough? Can you honestly justify that statement given the facts above? If want to debate that one question, then please do so rationally. I'd like you see your dance moves now! :-)

@Bertrand

I suspect that you may not be receiving open and public feedback from the authors of "said .NET open-source CMS apps" because any public feedback contrary to supporting Orchard would only indicate possible weakness and/or concern for the continued development/success of their own product and would only help reduce an end-users confidence in it. For any author responding otherwise, their support may possibly indicate the reversal of the last statement ;-). I will continue to remain open-minded and will concede that orchard is healthy competition for open-source .net cms systems instead of possibly "overshadowing" them, if, not 1 but many of those authors genuinely support orchard.

Cheers.

-Kevin

# August 19, 2010 1:22 AM

Vincent said:

This is amazing. Just tested it out and it feels very smooth.

The only thing is that you lose Intellisense when you pass the created object graph into a View of an MVC app (ViewPage<dynamic>).

Still doing <%= Model.FirstName %> perfectly renders the correct value of course.

Or is there a way to "enforce" Intellisense for a dynamic type?

# August 19, 2010 1:33 AM

Robin Debreuil said:

I'm pretty sure you would agree 'less typing' isn't a good reason to give up compile time safety, but I've done a ton of AS/JS and understand the attraction

I've never really worked in a domain where I needed to munge unknown types together at runtime though. REALLY not questioning it, I know everyone has a different set of problems in different domains - I am curious what kind of things that is though..? Is that like user generated data? This is OT, feel free to ignore, but isn't handling data like that basically impossible anyway? Or is it more wrap it and send along, or just display it? Or maybe you get code that handles the objects from the same source?

Always cool to look at problems through the eyes of others : ).

To be honest, I do cringe a little seeing C# able to run blind like JS, but if you are authoring it I'm sure it is sensible and in good hands : ).

# August 19, 2010 3:01 AM

Bertrand Le Roy said:

@Vincent: as the article shows, you can cast into an interface type and get IntelliSense but if are willing to do that, it's actually quite likely that you will get little benefit from not using a statically-typed object as your model.

@Robin: community-created modules can all chime in on the creation and enrichment of any node in the tree of view data that can be displayed on an Orchard page by community-created themes. Even a specific node might get enriched with new properties and children by multiple agents. You've got tiny bits of data being collaboratively composed into the view model, and tiny bits of themed templates rendering them.

What you trivialize by referring to it by "less typing" is actually quite important. In particular when dealing with a designer audience, being able to write item.title rather than item.Attributes["title"].Value is very important. And as I said in the article, you *already don't* get IntelliSense on what matters here, the data.

It shouldn't be that surprising that people prefer to manipulate an HTML DOM using jQuery rather than the native DOM API. One is fluent, dynamic and concretely data-centric while the other is static and focuses on the abstract structure of the tree.

Same thing here. I'm certainly not advocating that you use Clay where you can easily create a good static model. But there are are many cases where a dynamic type works a lot better.

# August 19, 2010 3:46 AM

jeroenh said:

I really believe that dynamic does have it's place in C#. In many cases it's better to rely on static typing, but sometimes static typing just get's in your way (reflection, DOM-style API, XML, ...).

I like how you can 'opt in' to dynamic in C#, simply by using the 'dynamic' keyword. It gives us best of both worlds. At the same time, the built-in dynamic features are pretty lame, so Clay fills in a gap here. This stuff *should* have been in the framework in the first place. It is what `dynamic`/ExpandoObject/whatever should have been.

Very nice work.

# August 19, 2010 4:42 AM

Tony Steele said:

I'm currently using ExpandoObject with JSON.net too serialize/de-serialize between json and dynamic objects, it makes handling interaction between a javascript client much easy.

But you library looks an even better match than ExpandoObject for handling JSON on the server.

# August 19, 2010 5:45 AM

Matt said:

Hear, hear. Great post.

# August 19, 2010 9:08 AM

Mike Hamrah said:

Really interesting stuff going on here.  This functionality combined with document store databases will open a whole new world to C# programmers.

# August 19, 2010 11:55 AM

Bertrand Le Roy said:

@Kevin: you're moving the goal post.

# August 19, 2010 3:05 PM

Ed said:

Roy,

The link provided: code.msdn.microsoft.com/KB969612 will open a new page where there are 5 tabs (Home, Downloads, Discussions, People, License) but on download one it says: This Resource has no releases.

On Home tab, there are no instructions on how to apply the fix either.

Doesn't look very professional to me...

Any solutions?

# August 19, 2010 7:34 PM

Bertrand Le Roy said:

@Ed: errr.  "The hotfix that corresponds to KB969612 has been superseded with the hotfix KB981201, which contains all fixes that were previously included in KB969612. You should use the hotfix KB981201 to fix the issues described in KB969612."

Alternatively, you can upgrade to a more recent version of ASP.NET.

# August 19, 2010 7:42 PM

Robin Debreuil said:

cool, thanks for the description - checking out Orchard now...

I'm certainly not advocating using attr["foo"] vs attr.foo, just I never really need either in the domain I work in. I'm sure it makes sense in domains like Orchard.

And you aren't saying people should use dynamic where they know things at compile time, so seems like we agree all around : ).

btw, cool name, it evoke 'written in stone' vs 'written in clay' with just four letters : )

# August 19, 2010 8:08 PM

ms440 said:

Way cool! Thanks for sharing this. I'll try Clay over the weekend - it looks like the domain requirements of the app I'm working on are quite similar to Orchard's...

# August 20, 2010 1:53 AM

Biswaranjan Behera said:

I want show a message box which will first confirm if i click ok it wil redirect me to next page.

# August 20, 2010 10:36 AM

ms440 said:

Is there any way I can find what props were already set on the Clay object?

In DynamicObject I could cast it to IDictionary<string, object> and get the Keys. Is something similar is possible in Clay?

Thanks!

# August 20, 2010 7:57 PM

Bertrand Le Roy said:

@ms440: yes, reflection capabilities need to be added. This being said, I think you should be able to cast a Clay object into IDictionary already.

# August 20, 2010 8:01 PM

Bill Ramirez said:

Commodore 64

Apple II Basic

Helix for Mac

Think Pascal for Mac

Turbo Pascal

Light Speed Modula II

FoxPro

... years and years....

asp.net MVC

# August 20, 2010 9:01 PM

schotime said:

mIRC

# August 22, 2010 10:37 PM

onof said:

I started writing a program to compute the planet orbits with an abacus. We migrated to Visual C# in 2003. I still prefer the abacus: it did not throw obscure exception.

# August 23, 2010 5:20 AM

Ted R. Smith said:

Hmm, funny.  I have always found ample PHP work.  it just depends on where you live.  Houston, TX (aka ASP.NET Land), good luck!  300 miles north in Dallas, TX? Hell, there's more PHP out here than .NET.

If you're prepared to move you can always find 6-figure php jobs if you're a good coder and the mid-60s is easy to find if you're not.

# August 23, 2010 10:40 AM

Nahu said:

Thanks alot for the updates. I had an underscore in my hostname and it would have taken me ages to find that out.

# August 26, 2010 8:43 AM

falken said:

I started with paper made cuttoff kit "computer" from kids magazine. Pencil and rubber required to store and clear and own eyes to load - from set of "registers". Narrow paper with pseudocode passed through current instruction window (yes, windows already there:-). My brain as processor and calculator as ALU. I remember for funny "Lunar Landing" algorithm executed many times :-D

Then irish programmable calculator Calcul PSR-98e, quite nice toy.

Then I8080 based PMI-80 school computer (hex terminal). Machine code to play melody at first run played content of ROM monitor due to coding bug, so nice cosmic sounds :-)

Then similar TEMS-8000 school computer, equipped even with stepper motor. Task to do some exact sequence of motor operations resulted in little interpreter (DSL) for few motor related commands.

Then Atari 800XL - its basic and 6502 (still fan!) machine code, ATMAS-II macroassembler (emulator for I8080 code as school project + Action! OSS Cartridge memory paging emulation optimized in ASM)

Then TurboPascal on PC/XT/AT - networked hospital IS of 20 workstations on Novell Netware

AND THEN ... "PC FAND" - difficult to describe here, but this model-centric tool started my addiction to "models first", resulting in difficult living as developer for next 15 years, when tool died... Today, it looks that LightSwitch returns me to the game of clean bussines logic again

During last 15 years - Delphi, Java, C#/NETCF, Python, everything far from clean bussines focussed "logic only" solutions :-D grrrr

Still, it seems that I am not good developer after almost 30 years too. I dont want to write again and again the same system things. I want to do it right(!), but its really difficult to do it right(!) in time, when I really desperatelly need to solve bussines logic(!!!):

LightSwitch, howgh!

# August 26, 2010 7:28 PM

Gareth Mark Elms said:

I'm looking forward to seeing this progress and following along, thanks

# August 28, 2010 6:58 AM

Joey said:

Great stuff -90% of my requirements are making the site look how my customer wants.

I like the modular approach - however, I hope Orchard makes theming easier

Could you please post on how to create a unique website look and feel using Orchard ?

(my email through your blog must not work, as I didn't get any replies)

# August 28, 2010 10:42 AM

Bertrand Le Roy said:

@Joey: we are working on the theming and general UI composition story. This is why I'm not investing in building my own theme right now and neither should you until the end of this milestone (ends in September) if you don't want to have to redo it almost entirely. :) Thanks for your patience...

# August 28, 2010 1:22 PM

Nicholas Mayne said:

Looking good so far, never noticed those blogpost.import.commands before....

# August 30, 2010 4:30 AM

Raj said:

Does current milestone ends on 1st Sept as mentioned in the roadmap? or is it going to be taking some more time? starting a client project and ready to take some risk, but just need to know about the UI composition plan? So I can make the plan accordingly.

# August 31, 2010 3:00 AM

Bertrand Le Roy said:

@Raj: it's not the milestone that ends Sept. 1st, it's the iteration. The milestone ends at the end of September.

# August 31, 2010 3:05 AM

Raj said:

oh ok. Thanks for clarification. so will we be able to start kind of working with UI stuff after this iteration? even if not final but at least the idea of where the UI story is going?

# August 31, 2010 3:33 AM

Brent said:

I am very happy to see Orchard as I've been looking for a CMS, commercial or open source, that takes advantage of the best features of Azure.

Regards,

# September 1, 2010 12:04 AM

Luke said:

I've written an article to sum up what bits of vs-doc are used to build Intellisense.. Hopefully it will be of some use.. www.scottlogic.co.uk/.../vs-2010-vs-doc-and-javascript-intellisense

# September 1, 2010 2:31 AM

Laurence said:

I like clean html and I don't want to see developer's comments. However I fail to see the problem with html file size. You're are talking about perhaps 1,2 Kb of comments per html page. That's irrelevant.

# September 3, 2010 8:02 AM

Bertrand Le Roy said:

@Laurence: if that's irrelevant to you, good for you! Some people care.

# September 3, 2010 11:48 AM

Shoe said:

Well...I have to admit, I lean right on some issues, and left on others.  I think personal responsibility needs to have a place in our society.  I still can't bear the farce that is Fox News.  Conservative or liberal doesn't matter with some things--facts is one of them.  How you INTERPRET facts can be dependent on a bias...but what the facts themselves ARE is not.  THAT is why I, even when I'm at (even strong) odds with liberals on the issue being reported, cannot STAND Fox News!

Does anybody remember the 2003 study?  The questions asked were important, but perhaps could have been more neutral (for example, I heard one justification that chemical weapons should count as WMDs, and we KNEW that Iraq had those because the US had previously GIVEN them those!)  Still, the sheer extent was still pretty laughable.  See the .pdf here: www.pipa.org/.../IraqMedia_Oct03_rpt.pdf

Because I wanted to see a poll that used another topic, I was more solidly pleased with drawing an opinion when I saw the 2007 study from Pew Research Center.  While Fox was not the absolute lowest (unsurprisingly, to me at least, that honor goes to the National Enquirer...though I'm a little shocked than anyone is using that as a primary news source to begin with!)  pewresearch.org/.../who-knows-news-what-you-read-or-view-matters-but-not-your-politics

According to the latter, by the way, comedy news parody shows that reference real events (like Colbert Report, for instance) honestly DID have higher rates of viewers knowing the facts tested (House Majority Party, Secretary of State, and Prime Minister of Britain).  And again, NPR ranked very high on the list (2nd overall, behind the New York Times and the Atlantic) for listeners knowing the true facts being asked.

As for a personal opinion, I have found that NPR has different slants on different issues and stories--mostly affected by the views and biases of the experts being interviewed and of the callers-in commenting on the story.  Even when I disagree with the conclusions being drawn by callers or the journalists themselves, I generally feel that I have received a wealth of INFORMATION--information which I am then able to interpret based on my own experiences and opinions...and obtaining information is the primary reason I turn them on in the first place.  They're just as entitled as the next American to hold whatever opinions they want--as long as I get the information from the story, I don't necessarily care what their opinions were when they told it to me.

Do I expect everyone on the street to agree with me on every issue?  Of course not.  Within my friends, family, workplace, etc. I am bound to have disagreements.  We're still civil to each other.  I and my more eccentric extended family members still love each other despite our differences of opinion on VARIOUS issues.  It would be foolish, then, to think that every news reporter, journalist, or radio show host would (or should) agree with me on the issues all (or even most) of the time.  They're entitled to their own opinion.  I'm entitled to mine.  Everyone's biased--human condition.  If your own opinion didn't seem right to you, why would you bother?  So your perspective is altered towards your own opinions.  But as long as the facts of the situation can get into the article or program for me to see, the reporter's opinion just isn't what's important.  As long as the facts and numbers discussed are there and accurate, the reporter or newscaster is doing his/her job, and I am satisfied.  I, the reader/viewer, can then make my own conclusions.  In my opinion, as it should be.

# September 4, 2010 3:10 PM

kay said:

it is media 11 my ipaq rz1716 has an out dated driver as well and the only way to sync is to downgrade to media 10 0r 9..but..that is not possibel u can not down grade!! we r screwed..i gues its time to ypgrade pc

# September 9, 2010 7:13 PM

krish said:

First of all thanks

am using the script here - http://krishnan.co.in/album/

How can i change the size of the thubnails, only the left and right thumbnails (previo0us and next) on the image view section.

I made small change and i made the up level thumbnail a small one.

# September 11, 2010 6:33 AM

Bertrand Le Roy said:

@Krish: it's in the settings. Look for "ThumbnailSize" near the beginning of the file.

# September 13, 2010 12:38 AM

krish said:

Thank you for your reply,

I think it is not my req., If you see krishnan.co.in/album

You can see that i have reduced the up level thumbnail, but i need to reduce the left and right thumbnail too (BUT with out changing the thumbnail size on the Folder view)

# September 13, 2010 3:06 AM

Bertrand Le Roy said:

@kris. Well, then you're on your own. Feel free to modify the code any way you want.

# September 13, 2010 3:17 AM

Hari said:

Bertrand, your post is one of the best I have read regarding php vs asp.net.

We (me and my team) moved to PHP (we were using classic ASP) 2 years back because of clients insisting on using it.

After reading your post, we want to try out ASP.NET.

Thanks.

# September 15, 2010 3:38 AM

Caesar Dutta said:

How to get the hotfix hotfix 981201

# September 16, 2010 4:31 AM

Bertrand Le Roy said:

@Caesar: call support.

# September 16, 2010 12:37 PM

Mitul said:

@ ramin

Thanks, now submenu has no compatibility issue, its working with all other brower

Thanks, Thanks A LOT..

# September 17, 2010 7:58 AM

David Taylor said:

Thanks you for the heads up Bertrand.

Dave

# September 19, 2010 1:50 AM

Denzel Mayhem said:

Thanks for the tip on server side comments. Personally I'd like to have seen .Net handle the old HTML comments better but I appreciate it's to do with how the XML is parsed. Just seems odd how a lot of  standards suddenly went out of the window when .Net became flavour of the month.

# September 20, 2010 5:33 AM

Zak Keown said:

I assume WCF is safe, but could old style ASP.NET web service be impacted by this?

# September 20, 2010 10:29 AM

Bertrand Le Roy said:

@Zak: you should not assume safety, no. The right thing to do is to first apply the workaround as it's described in the advisory.

# September 20, 2010 3:51 PM

Bertrand Le Roy said:

@Denzel: what do you mean?

# September 20, 2010 3:52 PM

Prakash said:

Hi,

I came across same situation in my project. But I kind of disagree with your explanation.

Assuming what you are suggesting is correct if we compile/run function with optional parameters and do not supply any value for the optional parameters than there should be runtime exception but surprisingly it works without any problem.

Please clarify.

# September 24, 2010 7:28 AM

Bertrand Le Roy said:

@Prakash: I think what's confusing you is that the 4.0 compiler does what it can even if you're targetting 3.5 but if you look at the IL you'll see what really happens. Also, try compiling the same client code with the 3.5 compiler (from what I see you are using the 4.0 compiler to target 3.5).

# September 24, 2010 12:17 PM

Prakash said:

@Roy: If you are using C# 4.0 compiler to compile the project with Optional Parameter it will works, Because Optional Parameter is the feature of C#4.0; So Whatsoever framework is targeted that does not make any difference.

I have compile the code with C# 3.0 to target 3.5 Framework and it gives error; but compile the same code with C# 4.0 to target 3.5 Framework and it works.

So, your Comment is wrong like compiling against 3.5 from Visual Studio 2010 will ignore the optional parameters and the above code is equivalent to:

public Path Copy(

   Path destination,

   bool overwrite,

   bool recursive)"

BECAUSE (I think) VS2010 uses C#4.0 compiler to compile the code so Optional Parameters will works anyways in VS2010.

Pl reply if Im wrong :)

# September 25, 2010 2:14 AM

Bertrand Le Roy said:

@Prakash: my name is Bertrand, not Roy. It does make a difference when you configure your project to target 3.5: you can then use the compiled dll in .NET 3.5 and VS 2008, which do not understand optional parameters. That's the whole point.

# September 25, 2010 2:49 AM

Skywalker said:

Has the project been stopped or moved? I can;t find anything here: http://clay.codeplex.com/.

# September 27, 2010 1:55 PM

Bertrand Le Roy said:

mmm, no, it's still there. Last checkin is from Sept. 8th too.

# September 27, 2010 3:13 PM

Jonas Eriksson said:

Interesting read - I stumbled on using code blocks in Web user controls when I wanted to use one inside another, then the code blocks syntax was not evaluated. Perhaps this will do the trick for me.

This didnt work:

UserControl1.Ascx:

<p><uc1:UserControl2 ID="uc2" runat="server" Text="<%=MyObj%>"/></p>

UserControl2.Ascx: (has public property "Text")

<% if (this.Text!="") {%><p><%=this.Text/></p><%}%>

# September 29, 2010 3:38 PM

Bertrand Le Roy said:

@Jonas: well the reason why your code doesn't work is fairly simple: to set-up a server control's properties, you need to use databinding syntax (<%# %> instead of <%= %>) and you need to call databind on the control.

# September 29, 2010 3:55 PM

transattic said:

well given that 29% of all visitors use ie6 still (on my site) means i need to pay real close attention to bugs.  

i already went through 5 select/iframe/ie6/fix sites but my problem seems to be special.  hopefully yours will get it right.

# September 30, 2010 10:51 PM

transattic said:

Hurray!!!

You've done it!  my dhtml popup now actually looks great

# September 30, 2010 11:16 PM

Blake said:

I'm afraid you've tangled up a bunch of definitions here.  

Reparse Points are a core NTFS feature, they are basically a type and a piece of opaque data that a filter driver can do whatever it wants with.   The OS provides a number of types, but third parties can add more.

A Junction is one type of reparse point, they were originally used to allow mounting volumes on a directory rather than drive letter.

A Symlink is another type of reparse point, and they can point to both files and directories.

Reparse points are also used by DFS and the Hierarchial Storage Manager.

# October 1, 2010 5:07 AM

Bertrand Le Roy said:

@Blake: thanks for the precision. This post tries to help non-technical users who were mystified by the very unhelpful KB articles and forum threads that seem to be the only references on the web for this problem. So sure I oversimplified and I'm glad you corrected me on junctions but the last thing I want is to confuse those readers even more than they were before they arrived here. That's why I'm trying to keep the concept count low while trying to not be too wrong.

# October 1, 2010 1:08 PM

Blake said:

I'm curious to know what exactly Windows Backup is choking on.  Do you know if it's directory junctions in particular or all reparse points?  

# October 1, 2010 10:32 PM

Bertrand Le Roy said:

@Blake: I can't be sure from just my own case but from what the KB article is saying that would be any reparse point.

# October 1, 2010 11:48 PM

Jonas said:

Thanks, ok, databinding server controls makes my code work nicely. With Resharper Intellisense comes to place also even inside attribute strings.

I tried using a anonymous function inside a regular include <!--#include file="includeCodeBlocks.inc"--> and that worked with Intellisense ootb. However that obviously requires some IIS7-configuration.

# October 2, 2010 4:54 AM

TypeTalaneria said:

United States Restaurant Guide - a guide to every restaurant, restaurants-us.com/.../48532

# October 3, 2010 5:53 AM

TypeTalaneria said:

It was many years ago we first selected Top Restaurants in the U.S. See it. restaurants-us.com/.../77630

# October 3, 2010 5:54 AM

TypeTalaneria said:

# October 3, 2010 5:54 AM

rlbkmksh said:

GvmsRl  <a href="nrwbltsjfnme.com/.../a>, [url=http://bvzpozmincew.com/]bvzpozmincew[/url], [link=http://pxycktrinrku.com/]pxycktrinrku[/link], http://byujdhtulxzs.com/

# October 3, 2010 9:14 AM

avghjf said:

B0zrv4  <a href="jdrkurwwalrg.com/.../a>, [url=http://hskxyuxrhehu.com/]hskxyuxrhehu[/url], [link=http://rvssqykwxhvm.com/]rvssqykwxhvm[/link], http://dxcuowiwgsyg.com/

# October 3, 2010 2:06 PM

Richard said:

OK, it just doesn't like me. Every time I try to submit a comment, it goes back to the home-page of your blog. WTF?

# October 4, 2010 3:46 PM

Richard said:

The problem is probably caused by the junctions that Microsoft added in Vista to avoid breaking old applications which used hard-coded paths to system folders.

[Useful explanation rejected by your blog software. :(]

The solution seems to be to turn off the "Hide protected Operating System files" option from the Folder Options dialog, de-select the junction points in your scan or backup job, and then turn the option back on.

# October 4, 2010 3:47 PM

Bertrand Le Roy said:

@Richard: your comments are getting through just fine. You can't see them right away because I'm moderating.

# October 4, 2010 4:02 PM

Benjamin Gavin said:

So what widgets are in the pipeline for 0.8?  Any hints?

# October 11, 2010 7:41 AM

Bertrand Le Roy said:

@Benjamin: to be clear what is being worked on is the widget infrastructure, not the widgets themselves. Some UI elements are being refactored into widgets but don't expect much more than that for 0.8. The system will be ready for community provided widgets though, so we hope the gallery will start to fill with external contributions. I will myself build a few and upload them.

# October 11, 2010 11:16 AM

john barnes said:

Hi Bertrand: Believe it or not, there are still "legacy" Classic ASP apps out there, although like objects at the outer reaches of the universe, they seem to be accelerating away at ever increasing speed :(

I've been trying to track down this session-loss issue ever since migrating a working website from server 2003 to server 2008 recently. Something has changed in IIS's handling of sessions between the two platforms, and it is unrelated to .NET framework.

It seems that server 2003 _would_ persist the same session ID between http and https redirects or pageloads (within the same FQDN), but in server 2008, two separate session cookies seem to be being written, one for http and one for https. And these session cookies are persisting, so that if you bounce back and forth between http and https (even on the same page), you will retrieve two separate session IDs.

If this is by-design, it's not how it worked on server 2003, and unfortunately, it appears that some of us relied on this behavior to maintain sessions when redirecting between secure and insecure pages. I've only verified this on Server 2008 Standard SP2 and Server 2008 R2 Standard 64-bit editions, but I expect it is the same on other versions.

I don't expect you to have an answer, and I'm not sure if it's even worth trying to get "fixed" or not, but I'm hoping that people experiencing the problem will stop tearing out their hair. If you're experiencing this behavior on 2008, rolling back to server 2003 may be the only answer for now.

# October 11, 2010 7:46 PM

Phill said:

That dollardreadful site is one of the worst websites on the internet. It's not usable at all.

# October 11, 2010 8:56 PM

Bertrand Le Roy said:

@Phill: forgive me but you're completely missing the point. I'm taking them as a piece of my mood board for their graphical design, not for their usability.

# October 12, 2010 2:52 AM

Bertrand Le Roy said:

@John: not only do I believe that but I know it: I've seen the numbers. Anyways, I can't help you much here, you should contact support, they'll help you. Classic ASP is still supported.

# October 12, 2010 2:54 AM

Elgetas said:

I have reached to other solution:

If the junction of "Application Data" who points tho her parent directory lose the a special permission of "Deny Reading" then you make a loop of ...\Application data\Application data\etc. an it cause a buffer overflow an the error. the solutions that worked for me was to restoring the permission in al of the Junctions of mi User Folder.

Make the following (rememner to use a Admin user):

Turn off the "Hide protected Operating System files"

open your user folder (C:\users\yourusername)

and do the following:

Right click on th folders with the little arrow.

Select Properties an open the security tab.

Hit Advanced Options and the Change Permissions.

Hit Add... an type Everyone and hit ok.

In apply to select "only this folder"

Select the box of Deny on "show Folder/read data"

and click ok

Click ok in the next windows and in the warning message an accept all of the property windows.

Do the same with all of the junctions with security tab in "C:\users\yourusername" and "C:\users\yourusername\App Data\Local".

After that try to launch the backup job.

Pd. Sorry for my bad english, and if the names are not the same as you may find is because i´m using a non english OS version.

If you have problems applying the permissions take ownership of the directory first.

# October 13, 2010 6:59 PM

Jason Bunting said:

Argh, this is killing me - I want 0.8 so badly!!! I am in the middle of a project using 0.5, and to hear that it is so close is more than I can handle! Are we talking next month or next week?

I'm dying here, I don't know that I ever wanted a piece of software so badly!

:)

# October 17, 2010 1:24 AM

Bertrand Le Roy said:

@Jason: ah, sorry to keep you waiting. We had to push back the release by a week, but the current ETA for 0.8 is Monday of next week (the 25th).

# October 17, 2010 11:51 PM

Sean Kearon said:

Hi Bertrand

Just thought you might like to know that there's another "no-install, x-copy deployable relational engine with good performance" - VistaDB (http://www.vistadb.net/).

Cheers

Sean

# October 19, 2010 7:54 AM

Bret Ferrier @runxc1 said:

Sweet now I can easily dig into the SQL CE DB that I have been using with Orchard.

# October 19, 2010 10:49 AM

Bertrand Le Roy said:

@Sean: I know about VistaDB. We haven't found its performance to be that good, but more importantly its licence is extremely unfriendly towards open-source.

# October 19, 2010 1:26 PM

Webturtles said:

Hi

A novice question, how would you hook in a lightbox control that works as you switch through photo folders?  I can add the class via writer.AddAttribute, but I am guessing the JS has to be triggered each time a folder is loaded to add new images to the lightbox... any thoughts.... also would it be done in the ashx or aspx (well ascx for me)?

Thanks

# October 25, 2010 4:21 PM

Bertrand Le Roy said:

@Webturtles: I have no idea how you'd do that. The handler was built to work standalone, not to integrate with other similar products.

# October 25, 2010 5:53 PM

webturtles said:

I guess it would be just another way to present the final album view.  Great code though, such an easy way to go through many folders and also to be able to use url parameters, have embedded it as an easy control in MWPSK.  Congrats on the great coding.    

# October 26, 2010 5:29 PM

Shawn T said:

This may also make sense when considered from the standpoint of the floating-point standard.

# October 27, 2010 7:01 PM

Rick Burgstaler said:

I just wanted to comment that the regular expression "\\/Date\((\d+)\)\\/" does not work for an example such as "/Date(-1233323754523)/".  It doesn't pick up the negative.  To fix this use: "^/Date\\((-?\\d+)\\)/$"

# October 28, 2010 5:10 PM

embarus said:

Actually,  I'm learning to extend Orchard and sure it will be a great CMS platform.

Thank you very much for doing a good thing for us.  

# October 28, 2010 9:38 PM

Mike said:

My head just exploded... is this C#?

# October 29, 2010 3:55 PM

John C said:

Looks facinating and clean. I'm curous about a contrast with DotNetNuke, which is the de facto heavy player in the open-source .NET environment currently.

The DNN community has done some MVC exploration, but I understand you are completely there.

Also they have a sitemap structure (with pages having a skin and set of modules on the page), where your layers seem to be more flexible and Drupal-like.

What are the other differences in architecture?!

# October 29, 2010 3:59 PM

Mike said:

Sooo, how are companies like Kentico or Telerik reacting to this? Because to me it seems that by looking at Orchard as a platform, it will eat those silly limited CMS vendors for lunch...

# October 29, 2010 4:00 PM

Jack Schueler said:

I have the "let me choose when to restart" option selected in Windows 7 but the darn thing reboots when it feels like. I reall enjoy those "Windows is installing updates - please wait" messages especially while I am in the middle of something important. I especially enjoy the last dying moments of all those apps putting up the "gosh you haven't saved your work" prompts as Windows Update reboots my system.

The "let me choose" option worked just fine for me under XP.

# October 29, 2010 8:57 PM

wooncherk said:

Orchard will be a very great platform... thanks for building such a great piece of software...

# October 30, 2010 10:34 PM

andrew said:

Do you know if this work with the release version of VS 2010? I downloaded your source and ran into issues with missing types... specifically the CSharpGetMemberBinder type.

# November 3, 2010 10:14 AM

Bertrand Le Roy said:

@andrew: I can't check right now but I think you may need the DLR from CodePlex, which has a few more features than are found in 4.0.

# November 3, 2010 12:30 PM

Don W. said:

Sure does look like an absolutely awesome start. Thank you for laying the foundation on this guy, going to start playing with it tonight.

# November 3, 2010 6:19 PM

Gregg said:

Just curious...doesn't Orchard make use of Lucene.NET for its search? How do recent events in the Lucene.NET community affect the future of Orchard?

codeclimber.net.nz/.../Lucene-Net-needs-your-help-or-it-will-die.aspx

# November 3, 2010 11:55 PM

Bertrand Le Roy said:

@Gregg: we are talking about it, evaluating options. It's way too early to jump to conclusions though.

# November 4, 2010 12:20 AM

Laique said:

I am facing the same problem, can any one help ?

I am

SessionIDManager Manager = new SessionIDManager();

                       string NewID = Manager.CreateSessionID(Context);

                       string OldID = Context.Session.SessionID;

                       bool redirected = false;

                       bool IsAdded = false;

                       Manager.SaveSessionID(Context, NewID, out redirected, out IsAdded);

Session["WebUser"] = logName;

                               Session["Usertype"] = logType;

  Session["Auth"] = true;

Response.Redirect("./AdminPage.aspx"); or Response.Redirect("./AdminPage.aspx", false);

In adminpage.aspx i am not getting the session variable

What should i do ?

I want to change Session id after success login but also want my session variable in new page.

How can I do ?

Pls. Help

# November 4, 2010 7:53 AM

Bertrand Le Roy said:

@Laique: what's all that stuff with SessionIDManager supposed to do?

# November 4, 2010 11:52 AM

hype8912 said:

This isn't accurate at all. Below is some code from Visual Studio and then the output seen in reflector. It uses System.Runtime.InteropServices.OptionalAttribute to make this happen.

<code>

public static bool Contains(this string text, string value, bool ignoreCase = false)

       {

           return text.IndexOf(value, 0, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal) >= 0;

       }

</code>

<code>

public static bool Contains(this string text, string value, [Optional, DefaultParameterValue(false)] bool ignoreCase)

   {

       return (text.IndexOf(value, 0, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal) >= 0);

   }

</code>

# November 4, 2010 1:06 PM

Bertrand Le Roy said:

Thanks to all who corrected me. I've updated the post.

# November 4, 2010 4:21 PM

Jevgenij said:

Why dynamic properties in PropertyGrid are always read-only?

# November 5, 2010 9:04 AM

Bertrand Le Roy said:

Because the implementation is incomplete: this is just a proof of concept.

# November 5, 2010 1:09 PM

ASPGuy said:

Great article, this was our strigle for a while as GDI is not officially supported on ASP.NET.

# November 5, 2010 9:00 PM

Fabien Royer said:

Good write-up :)

About the resistor before the LED: the risk is that you can burn out the LED if too much current is passed through it, which is not the same issue as a short circuit.

To determine, the proper value of the resistor, there are useful tools online like this one: www.ohmslawcalculator.com/led_resistor_calculator.php for example.

Given the specs of the LED matrix and of the netduino, the optimal resistor would be ~130 ohms, maximizing the brightness of the LED and its life. With 150 ohms, you're golden, but dimmer.

Another thing to consider with the design is that the LED will only receive current 1/8th of the time using the persistence of vision method, so it will look dimmer, so you could lower the value of the resistor to compensate for this.

Since the LEDs in a given row will only be energized for a brief instant, it can take a lot more current than the 25mA rating. According to the LEDMS88R spec, this is expressed as the 'Pulse Forward Current (Ifp)' which is, 100 mA.

# November 7, 2010 1:27 PM

Bertrand Le Roy said:

@Fabien: thanks for the correction, I updated the post. Your other explanations will be a perfect segue into the next post :)

# November 7, 2010 2:27 PM

Niels Hartvig said:

@Kevin: Missed the conversation so this is just a follow up.

I stand up to my previous points. Any project have a chance on the .NET platform, whether Microsft is competing or not.

I believe there's room for more than a couple of CMSes on the Microsoft stack and Orchard is just one solution to many ways of doing CMS. There's no silverbullet.

If you wanted to make an Orchard clone you're probably out of luck. Just as if you wanted to make an Umbraco clone. But we don't need clones. We need better and other ways to solve problems. Period.

My lack of fear is based on empirical knowledge not random paranoia. To be a bit frank.

/n

# November 10, 2010 6:36 AM

Andrew Powell said:

Great post B. One question is still bothering me though and I haven't been able to find any resources which explain it: what the heck does the 'locid' attribute do on summary tags? Any chance you've stumbled across an answer to that?

# November 11, 2010 1:46 PM

Bertrand Le Roy said:

@Andrew: the locid is a hook that can be used to handle translations. It doesn't "do" anything out of the box.

# November 11, 2010 3:30 PM

SDG said:

Query about sidestepping the whole problem by simply not using cross-domain frames: Will it resolve the problem if the framed site using Ajax uses a subdomain alias of the host page domain? E.g., if I use Ajax on a page hosted at sub.mydomain.com, and I display that site in an iframe on a page at www.mydomain.com, will this avoid the issue?

# November 15, 2010 9:53 AM

Bertrand Le Roy said:

@SDG: seriously, just upgrade ASP.NET already, this has been fixed for the last two versions.

# November 15, 2010 1:54 PM

anil said:

Thanks mauli and chetali

It works fine

remove your old !DOCTYPE

and add <body scroll="no"> insted of <body

# November 17, 2010 8:29 AM

sankayan said:

I have created a application using menu control in asp.net 2.0, and it is not running in IE8 vertion but it easily running in mozilla browser.

Have you any idea about this?

# November 18, 2010 6:14 AM

Bertrand Le Roy said:

@sankayan: upgrade?

# November 18, 2010 12:53 PM

Julien said:

Seriously? All this to solve one single use case that will occur in, what? One in a hundred apps? One in a thousand?

JSON is not meant to be a self-describing format. You have XML for that. If you want types, if you want differentiation, use that. Don't try to shoehorn a square peg in a round hole. Get a round peg.

As it stands, this "solution" will require parsers everywhere to either be aware that they're talking to a Microsoft-based provider (breaking encapsulation and platform agnosticism) or waste resources testing for this format, rather than using a single, clear, platform agnostic, standardized format like ISO.

This is the embodiment of a negative feature and a solution to a problem no one's having. Thank you for making my code more complex to solve a non-existent scenario. And when developers complain about Microsoft's approach to interoperability, THIS is exactly what they're complaining about.

# November 19, 2010 11:15 AM

Bertrand Le Roy said:

@Julien:

* even with your made-up statistics, one in a thousand, on a platform that is used by millions of developers, that is still thousands.

* JSON has support for all JavaScript types, except date. It's not by design, it's an oversight in the JavaScript spec. If JSON really wasn't "self-describing" like you claim, we'd be writing "SomeNumber": "6". What is by design is the lack of support for types of complex objects, not the lack of support for dates.

* This solution does not require parsers to be aware of that feature of the Microsoft serializers: if they aren't they are just going to see a string, the same way that if you're using ISO dates, you are really using strings. It also doesn't prevent anyone from using ISO dates, but if you do, you need to know in advance that this or that property is a date. Without that knowledge you can't differentiate between "4/6/2010" and 4/6/2010.

# November 19, 2010 12:07 PM

Damian Edwards said:

Nice. Would be great to see it extended with some async/Task<T> goodness so those fluent calls could build async execution trees.

# November 19, 2010 12:11 PM

Bertrand Le Roy said:

@Damian: yeah, I'll probably do that once C# 5.0 is out.

# November 19, 2010 12:17 PM

Julien said:

@Bertrand

Let me reformulate then: What was your initial use case for needing to differentiate between a string-formatted date and non-date, but date-formatted string in a way that would significantly matter to the client, and could not be remedied by the existing JSON types?

Furthermore, how common and widespread would that use case likely be?

And what would be the impact on interoperability, on a platform used by millions of developers as you correctly put it, of instituting the use of a format specific to that platform, which will require all potential clients using providers on that platform to adapt themselves to it? Would that impact be smaller or greater than the alternate solutions for that use case?

Secondly, JSON itself, as a data format, is quite independent of Javascript, even if it was inspired by Javascript notation. It's not part of the Javascript spec, it's defined by it's own RFC (tools.ietf.org/.../rfc4627).

As such, it has types for strings, numbers and booleans. That's it, and that's the point. These are not Javascript types, they're basic interchange types, kept simple to be as platform agnostic as possible. The absence of dates or other complex types is not an oversight, it's deliberate. It's not meant to be another IDL.

Finally, my parser does need to be aware of it, because I need to parse the output of a WCF REST service and I need to be able to parse that into a workable date. Had the ISO standard been used, that would have been a piece of cake, but now I need to account for MSAjax JSON format as well.

So I'm off to write some code...

# November 19, 2010 1:39 PM

Bertrand Le Roy said:

@Julien: the use case is when the consumer is a generic data consumer that doesn't have prior knowledge of a specific schema and that's either editing or processing the raw data. But you are absolutely right that the proportion of such applications may be small when compared with those where knowledge of the schema exists in the consumer. You're also correct that producers mindlessly exposing dates in that format can incur some cost on their customers. Ideally, I would have preferred the default to be ISO and this to have been an option. The .NET parser does understand both formats though.

You cannot really say that JSON is only inspired from JavaScript notation. It means, after all "JavaScript Object Notation" and there is nothing in it that can't be parsed with a single eval. It does not have date expressions because JavaScript doesn't have a syntax for date literals. Date is not a complex type: it is not a composition of strings, numbers and Booleans. At least not any more than strings are sequences of numbers or numbers sequences of Booleans. It's a fundamental type that is present in all languages.

The weakness of JSON and more generally JavaScript with regards to dates (lack of proper globalization for example) has been and continues to be a pain point for the industry, not a design strength.

By the way, Crockford does object to this extension as well, but from what I understand not because there's no legitimate need for dates in JSON but more because it fragments the spec. I would today tend to agree with that as I said earlier.

Good luck with the code. Note that WCF has added a time zone specification to their date literals but it remains fairly easy to parse: look for \/ at the beginning and end of string literals, and if found extract the integer and time zone shift. The integer is the number of milliseconds since January 1st 1970 UTC, which is something that many languages and class libraries accept as arguments to construct a date. Add the zone shift as hours and you should have your date object.

# November 19, 2010 6:47 PM

Marc said:

Bertrand,

It would be good if updated your original post to use the regular expression from Rick Burgstaler's comment so that dates before January 1 1970 (where the numeric value is negative) can be parsed as well:

"\\/Date\((-?\d+)\)\\/"

I just got bitten by this in an app I developed some time ago.

# November 22, 2010 4:12 PM

Bertrand Le Roy said:

@Marc: thanks!

# November 22, 2010 4:52 PM

Michael said:

Really great to hear you're planning mockable layer of abstraction.

# November 24, 2010 1:47 AM

RichB said:

> p => new[] {

>            ".avi", ".m4v", ".wmv",

>            ".mp4", ".dvr-ms", ".mpg", ".mkv"

>        }.Contains(p.Extension))

I wish C# had an 'in' operator similar to SQL. It would make this much more readable.

p => p.Extension in new [] {".avi", ".m4v", ".wmv", ".mp4", ".dvr-ms", ".mpg", ".mkv"}

# November 24, 2010 4:57 AM

DBJDBJ said:

Bite the bullet BLR ;o)

Use CallStream ... this lib is perfect for it ...

Thanks: DBJDBJ

# November 24, 2010 10:23 AM

Bertrand Le Roy said:

@RichB: you can get something fairly close with an extension method, something like p.Extension.In(new[]{".avi", ".m4v", ".wmv", ".mp4", ".dvr-ms", ".mpg", ".mkv"}).

@DBJDBJ: I disagree.

# November 24, 2010 1:16 PM

Mikael Henriksson said:

This is awesome! I see my self using this lib quite a lot in the future. Has been looking forward to it since the first post you wrote.

# November 26, 2010 11:18 AM

Gishu said:

Thanks! Saved me quite some time

However a small add-on, matchers don't work for the key (first param) - the expectation is not matched.

stackoverflow.com/.../4293273

# November 27, 2010 1:49 PM

Matanel Sindilevich said:

Let's assume the TXT variable defined and initialized as follows:

var txt = "{\"UpperLimit\": \"\\/Date(1290117600000)\\/\"}";

Then the following code (a *safe* deserialization) will throw an exception:

var deco1 = Sys.Serialization.JavaScriptSerializer.deserialize(txt, true);

But the following code (a *regular* deserialization) will work successefuly:

var deco2 = Sys.Serialization.JavaScriptSerializer.deserialize(txt);

Any ideas?

Thank you in advance!

# November 28, 2010 8:03 AM

CW2 said:

You can use SPI to write data to the shift register, it is faster than software bit toggling (you'd probably need it for the matrix, to reduce flicker).

# November 28, 2010 8:16 AM

Bertrand Le Roy said:

@CW2: true. I'll look into that in the next post. Thanks for the heads up.

# November 28, 2010 1:58 PM

Bertrand Le Roy said:

@Matanel: that might be a bug. I'll contact the current owner of the feature. You may have to do your own sanitization if the payload comes from an untrusted source.

# November 28, 2010 2:33 PM

Tony Hinkley said:

Bertrand, great library, already finding places to put it.  As for the In method, I always write an extension for this early and use it lots, I find a params array saves unnecessary array definitions in the caller though.

Thanks for the code.

Tony

# November 29, 2010 4:49 AM

Mohit Mathur said:

You can split a pst file or if you donot want to split your pst file into many files, you can compact your pst file which can reduce the size of your pst file

# November 29, 2010 5:19 AM

Matanel Sindilevich said:

@Bertrand: Thank you for your quick reply. What I was trying to do is to work with a data structure of a few fields of type String and a field of type DateType, serialized by the System.Web.Script.Serialization.JavaScriptSerializer class at the server-side. Then, I wanted to deserialize that serialized text at the client-side, using ASP.NET AJAX Sys.Serialization.JavaScriptSerializer.deserialize(data,secure) overload.

When Sys.Serialization.JavaScriptSerializer.deserialize() is called with the second parameter as true, it performs JSON-confomance check prior EVAL'ing the string. This JSON-conformance check fails when encounters a serialized DateTime field.

As you pointed in the above article there is a RegExp that replaces a "\/Date(1290117600000)\/" with "new Date(1290117600000)". And JSON-conformance check fails when it encouters "new Date(1290117600000)" literal in a field with "Invalid JSON data" exception.

# November 29, 2010 7:05 AM

zuma06 said:

You stinkin wimps.  I agree that windows update is annoying.  so is wearing a seatbelt in a car and a helmet on a motorcycle.  and come to mention it that parachute is kind of heavy when you skydive.  do you ignore your check engine light too?  when you don't take time to apply updates and make backups you suffer.  your computer is a machine and machines need maintenence.  some more than others. and is your creativity so fragile that you can't allow 5 or 10 minutes to reboot?  and wait a second here, a WIKI page?  how pathetic.

by the way, if you hate your computer, try using paper and a pencil to write.

# November 29, 2010 3:31 PM

Fabien Royer said:

Yep, SPI would reduce flickering.

Another easy way to greatly reduce flickering is to only send data to the shift register once when the row needs to be energized:

       public override void OnRow(int logicalRow, byte bitmap, bool energize) {

           // Energize the row in the LED matrix corresponding to the row in the bitmap matrix

           if (energize) {

               ShiftRegister.Write(bitmap);

           }

           GetPortForRow(logicalRow).Write(!energize);

       }

# December 1, 2010 3:25 PM

Gabriel C said:

The links are broken. Could you post the new ones? Thanks.

# December 3, 2010 1:24 PM

Andy said:

I have the same issue and tried all of the "solutions" posted.

Is there anything else that could be causing this?

# December 3, 2010 3:45 PM

Bertrand Le Roy said:

@Andy: if you've tried all the solutions above and they didn't work for you, please contact support.

# December 3, 2010 3:51 PM

Bertrand Le Roy said:

@Gabriel: this post is from 2008 and is pretty much obsolete now. You should either migrate to jQuery, which is now the recommended and supported JavaScript library for ASP.NET, or go to ajaxcontroltoolkit.codeplex.com which is where the parts of the Ajax Library that are not directly in ASP.NET can be found.

# December 3, 2010 3:54 PM

Andy said:

Thanks for the reply.  I can post some of my code:

This is part of my Default.aspx:

//  button click handler is executed

Session["userSession"] = userSession;

Response.Redirect("WelcomePage.aspx", false);

This is part of the WelcomePage.aspx:

protected override void OnInit(EventArgs e)

{

 UserSession userSession = (UserSession)Session["userSession"];

//  test to see if the userSession is null.  If it is,

//  then send them back to the login page.

...

}

The "userSession" is only null on the initial try.  After that it works fine.

Any idea where I am going wrong?  

Thanks again for your help.

# December 3, 2010 4:02 PM

Bertrand Le Roy said:

@Andy: nothing strike me as utterly wrong. Ah, caching maybe? Do you have any caching on those pages, or maybe configured in IIS?

You should contact support, they will help you.

# December 3, 2010 4:10 PM

neonp said:

Thanks a lot Bertrand ! I was searching for a kind of hardware like this. I found adruino, but it was not in .NET ;)

# December 7, 2010 3:14 AM

duminda said:

Dear sir,

I put this in a asp.net solution and when the thumbnails of the folders are shown, the other folders like "obj"  and "properties" are also shown as thumbnails. can u please tell me a way to remove those.. I guess i should change the path of folders. but i dont know how to?

please help me Im a begginer. ..

thanks in advance!!

# December 9, 2010 9:08 AM

Bertrand Le Roy said:

@duminda: the simplest is probably to create a folder where you put nothing but the images and the handler.

# December 9, 2010 1:16 PM

Mary said:

Hi, im having the same problem so im following your step by step guide.

After i get to the command prompt, how exactly do i know what to remove?

# December 16, 2010 4:00 PM

Bertrand Le Roy said:

@Mary: well, it's your call really.

# December 16, 2010 4:07 PM

Mary said:

i dont really get it to be honest. where do i remove the errors from?

# December 16, 2010 4:15 PM

Mary said:

i really dont get this at all. what do i delete? where do i go to delete it

# December 16, 2010 4:27 PM

Bertrand Le Roy said:

@Mary: at the command prompt, you must cd to each of the directories in your backup plan and from each execute dir /A:L /S *. Then you must make a judgement call on what you need to keep and what you can afford to remove. You can do that from Windows Explorer. What I did was to try backup again after each step in order to repair what was needed but nothing more.

If you still can't figure it our with those steps, please contact Microsoft support.

# December 20, 2010 3:11 PM

rtpHarry said:

What happened with this? Didn't seem to ever make it into asp.net 3.5 sp1?

# December 23, 2010 4:05 AM

Bertrand Le Roy said:

I'm not sure. The code for this is still available, and it's not too complex. Feel free to use it.

# December 23, 2010 4:17 AM

Ken Forslund said:

Looks like I hit the problem on on VS2010 C# .net 3.5 site.

I got it solved.

The short of it is this.  Have your master page or regular pages look for your UserID (or whatever token you pass to yourself) in the session.  if it's missing, do a Server.Transfer to your login page.

In your page_load of the login page, capture this.Page.PreviousPage into a hidden variable (and set it to ~/Default.aspx it it's null).

Also be sure to clear out your Session's UserID (this initializes it)

In your Login button handler, after you've verified the credentials, set the UserId in your session.  Then do a Response.Redirect() back to your Previous Page (that you kept in a hidden variable).

Because the Login page is actually 2 loads (1st load, and a postback), this initializes your session for you.  

Finishing the 1st load (rather unload) gets the cookie in place.  It'll still be empty when you postback (but you aren't needing it yet).  Because the cookie is in place, when you finish yoru postback, your session will stick.

# December 27, 2010 4:34 PM

Pekka said:

Did you actually publish from Visual Studio using FTP or by separate FTP client?

# December 28, 2010 2:18 PM

Nicholas Mayne said:

Awesome stuff, I'm glad the module helped you to migrate quickly!! :)

# December 28, 2010 3:00 PM

Mike said:

Ok, a simple question in plain English from someone who isnt much of a programmer but has to import a lot of JSON into a database.  I have got an embedded date in that JSON and its format is:

"date_created":"\/Date(1293595692063-0700)\/"

How do I get this into a MM/DD/YYYY HH:MM:SS format (in my local timezone).  I am in Eastern Timezone.  I use VBA in MS Access 2010 but could get VB 2010 Express if need be.

# December 28, 2010 4:36 PM

Bertrand Le Roy said:

The -0700 at the end is giving you the time zone. The number before that is the number of milliseconds since 1/1/1970. Most languages have an easy way to transform that into a date.

# December 29, 2010 12:57 AM

Bertrand Le Roy said:

@Pekka: I use Filezilla.

# December 29, 2010 12:58 AM

Jonathon Kresner said:

When will Orchard support custom themes? I would like to migrate my site soon.

# December 29, 2010 12:38 PM

Bertrand Le Roy said:

@jonathon: custom themes have been supported for several versions.

# December 29, 2010 12:53 PM

Roland said:

Lots of fun reading the top most popular blog entry ;o)

# December 31, 2010 8:07 AM

Mark Mitchell said:

Thanks for the write-up Bertrand!

Do you think there will be any issues copying over my custom theme from 0.8 to 0.9?

Should I rerun the commands to generate the folder structure from the ThemeEngine theme first?

# January 1, 2011 9:15 PM

Bertrand Le Roy said:

@mark: you should be fine. Just copy your theme's folder over. Few things changed since 0.8.

# January 1, 2011 10:51 PM

nyc2mia said:

Are there are any installation instructions or 'howtos' for this control?  It seems really cool, but I can't seem to get it to show my albums.  All I get are hyperlinks with broken thumbnails (image placeholders with an 'x').

# January 2, 2011 11:15 AM

Luis Abreu said:

Happy New Year!

Regarding IE6, it's not so easy...I do have some friends working for banks where IE6 is still the official browser...and they can't do anything about it :(

# January 2, 2011 2:07 PM

Dave Minter said:

I arrived here in exactly the same manner as Matthew.

Assuming you were planning on exercising some sort of rights in the idea I think you're probably stuffed: it's not patentable because it's obvious.

Assuming for the sake of argument that the patent examiner can be persuaded that it's non-obvious then you have the insurmountable problem that you've published prior to applying for a patent which isn't allowed.

# January 2, 2011 9:12 PM

Jos Kampes said:

I love this application!  I do however also have the same question as RED, to find out how to get the name of the image under (or above)  the picture.

# January 5, 2011 9:38 AM

folbec said:

My customers (big insurance) sold out (outsourced) their IT, and got what was predictable : minimal upgrade, minimal IT.

They were testing an upgrade to XP SP3 from XP SP2 last year... Sob...

# January 6, 2011 10:06 AM

Mark Mitchell said:

Migrated per your instructions. Copied the theme folder over and everything worked great. Haven't found any bugs so far, all the previous ones I had noticed seem to have been fixed, and much faster!

Thanks!!

# January 8, 2011 10:19 AM

Simone Chiaretta said:

Trying to make it work with the orchard site installed from WebMatrix but doesn't work

# January 14, 2011 6:34 AM

James Radford said:

whats it called when you have the structure within the css?  I.e. #Main .Content span {color: #000;}

instead of span {color: #000;}

I know why, just can't thing what's the official term for it!

Thanks,

James

# January 14, 2011 12:43 PM

TBay said:

Installed Orchard with WebPI, set it up, and tried to extract translation. Got weird error message about Orchard.Azure folder not being present, even though the folder it is installed is called "orchard". Did I miss something?

orchard> extract default translation /Output:\temp

Error executing command "extract default translation"

--------------------------------------------------------------------------------

Could not find a part of the path 'C:\inetpub\wwwroot\Orchard.Azure\'.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part o

f the path 'C:\inetpub\wwwroot\Orchard.Azure\'.

Stack Trace:

[DirectoryNotFoundException: Could not find a part of the path 'C:\inetpub\wwwro

ot\Orchard.Azure\'.]

  at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

  at System.IO.FileSystemEnumerableIterator`1.CommonInit()

  at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String origina

lUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`

1 resultHandler)

  at System.IO.Directory.InternalGetFileDirectoryNames(String path, String user

PathOriginal, String searchPattern, Boolean includeFiles, Boolean includeDirs, S

earchOption searchOption)

  at System.IO.Directory.InternalGetFiles(String path, String searchPattern, Se

archOption searchOption)

  at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()

  at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()

  at Fluent.IO.Path.Files(Predicate`1 predicate, String searchPattern, Boolean

recursive)

  at Vandelay.TranslationManager.Services.LocalizationManagementService.<>c__Di

splayClass1d.<ExtractDefaultTranslation>b__18(Path p)

  at Fluent.IO.Path.ForEach(Action`1 action)

  at Vandelay.TranslationManager.Services.LocalizationManagementService.Extract

DefaultTranslation(String sitePath)

  at Vandelay.TranslationManager.Commands.LocalizationManagementCommands.Extrac

tDefaultTranslation()

--------------------------------------------------------------------------------

# January 14, 2011 3:06 PM

Bertrand Le Roy said:

I figured out the weird Azure thing. You NEED the full source code, not just the web site or a WebPI install.

The Azure thing comes from the fact that the Azure project contains specific strings that also need to be translated and that are one level up from the web site project.

So just try again with the full source code.

# January 15, 2011 5:01 PM

Attila said:

Wow :-) It's a very great example of how modular Orchard is!

(And from this very simple example I get how hard to document such extensibility points :-))

# January 18, 2011 4:12 AM

Raymond de Jong said:

A nice feature i'll be sure to use some day. I'm glad to see it in the galery instead of a NuGet package which i always open with my favorite zip tool.

# January 18, 2011 7:24 AM

Wictor said:

Nice module!

How about giving a detailed instruction on how to "bundle" this module into a Orchard Azure package? Can't just get it to work :)

# January 18, 2011 8:37 AM

jason_palmer said:

How is Orchard for seo ?

The only thing I have against a cms is the seo factor, many people say it is hard to optimise a website built by a cms.

Is this true for Orchard ?

# January 18, 2011 8:52 AM

Bertrand Le Roy said:

@Jason: a long time ago, CMS could impair your ability to have good SEO, but now they are all supporting relatively clean markup and URLs which gets you most of the way there. In Orchard, the default markup is clean and everything can be overridden anyway. Clean URLs are there by default. Additional stuff could be done, such as meta tags and additional semantic constructs in the markup and I'd expect that to be available as modules at some point.

# January 18, 2011 3:16 PM

Bertrand Le Roy said:

@Wictor: did you read this? orchardproject.net/.../Deploying-Orchard-to-Windows-Azure.ashx

What exactly doesn't work? Feel free to e-mail me at bleroy at you know where.

# January 18, 2011 3:18 PM

Chris said:

Thanks so much! This worked brilliantly. I would never have thought to hook the ResolveScriptReference event to determine which scripts we needed.

Great.

# January 18, 2011 8:05 PM

Gideon said:

Nice!!

Could you maybe do something like an API overview of some of the core modules (Like Orchard.Blog or Shapes)

Its a little hard to traverse the source and figure things out.

# January 19, 2011 11:54 PM

jason_palmer said:

What about seo ?

Wordpress sucks on SEO so to kill wordpress with orchard it needs ace seo.

# January 22, 2011 9:32 AM

Bertrand Le Roy said:

@Jason: what about it? People put many different sets of expectations under SEO. What's yours?

I published a meta description and keywords module there: orchardproject.net/.../SEO

Nowadays, SEO is above all about offering relevant contents in clean markup, under friendly URLs. And have other well referenced sites link to you. There is only so much the platform can do for you.

# January 23, 2011 12:40 AM

Russ Cam said:

Hey Bertrand: nice module, but unfortunately I can't enable it :( It installed fine from the gallery but when I enable in Configuration|Features, I get the following server error:

Cannot insert the value NULL into column 'Id', table '[database name]__Settings_ShellFeatureRecord'; column does not allow nulls. INSERT fails.

The statement has been terminated.

Any ideas?

# January 25, 2011 4:06 AM

Bertrand Le Roy said:

@Russ: none at all. Can you install other modules fine?

# January 25, 2011 2:46 PM

Russ Cam said:

@Bertrand: D'oh! it appears it's an issue to install any modules. I copied the database via an SSIS package to a provider, so I'll try again by installing from a backup.

Many Thanks

# January 26, 2011 5:42 PM

maulesh said:

hi i had tried with both of the version but the only problem is that the menu is aligned in left side in place of the centrer of the screen

# January 27, 2011 1:05 AM

Steve Wagner said:

If someone wants to give the new image a another DPI then 96. Be aware that you need to recaclulate the rect of the drawing this way:

var drawingWidth = (newWidth * 96.0) / destDpiX;

var drawingHeight = (newHeight * 96.0) / destDpiY;

group.Children.Add(new ImageDrawing(imageSource, new Rect(0, 0, drawingWidth, drawingHeight)));

# January 28, 2011 4:34 AM

rothen_s said:

I had the same problem and a Response.Redirect(..., false) did not work for me (ASP.NET 2.0.5, IIS version unknown). In the end I solved the problem with a trick: I made a aspx.page only to start the session. This page basically consists of a a dynamically generated metatag which makes the redirect instead of a Response.Redirect. A detailed description of this solution (although in German) and the code can be found when you click on my name.

# January 30, 2011 7:11 AM

Ries Spruit said:

Thanks for the great sample Bertrand, for me it works like a charm on Windows 7, but I can't get the sample to compile on Windows 2008 Server.

I think I am missing the point with the wrappers. (Been a while since I wrapped anything..).

I run into the following compilation error:

Foutbericht van compiler: CS0234: Het type of de naam van de naamruimte Test bestaat niet in de naamruimte Microsoft (ontbreekt er een assembly-verwijzing?)

Fout in bron:

Regel 7:  using Microsoft.Test.Tools.WicCop.InteropServices.ComTypes;

(you understand Dutch right? ;-)

I can run all the WICTools samples so I assume the components are correctly installed. I just don't know how to make sure the WIC components are correctly referenced..

All help is greatly appreciated!

# February 1, 2011 2:45 PM

Bertrand Le Roy said:

@Ries: the wrappers are necessary because we are calling into unmanaged Windows APIs directly here. It seems like the problem here is in the WIC APIs so I think your only reasonable option is to contact support.

# February 1, 2011 2:55 PM

Ken said:

HI,

I'm trying to use two 74hc595 and 16 led (connected like this: www.arduino.cc/.../ShiftOut)

But I cant address the led separate, they run parallel (almost in sync). Any suggestions?

# February 1, 2011 5:48 PM

Bertrand Le Roy said:

If you got the exact same wiring they have, I think you just need to send 16 bits of data and the first register will overflow the extra data to the second one. Make sure that you are not signalling that you are done before you transmitted all 16 bits of data. Also check that you have output enabled on the first register. Other than that, maybe ask over there?

# February 1, 2011 5:59 PM

Siva said:

Hi,

I am using 4 dropdownlists. In the pageload 1st ddl is populated, when I select the ddl1 value ddl2 should be populated Again when i select the value from ddl2 ddl3 should be populated based on the values selected in ddl1 and ddl2 in the same manner ddl4 should be filled. I don't want to use AJAX and I want to use IcallBackEventHandler Interface.

Thank you

# February 3, 2011 3:56 AM

Amit said:

One thing to add is ensure we dont have session.abandon written on the page as it clears the original session id and issues a new one; the request has still not gone to the browser the new session id is not available on the next page which results in loosing the session altogather

# February 5, 2011 3:11 PM

Jeff said:

That seems like a lot of work to add a favicon...I mean all of that work to add something like this to a page:

<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />

It has the smell of an over-engineered abstraction.

# February 10, 2011 4:31 PM

Bertrand Le Roy said:

@Jeff: you can go ahead and do that in the document.cshtml of your theme and you'd be done. This is in response to several users who wanted more than that: admin UI to change the icon and a solution that works across all themes without requiring the change of a template file.

# February 10, 2011 4:39 PM

Jeff said:

@Bertrand - I gotcha programmer free maintenance. I stand corrected :)

# February 11, 2011 12:24 PM

Bertrand Le Roy said:

@Siva: don't. All this is pretty much obsolete. Use a JSON web service and jQuery.

# February 11, 2011 2:08 PM

Bertrand Le Roy said:

@Jeff: oh, and multi-tenancy is another reason to use this: you want each tenant to be able to choose their icon.

# February 11, 2011 2:10 PM

Herman said:

My problem with asp.net 4.0 is that the menu is aligned in left side in place of the center of the screen, like maulesh.

Is there a solution?

# February 11, 2011 4:52 PM

Bertrand Le Roy said:

@Herman: contact support.

# February 11, 2011 4:58 PM

Rod said:

@ Phil: From your quick calculation, could you clarify if the rotation would be slowed by 1 second total, or if the rotation would be slowed by 1 second per day over 300 million years?

The simple reality is that the earth's rotation is not renewable with absolutely no way to reverse any side effects that we inadvertently cause.  

PS: Thanks for posting this thread Bertrand!

# February 11, 2011 9:46 PM

Ivan Pavlović said:

Hi, I'm receiving "500 - Internal server error." when I click on the Gallery / Feeds menu item. source.FeedUrl is feed.nuget.org/.../v1. I'm running latest source from Codeplex using Visual Studio. How can I install Vandelay.TranslationManager?

# February 15, 2011 4:22 PM

Ivan Pavlović said:

oh, looks like I haven't worked with latest source code from codeplex. It works now!

# February 15, 2011 4:51 PM

Nairb said:

I'm not familiar with the triggering. Does this then invalidate the cache on the local machine only? What if you're using this on a web farm?

# February 17, 2011 11:14 AM

Marco said:

Very cool! So when you signal a trigger, when does that item actually get removed from cache? is there a background process that runs ever so often?

# February 17, 2011 11:14 AM

Bertrand Le Roy said:

@Marco: I think all listeners get the signal immediately and can expire the cache entry right away.

@Nairb: that is a very good remark, and for the moment we are not supporting that scenario. I filed this bug to track the issue: orchard.codeplex.com/.../17361

# February 17, 2011 2:27 PM

Piotr Szmyd said:

Nice article! But can we get the item from cache without specifying lambda as a parameter? I have a  couple of places where the cache item gets retrieved (eg. different actions of the same controller), but only in one of those I want to define the lambda. It would be great if there would be an override which would just throw exception/return null if the cache item is not found.

# February 18, 2011 5:24 AM

Bertrand Le Roy said:

@Piotr: you don't want to do that. Actually you can throw or return null from the Lambda, but the Lambda is still mandatory. There are all kinds of subtle things going on here that could be the subject of another post.

# February 18, 2011 3:45 PM

Marc Brooks said:

@Bertrand. I like it a lot. Similar to what I've built.

@Piotr: No, you should NEVER have that sort of login in your controllers... put that logic in a repository class and call the repository from your "several places" in the controller.

# February 19, 2011 1:39 AM

Piotr Szmyd said:

@Marc: Yes, I know:) - I just thrown an unfortunate example... Thanks for noticing that.

@Bertrand: But when I specify a null lambda for an item, which had it specified before, isn't it going to be overwritten? Basically, what I'd want to achieve is a "get" behaviour on a cache item, not a "get/set" one. I would like to check if an item exists in cache (and get it if it is). As for now the Get method always updates the cache dictionary...

Scenario: I have a complex object fetched from a WCF service (which is costly) and cached at point 1. This item gets invalidated at point 2 (by IClock or ISignal), but I don't want to renew it instantly - only when user once again reaches point 1. I have to be aware of the moment when the cache gets invalidated to display an appropriate info.

# February 19, 2011 10:36 AM

Bertrand Le Roy said:

@Piotr: that is a somewhat unusual scenario. What do you tell the user if you don't find the object in the cache?

You could cache a token instead of refectching. When getting from the cache from point 1 and finding the token, you'd know to re-fetch.

# February 21, 2011 8:53 PM

Piotr Szmyd said:

Nice one! This should definitely land in the Orchard docs.

# February 22, 2011 4:28 PM

Mike Radmore said:

Sorry I didn't see the Leave a Comment form so I sent this first to your Contact page.

Bertrand, I too am unable to use Alert.

I copied Alert.aspx to my project folder and then copied Alert.dll to C:\Program Files\Microsoft Visual Studio 10.0\VB\Bin.

Is that the correct Bin folder? If not, what is the correct folder?

Sorry to bang on about your second least favourite subject, judging by 'Mandatory look back at 2010', but I'm new to ASP.NET, which has raised my opinion of Microsoft very considerably. I had my first, and real, production site up and running in a very short time, most impressive, but my error alerts kept appearing behind the browser. I had no idea why until I found your article, which appears to be a godsend. Why hasn't Microsoft made Alert an official part of ASP.NET? Everybody needs to notify the user of errors and warnings. Well I'm very glad you made this control, and I thank you but some installation instructions might have been a good idea.

# March 5, 2011 11:22 AM

Bertrand Le Roy said:

@Mike: no, that is not the correct bin folder. 99% of the time, when people are talking about the bin folder, they are talking about the bin folder that is immediately under your web application's root folder.

One of the many reasons why this is not in the framewrok is that frankly there are much better ways to do notifications on the web than dialog boxes. For example, have a notification area on top of your page.

# March 6, 2011 3:00 AM

Mike Radmore said:

Thanks Bertrand, now it does exactly what it says on the tin! Many thanks.

# March 6, 2011 6:56 AM

Confused N00b said:

This is probably the dumbest question in the world, but how do you actually USE it?  I had no problem installing it and it is listed in modules, but I don't see any way to configure it.

# March 10, 2011 3:21 AM

Confused N00b said:

Oops! I found it in the menu under Themes | Picker.  Sorry, it was such a subtle change to the menu that I missed it.

For ref: ~/Admin/VandelayThemePicker

# March 10, 2011 3:28 AM

idanciu said:

you might want to check this out: weblogs.asp.net/.../testing.aspx

# March 11, 2011 5:03 AM

Gianluca said:

Warning: the correct link for Orchard Translation Manager is www.orchardproject.net/.../Orchard.Module.Vandelay.TranslationManager

# March 12, 2011 7:52 AM

Joe Albahari said:

Hi there

The combobox for choosing 'Automatic' is no longer there because it's redundant. It's exactly equivalent to choosing 'Build data context driver automatically' and choosing 'LINQ to SQL' in the first dialog. So if you do that (instead of choosing 'Entity Framework'), you'll be able to connect to SQL CE and run queries as before.

Joe

# March 14, 2011 9:08 AM

Bertrand Le Roy said:

Gee, @idanciu, that problem has been patched in 2009, as this post shows. If the version of ASP.NET you are running today still has this problem, it's time to upgrade, not to apply workarounds...

# March 14, 2011 1:59 PM

techieg said:

Great job! I actually need this feature since I am working on a site that has a public-facing theme that is different from the backend user/administration theme (and mobile as well). The link you posted for it above is broken, where can I get it?

# March 16, 2011 10:00 AM

Bertrand Le Roy said:

I fixed the link.

# March 16, 2011 1:25 PM

danieleli said:

Nice post.  I was wondering how to get at the stuff inside the nuget package!

# March 17, 2011 3:40 AM

Brian H. Madsen said:

Hey Bertrand,

Yes, it was most certainly a shame that we didn't have more time - so much interesting content!!

Looks like getting you back for a Part Deux would be a great idea!

Can definitely recommend taking a look at this presentation - very hands-on...Good insight into Orchard.

Cheers,

Brian

# March 21, 2011 10:56 PM

TonyWhalen said:

Thanks for a great talk Bertrand!  Keen to get lots more technical info on Orchard in the near future.

# March 23, 2011 8:10 AM

Sweavo said:

Now that the consequences of CTRL-ALT-DEL are not a soft reboot but a call up of a system dialog, it should be done on the SysRq key.  The SysRq key shares the property of CTRL-ALT-DEL that it generates a different interrupt to normal keyboard use... and what's more, the legend on the keycap actually implies that you are making a ReQuest of the SYStem. It's almost like they designed it for that!

# March 23, 2011 8:40 AM

BrianPopovec said:

I am still trying to solve the riddle of where to put the jQuery calls to AjaxControlToolkit for rounding corners of Panels.

When converting my site to MVC, I cannot get the panels to display rounded corners.

Do you put the jQuery in the controller? or the view.

I have tried using a separate project referencing the scripts and then initializing that as a component in the main site and the corners still display as square, not rounded.

When in Web Forms, all worked perfectly!

# March 25, 2011 12:48 AM

Bertrand Le Roy said:

@Brian: just use CSS for that. Most browsers support it nowadays, and those antiquated that don't, will just see square corners. That's better than adding a lot of script and making your life more difficult than it needs to be.

# March 25, 2011 1:07 AM

King_DuckZ said:

I don't really understand why you guys don't use it. When you learn how to type, you soon get to know that for an upper case character you have to use the shift key opposite to the hand you're using for your letter. So H is lshift + h, G is rshift + g. And that's why you have two shift keys.

Now, typing an all caps word only using shift keys would force you into a weird and awkward dance (unless you're lucky and all the letters you need are on the same side, which shouldn't happen anyways). Go ahead and type MY_DEMONSTRATIVE_TEST, and no cheating!

Writing all-caps words happens quite often, for example when you're a developer. Depending on the language and on the adopted coding style, you are required to put an all-caps word every now and then, such in:

for (int z = FIRST_INDEX; z < LAST_INDEX; ++z)

I find caps lock to be quite useful, and it's right in the good place for me.

I assume that other heavy typers (other than coders) have cases where they often put all-caps words in the middle of a text.

Besides, if you look at the screen and you type an unwanted caps letter, you immediately know that you hit the wrong key. You don't need any led, and if you have to rewrite the whole sentence is because you were watching your keyboard while typing. If you do so you're a beginner and you don't deserve to express your opinion on how things should be changed.

# March 25, 2011 8:41 AM

Mathias said:

Hello Bertrand,

I'm trying to use your FavIcon module in a multi tenant orchard site. It works in the primary tenant, but not in the other tenant. I have enabled it for the sub tenant as well, but it does not show up in the settings page of the tenant. Do you have any ideas why it fails?

# March 25, 2011 9:09 AM

Mathias said:

It seems that the table that stores the favicon settings was only created in the database of the main tenant, but not in the db of the sub tenant. When I manually create the table, the module works for the sub tenant as well.

# March 25, 2011 9:18 AM

Bertrand Le Roy said:

@King_Duckz: that last sentence is such a nice touch... To each his own. I personally avoid shouting and none of the programming languages that I use force me to shout, by a lucky coincidence. Note that the new Google laptops did remove the Caps Lock key, so I guess I'm not alone in my misguided quest for the elimination of that key...

# March 25, 2011 8:18 PM

Bertrand Le Roy said:

@Mathias: weird. I've filed a bug to track this: orchard.codeplex.com/.../17558

# March 25, 2011 8:21 PM

Skywalker said:

Very cool! The more I get to know Orchard, the more I love it. Keep up the awesome work!

# March 27, 2011 12:44 AM

Grzegorz Kumik said:

Bertrand,

I was facing the same problem. I wanted to show widget related to specific content and I ended up with different solution (BTW thanks to  yours and Randompete's  tips on forum).

I created widget which is content aware by puling from WorkContex (in my case from RouteData) then I created layer with url rule and at the end I placed the widget in this layer.

IMHO the advantage of this approach is that widget can be move around declaratively in UI.

# March 28, 2011 8:22 AM

Skywalker said:

This is EXACTLY what I was trying to figure out. And now that I see it how easy it is I don't understand I didn't figure it out myself. But I guess that goes for most of the things (once you know how, it's easy).

Two questions I'm still having are:

1. Is it possible to create multiple templates ("skins") for a single Widget.

2. If question 1 resolves to true, then how do I do it?

Thanks!

# March 28, 2011 9:53 AM

Bertrand Le Roy said:

@Skywalker: sure, but what do you want to base the decision on?

# March 28, 2011 3:15 PM

Skywalker said:

It would be great to be able to base the decision on the layer and/or the zone the widget is assigned to.

For example, I have two Blogs: one blog hosts all Political articles, and the other blog hosts all Personal blogposts.

I want to render the Political blogposts in the zone named "Content" using the RecentBlogPosts widget using a custom list template (the way you described in this post). The Personal posts I want to render in the zone "AsideSecond", also using the RecentBlogPosts widget, but using another template.

To achieve that I guess I should name the two templates correctly, but I'm not sure how to name them.

Is it like:

1. Parts.Blogs.RecentBlogPosts-Content.cshtml

2. Parts.Blogs.RecentBlogPosts-AsideSecond.cshtml

?

And if I wanted to use another skin based on the current layer (like "TheHomePage"), would that be possible? What about a combination of the two: I want to use template A only on layer "Authenticated" in the zone "AsideSecond". On layer "Anonymous" I want to use the same widget, but render it using another template.

Perhaps I'm aproaching these problems from the wrong angle, but I'm still trying to grasp the essentials of Orchard, especially theming.

# March 28, 2011 4:08 PM

Bertrand Le Roy said:

The right way to do this is to create alternates for the shape, I think. I have a post about that.

# March 28, 2011 4:26 PM

Skywalker said:

Just the direction that I needed. Thanks, I will look that up!

# March 28, 2011 5:21 PM

Pedro Salgado said:

Great post Bertrand but I still have a doubt.

Is it possible to show other fields from my content type in the list?

I want my list to show subtitle (Text Field), lead (HTML Field) and picture (File Field).

If its true, how do I do it?

Thanks!

# March 29, 2011 1:17 PM

Bertrand Le Roy said:

@Pedro: sure, I would recommend you try the new Shape Tracing feature in the upcoming Orchard 1.1. The model tab will give you the syntax that you can copy and paste into your template for any field or part property. The difference here would be probably that you would apply the same path, but from the content item instead of from Model.

# March 29, 2011 4:31 PM

Jan Chvojka said:

Thank you for the post! I'am really looking forward to 1.1 version. This feature seems very helpful.

# March 29, 2011 5:21 PM

tobias said:

When will the stream of your presentation be available?

I've downloaded the recording from the LIDNUG homepage, but the video file seems to be broken.

# March 30, 2011 5:50 AM

weblogs.asp.net said:

Migrating a blog from orchard 0 5 to 0 9.. Dandy :)

# March 30, 2011 5:52 AM

tobias said:

Sorry, now it works! I had to download the "Microsoft Application Screen Decoder 1 (MSA1)" to get it to decode the video file.

# March 30, 2011 6:00 AM

nk54 said:

Very intersting ! I've read severals of your post on matrix with netduino.

I'm going to test your code as soon as i get some shift register.

++

# March 30, 2011 10:16 AM

Heinz said:

Someone else came up with the idea in 2007. No idea if it was implemented. I was googleling fpr thes kind of glasses ready made, but looks like I have to build them myself.

# April 2, 2011 7:30 AM

RJ said:

How would i be able to let someone upload pic's and see it loaded in the album?

i know i could use a uplaod commponent, but getting it to save?

Thanks

# April 4, 2011 11:44 AM

Bertrand Le Roy said:

@RJ: you can't, except if you give them ftp access or build it yourself.

# April 4, 2011 1:54 PM

Oladipo Olasemo said:

How do i do an horizonatal listing of my image directories, say i want to have 4 items per line as against having them listed vertically with one item per line.

# April 11, 2011 8:58 AM

Test said:

Will LINQpad be updated to have built-in support for Entity Framework 4.1 (containg Code First)?

# April 14, 2011 5:42 AM

Bertrand Le Roy said:

@Oladipo: it should not be a vertical display. That it is in your case indicates that it wasn't properly configured and that you are not getting the stylesheet. Glancing into the network trace in Firebug should confirm that and give you an error message.

# April 14, 2011 3:18 PM

Bertrand Le Roy said:

@Test: you should ask the authors of LinqPad.

# April 14, 2011 3:18 PM

Jace said:

Has anyone done some benchmark of Clay against Dictionary<string, object> and casting? Dynamic type is from my experience 3x slower than casting an object (if not more).

# April 15, 2011 4:06 AM

Bertrand Le Roy said:

@Mike: yes.

@Jace: not that I know of. Still, *what* dynamic types are you talking about? There are many ways that you can implement a dynamic object. Clay is not especially optimized for performance and uses dictionaries inside. Other implementations use expression trees, a method that is much faster than dictionaries and almost as fast a statically typed code.

In the end, using dynamic objects means sacrificing some performance for extreme flexibility. Ruby, Python and JavaScript developers usually consider it's a tradeoff they're willing to make. If to you performance is the most important maybe you should switch to assembly language. Kidding.

# April 15, 2011 2:26 PM

Andrew said:

Instead of complaining, I think you should look at your list as an indication of what developers want to know.

There are so many blogs (like yours) about the latest beta version of something that may never take off, that's cooking in a lab at Microsoft.  

Most .Net developers are sitting in cubicles writing business applications to update customer records. They just want to know how to prompt the user when he tries to delete a record out of a GridView.

"Do people still do that stuff?"

Of course they do.  Don't act condescending to them, OK?  And they still have to support IE 6 (which your company produced), because it's still out there causing headaches.  Maybe we developers should just announce that IE 6 is "so yesterday" and stop writing code to deal with it?

# April 15, 2011 3:25 PM

Bertrand Le Roy said:

Ah, @Andrew... Where to start? There is nothing wrong about prompting the user for confirmation. You completely, grossly misunderstood what I meant by "do people still do that kind of stuff": I was actually talking about how wrong my own solution was today. There are much better ways to prompt the user than that hack. One example is in jQuery UI, another is what Netflix is doing in their queue where they execute the action but give you a chance to undo it (thus not disrupting the user's action flow with a modal dialog). Sad that you would interpret a self-deprecatory comment as condescending.

It's nice of you to think that I'm running Microsoft but I'm not, and I had nothing to do with IE6 but yes, I do absolutely think that developers should stop writing code to deal with it and have said so on numerous occasions, including on this blog.

Finally, "complaining" when it ends with "no regret, 2010 was a good year"? The bitching before that is clearly tongue in cheek. Thanks for the advice to "look at [my] list as an indication of what developers want to know": that was precisely the intent of that post in case you couldn't tell. My conclusion was that well, OK, what I like to write is not precisely aligned with what people want to read but that I don't care that much and will continue to write what I want to write. If people want to read it, good, if they don't, no big deal.

# April 15, 2011 4:59 PM

nellbryant said:

This one worked for me. Thanks Bertrand!

# April 20, 2011 3:32 AM

Michael said:

I just hope this thing never goes the route of Community Server.  Get people to use it because it's "free", then switch it over to commercial...the ole bait and switch.

# April 20, 2011 12:46 PM

Bertrand Le Roy said:

@Michael: it will never happen.

# April 20, 2011 1:53 PM

TheDirtyBird said:

This is similar to DotNetNuke.  I will be giving this a try in a few weeks.

# April 20, 2011 3:59 PM

Chris said:

Wow, nice updates.  What does the license say about someone integrating Orchard with another app (closed source) and selling the resulting combination app?

# April 20, 2011 5:48 PM

Bertrand Le Roy said:

The license is BSD, which is very permissive towards this kind of thing.

# April 20, 2011 5:53 PM

Preetham Reddy said:

Bleroy,

This is an excellent post.. Thanks a lot for letting us know about it...

Can you point me where in the documentation can I find such information?

# April 20, 2011 8:11 PM

David Fekke said:

Thanks Bertrand.

This solves a lot of problems that I might have had with my module development. The WCF feature is extremely cool.

David

# April 21, 2011 12:14 PM

Hugh Mannity said:

This didn't help at all.  You don't at all explain the most important part, "Remove all reparse points I found under folders."  Are you suggesting to delete a folder called, for example, "My Documents", to fix a backup problem?  If not, explain - you are being irresponsible by being so vague because some people, not having anything specific to go on, will start deleting these folders and everything in them.  If it's so hard for you to be detailed and specific, it's better you not even comment on the problem at all.

# April 21, 2011 9:25 PM

Bertrand Le Roy said:

@Hugh: look, here is how this works. This is my blog, where I wrote a post to try to help people. Those people who arrive here and start bitching and telling me I'm irresponsible, I feel no urge to help further. Please go complain somewhere else.

# April 21, 2011 10:26 PM

Deep said:

Looks good.

Any comparison with DotNetNuke?

# April 23, 2011 10:28 AM

Katie said:

# April 24, 2011 1:44 PM

Tommy said:

Is there a significant speed advantage to using Sql Express over SqlCe?

# April 27, 2011 7:33 AM

Bertrand Le Roy said:

SQL Express maybe not that much but SQL Server makes a huge difference and the migration process is the same.

# April 27, 2011 1:53 PM

Swayam said:

Menu item doesn't show up in Orchard 1.1

# April 27, 2011 6:30 PM

Bertrand Le Roy said:

What menu item?

# April 27, 2011 6:33 PM

Bogdan said:

Hello, a great post that helped me with the view for my recent blog posts, but I seem to be encountering some difficulties trying to display another content type.

My scenario is the following : I have a list of "Service" content types, that I display in a widget in the AfterMain zone on the homepage and in a separate page linked to the main menu. I have created the view for the separate page (Content-Service.Summary.cshtml), and after reading the documentation about alternate templates, have created a Widget-AfterMain.cshtml view to change what appears on the homepage in the widget.

The problem is I cannot access the list items with Model.ContentItems.ContentItems. I know that with Model.Content I can make them appear, but I cannot dig further down than that, not event with Shape Tracing, which doesn't show me in the Model the actual Service Content Items.

I don't event know if doing the view for this in Widget-AfterMain.cshtml is appropiate, as any other future widgets, on other pages, placed in this zone, will be affected.

Can you guide me please? Thank you

# April 28, 2011 6:09 AM

Seeker said:

I sure hope not!

# April 28, 2011 1:57 PM

Bertrand Le Roy said:

I can only guess, but you're probably not looking at the right shape. I would need to take a look at the code to be able to provide anything beyond guesses. Feel free to use the contact form.

# April 28, 2011 3:10 PM

Jay said:

Thanks for your post, but wouldn't it be possible/easier to insert a hashed password directly into DB? I guess everyone who has to deal with CMS's knows how to hash/encode a password using a SHA1/Base64 generator.

BTW: I think the term "encrypted" is a little bit misleading in this context. I think Base64 encoded passwords should be referred to as "encoded" instead of "encrypted" passwords.

PS: Is there a way to change the encryption from SHA1 to a more secure algorithm like SHA2? Would it be possible to overwrite the UserPartRecord setting and update all existings passwords (using a module or something)?

# April 29, 2011 1:00 AM

Bertrand Le Roy said:

@Jay: wow, not by any stretch of the imagination. Not that many people know how to hash a password, and even if you do, this is considerably easier. You are also fogetting about the salt here.

And BTW, I did not talk about encryption at all in the post, so I'm not sure what you mean here.

To move to a better hash algorithm, you can always replace the implementation, using a module, yes.

# April 29, 2011 1:07 AM

RichB said:

Why no password iteration count?

# April 29, 2011 1:46 AM

Bertrand Le Roy said:

@Rich: because you haven't contributed it yet.

# April 29, 2011 1:48 AM

Bogdan said:

Thanks, I've sent you the code.

# April 29, 2011 10:46 AM

Kevin Stevens said:

Nice solution.

# April 29, 2011 11:28 AM

Ashwani K Tiwari said:

Nice post.

i want to implement this feature

can you provide me steps like

what js file i required as start.js

what js references i need to add and

Most importantly where should i define my scripts

Sys.loader.defineScript({

 name: "classBrowserTree",

 releaseUrl: "%/TreejQuery.js",

 executionDependencies:

   ["jQuery", "Templates", "ComponentModel"],

 isLoaded: !!(window.jQuery &&

   window.jQuery.fn.classBrowserTreeView)

});

in which file so that i can access from my aspx file.

# May 4, 2011 4:46 AM

Richard Hein said:

Very nice and very relevant.  This is exactly the kind of thing C# needs for things that just can't be statically typed.  I absolutely love the fact that you can assign a ... Clay object? ... to an interface.  Then just carry on statically.

# May 6, 2011 11:17 PM

Tommy Havens said:

This is great Bertrand... Thanks...

# May 8, 2011 8:48 PM

Donald said:

I would choose:

node.Attributes["rating"].Value

because then I could make it:

node.Attributes[someVariable].Value

and have it do other work.

# May 9, 2011 8:45 PM

Bertrand Le Roy said:

@Donald: you can get that result by implementing your own Clay behavior.

# May 10, 2011 12:02 AM

David de Vries said:

Very nice! Just what I needed now!

# May 11, 2011 6:42 AM

Jason T said:

Something like this needs to be baked into the .NET Framework as a more flexible ExpandoClass.  I ran into another great library on Codeplex that uses the DLR for XML querying.  dynamictoolkit.codeplex.com

# May 11, 2011 1:40 PM

Bruce Palmer said:

Great idea, but couldn't get past Microsoft JScript runtime error: 'WebForm_PostBackOptions' is undefined.  Only httpmodule I had was "ScriptModule".  Under pressure to finish a project; have to find another way to solve this.  

# May 15, 2011 5:37 AM

Mauricio Scheffer said:

What's bind and unit in Parallel.ForEach() and dynamic? I don't think these are monads...

# May 15, 2011 6:24 PM

SLa said:

Well, when it in URL to the 3rd party site. for exmaple you generate Image url to the flickr site, and ASP.NET keeps insisting to replace all & with &amp, images jsut doesnt work.

# May 16, 2011 11:41 AM

esims said:

hi, i'm a noob to orchard. still trying to understand. i want to change around some things in my blog posts and your article looks like how i do it.

so, are you saying all i need to do to change the appearance is to create a file called 'Parts.Blogs.RecentBlogPosts.cshtml' and place it in my theme's views folder and that's it? i don't have to add any other code or do any compiling?

sorry for the dumb question, but thanks for your help.

only reason i'm asking is this is what i did, but i don't see any changes.

# May 16, 2011 12:45 PM

Bertrand Le Roy said:

@esims: yes, that is all you need to do but this is to change what gets displayed by the recent blog posts widget. If that's not what you want to change, you need to determine first what template is rendering what you want to change. I recommend using the Shape Tracing feature to figure that out.

# May 17, 2011 5:18 PM

Bertrand Le Roy said:

@SLa: you might want to re-read the post. ASP.NET is doing the right thing here.

# May 17, 2011 5:20 PM

Bertrand Le Roy said:

@Bruce: this code is antique. You should consider using more modern alternatives, such as jQueryUI.

# May 17, 2011 5:23 PM

Bertrand Le Roy said:

@Mauricio: as explained above, unit for Parallel.ForEach is implicit and is the call to the AsParallel method; bind is ForEach itself. The pattern is very implicit here (its different elements float below the visible surface) but it's definitely there in spirit and implementation: put an object into a box that the monad understands, then hand that over to processing machines.

For dynamic, unit is the dynamic declaration, and bind is implicitly provided by the compiler itself once that is done. Unboxing happens when you cast back into a CLR object (if you choose to do that). Here you have arbitrary operations that can be expressed in a universal manner and applied to objects of various natures, provided they have been boxed with dynamic.

Those two are very much monads. Or I have not understood monads at all, which is entirely possible...

# May 17, 2011 5:56 PM

Martin said:

Hi Bertrand,

Thanks for the video - very useful!

Is it possible to add the Taxonomy Widget such that it is visible "only" when viewing the Blog (i.e. it is not visible when viewing the Home Tab)?

Martin

# May 18, 2011 5:33 AM

Bertrand Le Roy said:

@Martin: yes, for that you need to put the widget on a layer that is only shown when viewing the blog. This can be done with a simple url rule, something like 'url("~/blog/*")' if "blog" is the relative url of your blog.

# May 18, 2011 2:45 PM

Adam A said:

Oh man, the timing of this video could not be better. Great stuff, Bertrand - thank you!

# May 18, 2011 4:09 PM

Chaker Nakhli said:

Hello,

Thank you for your post!

In your benchmark you didn't mention memory usage for each option. Space complexity is important when you handle multiple request in parallel.

Cheers

# May 21, 2011 11:36 AM

David said:

This is great! Thank you!

It should be built in to the next version.

# May 23, 2011 5:27 AM

David said:

btw, do you know why this hasn't been built in?

Does it have any negative side-effects?

# May 23, 2011 5:28 AM

Adam A said:

Hi Bertrand,

I was playing with this a bit, and was wondering if it possible to have the taxonomy info appear in the route when displaying a content item? Using your news example, instead of www.mysite.com/content-item-slug, I would like www.mysite.com/.../content-item-slug.

Is this possible?

Thanks

Adam

# May 23, 2011 2:19 PM

Bertrand Le Roy said:

@David: you should check out the designer tools module and its url alternate feature.

# May 23, 2011 2:51 PM

Sebastien Ros said:

@Adam, you would need to define your own Handler for TermPart so that it overrides the default item url in the metadata event. Also it would require a setting to select which field needs to be used as the route provider. It's not trivial ... And it's not something I will do, as there are features with higher priority than that.

A simple solution would be for you to define the exact route you want by hand, on the content item, something you can do with everything out of the box in Orchard right now.

# May 23, 2011 4:11 PM

Adam a said:

Thanks for the reply Sebastien. That does sound pretty complicated. Defining the route by hand would work, but misspellings, renaming of vocab, etc. would wreck havoc on our URLs and site structure.

If my understanding is correct, the Taxonomies module is the recommended way of implementing categories/sections/etc. It seems like this type of URL scheme (category/subcategory/item) would be common in many separate scenarios (e-commerce, classified/auction site, newspaper sections/pages, etc.) I work for a newspaper publisher, and we have been trying to figure out if Orchard would work out of the box as a back-end for our sites. We can't really trust users to come up with a valid/logical url for each item on their own, but http://domain.com/story-slug is way to generic.

I've also read in various places that the Blog module will get a rewrite, and Routing will be getting a makeover as well. Is this accurate?

I will take a look at the current Blog implementation and will try to hack something up. Please let me know if there are any resources out there, other than the wiki, that could help me get started.

Thanks for your help and all of your hard work.

Adam

# May 23, 2011 6:35 PM

Adam A said:

Well... I am thoroughly stuck. This is kind of a deal breaker for us, and I am unable to get my head around Orchard's method of routing, overriding default url's, etc. - so I shall be back when this feature is implemented. Is there somewhere that I can make a feature request that is track-able?

Thanks,

Adam

# May 24, 2011 6:41 PM

Sebastien Ros said:

Please file a bug in orchardtaxonomies.codeplex.com

# May 24, 2011 7:04 PM

David said:

Thanks, that's very easy!

I started reading the documentation just before the release of version 1.1, must have just overlooked this part.

# May 25, 2011 4:32 AM

Ranman said:

The truly sad part of all this is that Microsoft can't expect normal end users to figure this stuff out.  Microsoft Backup should just work.  If it can't backup a reparse point then at least skip it and continue.  It can at least be listed as skipped.  I believe the backup software should be able to tell what a reparse point is and what to do with it.

How does third party backup software handle reparse points?

# May 25, 2011 5:12 PM

Bertrand Le Roy said:

@Ranman: couldn't agree more. Apparently third party software is doing fine.

# May 25, 2011 5:18 PM

ejsa13 said:

Hi Bertrand,

I am new to Orchard and ASP.NET MVC and still learning it. I tried to use the code above (the first part of Parts.Blogs.BlogPost.List.cshtml)to override the rending of my generic list (created a ContentType named Project) but I am encountering an error with this line

var listTag = Tag(list, "ul");

The error thrown was:

The type arguments for method 'System.Web.Mvc.TagBuilder.MergeAttributes<TKey,TValue>(System.Collections.Generic.IDictionary<TKey,TValue>, bool)' cannot be inferred from the usage. Try specifying the type arguments explicitly.

I assume that the this error was not thrown when you used it because you are using Blog part and I am using a generic one.

What should I do?

# May 27, 2011 4:22 AM

Bertrand Le Roy said:

Attach a debugger and look at that list variable. I wouldn't be surprised if it was null.

# May 27, 2011 1:41 PM

Saeed Neamati said:

Hi

I don't think working with something like jQuery need such a complicated process. I think we can work natively, with ease and simplicity.

ASP.NET framework is so powerful. But the way it joins client-side to server-side is so abstracted and dirty.

<a href='www.thoughtresults.com/webform-sucks-mvc-rocks'>Here</a> I've talked about it.

# May 28, 2011 3:23 AM

Bertrand Le Roy said:

@Saeed: care to look at the date for this post?

# May 28, 2011 3:25 AM

Chiliyago said:

I created a Folder and added this code but the lines starting with: workContext.Layout.Metadata...

do not compile.

Error says:

One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll? D:\Visual Studio 2010\Projects\Orchard.Source.1.1.30\src\Orchard.Web\Themes\MyTheme\Filters\LayoutFilter.cs 23 4 Themes (Themes\Themes)

# May 28, 2011 8:16 PM

Chiliyago said:

I needed to add the following using statement to get this to compile.

using Microsoft.CSharp;

# May 28, 2011 8:19 PM

Chiliyago said:

After finally compiling this code I cannot seem to have it hit a breakpoint to be sure it is working. Are there other dependencies needed to get this thing to work?

# May 28, 2011 8:49 PM

Ling said:

Hello Bleroy,

do you have any details or any demos for building WCF service in Orchard Module?

# May 29, 2011 9:51 PM

Bertrand Le Roy said:

@Chiliyago: do you have debug=true in your web.config?

# May 31, 2011 4:16 PM

Bertrand Le Roy said:

@Ling: that's what we have at the moment.

# May 31, 2011 4:17 PM

Rosh said:

Anyway to navigate through multi pages of a tif image?

Thanks.

# June 1, 2011 12:33 PM

Bertrand Le Roy said:

@Rosh: not with this. Quite off-topic actually.

# June 1, 2011 12:39 PM

Brian said:

I'm kind of surprised that no one mentioned that Netscape introduced a proposal for "action sheets" all the way back in 1998: www.w3.org/.../10

# June 6, 2011 11:15 AM

Roubo said:

Thank you so much for the explanation, Bertrand!

I am a little noob with JavaScript, but I finally understood how to properly pass parameters to event handlers and it WORKS!

Life is wonderful again :)

All the best!

# June 6, 2011 6:36 PM

Jesse said:

Great video! Thank you

# June 6, 2011 7:36 PM

Michele said:

if I want to change an element based on the zone where it is, what alternate should I use? For example if I have an html widget in the zone asidefirst, what alternatives shoud I use?

# June 8, 2011 5:52 AM

Steve Gentile said:

popping out to cmd is interesting, but I couldn't help but to wonder what this experience would be like if WebMatrix supported the powershell built in, so the commands could be executed in powershell, in the same manner, ie. MvcScaffolding by Steve Sanderson works.

Good video, (do more!) I didn't realize Orchard could do half of this  :)

# June 8, 2011 7:41 AM

Bertrand Le Roy said:

@Michele: the alternate doesn't exist out of the box (there are alternates with zone name and widget type, but not both at the same time.

If you only have stylistic changes to make (CSS), then you can use this: weblogs.asp.net/.../even-better-customizability-in-orchard.aspx.

If you need to modify the actual template or add alternates, you could follow the technique exposed here, as zones are rendered as zones: weblogs.asp.net/.../orchard-list-customization-first-item-template.aspx. There are differences but that's the idea: add the alternate you need during the zone/widget list rendering.

Another technique that may be simpler is to add the alternate from a shape table provider (see weblogs.asp.net/.../orchard-shapeshifting.aspx).

It's the second time I'm getting this question, so I may blog the details.

# June 8, 2011 2:01 PM

Brett said:

I'm curious; you provide a regex example to parse this string but later say, "don't do your own parsing". It seems that for those of us without access to the Sys namespace in JS, it would be better to parse for the string inside the parens, split on the hyphen, get a date object from arr[0] and calculate the tz differential on that result with arr[1] (if arr.length>1). Or am I missing something?

# June 13, 2011 2:58 AM

Bertrand Le Roy said:

@Brett: feel free to do that if you want to.

# June 13, 2011 3:09 AM

Chris said:

Hmm, maybe late to the party...

Anyway I'm using this approach for a jquery cycling images type'o'thing but I just get StackOverflow errors with the recursive call.

First time I ran this script it crashed firefox 4.1 with no recovery! Chrome however at least says 'you're script is gonna crash! shall I kill it?' (effectively).

Am I doing something wrong?

# June 15, 2011 8:46 AM

Joe said:

Are there any suggestions to correct for photo order time sequence for photos taken within the same second period of time?  My experience has been for pictures taken in fast sequence (same second of time), they are often of chronological order.  Thanks for any suggestions.

# June 15, 2011 11:43 AM

Bertrand Le Roy said:

@Chris: hard to say without seeing your code. But yes, you are obviously doing something wrong.

# June 15, 2011 2:03 PM

Bertrand Le Roy said:

@Joe: edit the dates.

# June 15, 2011 2:04 PM

jp said:

Really nice demo. I ran it tonight and it is really smooth :). When running the command prompt with orchard ( bin\orchard.exe ) I think it will be nice to mention the fact that WebMatrix should be shutting down or you end up with the following message : log4net:ERROR [OrchardFileAppender] Unable to acquire lock on file...

Also I noticed that when preview a new theme, if you apply it after the preview orchard is confused and seems have already applied this new theme!!! did I miss something :P.

that's it for now

# June 18, 2011 1:12 AM

jp said:

By the way when using orchard to the command prompt and when creating a new theme based on contoso for instance I have the following warning :

orchard> codegen theme JPTheme /BasedOn:Contoso

Creating Theme JPTheme

Warning: Orchard.Themes project file could not be found at C:\Users\jharroch\Doc

uments\My Web Sites\Orchard CMS\Themes\Themes.csproj

Warning: Solution file could not be found at C:\Users\jharroch\Documents\My Web

Sites\Orchard.sln

Theme JPTheme created successfully

Is that expected?

# June 18, 2011 1:19 AM

Bertrand Le Roy said:

@jp: I don't think the log4net error is due to WM, rather to concurrency with the web server.

For the preview thing, please file a bug with precise repro steps.

# June 18, 2011 1:57 AM

Bertrand Le Roy said:

@jp: yes, thse warnings are expected (I thought I had explained that in the video actually). They are there because you don't have the full source code and it can't find the solution to which to add the new project.

# June 18, 2011 2:08 AM

jp said:

thanks for the reply. I will try to reproduce step by step the issue when applying a new theme when the default one is in place.

still orchard is amazing :)

# June 18, 2011 5:48 PM

jp said:

I did create an issue tracker on codeplex :

Work Item Details

Item # 17963  

# June 18, 2011 6:20 PM

Bertrand Le Roy said:

@jp: merci m'sieur.

# June 19, 2011 1:03 AM

jeremy said:

wow, I wish I noticed this 10 days ago ... oh well, much better than the cshtml hacks I was resorting to. Thanks :-)

# June 22, 2011 2:11 AM

Tomas Crespo said:

The link www.asp.net/.../default.aspx doesn't works

# June 22, 2011 11:54 AM

Tomas Crespo said:

And now? With ASP.NET 4, is it posible to do this easy? or I need to use Bertrand method yet?

# June 22, 2011 1:16 PM

Ksenia Orlowa said:

Can i define a Custmon Event on the ASMX Webservice, and run a javascript function on the client site with this event??

# June 23, 2011 2:01 PM

LIpu said:

I agree with Piotr Szmyd that this should go into Orchard docs

# June 24, 2011 6:05 AM

Bertrand Le Roy said:

It's a wiki...

# June 24, 2011 3:31 PM

mnf said:

# June 25, 2011 9:01 PM

Skywalker said:

I'm using the Url Alternates feature of the Designer Tools module to achieve the same thing, which is great.

However, I would really like to use the Razor Layout feature so that I could have a Master.cshtml which contains the primary layout markup, and then a Layout-url-home.cshtml template for the homepage and Layout.cshtml for all other content pages.

Both Layout-url-home.cshtml and Layout.cshtml should use Master.cshtml as their Layout (in terms of the standard Razor view engine).

Orchard uses its own view engine implementation which prohibits setting the Layout property.

Right now I have duplicated HTML. What should I do?

# June 28, 2011 5:53 PM

Bertrand Le Roy said:

@Skywalker: it seems like the layout is *not* the shape you want to vary on those pages. I'd need to know more about what you are trying to do but I'd guess that with a few deeper shapes and wrappers, you should be able to do exactly what you want. Feel free to e-mail me if you want to discuss that more specifically.

# June 28, 2011 5:59 PM

Skywalker said:

I'm basically trying to do exactly the same as you are doing in this article, but if you look at both your Layout-HomePage.cshtml and Layout-Orchard_Blogs.cshtml templates, they look very similar: for example, both templates define the Header zone.

Although this works just fine, I would prefer to put the site markup structure (e.g. Head zone, Footer zone) in its own "master" template. Then Layout-HomePage.cshtml would only have "<h2>This is the home page!</h2>" and Layout-Orchard_Blogs.cshtml would only have "<h2>This is the blog!</h2>". The surrounding HTML would come from the "master" template.

In ASP.NET MVC Razor views, you would achieve this by simply creating a _Layout.cshtml view, a Home.cshtml view and a Blogs.cshtml view. The latter two would set the Layout property to "_Layout.cshtml".

This doesn't work in Orchard (for understandable reasons, Orchard works with the Shape system and is quite different I assume)

If I'm still not making sense I will be happy to elaborate in a message demonstrating the issue and what I'm trying to accomplish.

Thanks!

# June 28, 2011 6:13 PM

Bertrand Le Roy said:

Well, if that's the extent of duplication, I wouldn't be that worried: a layout is just a few structural tags and top-level zone declarations; and maybe a small number of custom, single use shapes. If you have anything more than that you are probably doing something wrong. In that case, the Orchard layout is doing pretty much exactly what Razor layouts are doing. So the remark that you would "prefer to put the site markup structure in its own master template" makes little sense to me: that is exactly what the layout is supposed to be. That is how we designed it and the intent we had. As a side note, the PM in charge of Razor layouts was on the Orchard team when we designed this.

This different title that you have there, and what your layout seems to be varying on currently, does *not* belong in layout. It should be a widget or a custom shape for which you have url alternates.

# June 28, 2011 7:25 PM

Bertrand Le Roy said:

Interesting quote from Eric Lippert: "LINQ was designed to bake the "monad" pattern into C#" blogs.msdn.com/.../following-the-pattern.aspx

# June 30, 2011 3:38 PM

Skywalker said:

Nice picture of the tree built with lego shapes. Orchard feels that way: playing with Lego.

I used this ad hoc shape technique yesterday to vary the layout based on whether the homepage was requested, or another content page (using the Url Alternates feature of the Designer Tools module).

It's very common to have a homepage with a different layout than the other pages.

For example, to vary the layout based on whether the user is on the homepage or not, I created an ad hoc shape "BodyContent" inside Layout.cshtml ("@Display(New.BodyContent())") and created two templates for it: "BodyContent.cshtml" for the content pages layout and "BodyContent-url-homepage.cshtml" for the homepage layout.

The interesting thing I'd like to share with newcomers to Orchard is that next you can easily render Zones in these templates, by simply calling "@Display(WorkContext.Layout.[NameOfTheZone])".

Being able to skin any shape using alternates you have ultimate flexibility in creating multiple page templates.

# June 30, 2011 7:53 PM

Bertrand Le Roy said:

Hush, that thing about zones is the second post I'm writing today. How did you know? ;)

# June 30, 2011 8:05 PM

Skywalker said:

Ha, looks like Orchard is causing some kind of quantum entanglement effect ;)

Sweet, looking forward to that second post!

# June 30, 2011 8:19 PM

Louis DeJardin said:

Plus, you can use a shortcut on the Display object to New and render a shape in one step:

@Display.DateTime(date: DateTime.Now, format: "d/M/yyyy")

Literally the same code running, really, just hitting fewer keys.

# June 30, 2011 8:36 PM

Bertrand Le Roy said:

Oooh, yes, missed that one. Updating the post.

# June 30, 2011 8:41 PM

jeremy said:

I want to create a differing implementation in a new module, because the default does some "interesting" stuff (eg description includes HTML, which it shouldn't) and I want to add some more fields (eg tags as categories, full html as CDATA wrapped "content" extension, attached media as embed etc.

I have had a good bash at the source, but it is fairly complex. Can you give me an overview of the minimum moving parts a a module for making a variant? happy for it to have different routes.

many thanks!

# June 30, 2011 10:11 PM

Bertrand Le Roy said:

@jeremy: if you want to alter how content items are transformed into feed items, you need to implement IFeedItemBuilder. You can look at existing implementations for inspiration.

# June 30, 2011 10:19 PM

jeremy said:

Probably shows my ignorance - how to I make Orchard "respect" my implementation rather than the default one in Feeds/standardBuilders? Can a theme do that? Or am I better off just developing a new one on a different route?

# July 1, 2011 12:38 AM

Bertrand Le Roy said:

@jeremy: sure, you can do anything. If you don't want to go through our RSS infrastructure you can create your own. I'm not sure what would prevent you from doing that.

# July 1, 2011 12:52 AM

hajan said:

Nice and very well explained!

# July 1, 2011 4:52 AM

Dan said:

Hi, I've got a situation that I think this could work for but I'm not sure how to go about it.

Say I have a Product ContentType and a blog.  I tag my posts with tags that sometimes match the name of a product, say, "Product1".  

Now when I'm on Product1's detail page, I'd like to list all posts tagged with "Product1".  Basically the same list as if I navigate to "~/tags/product1" or "~/rss?tag=prod1"

What should I add to my product view to show this list?

thx!

# July 3, 2011 4:15 PM

Danae said:

Trying to make a simple, multi-use slideshow and setInterval() is causing havoc; I'll try and use this method and hopefully all my problems will be solved. Thanks!

# July 4, 2011 6:19 PM

DerbyGirl said:

I just think this is all a bunch of b.s.  I didn't have ANY problems backing up my stuff until I did a Windows Update. After updating files they recommended as important, I can't run a backup. Isn't MS the cause of this problem in the first place?

I surely hope getting rid of some 'clutter' will help solve this problem. Thanks for passing on what worked for you. Wish me luck. :)

# July 6, 2011 2:18 AM

Sumon said:

Dear Sir

I am a beginner in asp.net.

I want to use this Photo gallery in my project.

How can i do it?

thanks in advance!!

# July 7, 2011 2:12 PM

JonVee said:

I've created a custom containable content type with image and text fields included as parts... (I read this may be of use later on when I try to search

based on those fields or rather part properties)..

Anyways I've got an image field and can't figure out how to display as a link to the details view.

I can't get past how the @Html.ItemDisplayLink(title, contentItem) for the title actually pulls the route.

I've tried <a href="@Model.ContentPart.Path">...</a> in the custom field view (using shape tracing),but that doesn't render anything in the href. I assume I need to tell it what the content part is somehow.

I'm also wondering if I should be creating this as a modue rather than via Orchard admin and adding content parts, fields, etc..?

Yes I am a noob and I will be laughed at ;)

# July 9, 2011 3:54 PM

Bertrand Le Roy said:

@JonVee: you might want to use Shape Tracing's Model tab to determine how to get to the data you want to display.

# July 11, 2011 5:27 PM

Brian Foster said:

Hi Bertrand,

Is this still the most recommended way of doing image resizing for asp.net for high traffic sites?

Have you seen http://imageresizing.net ? It even has a nuget package.

Just wondering if you know any high traffic asp.net sites that did image resizing and how they're approaching

Thanks

# July 13, 2011 2:40 PM

Bertrand Le Roy said:

@Brian: I've heard good things about that library but haven't tried it myself. That's a great idea for a future post though.

I think Bing is using pretty much this method above for its image resizing needs. That's as big as it gets.

# July 13, 2011 4:00 PM

thinsoldier said:

Wishful thinking.

@scope #adminpanel {

/*

Styles that are scoped to the admin panel area.

The equivalent of having <style scoped=scoped>

in the markup of the #adminpanel div.

*/

h1 {color: red; font-weight: bold;}

.panel { width: 400px; height: 300px; overflow:scroll; }

form { margin:0; }

input{float: left;}

label {float: right;}

} /* end scope */

it would also be nice if we could have something like <style scoped> in the markup but without having to write the css in the markup:

<div id="adminpanel">

<link scoped=scoped rel="stylesheet" type="text/CSS" href="adminoverlays.css">

<p>....</p>

<form>...</form>

</div>

# July 16, 2011 12:54 PM

Luke Page said:

Any idea why vs2010 shows the type from a properties value tag, but not the comment inside the tag? For that you have to add a summary to both getter and setter...

# July 18, 2011 12:40 PM

Ankur Nigam said:

From where can I get either either DZI processed or unprocessed image you have used in this webpage?

In fact, I am very much interested in the Bicycle image used to showcase deep zoom functionality on Seadragon official page as well.

Do you have the image or its references, from where i can download?

# July 18, 2011 12:51 PM

Bertrand Le Roy said:

@Ankur: The image I used above is a composite of pictures I took on top of Mount Pilchuck, WA. I do not know the pedigree of the sample images the Seadragon team used for their samples. You'd have to ask them.

# July 18, 2011 2:10 PM

Bertrand Le Roy said:

@Luke: you would have to ask the Visual Studio team about their implementation.

# July 18, 2011 2:11 PM

Bruno said:

Have you seen HTML5 microdata? Is it an option for your tokens?

# July 22, 2011 5:52 PM

Bertrand Le Roy said:

@Bruno: I have, but I'm not sure how this would relate to it.

# July 22, 2011 6:40 PM

Justin James said:

What's the use case for this? I don't think I've seen a CMS try to solve this problem before (at least not in the core package). Considering all of the other issues that need to be addressed in Orchard, I think the time would be better spent making it easier to use, not building in complex, rarely used functionality that does not solve an obvious pain point.

J.Ja

# July 22, 2011 7:48 PM

Bertrand Le Roy said:

@Justin: a typical use case is URL generation, a feature in very high demand, or user-customizable alerts. If you haven't seen a CMS try to solve this problem before, then you have never looked at Drupal. They have a token module that does exactly that and that is used pretty much everywhere in the platform.

You are mistaken if you think that this is the only thing we are going to do for Orchard 2.0. We are also looking at the "other issues". Also, it's open source, so you are more than welcome to contribute.

# July 22, 2011 7:55 PM

Gokhan Kaya said:

You're doing great job with Orchard.

We're a web agency, built at least 3 CMS from scratch, used many ready e-commerce and CMS platforms. Orchard is the first platform where our developers are happy to work with. Many of the problems we faced are already considered and resolved in a clever way. Especially the modular design, we have been dreaming of this for 10 years but not able to make a fully modular product. Thanks to Orchard, finally we have it.

We're not only using it in our website projects, but also learn new technologies and apply best practices on other projects we are developing.

Keep up the good work guys.

Cheers

Gokhan

# July 23, 2011 6:14 AM

Paul said:

Very Cool. Cannot wait for v2.0!

# July 24, 2011 12:48 AM

AndrewSeven said:

I'm probably not the only one who isn't familiar with MadLibs, is there any chance you could have another try at explaining what the problem-being-solved is?

Thanks

# July 25, 2011 10:49 AM

Jing Wu said:

Seems cool. hoping can see more scenarios the tokens are targeting to in part 2.

# July 26, 2011 2:19 AM

Piotr Szmyd said:

I noticed that tokens were recently added to the source dev branch and couple of days later completely removed. Is it just some refactoring taking place or this feature was really dropped?

# July 26, 2011 6:45 AM

Bertrand Le Roy said:

Refactoring. You'll actually notice the code that was removed was not consistent with the code in this post.

# July 26, 2011 2:54 PM

Rob said:

Did you happen to check out Mustache template system?

http://mustache.github.com/

It's open source and there's a .NET implementation that is lightweight, fast and easy to use.

Seems like it (after some tweaks) could've been a perfect fit for this

# July 27, 2011 1:16 PM

Bertrand Le Roy said:

@Rob: yes, I know mustache, and I participated to the design of jQuery templates. This feature is not a templating solution. The point is to get tokens from the environment. The actual replacement of the tokens in the string is a detail, and in the places where we are going to use this, there is no need for complex template structures, just token replacement.

# July 27, 2011 2:56 PM

nathanael.jones@gmail.com said:

@Bertrand

Hey, I figured I'd chime in with some information about the open-source http://imageresizing.net project and high-traffic sites, since it seemed relevant.

The project has a long history (since 2008) of being used for large, high-traffic websites with as many as 10 million images. It's designed to handle load, and do it well.

It has an excellent disk cache system that is designed for optimum concurrency and to eliminate the possibility of cache corruption. It uses hash bits to divide the disk cache evenly into subfolders, to avoid NTFS bugs. It does all this without the need for a cache index, and without making any assumptions about what the user might do to the cache while the app is running. You can delete half or all of the cache folder, and the system won't miss a beat. It uses a self-healing compact tree cache to minimize I/O calls, but doesn't ever sacrifice accuracy. It can incrementally clean the cache (during idle time) to a desired size without impacting performance.

It's also compatible with CloudFront, so you can edge-cache your resized images and get worldwide speed increases.

The library is low-trust friendly, and even runs on GoDaddy servers (ugh!).

You can download it at

http://imageresizing.net

I'd be honored if you had a chance to try out the library and blog about it.

I'm always looking for feedback and ideas.

Thanks,

Nathanael

# July 27, 2011 7:54 PM

Sebastien Ros said:

This is just awesome ... can't wait to see next part ! And even more to see the one about Projections, I might learn a few things ;)

# July 27, 2011 9:00 PM

Jasper said:

Great post!

It shows how useful tokens can be and that is more than string.Format(). The last example is impressive. Looking forward to see/use it in action.

# July 27, 2011 9:11 PM

CoReTeX said:

Sadly this doesnt seem to work with Pages. Adding IDs there doesn't show them in source then.

This is where i would need them, depending on the page, which actually makes my content, i'd alter the widgets around it via CSS.

# July 28, 2011 6:48 AM

Alexandre said:

Hi,

Great article, I'm trying to keep my IPTC metadata during the process.

I successfully retrieved my app13 block using :

PropVariant metadataValue = new PropVariant();

frame.GetMetadataQueryReader().GetMetadataByName("/app13", metadataValue);

But I'm not able to set it back in the resized frame.

outputFrame.GetMetadataQueryWriter().SetMetadataByName("/app13", metadataValue);

OR

outputFrame.GetMetadataQueryWriter().SetMetadataByName("/", metadataValue);

If I put this line before the WriteSource then I get a InvalidCastException or another error, if I put it after the WriteSource I don't have any metadata set in resulting picture.

Can you help me with this ?

# July 28, 2011 7:52 AM

George said:

I think Orchard should prove itself as an easy to use CMS by the community before everyday adding more advanced features that may not be used by majority of the users.

# July 28, 2011 9:31 AM

Jon Vee said:

Thanks Bertrand!

I think this will find its way into a lot of SEO uses!  (prepending/postpending categories, hierarchy, etc..)

Stay Awesome!

# July 28, 2011 7:47 PM

Bertrand Le Roy said:

@George: you are entitled to your opinion, but we have some hard evidence that this is already the case (although one can always improve, which we are also going to do). I also know for sure that the features that we are going to build on top of Tokens are in very high demand from the community, and have proven to be extremely useful if not indispensible on other CMS. Furthermore, your comment is too vague to be actionable I'm afraid. Contribute.

# July 28, 2011 7:56 PM

Bertrand Le Roy said:

@Alexandre: I'm afraid not. You might want to try the MSDN forums.

# July 28, 2011 8:31 PM

Andrianarivony Léon said:

This is an awesome feature and I can that it's almost our Content authors needed (à la Office TextMerger Field).

This feature will be useful for Newsletter templating but the way how you show it, it's more than this.

We can imagine a content editor (RadEditor, ...) to have a dedicated toolbar filled by the Token Provider.

It's like a "Reusable Content" but more powerfull.

Does it plan that the feature able to query other ContentTypes rather than the "Current Content" ?

# July 29, 2011 4:04 AM

Pierre Henri said:

Really cool!

I couldn't tell for sure, but I assume that you will be providing reflection out-of-the-box!?! And maybe add a setting to turn it off, if some people don't want that (for security reasons).

This would basically allow us to use tokens exactly like in Views (eg: @Model.ContentPart.Comments.Count becomes {Model.ContentPart.Comments.Count} without any extra coding).

I wish there was also some kind of auto-completion experience inside the Dashboard, but I guess that's asking for too much :)

In any case, discovering what tokens are available will be a key aspect of this feature. Maybe you could extend the shape tracer to provide them as well...

# July 29, 2011 4:05 AM

Rob said:

@Bertrand In your second post on this you mention creating an e-mail using these tokens. Surely knowing whether some data value is empty or missing is essential when creating an e-mail message, or even looping through a list for some simple values to output. Mustache is "logic less", and very simple.

The simple implementation of your token system should work well for really simple things your currently throwing at it, but after it is put to numerous real world tests, I would imagine there will need to be some kind of simple logic and you'll have to extend it anyway.

# July 29, 2011 6:50 PM

Bertrand Le Roy said:

@Rob: Drupal proves otherwise. It's real world enough for me. If you need to write loops and tests, does this really belong in a user/admin-provided template? There is a templating solution in Orchard already, it's Razor. This is not what Tokens are for.

# July 29, 2011 6:59 PM

Dan Schlossberg said:

this is a great feature and I wish I had discovered it much earlier!

But, I'm noticing the same thing as CoReTeX.  The CSS ids and classes don't get added to pages.  Why is that?

Funny thing is that it does add the javascript refs.

thx,

Dan

# July 30, 2011 1:17 PM

lonely7345 said:

very good.

when   orchard 2.0  come?

# July 31, 2011 4:44 AM

Bertrand Le Roy said:

It's a bug. It only works on widgets for now.

# July 31, 2011 9:19 PM

Bertrand Le Roy said:

Early Spring 2012.

# July 31, 2011 9:20 PM

Jing Wu said:

Looking forward to it! really good.

# July 31, 2011 11:47 PM

Skywalker said:

Just wanted to say that I really like this new approach to routing / url generation! Now the tokens feature makes even more sense to me as well.

Already can't wait for 2.0!

# August 1, 2011 1:51 PM

lonely7345 said:

preview version  for  2012?   or  release version

i cant't wait too .hehe

# August 2, 2011 2:25 AM

Bertrand Le Roy said:

Release.

# August 2, 2011 2:38 AM

lonely7345 said:

have the plan for preview version?  and when?

# August 2, 2011 7:54 AM

shrikant said:

Hi Bertrand Le Roy,

i am facign the same problem. I am redirecting from one page to another page of different server. But i need to set some session variable before redirecting to page of another server. like

http:www.example1.com/default1.aspx to

http:www.example2.com/default2.aspx

I had session mode as Inproc which i changed to sqlserver. then also session variables got cleared in redirect. Please help me in this. Thank you in advance.

# August 2, 2011 12:58 PM

Bertrand Le Roy said:

@shrikant: if you tried all the solutions in the post and it didn't work, please contact Microsoft support.

# August 2, 2011 4:42 PM

Bertrand Le Roy said:

First preview will be around September.

# August 2, 2011 4:43 PM

Richard Turner said:

Thanks for sharing your thoughts on Autoroute here - great to see what you guys are thinking about for this important feature.

This is the one remaining reason I've yet to port my own blog from BlogEngine.NET to Orchard ...

... well, this and the issues I'm experiencing with Orchard's current pagination issues.

# August 3, 2011 6:27 PM

Richard Turner said:

Oh ... and are you using Sketchflow to prototype the UI here?

# August 3, 2011 6:29 PM

Bertrand Le Roy said:

@Richard: no, that's Balsamiq.

# August 3, 2011 7:27 PM

Vishal Kr Singh said:

Liked the idea but is there some other alternate to do so.

# August 4, 2011 2:44 PM

Adam said:

I think it is smart of orchard to focus on the core product and at the same time encourage the plug-in ecosystem to blossom.  

It also sounds like you are taking a lot of inspiration from existing CMS products, which is very smart move

# August 6, 2011 8:40 AM

dave nelson said:

i have a domain name pointing to a web server running an  ASP.NET 4 application, authenticating using the ASP login control.... everything works fine.

then, i created a second domain name and in a DNS server, i pointed this second domain to the first, symbolically (no ip address).  using this second domain, i connect to the web app ok, but aftyer login, the cookie gets lost because Page.user.identity.name comes up blank on the redirected page.

any ideas?

# August 16, 2011 11:09 AM

arshad said:

Hi, i m having same problem using extjs which expects json data and bind it with grid.

var output = serializer.Serialize(oOffer).Replace("\"\\/Date(", "new Date(").Replace(")\\/\"", ")");

i tried this at server side but the result is complete UTC date time which i dont want i tried to ad fromat after new Date().format('Y-m-d') but still not working can some help me regarding this issue

# August 18, 2011 7:45 AM

Kevin Kuebler said:

I was thinking about this today, along with your "Creating shapes on the fly" post, and something occurred to me.

Using this example, I wanted to see if I could dispatch one of these shapes to one of the layout zones. For example, what if you wanted to put the Parts_Tags_ShowTags shape in the AsideSecond zone for some reason on blog posts? I'm not totally clear whether you can do that with this technique.

But if you have the necessary data on your model, you can use the technique in that other post to do it. So if you take this same example and create a Content-BlogPost.cshtml template to override the default Content template, you can add this bit of Razor code to put the tags in the AsideSecond zone:

@{

   var tagsPart = Model.ContentItem.TagsPart; //Just to make the next line easier

   WorkContext.Layout.AsideSecond.Add(New.Parts_Tags_ShowTags(ContentPart:tagsPart, Tags: tagsPart.CurrentTags));

}

This works because I can access the bits of data that the Tags_ShowTags shape expects. What do you think about that? Could I instead just do this? ...

WorkContext.Layout.AsideSecond.Add(ShapeHelper.Find(...))

# August 18, 2011 2:37 PM

Pat said:

Sorry to see that more of this didn't focus on human readability.  Why do we keep having the same coversations over and over again?  Because we loose track of the real issues and focus on the technology.  As has already been pointed out, if Human readability is not the goal, why use JSON at all?  Why not just send bits?

# August 18, 2011 5:49 PM

Bertrand Le Roy said:

@Dave: yes, that's 100% expected. Session cookies don't survive a domain transition, even if the server is the same. You'll have to find another way to do whatever it is you are trying to do.

# August 19, 2011 5:07 PM

Bertrand Le Roy said:

@Kevin: yes, you should try that second solution, in order to avoid having to create a new shape and reuse the existing one.

# August 19, 2011 5:10 PM

Bertrand Le Roy said:

This comment really is from taw1962:

I have tried all the solutions above and in other threads, I'm sure they all helped but I kept getting 0x81000037 error UNTIL I found this:

www.partition-tool.com/personal.htm

I solved the very same problem by installing a partition manager (Easeus's Free one) and enlarging the standard 100 MB hidden boot partition to 300 MB (any value under 500 MB will do). That was accomplished by shrinking the C partition by 200 MB, moving it up over the unallocated space created on the right (in a linear representation of partitions starting with the hidden one to the left). Then the unallocated space "moved" to the left so I could expand the hidden boot partition.

It appears that Shadow Copy cannot work properly if available space on any drive is less than 40%.

Maybe this worked because my downloads, music, pictures folders became too large for shadow copy to process in the 100mb partition? Whatever, the 300mb partition has cured it for now and if Backup fails again in future I can extend it some more.

Best wishes, Tim

# August 22, 2011 8:28 PM

Pedro Costa said:

the reach of a feature, is always hard to grasp :)

i particularly like the injection of a tokens per context, but as per example, is newComment a model that gets registered by a some generic token provider on the Replace method? haven't looked at the code for this feature yet!

# August 29, 2011 5:16 PM

Zeeshan Umar said:

Nice post, It solved my problem, i was looking for many hours that why session value is acting weird.

# August 30, 2011 4:44 AM

Derric said:

If I already using the free Team Explorer 2010, could I upgrade it to VS Professional?

Would there be an issue?

# August 30, 2011 1:50 PM

Dan said:

That doesn't make sense, Tim (Bertrand Le Roy).  Shadow copies reside on each partition where they are created. "shadow copies require a minimum of 100 MB of free space for each volume on which you enable them." (www.sbs-rocks.com/Windows%20Server%20Hacks%20Excerpt.htm) - Since you're not going to have shadow copies of files on the hidden partition, which can't be accessed by Windows, I don't see how that would affect this error... We are definitely missing information.

The EASY solution to this problem is to exclude any folders with reparse points in them.  That is, exclude the following (these are the ones that list junctions for me; I have no personal data under C:\Users on the PC where I get this error):

C:\Users

C:\ProgramData

If you need to back up personal data, just copy everything you want to a folder like C:\MyStuff.

Also, it's easier and probably more reliable to do an image backup using a 3rd party application and just use Windows 7 backup for those daily/weekly backups of your files.

# August 30, 2011 2:09 PM

Bertrand Le Roy said:

@Pedro: newComment is a piece of context provided by the code using the token API. It is a plain dynamic object. A token provider that understands the "Comment" token will inpect it to extract token values.

# August 30, 2011 2:20 PM

Bertrand Le Roy said:

@Derric: I don't think it should make a difference. As I understand it, Team Explorer is a free add-on that works on top of any VS.

# August 30, 2011 2:21 PM

Bertrand Le Roy said:

@Dan: "if you need to back up personal data"... Err, isn't that the only thing most people need to backup? And what the Users directory is for?

# August 30, 2011 2:26 PM

Dan said:

Do not let Windows choose what files to back up.

Your backup may still fail with some exclusions.  Try testing your backup without including the system image (the checkbox at the bottom of where you choose your files).  Also try testing the backup of other partitions.  If you only have a single partition, and you're on Windows 7, shame on you.  You should have at least a 160GB HDD in your PC, and thus an 80GB split for C:\ and D:\

Single partition Windows 7 users are probably screwed.  You could get two externals, and put your data to be backed up on one of them, then backup to the 2nd... Aha

# August 30, 2011 2:40 PM

Bertrand Le Roy said:

@Dan: "If you only have a single partition, and you're on Windows 7, shame on you." Whaaaaaat?

# August 30, 2011 2:47 PM

Skywalker said:

Interesting! You are setting up the OnDisplaying event from within the template of the "current" shape (the List) for the first item. So as soon as you call @Display(item), that event gets fired, registering an alternate, after which Orchard will pick the correct template to render the list item. That's really cool.

I'm wondering, when we are inside Parts.Blogs.BlogPost.List.cshtml and inside the foreach item in items loop, "item" is a shape and not a ContentItem? Or is it a ContentItem, for which we call @Display(item), after which the ContentPartDriver for that ContentItem kicks in, which in turn creates shapes?

Which would make it obvious that before @Display(item) gets called, no child shapes exist for "item", but after @Display() returns, I could access the generated child shapes of the current shape (Model), is that correct?

# August 30, 2011 7:40 PM

Bertrand Le Roy said:

@Skywalker: You only ever call Display on shapes, so yes, item is a shape there. Those shapes were built by the controller or driver that created the list shape.

# August 30, 2011 7:59 PM

Skywalker said:

Ok! So if I have a List of ContentItems of type Page, and I'm currently in List.cshtml inside a foreach loop (foreach item in Model.ContentItems), each item is a shape that is just the result of merging all the shapes that each ContentPart of the Page created.

In other words, the entire Shape hierarchy will have been created before rendering kicks in, exactly like it's supposed to be with MVC: Build the entire viewmodel (the final shape) from the controller, then pass that shape to the view engine. Based on the shape's metadata (alternates), the correct (partial) view will be selected and applied, starting with Document, the root, continuing with Zones, etc. Each view will render some HTML and invoke @Display() for certain properties (child shapes) of the current branch. Each partial view acts as a skin for the shape branches.

It's a bit like the leaves on the branches of a tree, together creating the bigger picture. That may very well be the reason for the name "Orchard". Am I the first who found out? :)

You know there's a saying: I can't see the forest because of all those trees. But now I see!

Thanks.

# August 30, 2011 8:51 PM

Bertrand Le Roy said:

Each item is a shape that typically came from calls to BuildDisplay by the driver or controller (see BlogController.List for example). When Display is called on this one, a template to render it will be found, and that template will typically render a bunch of zones. Those zones will typically already have shapes in them, which are the shapes for the parts, as created by the relevant drivers and dispatched to each zone according to placement.

So yes, you got that pretty much right: a tree of shapes is built that is the analog of a view model, except it's a tree and it's dynamic, and then we find the templates to render each, recursively. The name Orchard was found way before we built that engine, but it's a neat coincidence.

# August 30, 2011 9:07 PM

Shawn said:

Can you please make the url much more customizable? say if my site has several language versions, and the content's going to have several titles repectively for each language version, I'd like the url for each language version be different just based on each of the language version's title.

# September 4, 2011 12:43 PM

Shawn said:

Also, can you please make the date time format more localizable on the admin ui rather than hard coded it in the code like this? This makes the translated datetime format much less human friendly. I think you can copy the way ScrewTurn wiki handles datetime format when setting up a new wiki.

public static LocalizedString DateTime(this HtmlHelper htmlHelper, DateTime value) {

           //TODO: (erikpo) This default format should come from a site setting

           return htmlHelper.DateTime(value.ToLocalTime(), new LocalizedString("MMM d yyyy h:mm tt")); //todo: above comment and get rid of just wrapping this as a localized string

       }

# September 4, 2011 12:47 PM

Shawn said:

Also can we work around a better way to handle the orchard localization? currently the localization works like word by word translated which really makes the final translated words unreadable in its context, I mean can we do it pattern by pattern with the some context info included rather than word by word, which might make more sense to help people spread this great work to every corner of the world.

# September 4, 2011 12:53 PM

Bertrand Le Roy said:

@Shawn: yes, the localization part can expose tokens that you will be able to use int your URL patterns.

For the date time format in the admin, a patch would be more than welcome.

Finally, what do you mean by "word by word translated"?

# September 5, 2011 12:56 AM

Shawn said:

"word by word translated": say for example, if we go to the installed themes, there are the authors' names right under the themes' names, and it goes like "By jowall, mibach, loudej, heskew" and here the word "by" is always translated separately, and that would be impossible for the user to figure out what it really means.

# September 5, 2011 2:19 AM

Bertrand Le Roy said:

No, that's not true. Translations are full sentences and they have the context of what file they were defined in right next to them. I'm wondering what could have given you that impression.

# September 5, 2011 2:29 AM

Naresh Kumar said:

Hey all,

           This is Naresh. I need help in placing the default navigation that appears in the orchard pages from the current navigation zone to the AfterMain zone. If i am not wrong, the Placement.info file helps in doing that. but i am not sure as to how or which parts i must use to do it.

Any other suggestions and steps on how to do that is appreciated very much.

PLease help me soon guys.

Thank you,

Regards,

Naresh Kumar

# September 5, 2011 3:19 AM

Bertrand Le Roy said:

@Naresh: please don't cross-post. Your question will be answered on the CodePlex discussions.

# September 5, 2011 3:22 AM

Naresh Kumar said:

Hey Bertrand, I am sorry but the situation as of now is kind of tight so i am desperately trying all possible solutions. please help!

# September 5, 2011 5:32 AM

labshasan said:

# September 8, 2011 8:03 AM

Ben said:

I understand that what you have described here would provide flexibility and power and I am so pleased at Orchard's priority to just getting the code really good so it can be built on. Wouldn't it also be cool to have a tree view showing all the different routes for the website presenting the content for the website just like good old windows explorer?

Is something like that on the cards?

# September 12, 2011 6:31 AM

grinnellja said:

Doesn't work. It says character is not valid and highlights the row

# September 13, 2011 12:41 PM

Bertrand Le Roy said:

@grinnellja: it does work just fine. You have an invalid character there. Try to re-type it and save.

# September 13, 2011 12:59 PM

Lukasvan3L said:

Impressive stuff!

Would it also be possible to add a shape to a zone that I defined in another shape rendering? For instance, in part_one.cshtml I placed the code @Display(Model.ExtendPartOne) and in the PartTwoDriver, I attach it to the ExtendPartOne zone via _work.GetContext().Layout.Zones["ExtendPartOne"].Add(shape, 1);

Unfortunately this doesn't seem to work...

# September 14, 2011 6:29 AM

Jeff said:

So is there anyway to specify that I want the DateTime to serialize to the iso format?

Thanks

# September 14, 2011 4:17 PM

Bertrand Le Roy said:

@labshasan: the solution in that thread is just horrendous, and nobody should follow those directions.

# September 14, 2011 4:31 PM

Bertrand Le Roy said:

@Ben: there is a new route debugging module on the gallery that you will probably like then...

# September 14, 2011 4:32 PM

Bertrand Le Roy said:

@Lukasvan3L: sure, if you can grab a reference to it (which should be possible by drilling into the shape tree from Layout), you can add to it. I think the problem here is that the zone you are trying to address is not top-level, you just need to drill deeper.

# September 14, 2011 4:36 PM

Arra Derderian said:

After install I can't seem to find the admin menu link that goes to /Admin/VandelayThemePicker

# September 15, 2011 9:23 PM

Bertrand Le Roy said:

@Arra: wrong version of Orchard maybe?

# September 15, 2011 9:26 PM

Jason Fant said:

Hi Bertand. Thanks so much for providing this code. It's helping me through my learning curve as new Orchard adopter. I just wanted to point out that for whatever reason, the code as it's posted was giving me an YSOD when the method was called. The exception was...

Unable to cast object of type 'IShapeProxyf18046ce9d044be78950e0623a808b00' to type 'ClaySharp.IClayBehaviorProvider'.

I was able to get it working by changing the model argument to Shape instead of IShape and explicitly casting Model to Shape in my template (which is Content-BlogPost.cshtml if that's helpful)

Anyway, I thought I should post that in case someone else has the same issue. Thanks for what you are doing with Orchard. I think it's going to be a great ASP.Net CMS.

# September 16, 2011 1:19 PM

Omar Awwad said:

Hi Bertrand

I follow the same steps , and every thing was fine , every post have section shown ,   but when click the Section Link on the right widget, [Sport for example ] no  blog Post Shown , its empty , seems no connection between the widgets and the post , any help

# September 16, 2011 7:15 PM

Bertrand Le Roy said:

@Omar: can you please ask on the discussions forum on CodePlex and specify version numbers of both Orchard and the Taxonomies module?

# September 16, 2011 7:28 PM

Omar Awwad said:

Hi Bertrand

after i install [search] and [indexing]   modules, every  thing goes fine.

orchard ver is [1.2.41] , tamonomies module is [.9]

thanks for your reply.

# September 17, 2011 7:31 AM

Mark Morgan said:

Still after reading this very long thread and doing all possible solutions still failed.

I have no problem running the site localy with the url as IP. When I publish and used the url as masked thats the only way my session variable is set to null.

I have tried passing them as url parameters and assign them to session variable on the load event of the redirecting page. But still Session variable is empty. I have also noticed that if I done it twice session now have values and not have value null.

It is not ideal to let the user login twice.

# September 18, 2011 1:27 AM

Bertrand Le Roy said:

@Mark: you should contact support.

# September 18, 2011 2:04 AM

Robert Maier said:

Hey!

I'm using Orchard v.1.2.41.0 and installed your module. I don't have a menu item in the admin-panel called themes/Picker.

Any tipps for me? :)

# September 19, 2011 8:58 AM

Bertrand Le Roy said:

@Robert: once the feature is enabled, there is an additional tab under Themes.

# September 19, 2011 6:24 PM

Arra Derderian said:

I have Orchard v.1.2.41.0 installed. I enabled and disabled the plugin but am not seeing the item on the left hand nav under Themes.

# September 19, 2011 7:26 PM

Bertrand Le Roy said:

@Arra: it appears as a tab on the right side when you click on themes.

# September 19, 2011 7:32 PM

Arra Derderian said:

Weird. I only have "Installed", "Gallery", "Updates". I can browse to the URL if I hardcode it in and all works. Just not seeing the link.

# September 19, 2011 7:40 PM

Bertrand Le Roy said:

@Arra: are you sure you enabled the right feature?

# September 19, 2011 7:44 PM

Arra Derderian said:

@Bertrand: VandelayThemePicker under Design.

# September 19, 2011 7:57 PM

Bertrand Le Roy said:

@Arra: yeah, well, I don't know. Works on my machine. Do you have the latest Orchard and Vandelay Industries module?

# September 19, 2011 8:05 PM

Arra Derderian said:

@Bertrand: Vandelay = 1.0

Orchard is v.1.2.41.0

I will check the logs.

# September 19, 2011 8:41 PM

Bertrand Le Roy said:

The latest version of this code can be found in orchardproject.net/.../1.2.3

# September 19, 2011 9:02 PM

Chandra Prakash said:

Session is working well for 2 minutes.. But After 2 minutes it showing nullrefernce exception..at server..

i have increase time to 20 minutes still session is termenating after 2 minutes.

It is working well at Local but not at the server

# October 1, 2011 5:56 AM

Bertrand Le Roy said:

@Chandra: this is a different issue. Please contact support.

# October 1, 2011 4:46 PM

arpita said:

How can i display only blogs using one tag?

e.g. B2B is one tag used in page,blog etc but i want to display blog only.

# October 4, 2011 12:09 PM

Bertrand Le Roy said:

@arpita: write your own controller action, with a query on the blog post part, with a where on tags.

# October 4, 2011 4:19 PM

JasperD said:

Thanks for the great work!

Support for Markdown is a killer feature. Is it possible (out of the box) to specify which user groups can use Markdown or HTML?

PS: I noticed that most of the work items were assigned to Sebastien Ros and he has also made almost all commits in the last few weeks. Is he the only one who is actively working on the code base?

PPS: Wys_i_wyg ;-)

# October 4, 2011 9:23 PM

Bertrand Le Roy said:

@JasperD: no, there is no permission associated with this, as the setting to use Markdown is at the content type level: you either have the rights to edit that type or not. I suppose you could create two different types and associate different permissions to them.

Sébastien is our full time dev at this point, yes.

# October 4, 2011 11:40 PM

John Goldsmith said:

Great new features.  Is there any documentation on upgrading a) a project created in WebMatrix (ie no source) and b) if you are using Hg + source? (I've got both on the go.)

Thanks, John

# October 5, 2011 4:02 AM

Bertrand Le Roy said:

@John: the upgrade docs mention both cases, but in the Hg case, it's ridiculously easy. Just update and you're done.

# October 5, 2011 4:08 AM

John Goldsmith said:

# October 5, 2011 5:59 AM

Ragesh said:

Just when I get my site running on 1.2 you guys go and release a new version with more toys to play with. When will I ever get any real work done!? :) Keep up the awesome work.

# October 5, 2011 10:34 AM

Scott said:

Just wanna say I love orchard, it's so easy to use!

I've just upgraded from 1.2 to 1.3, in my dash it says latest version 1.3.9, bottom right corner it says current version 1.3.0.0. Is that right, or have I missed something during the upgrade?

Thanks and keep up the good work!

# October 5, 2011 4:51 PM

Bertrand Le Roy said:

@Scott: yes, that's normal. The version number in the dashboard never reflects the build number (the third number in the version).

# October 5, 2011 5:54 PM

Znowman said:

Thanks guys! nice work! love Orchard! Looking forward to your next releases.

# October 7, 2011 2:22 AM

Dylan6793 said:

Hey, codeplex only holds it for 30 days, (unless you publish it) is there another way i can do this? maybe using a FTP server?

# October 10, 2011 8:26 PM

Bertrand Le Roy said:

@Dylan: only holds what for 30 days?

# October 10, 2011 8:32 PM

Dylan6793 said:

codeplex only holds your project for 30 days, and then it will be removed. unless you publish it, but if i publish it, i dont want anybody to have access to my source code, i want it to be private, is that possible?

# October 10, 2011 9:15 PM

Bertrand Le Roy said:

@Dylan: don't you think that's a little off-topic? Codeplex does not do private repositories. Try Bitbucket, but please don't spam blogs that have nothing to do with your issue. Thanks.

# October 10, 2011 9:33 PM

FA said:

I want to have template binding of drop down list with a string array.

I tried the sample but got the error "Object doesn't this support this property or method". Not sure but it seems the it's unable to recognize the itemRendered event. Any thoughts?

# October 12, 2011 7:10 AM

Robert R. said:

Your "send email" form doesn't appear to be included by default, how would I add that form to the Comments module rule file without stepping on the "Close Comments" form that already exists?

# October 12, 2011 4:30 PM

Bertrand Le Roy said:

@Robert: the email action comes as a separate feature that you need to enable from the Modules admin screen. When you do, the form appears when you edit the rule's action, not in the comment edit form.

# October 12, 2011 5:46 PM

gyermek angol said:

+1 one thanx for Markdown!

# October 15, 2011 9:44 AM

Matthew Morgan said:

I had used your example here to alternate my homepage layout. This worked until I translated the page. With multiple languages, it seems that Layout-HomePage no longer applies to the default or translated pages.

Can you think of what I may be doing to cause this behavior? I would like for all translations of the homepage to share Layout-HomePage.cshtml

# October 20, 2011 4:32 PM

Bertrand Le Roy said:

@Matthew: I'm guessing you're not using Orchard 1.3 because that problem was fixed in the latest release.

# October 20, 2011 4:37 PM

Matthew Morgan said:

I had already upgraded via source enlistment. The dashboard says I'm running version 1.3.9 but only one of the translations is marked as "HomePage" (RoutableHomePageProvider;50). I'm not sure how multiple translated pages should appear in the "Settings_SiteSettingsPartRecord" table.

I'll see if I can track down the old issue on codeplex and check if my problem is the same.

# October 20, 2011 4:55 PM

Bertrand Le Roy said:

Thanks. Please file a bug if necessary.

# October 20, 2011 5:12 PM

oceantrain said:

The new Projector feature is exactly what I need in 1.4. Any Ideas when there will be a beta release of this module??

Thanks

Your the best!

# October 21, 2011 10:49 AM

Bertrand Le Roy said:

@oceantrain: when it's ready. It's getting harder to predict delivery dates with more of the work being handled by the community. That's a good thing in general, but there are tradeoffs, such as this.

# October 21, 2011 11:42 AM

dbjdbj said:

Hi BLR,

I think You simply *must* repeat this on Your W8 machine.

I bet in W8 this is *much* faster and easier.

W8 WinRT is using DirectX.

And of course, it would provoke many web visits to Your blog, just to check if image resizing on W8 is equaly fast using JavaScript, C# or WINC++ on W8?

Thanks ...

# October 24, 2011 3:33 AM

Bertrand Le Roy said:

@dbj: I don't have a Win8 machine, but I'll try to grab one.

# October 24, 2011 3:49 AM

Christopher Edwards said:

Very useful, thank you.  Please keep it up if you see any other options for image resizing in the future!

# October 24, 2011 4:58 AM

Rob said:

Try this to solve the error

public static object GetValue(object dyn, string propName)

       {

           // Warning: this is rather expensive, and should be cached in a real app

           var GetterSite = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember(CSharpBinderFlags.None, propName, dyn.GetType(),

               new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) }));

           //var GetterSite = CallSite<Func<CallSite, object, object>>.Create(

           //        new CSharpGetMemberBinder(propName,

           //            dyn.GetType(),

           //            new CSharpArgumentInfo[] {

           //                new CSharpArgumentInfo(CSharpArgumentInfoFlags.None, null)

           //            }));

           return GetterSite.Target(GetterSite, dyn);

       }

       public static void SetValue(object dyn, string propName, object val)

       {

           // Warning: this is rather expensive, and should be cached in a real app

           var SetterSite = CallSite<Func<CallSite, object, object, object>>.Create(Binder.SetMember(CSharpBinderFlags.None, propName, dyn.GetType(),

               new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null),

                   CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant | CSharpArgumentInfoFlags.UseCompileTimeType, null) }));

               //CallSite<Func<CallSite, object, object, object>>.Create(

               //    new CSharpSetMemberBinder(propName,

               //        dyn.GetType(),

               //        new CSharpArgumentInfo[] {

               //        new CSharpArgumentInfo(CSharpArgumentInfoFlags.None, null),

               //        new CSharpArgumentInfo(CSharpArgumentInfoFlags.LiteralConstant |

               //                               CSharpArgumentInfoFlags.UseCompileTimeType, null)

               //    }));

           SetterSite.Target(SetterSite, dyn, val);

       }

   }

# October 24, 2011 7:24 AM

Chris Pont said:

I brought a copy of imageresizer a while back and as the above shows, it's not the quickest, but it is super easy to implement. Unless you're really doing a lot of intensive image processing, it's a great choice.

# October 25, 2011 6:23 AM

haacked said:

Nice! We built a crude/simple tool for managing the NuGet docs using Markdown. github.com/.../NuGetDocs

Though we could simply just use Github's Pages support too. :)

# October 26, 2011 2:23 AM

Bertrand Le Roy said:

Yes, Phil, that's the code I'm using as well for Orchard.

# October 26, 2011 2:29 AM

Naresh said:

Hi bertrand,

i am trying to use vandelay classy to incluse few tags to the head section of the html generated. will it be possible to do i and how may i do it?

i am trying to include few meta tags in the <head>  of the page

# October 26, 2011 3:38 AM

Bertrand Le Roy said:

@Naresh: it's not classy that you need for that. Look at the meta feature in Vandelay Industries.

# October 26, 2011 3:50 AM

Blake said:

It doesn't appear you've made that repro public yet.   Just an "access denied" here.

# October 26, 2011 3:59 AM

andrexx said:

Good news! Access denied for repository :)

# October 26, 2011 4:00 AM

Bertrand Le Roy said:

It's public now.

# October 26, 2011 4:14 AM

Alexandre Jobin said:

thank you for your review. I was looking for this kind of solution. I will give it a try!

# October 26, 2011 9:20 AM

Axel said:

Did you post the original images somewhere?

# October 26, 2011 9:57 AM

Mike said:

If it's impossible to get native code faster, then there is no silver bullet. Also, with caching to disk an image should only need to be resized once to each size you need. So performance is mostly an issue when doing batches. And if you are doing batches, then you should definitely not do that on the web server process. offload it to a service that can use native code and wait for the result, problem solved no?

I think imageresizer looks like a great tool, possibly the best.

Thanks for the write up.

# October 26, 2011 11:03 AM

Jeff said:

This is good stuff. What's really unfortunate, as you said, is the dependencies on System.Web. If you remove that, you have a solution that works in Silverlight, which frankly we are dying for in a lot of different cases.

# October 26, 2011 12:51 PM

Bertrand Le Roy said:

@Axel: some of them are on my Flickr (www.flickr.com/.../boudin). If you need a specific one just tell me and I'll make it available.

# October 26, 2011 1:01 PM

Axel said:

Yes the original hummingbird that you used please, this is the only image where I see a notable sharpness issue (one that can be seen without the need for side-by-side comparision).

There is a little more aliasing on the WIC side, visible on IMG_2351_85 and IMG_2565_85 but, overall, nothing worth a 4x slowdown in my opinion.

I'd like to try resizing the hummingbird with a couple of desktop apps of mine.

# October 26, 2011 7:44 PM

Peter said:

Thanks, very useful information and benchmarks.

# October 27, 2011 11:41 AM

Bertrand Le Roy said:

@Axel: you can doanload the hummingbird image from here: www.flickr.com/.../photostream

# October 27, 2011 8:11 PM

ket said:

It's still working fine with the IE9 and Firefox 4+, not mention to latest chrome. I use this tactic to overlay a java applet, and it is working far better than any iframe shim method I've ever come across. Do not stop developing it.

# October 28, 2011 2:28 PM

Dan said:

Wow, you people are amazing.  Wondering about the answer to bizarre questions like this that have absolutely no practical implications for our day-to-day lives is what keeps us human.  And helps me procrastinate.

# October 28, 2011 9:01 PM

nathanael.jones@gmail.com said:

Hey, thanks for the article :) I'll try to answer your questions.

The default ImageResizer pipeline is GDI, and GDI = 1.3xGDI is an impossible equation, even if you grant 1ms for the processor to perform a couple dozen math operations.

The performance difference between the image resizer and GDI is likely due to different quality settings. The download doesn't seem to include the code you used to benchmark them, so I can't be sure - but it's consistent with the 30% performance improvement provided by the SpeedOrQuality plugin. So if you prefer to trade, the image resizer gives you that option via speed=0..3.   The ImageResizer really deserves 2 stars here  - not fair to punish it for trading speed for quality :)

Also, it's worth taking note of the new FreeImage plugins. I've been working with the authors of libjpeg-turbo to get the world's fasted jpeg encoder merged into FreeImage (which is already integrated with the image resizer via a plugin).

I'm seeing a 4x improvement in jpeg encoding speed, ignoring the overhead caused by the bitmap data conversion, and the file sizes are looking better as well.  I decided to pursue this path instead of WIC because it offered better cross-platform support (Multithreaded WIC is only WS2008+) and much better file format support. I may resume work on a WIC plugin if I can't beat WIC's speed with FreeImage.

I use untyped source and destination objects because I offer support for .NET 4 datatypes, yet can't reference them directly from .NET 2.0. Also, the permutations would require 4x10x3= 120 overloads.  The untyped API is also COM-compatible (COM doesn't support overloads).

Regarding the System.Web dependency - switching from Client Profile to the full .NET framework in Build Properties would have resolved the issue - no configuration issues :)  I have considered creating a separate version of the product that doesn't reference System.Web, but splitting them would be bad for 95% of users. Perhaps in v4 I'll be able to do this, but right now the code isn't organized that way. Silverlight doesn't support System.Drawing, sorry to disappoint you, Jeff.

The ImageResizer does allow alternate pipelines to be used (like FreeImage), so a WIC pipeline is definitely a possibility. I posted the idea on the http://resizer.uservoice.com/ forum back in april http://resizer.uservoice.com/forums/108373-image-resizer-v3/suggestions/1758591-fulltrustwicplugin, but nobody seemed interested.

I suspect it's mostly due to the full trust/WS2008 requirement.

Anyhow,

Thanks for getting involved and taking the time to benchmark the software. It does seem to be slower than WIC's lowest quality mode, but in a cached scenario it's quite difficult to beat context.RewritePath :) I do take performance very seriously, and I have hundreds of benchmarks that I run each time I change relevant code - tests that break the performance down to a granular level and let me know exactly which GDI calls are fastest under which conditions, with which file formats.

I also look at performance statistics for more than simple resizing. The image resizer is optimized to handle complex operations and coalesce them into a 1 or 2 GDI calls - cropping actually makes the image resizer faster, and rotation adds almost no overhead.

I'm currently working on V3.1, which includes the SpeedOrQuality plugin, and includes a libjpeg-turbo version of FreeImage and both encoder and decoder plugins for it. Overall performance speedups range from 10% to 200% for jpegs, but for tiffs it can be 4 to 12x.

It's sad how benchmarks seem to get outdated before you upload them :)

# October 29, 2011 12:27 AM

Bertrand Le Roy said:

@Nathanael: thanks for the comments. The benchmark code is actually available up there. I think the comparison is fair as the GDI code is not using the default settings, but rather my own custom configuration of it (bicubic high quality). I'd be interested to know where the difference comes from, if you can profile the benchmark code, that would probably give some interesting insights.

I will try that plugin when I get the time.

Careful with WIC, as you will lose medium trust if you go this way, but maybe that's already the case with FreeImage?

It will also be interesting to see what things look like on Win8 as we should have new managed APIs with hardware acceleration.

The thing about .net 4 types is unfortunate, but I still think having overloads with the most common usages would be better than the current situation. Also, options structures are a good way of alleviating combinatorial problems like the one you're facing.

Let me know when 3.1 is available and I'll gladly post an update.

# October 29, 2011 1:48 AM

bhanukumar said:

i am trying to display pdf file in webpage in IE7 browser.but, when ever i am trying to scroll down the cursor ,the pdf content is overlapping on the headr part of the screen.

i have used div and iframe.

pdf file calling through the iframe and iframe is inserted in side the DIv Elemnent.

# October 29, 2011 2:21 PM

nathanael.jones@gmail.com said:

Another interesting WIC anomaly I noticed - WIC's IWICBitmapClipper is extremely slow - cropping 1 pixel off 1 edge takes 4x more time than Fant resizing the whole image. Performing clipping after resizing ameliorates the problem, but it's still absurd considering the speed IWICBitmapClipper should be capable of considering how CopyPixels works. My managed WicBitmapPadder class is faster, and it's in fully managed c#!  

Also, it seems that of Oct. 8, A memory leak was detected in WPF BitmapSource subclasses due to a COM reference cycle.... So I guess there is good reason (aside from threading) to use WIC instead of WPF on the server.  Also, anyone using WIC should make sure they are using Win7 or WS2008 R2 with all the platform updates applied - the shipping version of WIC seems a bit bug-riddled.

Bertrand - I'm guessing you have experience using WIC on the server - how do you handle disposal of the COM references? Do you let the GC handle it eventually, or do you Marshal.ReleaseComObject each COM object? The .NET GC doesn't seem to properly prioritize cleaning up large unmanaged memory allocations (I'm assuming because it sees only the handle, not the actual usage).  (blogs.msdn.com/.../net-memory-leak-to-dispose-or-not-to-dispose-that-s-the-1-gb-question.aspx)

I prefer to manually release stuff on the server, as long as there aren't external references.

# October 30, 2011 11:22 PM

Bertrand Le Roy said:

@nathanael: I haven't seen GC problems, the code I've been using is pretty close to what's in the benchmark, but I think that's where the real value of your library is: you've figured it all out for all of us ;)

# October 31, 2011 5:53 PM

nathanael.jones@gmail.com said:

Saturday I posted a (long) comment in between the two you've approved above. Is the comment still sitting in your moderation queue? I'll repost it again in case it somehow vanished from the database.

# October 31, 2011 8:15 PM

nathanael.jones@gmail.com said:

[Repost - originally posted Sat, Oct 29, 2011 at 9:11 PM GMT]

It looks like the first time I downloaded it I got a corrupted zip, but it's working now.

Your code is not using bicubic high quality - it is using Bicubic. Bicubic is a single-pass algorithm good for small resolution changes. BicubicHighQuality is a 2-pass algorithm that pre-filters the image, and is suitable for making thumbnails.

Naturally (and as your charts show) 2-pass filters are slower than 1-pass filters. It's not exactly a fair comparison. There were also some inconsistencies in the benchmark, but they're not probably that significant (although I did rewrite it to eliminate them all).

Another note: Improved resizing quality is often compounded by  slower encoding as the image is more detailed and requires more CPU cycles (and space) to encode it. It's quite apparent once you eliminate all the other factors except the resizing filter - the same encoder, same code, same settings, same file can have a 10% file size variation based on the image resampling filter used.

To see how the ImageResizer would fare under WIC, I wrote a basic WicBuilderPlugin and ran the benchmarks. It seems to be a bit faster than your WIC and WPF code.

And, using the Speed plugin to adjust the resampling to Bilinear, it beats all the GDI benchmarks by a wide margin.

The chart:

downloads.imageresizing.net/Oct29-2011-comparison.png

The spreadsheet:

downloads.imageresizing.net/Oct29-2011-Comparison.xlsx

Note that the FreeImage plugin is actually the slowest by a small margin. While FreeImage has fast encoders and decoders, its resizing algorithms (while the best of the bunch - catmullrom/lanczos3) are very, very slow. FreeImage is still being improved, so it's possible that may change shortly.

I also added a 600x600 resize to the chart so you can see how things change when the output size increases. It's interesting to note that quality=100 at 150x150 is slower than quality=10 for 600x600. That's true across the board for every encoder (WIC, GDI, and FreeImage).  Jpeg quality=100 is definitely much slower than 90, and it's not always better quality on GDI, although in theory it should be.

Anyhow, I think it's safe to say that you can get any balance of speed and quality you want out of the ImageResizer, and while I don't believe in silver bullets, it's probably the closest thing available.

Question:

Is the WIC interop code under the MsPl?  If so, I can go ahead and make the WicPlugin available as an alpha plugin in the next release.

Also, if your benchmarking code (default.cshtml and Utils.cs) is under the BSD/MIT/MsPl (or something similar), I can upload my rewritten version so you can take a look at the code that generated the results. Do note you need to watch memory usage with the benchmark app, after a few minutes the GC starts cleaning upp all those MemoryStreams and it affects the results very significantly.

# October 31, 2011 8:16 PM

Bertrand Le Roy said:

@Nathanael: that is great to know. To explain a little more why I chose those parameters, those are the ones I care about, the ones I use in my own private photo album. I use 150x150 thumbs, and I set the quality and compression to what I considered was the best compromise between speed and quality. I have to admit I didn't configure imageresizer and left the default parameters. I'll do a follow-up and an update when I get the time to re-run the benchmark.

Yes, the wic plugin stuff was made by the wic team and is absolutely free to use (it was released as a sample a while ago). My benchmark code is public domain, please feel free to use, modify, whatever you want. I'd love to get a corrected version from you.

Thanks.

# November 1, 2011 1:27 AM

Axel said:

Minor point: 150px is not the best choice for any JPEG. Try 144 or 152.

Thanks for the pointer to the humminbird image. I was hoping to get the original full-res image, not a Flickr re-compressed/rescaled one, but anyway I did not see the blurring that you got.

Besides that I believe that what you (all) refer to as GDI is actually GDI+, an entirely different API!

# November 1, 2011 8:01 PM

nathanael.jones@gmail.com said:

@Bertrand

Apologies that I haven't uploaded the benchmark code yet; I've been down with the flu since the 1st.

As I plan on releasing at least an alpha version of V3.1 in the next two weeks, I think I will include both the WicPlugin and the updated benchmark code in that version. This way everyone will be able to see the full source code for all involved software in the benchmark - right now I'm benching against development version, since the public release doesn't have the SpeedOrQuality or WicPlugins yet. (I started working on the SpeedOrQuality plugin a month ago, but this post definitely gave it more attention).

I'd be happy to post a link here first so you can error-check me; I'm as prone to benchmarking errors as the next guy, and it's hard enough to get repeatable results  on a multithreaded OS even if your benchmark code is perfect :)

I'm going to try adding pauses between the loops and forcing a GC regularly so results don't get upset by a GC of the MemoryStream instances or the async writes to the filesystem. Actually, I might make filesystem writes optional, so the filesystem driver doesn't mess with the results (hey, writing 10,000+ files makes a queue)...  I'd like to get perfectly stable results before I re-release the code, otherwise it will probably cause confusion. The chart I posted above I had to re-run several times to get a stable/sensible result without any spikes.

@Axel

Yeah, in .NET we work with GDI+ exclusively, so somewhere along the way from brain to keyboard the + symbol falls off...

I noticed you develop WIC-compatible codecs? I'd be interested in benchmarking them and ensuring they're compatible with the ImageResizer. Is there a way to enable/disable them via a registry key?  Also, what do you charge for server licenses?

# November 4, 2011 6:00 PM

nathanael.jones@gmail.com said:

Update on WIC and ReleaseComObject:

I've been reading all of the WIC documentation and all the sample code, and it seems Microsoft's pattern is to religiously call Marshal.ReleaseComObject on every single WIC object they use. That's in a client app, even - not a server situation where memory leaks are a far bigger concern.

They even made an extension method to make it easier (reformatted):

public static void ReleaseComObject(this object o)

{

   if (o == null) return;

   if (o.GetType().IsArray) { foreach (object i in o as Array) i.ReleaseComObject(); }

   else Marshal.ReleaseComObject(o);

}

So, I think the advice here is that .ReleaseComObject() is probably necessary.  It'd be nice to get the WIC team to confirm, but their example code is enough proof for me: archive.msdn.microsoft.com/wictools

# November 8, 2011 7:44 PM

nathanael.jones@gmail.com said:

Hey, is the comment I posted 2 days ago regarding WIC and Marshal.ReleaseComObject still in moderation, or are some comments getting lost?

# November 10, 2011 8:45 AM

nathanael.jones@gmail.com said:

I've made a pre-release version available here:

downloads.imageresizing.net/Resizer3-1-alpha-1-full-hotfix-9am-Nov-10-2011.zip

And my updated benchmark results: downloads.imageresizing.net/Nov10-2011-Comparison.png

downloads.imageresizing.net/Nov10-2011-Comparison.xlsx

The benchmark application can be found in Tests\ComparisonBenchmark\

As before, drop your test image collection in Tests\ComparisonBenchmark\Images

It now displays speed in average milliseconds per image, which is more useful than the aggregate time.

I've modified the GDI code to default to high-quality settings, but I've kept your settings selection for comparison purposes as GDI(defaults=bertrand).

There is a 5% discrepancy between the ImageResizer and the GDI code - the ImageResizer uses a different DrawImage overload with an ImageAttributes instance specified to reduce the GDI outer border blending bug, which I believe accounts for the difference.

The new WicBuilder is somehow slightly faster than your stock WIC code, although it could be testing error.

It also allows the filter to be configured; bicubic and NearestNeighbor both offer a 40% performance increase at larger file sizes.

Anyhow, please contact support@imageresizing.net if you have any questions or concerns; I can't manually check this page very often.

All plugins and source code is included in the above bundle - feel free to try some of the new plugins out!

# November 10, 2011 9:00 AM

Marco said:

I think you're looking at the problem from the wrong perspective.

Inheritability is what you WANT and not what you need to stop.

Instead of writing many general css selectors (like p {}) limit your css per-section.

If you need completely different style rules for a section of content, keep it separated from the section styled differently. Or write rules that negate what you've written before.

That's what priority is made for, and that's why priority is (simplifying) established as heavier for longer selectors: to be more specific as you write rules for deeper parts of the page.

Maybe you problem is not with css, but with the structure you apply css on.

# November 10, 2011 9:28 AM

Bertrand Le Roy said:

@Marco: I'm afraid you did not understand the problem correctly. The problem is when you don't control the css for the rest of the page (and I'm sorry but you don't get to tell me what I want). When you say "keep it separated from the section styled differently", I can't because I have no knowledge of it. "write rules that negate what you've written before": *I* have not written that, I have no control over it so I can't write a rule that negates it. That's the whole point.

# November 10, 2011 3:27 PM

Bertrand Le Roy said:

@Nathanael: your comments are going directly to the spam folder for some reason, sorry about that. I just rescued two of your comments from there.

# November 10, 2011 3:54 PM

Nathanael Jones said:

What spam filtering system does it use?

# November 10, 2011 5:21 PM

Bertrand Le Roy said:

I don't know, it's whatever Community Server uses. In other words it's a piece of crap.

# November 14, 2011 6:39 PM

nathanael.jones@gmail.com said:

I use NestaCMS and Markdown in a Git repository, pushing to a free Heroku instance. It's amazingly simple and quick. You really can't beat Markdown for expressing content or Sinatra for views.

I'm finishing a Wordpress to NestaCMS conversion script, I'll publish it once I've used it to move nathanaeljones.com to Nesta. http://imageresizing.net has been running nesta since the beginning.

What CMS are you moving to?

# November 20, 2011 9:29 AM

Bertrand Le Roy said:

@nathanael: I run the Orchard CMS project.

# November 20, 2011 6:01 PM

morgma said:

Is there anyway to detect which Zone the shape is headed to? I'm trying to create an alternate based on a part and a zone. In particular, I'm shooting for, "Parts.BetterMenu-AsideLeft.cshtml"

You mentioned possibly blogging about this topic at some point in the future in your post here - weblogs.asp.net/.../getting-started-with-custom-themes-in-orchard.aspx

I looked into using the WidgetAlternates module, but it is not picking it up.

Zone[AsideLeft]

>> Widget

>> >> Parts_Contents_Publish [empty] <-- I get "Parts.Contents.Publish-AsideLeft.cshtml"

>> >> Content

>> >> >> Parts_Contents_Publish [empty]

>> >> >> Parts_BetterMenu  <-- I need the alternate "Parts.BetterMenu-AsideLeft.cshtml"

Within Orchard.DesignerTools.Services.WidgetAlternates it looks like we could create an alternate for each part within the ContentItem, but I'm still missing something. The only part alternates I get are Parts.Contents.Publish-[Zone].cshtml

Here's a thread on codeplex that seems to point out my difficulty:

orchard.codeplex.com/.../275650

If you could point me to a more relevant thread I'd really appreciate it.

Thanks

# November 21, 2011 4:32 PM

Sean said:

Hi Bertrand,

I have tried adding code like this to a theme - I added a class like your FaviconShapes class but the Discover method never gets called - what lets the Core know to call my IShapeTableProvider?

Thanks!

Sean

# November 23, 2011 2:39 AM

Bertrand Le Roy said:

@Sean: That's because you need a project in your theme for code to get picked up.

# November 23, 2011 8:17 PM

Bertrand Le Roy said:

@morgma: techniques similar to this: weblogs.asp.net/.../orchard-list-customization-first-item-template.aspx can be used to override Zone rendering and add alternates on the fly.

# November 23, 2011 8:22 PM

Sean said:

I do have my theme in a project. Is that all, if I just have the theme in a project and a class that implements IShapeTableProvider then it should just work?

# November 24, 2011 10:36 PM

Anunay said:

Thank you so much for the tutorial  !!!!

actually i created a new project and did all what you said and i added a read me.txt file in the local folder of the project then

refreshed the source control explorer then i clicked on add items to folder and selected the read me.txt file and clicked on finish. when i went back and saw my project source i did not find anything there

it still says

There are currently no change sets in source control.

is there any particular way to upload source files ?

Please Help me out !!

# November 27, 2011 10:19 AM

william said:

Hi,

I'm new to the Orchard, I'm trying to understand how localization works in Orchard.  I downloaded French .po zip file and installed it following steps from docs.orchardproject.net/.../Creating-global-ready-applications.  when I change default culture, it works fine.  But, after I changed a .PO file, say orchard.module.po under Modules\Orchard.Blogs\App_Data\Localization\fr-FR folder, when I switch culture, I do see my changes.  could you shed some lights?

thx.

# November 27, 2011 11:47 PM

Chris Hynes said:

Any idea how to performantly crop and scale the image at the same time, so that the thumbnail can be a full frame square regardless of the source size?

I popped a WICBitmapClipper in the pipeline before the scaler, which seems to work. Problem is, it doubles or triples the rendering time. It seems like cropping should reduce the amount of data the scalar needs to go through, so I'm rather stumped as to why it takes longer to scale a smaller image.

Any thoughts or can you point me to someone that might know?

I tweaked your resize code like this:

uint frameSize = Math.Min(width, height);

IWICBitmapClipper clipper = factory.CreateBitmapClipper();

clipper.Initialize(frame, new WICRect() { X = (int)((width - frameSize) / 2), Y = (int)((height - frameSize) / 2), Width = (int)frameSize, Height = (int)frameSize });

IWICBitmapScaler scaler = factory.CreateBitmapScaler();

scaler.Initialize(bmp, size, size, WICBitmapInterpolationMode.WICBitmapInterpolationModeFant);

# December 1, 2011 4:57 PM

Avie2 said:

I am on MS Vista, ASP 4.0, should I upgrade to Win7 to use WIC? Thanks.

# December 4, 2011 6:21 AM

Bertrand Le Roy said:

@Sean: to be clear, it's not that you need your theme in a project, it's that your theme must have a csproj file with the same name as its folder. Then if that project file references cs files, they will get compiled. So yes.

# December 4, 2011 9:32 PM

Bertrand Le Roy said:

@Avie2: you should upgrade to Windows 7, period.

# December 4, 2011 9:32 PM

Bertrand Le Roy said:

@Chris: just use the ImageResizer library.

# December 4, 2011 9:33 PM

Bertrand Le Roy said:

@Anunay: please contact support.

# December 4, 2011 9:35 PM

Bertrand Le Roy said:

@william: these things probably get cached. Try restarting the server and see if it makes a difference.

# December 4, 2011 9:36 PM

Avie2 said:

@Bertrand Le Roy, I checked everything thoroughly. I can use BitmapImage on Vista but in Silverlight applications. So as I understood, if I upgrade to Win7, then BitmapImage will be accessible from simple aspx web applications. If so, I will upgrade immediately :)

# December 5, 2011 1:24 AM

Bertrand Le Roy said:

As I said, you should upgrade in any case. I don't know about Vista support.

# December 5, 2011 2:20 AM

Magnus Mårtensson said:

Hey Bertrand - liking the effort - it's very good and bare metal! No fancy stuff just do the right job in a hurry, please! ;~)

That being said I note that you drop data from each table before you insert. How do you handle forgein keys between the tables and also how do you handle autoincrementing ID-columns in relation to that?

Cheers,

M.

# December 5, 2011 2:23 AM

Avie2 said:

Bertrand Le Roy, It gives me hope :) Do you have any links to aspx pages with graphics that definitely use WIC and do not use GDI+ at all? Thank you.

# December 5, 2011 3:35 AM

Bertrand Le Roy said:

@Magnus: from what I understand bcp suspends referential integrity checks and identity auto-increments while doing the import (in its default configuration, there are flags to modify that) so I suppose you can get into inconsistent states until your import is done. If I were implementing that in a more industrial setting (for the moment I'm only using it in dev settings but that might change soon), I would add a step after restore to check and enforce integrity. I'll follow-up if necessary once I know more about this.

# December 5, 2011 3:41 PM

Bertrand Le Roy said:

@Avie2: I'm pretty sure MSN uses WIC.

# December 5, 2011 3:43 PM

Avie2 said:

@Bertrand Le Roy, *LOL*

# December 5, 2011 3:59 PM

John said:

beautiful post and exactly what I need for orchard.  Thanks for sharing!

# December 5, 2011 8:14 PM

gill bates said:

Maybe the site config shouldn't go in a SQL database

# December 5, 2011 10:57 PM

Bertrand Le Roy said:

(sigh)

# December 6, 2011 10:18 PM

Petar Repac said:

NuGet.org uses NHibernate ?

That's second MS site then.

First I heard of was http://channel9.msdn.com

nhforge.org/.../success-stories.aspx

# December 7, 2011 3:25 AM

TiGruu said:

Why not using Orchard to power the new asp.net site ?

# December 7, 2011 6:17 AM

Bertrand Le Roy said:

I don't know, you should ask the people in charge of it, such as Jon Galloway or Scott Hanselman. One reason is that they started the new site before Orchard was viable.

# December 7, 2011 12:07 PM

Klaxon said:

also possible that they thought Umbraco was better for their needs. umbaco is still "dog fooding" the asp.NET tech, + its editing pages are quite different which can bring pros and cons even ignoring technology rendering pages

ppl probably understand you want protect to your baby, but when you not admit possibility Umbraco can be chose over Orchard for valid reasons - in every public response to this question .. ppl can see thru it

I imagine is your belief that Orchard "better" than lots of things, and maybe even team existance in MS depends on getting big famous sites, but I think ppl just want see you be consistent: say you are happy to coexist in the .NET CMS market, or not

# December 7, 2011 12:33 PM

Scott Hanselman said:

NuGet stats are public at http://stats.nuget.org. FYI.

# December 7, 2011 2:24 PM

Yex said:

Sounds like a nice tool, although, aside from the use of the BCP utility, I'm having some trouble seeing how it's much different than the Database Publishing Wizard command line tool [0]. It does pretty much the same thing, doesn't it? I've used it before with great success.

[0]: http://goo.gl/HbqzO

# December 7, 2011 5:12 PM

koistya said:

I suspect having Orchard as a core engine for asp.net and nuget.org would increase time in the feature spent on adding new functionality and maintenance because it's code base is a  ...not ideal)

# December 7, 2011 8:47 PM

ASPSmith said:

You can find NuGet stats at http://stats.nuget.org/, though it's not exactly fast.

# December 8, 2011 11:15 AM

Klaxon said:

wld you prefer if I blog that my comment never made it thru moderation & isnot visible on your site?

# December 8, 2011 1:28 PM

Carlos Eduardo Miranda said:

That is perfectly pointed out, Bertrand...Orchard is getting his way, if they like them or not....the product is very robust and taken care by the Comitte and the community.....Heads up!

# December 8, 2011 6:26 PM

Robert said:

Good work with Orchard.  It's too bad that other Microsoft teams are not eating the dogfood.

# December 9, 2011 1:45 AM

nathanael.jones@gmail.com said:

Hi Bertrand, just wanted to let you know that V3.1 has been released at imageresizing.net/.../3-1-alpha-2

Looking forward to your update :)

# December 12, 2011 1:57 AM

Kepha Mose said:

Why are you not using Orchard for your blog?

# December 14, 2011 4:53 PM

bidware said:

so, how would you display a format of a date such as "12/14/2011 3:44:38 PM"   Mine just comes out as:  "/Date(1323907002367)/".  shouldn't there be a function to use?  Why can I not find it on Jquery.com?  Why is there only a datepicker function?  this long thread doesn't even have an answer, so someone post it.

Thanks.

# December 15, 2011 6:27 PM

secgeek said:

Usage of WPF libraries in server side code is not supported nor advised.

# December 16, 2011 2:23 PM

Bertrand Le Roy said:

@secgeek: you could have bothered to read the post.

# December 18, 2011 9:16 PM

Bertrand Le Roy said:

@Kepha: I am on http://vulu.net. But on this blog, I would if Community Server would let me do permanent redirects. Because it doesn't, I'm trapped as I would have to basically abandon all the existing links to this site, which is unacceptable.

Believe me, there is not much I desire more than drop that horrible platform for Orchard, and I will the day I find an acceptable solution. Suggestions welcome.

# December 18, 2011 9:20 PM

Bertrand Le Roy said:

@Yex: maybe. Does it work with Azure?

# December 18, 2011 9:27 PM

Bertrand Le Roy said:

@Klaxon: what could you possibly be referring to? I've praised Umbraco on Twitter many times, as Niels can testify. Where are these "public responses" you are referring to?.

# December 18, 2011 9:32 PM

rswank said:

I had a calendar control with an apparent negative z-index and removing <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/.../xhtml1-transitional.dtd">

Fixed the issue.

To all those making blanket statements about this being a "bad bad bad" idea remember that things are rarely black and white.

In an enterprise intranet environment where all users' PCs are forced to be a certain version this works just fine.

# December 19, 2011 11:39 AM

Bertrand Le Roy said:

Please let me explain again why this is a bad bad bad idea: by switching to quirks mode, you are going to break other things in unpredictable ways. It's cargo-cult programming. If you want to go there, fine, knock yourself out, but don't advise other people do the same. There are rational and good fixes for these issues that should be used instead.

# December 19, 2011 7:26 PM

Yex said:

Uuummm...no. You definitely got me on that one, doesn't support Azure...which is a pretty significant difference (that I missed).

# December 21, 2011 4:13 PM

Venkat said:

Hi Scott,

Can you share your thoughts on why Microsoft chose not to use Orchard CMS and chose Umbraco instead?.

If it was a timing issue, can you share what the future plans for Orchard are within Microsoft properties?

-venkat.

# December 21, 2011 10:52 PM

J. Jans said:

Hi,

I'm working with the IShapeTableProvider. Now we need to extend the 3 default zones of the layout shape with a filter zone. I don't see the way to implement this behavior, is it possible? I'm able to change the wrapper of the layout shape using the ondisplaying method like described here but I suppose you cannot change the definition of the shape at this level.

# December 23, 2011 5:24 AM

Bertrand Le Roy said:

@J: not sure exactly what you are trying to do. Can we move that discussion to the discussions forum on CodePlex with some more details on what exactly you are trying to do and how it doesn't work?

# December 23, 2011 6:33 PM

Bertrand Le Roy said:

@Venkat: I doubt Scott monitors the comments on my blog. You'd have better luck contacting him directly.

# December 23, 2011 6:35 PM

Bertrand Le Roy said:

@Petar: not anymore from what I understand: it's EF now.

# December 23, 2011 7:27 PM

csharper said:

how can we make the properties editable not read-only??

# December 27, 2011 10:04 AM

orchaduser said:

How can I sort items in foreach loop by created date

@listTag.StartElement

   @foreach (var item in items) {

       var itemTag = Tag(item, "li");

       if (index == 0) {

           ShapeMetadata metadata = item.Metadata;

           string alternate = metadata.Type + "_" +

                   metadata.DisplayType + "__" +

                   item.ContentItem.ContentType +

                   "_First";

           metadata.OnDisplaying(ctx => {

               metadata.Alternates.Add(alternate);

           });

           itemTag.AddCssClass("first");

       }

       else if (index == count - 1) {

           itemTag.AddCssClass("last");

       }

       @itemTag.StartElement

       @Display(item)

       @itemTag.EndElement

       ++index;

   }

@listTag.EndElement

# January 3, 2012 11:43 AM

Bertrand Le Roy said:

#csharper: this is just a proof of concept. You'd need a more complete implementation of the interfaces in play here.

# January 6, 2012 4:12 AM

Bertrand Le Roy said:

With Linq? Or from whatever controller or driver or service class does the actual querying. I see no good reason to do something like that in the view.

# January 6, 2012 4:14 AM

Nick said:

In case anyone else had this trouble, I couldn't figure out where you were getting 9.53MM, but its in the "Common Dimensions" from the data sheet. I kept looking for it in the specific TSR-3386 part.

Great post!

# January 8, 2012 10:54 AM

JERCEN RCLAND said:

Safari on Windows a bad thing, you know that Safari run on ipad don't need flash player. I've changed my user agent in Safari for Windows to Ipad ios5 Mozilla/5.0 (iPad; CPU OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3

and remove flash player, now i got a problem, i Can't play video on 'Youtube! This real frustrated me!

# January 8, 2012 6:13 PM

IG said:

Hi

I have added your code to website but I need to specify a path to the folder I want it to get the images from.  eg I have a page (default.aspx) which has a list of houses, they click to view a house (details.aspx?property=1) on the details page I want it to get all the images that exist in ~/images/propertys/1

If the above folder does not exist then do nothing

But when I try and change the Path method on PageLoad of details.aspx I get an error of

Value cannot be null.

Parameter name: value

My OnPageLoad code looks like this

Album1.Path = "~/images/propertys/1"

What am i doing wrong

Many thanks inadvance

# January 12, 2012 8:03 AM

Nathanael Jones said:

Oops, sorry... I didn't know that when I posted that comment.

# January 14, 2012 3:02 PM

wadison said:

BitmapImage bi = new BitmapImage();

bi.BeginInit();

bi.UriSource = photoPath;

// **Set only one side** !!

bi.DecodePixelWidth = width;

bi.EndInit();

# January 16, 2012 5:38 AM

Bertrand Le Roy said:

@wadison: that's using GDI+

# January 16, 2012 4:49 PM

Bertrand Le Roy said:

Attach a debugger and find out...

# January 16, 2012 9:12 PM

wadison said:

Ok, so I don't understand your post :

"""

There are actually several different ways that you can resize an image using the WPF API.

The fastest way is to create a BitmapImage from the file on disk and to specify the target width and height as part as image decoding:

BitmapImage bi = new BitmapImage();

bi.BeginInit();

bi.UriSource = photoPath;

bi.DecodePixelWidth = width;

bi.DecodePixelHeight = height;

bi.EndInit();

[...]

Unfortunately, this won’t do here because in order to compute the size of the thumbnail, we need to know the dimensions of the original image: we want the thumbnail to have the same aspect ratio as the image it represents

"""

we can keep the ratio with this way! ( Set only one side).

++

# January 17, 2012 3:57 AM

Bertrand Le Roy said:

Oh, I see. I had misunderstood your comment, as it had no actual words, just code out of context. That works for fixed width, but it won't do here, where the thumbnail is constrained within a width and a height.

# January 17, 2012 5:05 AM

Sarkie said:

Would it be possible to have a route for

/favicon.ico

For old browsers that assume it'll be in the route? Getting a few 404's for them looking for that file. I'm currently adding a url rewrite.

# January 17, 2012 7:54 AM

Bertrand Le Roy said:

@Sarkie: please file a bug for that on vandelay.codeplex.com/.../Create

# January 17, 2012 3:07 PM

festusramsey said:

partitions can be used for a number of things. data backup/dual boot os, like linux so u dont have issues, like windows/a slimmed down version of windows for gaming/ page file

(although i use a sd for page file), and super fetch. just saying. i wish my dumass had partitioned last install. i want android on my lappy, although i believe it can b3 installed on a mass storage device.

anyway i am getting this error when trying to diagnose network issues.

i will be glad the day windows decides it cannot run every program on earth. repairs issues already in tact, and quit trying to please everyone. no 1 os can do that without hundreds of issues.

# January 19, 2012 11:17 PM

Michael said:

A big circle, isn't it? .NET slowly becomes a dynamic scripting language ... ;) This aside, what about dynamic get/set methods for a property and what about some access to the instance, I should probably read on the codeplex first, but I felt like posting a comment ;)

# January 22, 2012 1:42 PM

Brill Pappin said:

This is actually not a good way to encode dates because its based on a specific point in time. e.g. i want to encode the year 1000... now what do i do if we using millis since 1970?

1) String format is much more flexible, transparent and portable.

2) there is no need to indicate it as a date because the parser already knows if it expects a date. You don't get your error any earlier using an escape.

The format pretty much needs to be a string and even better that it be human readable.

I actually don't see the need to disambiguate the value at all... if you are expecting a date, then you already know what the format is, otherwise it is a string that still looks like a date.

No problem.

This works for programatic conversions as well in both typed and non-typed languages and generates an error at roughly the same time. You gain nothing by indicating adding type to the data.

# January 30, 2012 1:27 AM

Bertrand Le Roy said:

@Brill: please read about JavaScript dates and you'll see that 1/1/1970 *is* the reference date that JS takes to define dates, and not something we arbitrarily decided on. You may use negative numbers.

You are wrong that the parser knows where to expect a date. It simply doesn't and that's precisely the issue. Dates are the only simple type where this ambiguity exists. You are just missing the point.

# January 30, 2012 3:51 AM

Andrei said:

Congrats! Yyou guys do a good job! But it is a pity that 95% of all commits for the last several months are done only by Sébastien Ros.

# January 30, 2012 4:51 AM

Nick Daniels said:

This can be reason 10 billion why I love Orchard.

# January 30, 2012 6:19 AM

stromblom said:

This is what makes Orchard so awesome and fun to work with. This is what gives Orchard that extra edge over other opensource cms.

# January 30, 2012 6:43 AM

Matthew said:

Orchard is more valuable to me than just a great way to build websites. For a greenhorn .NET developer like me, Orchard is a classroom. Everything from how this project is managed to how the code is written is quite a learning opportunity for me. I especially admire that our contributors have come from all over the globe to work together, build something great, and share it freely. If more industries could find some capacity to facilitate open projects the world would indeed be a better place. My thanks to the entire Orchard team and to Microsoft.

# January 30, 2012 9:26 AM

Rich S said:

More companies need to be as open and transparent as you are about what happens with the project and where it is going. Too often companies over-promise and under-deliver, and it's been shown that tons of people with a little bit of time can accomplish more than small groups of people with lots of time.

However, I'm glad there's a small group of "overseers" to guide the project so it doesn't land in dev-hell. I'm even thankful for a "benevolent dictator". :) Thanks for all you are doing and I'm very excited about the future!

# January 30, 2012 10:40 AM

Bertrand Le Roy said:

@Andrei: the other features are being integrated as I write this. Once they are, you will see lots of check-ins from other people. What you see right now is mainly the result of working in separate branches (a good thing).

Another thing to take into account is that in previous releases, 99.9% of the code was provided by Microsoft, so even if that 95% figure was real, it would still be an improvement.

# January 30, 2012 11:16 AM

Joe Raby said:

How does this differ to how .Net MF is run?

# January 30, 2012 1:09 PM

Bertrand Le Roy said:

@Joe: I don't know. How is .NET MF run? I couldn't find any info on governance on their site.

# January 30, 2012 2:04 PM

Joe Raby said:

I just know that it became an open source project.  I have no idea how, if any, public insight turns into governance rulings for releases.  The only line that I can find is about the different divisions, namely:  "Core Technology Team

Microsoft and non-Microsoft engineers who are the gatekeepers of the core implementation and subsequent releases"

Microsoft does have copyright messages on the page.

Scott Guthrie or Colin Miller might be able to answer some of these questions though.

# January 30, 2012 5:01 PM

Bertrand Le Roy said:

@Joe: that says nothing about them being elected by the community. It only seems to indicate that they are taking advice from or gave commit rights to non-MS people.

# January 30, 2012 9:23 PM

stromblom said:

btw, it doesn't look like you have had any meetings in the last two weeks. Are the meeting notes not released yet or are you to busy with 1.4 to have regular meetings?

# January 31, 2012 5:47 AM

vkrk said:

One of the best engineered CMS's out there and great job guys.

# January 31, 2012 7:57 AM

Bertrand Le Roy said:

@stromblon: no, we have had meetings every single week since the election. What made you think we didn't?

# January 31, 2012 1:08 PM

Joe Raby said:

I dunno - that's why I asked about it.  I figured you might know Scott.

# January 31, 2012 3:58 PM

Bertrand Le Roy said:

@Joe: I don't, sorry.

# January 31, 2012 4:07 PM

stromblom said:

@Bertrand I can't seem to find any meeting notes since 18/1, and I'm guessing that this groups.google.com/.../orchard-gov is where I would find them.

# February 1, 2012 4:11 AM

Bertrand Le Roy said:

@stromblom: that's because I didn't send notes last week.

# February 1, 2012 4:29 AM

Anthony Grace said:

There has been a lot of negativity regarding Orchard in the blogosphere lately, not really about the open source aspect. Specifically in relation to its architecture and that it may be "over-engineered" to some degree. Personally, I do not see it as an ideal learning tool for someone coming to MVC for the first time.

That Microsoft is opening this up to the community is commendable. But I've never been a fan of open source. By its very nature there is not the same accountability and sense of ownership as when developers have to answer and account for their work contributions and design decisions.

Not trying to be the party pooper here, but am I the only one who even questions the value of open source projects these days?

# February 2, 2012 10:52 PM

Bertrand Le Roy said:

@Anthony: really? Can you give me some pointers? Apart from Rob's post, I haven't read those.

As for the value of open source, well, you're probably not the only one, but that's fine, as there is plenty of choice out there. My personal opinion is that OSS authors are putting themselves (not their company) on the line, and are producing works of love. Closed source on the other hand cultivates a spirit of secrecy and puts their authors in ivory towers.

# February 4, 2012 10:25 PM

Todd said:

While I appreciate the fact we are making Orchard more open by giving it to the community I wonder if this is a sign from within MSFT around the commitment to continue to fund developers working on the project. A bit like a kid sharing a toy because they are tired of the toy.

# February 10, 2012 12:52 PM

Bertrand Le Roy said:

@Todd, that hypothesis doesn't resist scrutiny: Orchard was open source from day 1.

# February 11, 2012 4:39 AM

Todd said:

Betrand, What I mean is, by transferring greater control to the community does this signal MSFT is stepping back a bit and will not continue to make the same investments in Orchard? It is a question not a hypothesis.

# February 11, 2012 7:54 AM

levinm said:

Doesn't withstand scrutiny :)  

Thanks for Orchard

# February 11, 2012 11:36 AM

Bertrand Le Roy said:

@Todd: no. Transferring control to the community was the plan from the start. It's weird how if we don't give enough control to the community, we're accused of not understanding open source, and if we do, we're accused of losing interest ;)

# February 11, 2012 7:05 PM

Todd said:

Since when does asking a question mean someone is accusing you of something. Have you hever heard of MSFT walking away or stepping back from anything before? I honestly don't see how this not a fair question? You sound offended and that was not my goal in asking.

# February 12, 2012 1:10 PM

Bertrand Le Roy said:

@Todd: please calm down, Todd. I'm not offended and neither should you. I didn't mean "accused" in a very strong way (hence the lame little smiley face I included). Maybe it wasn't the best choice of words. Sorry about that.

Yes, Microsoft has walked away from many things, and it bugs me as much as anyone, if not more: some of my projects, which I cared a lot about, got that treatment in the past. So I agree it's a fair thing to ask, and I'm answering you the best I can. Precisely because I've wanted to protect this project from such outcomes, it's been my intention from the start to involve the community in a meaningful and real way. This is not Microsoft losing interest, it's the Orchard folks making sure that if that ever happened (which, again is definitely not the case here), if that ever happens, it won't hurt the project because it's already in a position to continue without Microsoft. It would be sad and difficult to lose their support (we get developer resources, PM resources, Azure instances and money that we're trying to make the best usage of), but it wouldn't kill us. That is what this means.

I hope this helps clarify.

# February 12, 2012 6:55 PM

Alexandre said:

Hi,

Me again, I'm having problem with WIC under heavy load :(

The problem is described here :

social.msdn.microsoft.com/.../1a413988-d96f-4780-a302-702174d94eca

I hope you can reproduce it and give a hand.

I can't find any solution, even lock() doesn't work.

# February 15, 2012 10:46 AM

Bertrand Le Roy said:

@Alexandre: I would recommend you contact support if your forum post doesn't receive answers from the WIC team.

# February 15, 2012 2:30 PM

Binu Jo said:

First of all, thanks for this awesome fix, I added this to my 2.0 application when the client wanted to call the page from an IFrame. It got fixed and worked well in IE, but now not working in Chrome. When I checked the .js, IE and CHrome shares same switch as I didnt changed any other. IS there any fix for this in CHrome, without changing the framework?

# February 21, 2012 6:46 AM

Bertrand Le Roy said:

@Binu Jo: It's probably time to move on to a recent version of ASP.NET. This was fixed about a century ago :)

# February 21, 2012 8:38 PM

Diego said:

A few hours ago I came into a bump with .NET JsonSerializer and Javscript.

I haven't found a discussion about this on the web so here's my little sand grain :).

After a couple of hours of hair pulling I found that DateTime objects where being serialized as UTC by .NET (something not quite nice when dealing with timezones and datetimes are critical).

But that was not all. Javscript does its own conversion also. When running new Date(<milliseconds>) I found that JS was converting those milliseconds to the client's timezone (also, something not nice when having to render the date/time in another timezone than the one the user it sitting at).

Hope this come in handy.

# February 23, 2012 2:39 PM

Kimmo said:

Holy smoke!

Transferring data (POJO - so I do know what's being transferred) between Spring server and Java client was quite easy to get working with Json. Dates, sets, everything. Jackson library on both ends.

When I tried that same interface with .net -> kaboom!

What heavens have MS people thought, when their Json libraries cannot decode other than "Date\/(..)\/" format? Thrown normal milliseconds-from-epoch number to it and cry cry not correct format. Does that suck or what?

What worries me now is that if the same server was made with asp.net MVC, it would stuff every time and date with this "victory day" nonsense. Zero compability, I would call it.

# February 26, 2012 5:04 PM

Bertrand Le Roy said:

@Kimmy: super-easy to work around. For example, read Dave Ward's post on this: encosia.com/how-i-handle-json-dates-returned-by-aspnet-ajax

# February 26, 2012 6:24 PM

Nick Daniels said:

I actually did this by accident a few months ago and discovered it worked. I have used this to extend Orchard's built-in parts with additional functionality. Things like this are why Orchard in my opinion is such a capable platform.

# February 27, 2012 1:31 PM

Kimmo said:

@Bertrand:

Sorry, I'm not sure where the answer in that link should have been, but it seems that custom datamember conversion did the trick for format (sorry about the code:

[IgnoreDataMember]

       public DateTime startdate { get; set; }

       [DataMember(Name="startdate")]

       private UInt64? _startdate

       {

           get

           {

               if (this.startdate.CompareTo(unixEpochEET) > 0)

                   return (UInt64)(this.startdate - unixEpochEET).TotalMilliseconds;

               else return null;

           }

           set

           {

               this.startdate = new DateTime(unixEpochEET.AddMilliseconds(Convert.ToUInt64(value)).Ticks, DateTimeKind.Unspecified);

           }

       }

This way the date within the object knows how it should be got and set. I guess that I can use this method also in server side for communicating with non-ASP.NET or non-Dot.NET clients?

The other thing is timezones... Jackson Json converts dates to GMT without asking (and without possibility to disable that behaviour it seems) which in my case sets all dates 2 hours off. For now I did dirty correction - use epoch+2 as base in Dot.NET client.

My case might be special in that I don't want timezoned times: everything that is entered or read, is absolute time - it can't vary depending on where the reader is. Maybe ISO formatted string would be the

ultimate date format for me, but I don't know if database can convert it to date/time automatically ;)

So nothing wrong with ASP.NET Json as long there's a way to avoid it's formatting ;)

# February 28, 2012 2:29 PM

Dan said:

DOes anyone know if it's possible to resize a digital camera photo with metadata that contains

the focal length the picture was taken at

the pixel dimensions

to 100% life size?

Thanks, Dan

# February 29, 2012 4:39 PM

Brainwrecker said:

I have a home page and about page. I added layout.cshtml and layout-AboutPage.cshtml, but it doesn't seem to pick different layout for the about page?

Also, I enabled the Url Alternates feature of Shape Tracing, but I can't find any suggestion for layouts. It simply displays all the Zones etc..

# February 29, 2012 11:15 PM

Simone Chiaretta said:

Best of luck with your new adventure, and keep rocking the World with Orchard!!

Out of curiosity, is Nwazet pronounced as noisette?

Simo

# March 1, 2012 1:25 AM

Bertrand Le Roy said:

You're probably not looking at the right shape. The alternate should be layout-url-aboutpage.cshtml if you're using URL alternates.

# March 1, 2012 1:32 AM

Josh Twist said:

Congratulstions Bertrand, I'm sure you'll be a total success wherever you aim your talents. Sad I didn't get to work with you.

# March 1, 2012 2:04 AM

ms440 said: