Timo, please send me a repro page at bleroy (at microsoft).
I know :|
[ASP.NET]Atlas CTP June 2006
Michael, please contact me directly and describe the multiple errors that you get. bleroy (at microsoft).
Info and download here. Be sure to checkthis post by Bertrand LeRoythis post by Nikhil Kothari
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
Kalimuthu: I don't understand what you mean by "demo version controls".
Bertrand Leroy, un des développeurs du projet Atlas de Microsoft a fait une interview où il parle...
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?
Nico, please give me more details by mail. bleroy (at microsoft).
Cyril: merci de ta réponse. C'est triste à dire, mais ceci est à peu près la seule raison qui nous pousserait à supporter Opera...
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?
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.
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
The bug is fixed in 1.0.2 that I just uploaded. Thanks for the bug report.
La question du partage des variables de sessions revient assez souvent, pas plus tard qu'hier pendant...
Masoud: what is supposed to be on this page? It comes out empty for me.
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...
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.
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.
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/
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.
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>).
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.
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.
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?
More Atlas stuff&nbsp;からです。 &nbsp; Using the XmlDataSource Data property for easy samples &nbsp;...
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.
It's the second time in just a few days that I see blog comments attack Atlas on its compatibility layer.
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?
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.
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.
We already knew that JavaScript had some issues with semantics. Here's another funny one. Guess what
Bertrand LaRoy, over at More Atlas Stuff, has discovered some truly weird JavaScript behavior. Apparently...
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".
Abo: the VB source code is available from the GotDotNet workspace. Just follow the link.
Kori: actually no, it's not a new concept, nor is the name. Look it up in wikipedia:
http://en.wikipedia.org/wiki/Mixin
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.
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.
ScottGu's Blogからです。 August 9th ASP.NET Link-Listing 今回の投稿では Scott さんが発見した素敵な記事のリンクとそれぞれの紹介コメントが書かれています。見てみたところ、全て英語(当然)ですが内容はやはり濃かったです。個人的に特に気になったのは...
Albert: this is Nintendo's Brain Age DS game.
Wozoi: all right, you're younger, but that won't last. Wait?!
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).
PingBack from http://blog.dream-coder.de/?p=89
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."
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.
It seems like I'm not alone in my hatred for useless keys.I mean, who hasn't pressed Caps Lock
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).
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.
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.
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.
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.
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.
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.
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.
(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.
Right. I should have done my homework more seriously. Updating the post.
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.
It's the second time in just a few days that I see blog comments attack Atlas on its compatibility
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:
--- 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."
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.
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.
Errrrr... Sure... No need to shout. You?
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.
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.
ASP.NET Event Validation
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.
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.
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.
Xander: it doesn't have anything to do with Atlas but see above comments.
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.
Zois: wow, I wonder where they got that from, but that certainly wasn't a scientific show ;)
Really good post about Creating Session variables and Redirecting the page.http://weblogs.asp.net/bleroy/archive/2004/08/03/207486.asp...
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.
Nikhil さん と Bleroy さん の blog からです。 Script# Prototype Script# brings compile-time and C# niceties to JavaScript
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.
nikhilk.net と Atlas and more と ScottGu's Blog からです。 Back Button Support for Atlas UpdatePanels ( nikhilk.net
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
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).
I thought I'd write a few posts about the controls I've created for Brad's Mix06 demo, which
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)
[来源:Bertrand Le Roy] 传统的web应用一般含有多个页面,用户在浏览时,浏览器地址框里的地址会随着页面的变动而更新。用户可以bookmark页面把网页地址收藏,之后通过收藏夹里的地址回到同个页面。用户在网站浏览时,也可以使用浏览器的向前/向后按钮来回访问多个网页。
Troubled: send me mail at bleroy at microsoft com with code to reproduce the problem and I'll have a look.
PingBack from http://brennan.offwhite.net/blog/2005/09/14/atlas-for-aspnet-20-is-out/
PingBack from http://edgardorossetto.net/2006/03/17/ruby-para-net/
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 ...
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.
SQL Injection attacks are reallynasty security vulnerabilities, and something all web developers (regardless
C'est une annonce relayée coup sur coup sur les blogs de Bertrand Le Roy et de Scott Guthrie : ComponentArt...
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.
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.
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)
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.
Manuel, you'll see in the next CTP that all Atlas classes are now prototype-based.
I'll fix the post.
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.
This posts completes the Microsoft AJAX library OOP enhancements, giving a lot o
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());
Craig. Read on to the next article: http://weblogs.asp.net/bleroy/archive/2006/10/11/From-closures-to-prototypes_2C00_-part-1.aspx
:)
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.
Matt: send me a simple repro of your problem at bleroy (at microsoft). I'll have a look.
It seems that the next MS AJAX preview will be very, very different from the previous CTP. Bertrand Le
So it's been a while since the last Atlas CTP was released (July). By now, if you've been following...
Here are three common mistakes I've seen recently in script files.Undefined is not null.If you've
Betrand Le Roy of Atlas fame has an interesting writeup on what he understood from the Matrix Trilogy.
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.
In part 1 of this post, I exposed the differences between the closure and the prototype patterns to define
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.
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.
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.
Microsoft has been hard at work on the next Microsoft ASP.NET AJAX (formerly "Atlas") CTP,
Michael, Jon: it's imminent.
Scott Guthrie l'annonce sur son blog via un billet fort détaillé . La version Beta 1 de Microsoft ASP.NET
Scott Guthrie l'annonce sur son blog via un billet fort détaillé. La version Beta 1 de Microsoft ASP.NET
Pour compléter le billet de Patrice il y a la beta 1 de Microsoft ASP.NET Ajax Extentions de dispo mais
Patrice et Fox vous l'a déjà annoncé hier : Une nouvelle version de Microsoft Ajax Extensions (nom de
Good post on this subject by Bertrand Le Roy
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.
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).
What do you mean?
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
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.
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.
> 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
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.
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.
We have recently completed converting our suite of user interface controls from the latest Community
</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>
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/
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
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.
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.
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.
In previous CTPs, the client-side DOM event model was the IE model. You would use attachEvent and get
You can download the bits here . The "value-add" package is now called "Futures" and it's available as
Fox nous a TRES brievement annoncer la mis en ligne de la beta 2 de Microsoft Ajax Extension : ASP.NET
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?
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.
http://ajaxian.com/archives/dom-events-in-the-microsoft-ajax-library-formerly-known-as-atlas
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.
Introduction Microsoft Ajax defines a component as a class that inherits from the base Sys.Component
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.
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.
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.
Foo.Bar = function() { this.stuff = {} } Foo.Bar.prototype = { number: 0, toString: function() { return "Bar #" + this.number + (this.stuff.id || ""); } }
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.
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"
Don't ask me...
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.
Chad: this is a known problem that is fixed in the RTM version. Thanks for reporting it.
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.
Ronny: feel free to modify the code and add more space. Would you need help with that?
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
Ronny: good point, you'dprobably need to modify the code a little so that it respects the property.
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..
In RenderChildren, just create a bunch of literal controls that contains " " 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.
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)!
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?
Add a button to the page, make it cause validation, browse to the page, view source.
Hmm, RTM version eh? So you guys are pretty close then :)
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..
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!
Hey, amazing how David Ebbo on this picture reminds me Benigni.
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
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
LOL! I could never have imagined there would be a web site dedicated to it.
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
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.
Do you get any script errors?
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.
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.
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.
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.
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
Any support for using the ms:confirmbutton w/ a delete imagebutton within a gridview?
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!
Alternatively, debug it is using Sysinternals DebugView and lots of Debug.WriteLine() statements...
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?
Got here from Sitefinity 3. Great add-on I am going to give this a try shortly.
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.
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).
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!
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).
the nerd tests are sweet!i was definetly not a nerd!!!
how to display message boxes from server-side code?
Moderage:I think you can use window.setTimeout and golbal virable for your poupose.
PingBack from http://www.fernandowendt.eti.br/?p=36
resh: I don't quite understand the question, that's exactly what the blog post is about...
what is the best xbox 360 game available???
Depends what you like. Gears of War and Oblivion are both marvelous time sinks.
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!
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...
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?
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?
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.
Thomas: Sure, except that you can't master all technologies around. And what if *you* are the client?
How about we make this easier for the people that have to do a science paper on this crap!!!
Great attitude, Kelly. Good luck with that.
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.
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.
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.
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.
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.
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.
Go AJAX, the old fashioned way!
I am having this exact problem with Classic ASP. Any ideas to use something other than Response.Redirect?
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.
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!
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
if (Session["Error"] != null)
Response.Write(Session["Error"].ToString());
Session.Remove("Error");
This does not work:
protected btResponseRedirectToNonExistantPage(object sender, EventArgs e)
Response.Redirect("NonExistantPage.aspx", False);
==> Object reference not set to an instance of an object.
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.
Tony: it's hard to tell exactly what's happening in your case. You should contact support.
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.
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.
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!
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.
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
AM: err, thanks. I think you're missing my point here but thanks. <g>
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?
Yes, that's the point of UpdatePanel.
Congratulations!!!
You've done a nice work...
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.
All I can say is.. Wow.
This looks great. A step toward melting the gap between web and desktop. Great work. Keep it up!
Congratulations!!
Raj
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 !!
i would love to see your demo video-streams... but the quality is so bad that someone can actually not watch them...
thanks b.
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
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
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?
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
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?
Very sweetly done folks ;)
Its making my job easier each day ;) hehe.
SB.
Dev Evangelist.
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.
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!
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?
"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
You shouldn't be proud, the release is buggy.
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.
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.
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 ?
u need a screwdriver to put on a faceplate?? and how come the companies who sell the faceplates dont give instructions??
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?
Mike: no, you don't, it's just easier with a screwdriver, it allows you to lever it out gently.
Bhaskar: good point. You could also set-up a response filter that swallows all new output.
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.
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.
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.
Ali: please contact me through the contact form of this blog.
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.
Right. I stopped reading as soon as the troll said "LOL".
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.
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.
Can you please go away? Atlas *does* run on apache and on PHP.
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.
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.
Good article. Hopefully Microsoft will fix this ASAP. Let's wait together
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!
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
(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...
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!
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.
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.
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.
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?
shashi
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.
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
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.
did the drive keep sticking and its easier with no faceplace like mine??
he asks wishfully
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
Mike: the next version of the toolkit will contain the fix, which may be your best best as I see you're using it.
Max: no.
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?
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.
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
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.
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:
Do you have any idea what causes the problem?
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?
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"
You probably don't have ASP.NET 2.0 installed, or it's not active on that application.
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.
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.
Thomas, please contact me through the contact form of this blog. I'll look at your file.
Does anyone have the full file working. I am getting a Sys is undefined when using the Atlas toolkit
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?
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.
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.
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!
All those comments in javascript will bloat the size of the js files won't they?
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.
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.
Has this now been fixed with the 3/2 release?
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!
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.
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?
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?
Love it! "I was a nerd wannabe" I slightly disagree with that remark!
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
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?
When can we expect ASP.NET Ajax update with this fix?
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.
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.
Fedor: see above comment. The next release (Orcas beta) will have the fix.
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.
Ron: I'm asking O'Reilly. I'll post their answer here.
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!
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).
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 :-)
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.
Try downloading it again. I just re-downloaded the PDF and it's stamped March 13, 2007.
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.
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.
> 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 :)
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?
Thanks Bertrand just purchased a copy of it.
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.
Got a copy too, looking forward to read it. Hope it gives you some motivation to write some more great posts.
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
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.
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?
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.
Does the ASP.NET Ajax team plan to release the "compression" tool they use to create the release script from the debug script?
Are you saying that Safari will not run scripts with the function body inline or that it simply won't show the stack?
Scott: that's good feedback, we're getting that question a lot. We're thinking about it, but it takes some time. Thanks.
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.
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!!
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...
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
Perhaps this bit of guidance could be added to the AJAX documentation at some point.
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.
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.
cool! and keep up the good work.
I bought the booklet today and on page 17 it's still using the atlas tag instead of asp... no biggie...
Hi - I have a Safari subscription, but this document does not show up there.
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.
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).
Kris: I'm asking my editor. What happens when you follow that link: http://safari.oreilly.com/0596527470 (found from the PDF page)?
Tyler: sure, I have a tip... Contact support :)
Jai: use setTimeout to queue the next request.
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).
Can you do up a small sample of how this $ method should be used for debug scripts and not for production scripts?
The features definitely rocks.
Can you reveal more secrets about the "elegant solution" that is implemented.
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.
Morten: I'll try to do that in the following days. I'll post when I'm done.
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?
Stefan: it's a combination of partial script execution, inferring types from the context and taking hints from doc comments. Does this help?
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.
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.
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!
Keith: even "j avascript:'<html></html>'"? (remove the space, I added it so the blog engine doesn't remove it)
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.
how do u take off the faceplate
Read this: http://www.xbox.com/en-US/support/systemsetup/xbox360/accessories/faceplates.htm
the screwdriver trick didn't work meanies
Well, I don't know what to tell you, it was pretty easy for me. Maybe you should contact support.
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...
Is there a way to implement background imagery with this method? Tried BackImage with no success. Ideas? Thanks!
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.
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...
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.
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.
The message works great except when I put <UpdatePanel> around it, then it does not work.
Do you know why?
Ta: yes, this is a known problem. It currently doesn't work inside UpdatePanel.
Thanks for this Bertrand, very useful article - problem sorted:-)
Are you still planning to do a post about Class events or can you point me at a good resource?
Peter: yes, absolutely. I'll try to get that done next week.
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.
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
Great article! This really helps.
What I used to do before reading this post is:
var self = this;
CallWebServiceMethod(function(results) { self.OnComplete(results); });
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!?
Muhammad: you'll have to ask Telerik...
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.
Hey it's really great!!
Is it possible to scan only a certain folder? Because right now it scans everything in my website ehhe
Mike: just put the handler in the folder you want to scan.
guitar hero 2 for xbox 360 OWNS
I am not able to use this code please help
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.
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!
wow this screw driver trick really works
i now have a new (chrome) face plate thx heaps
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.
Awesome, thanks Bertrand.
Thanks Bertrand. I have linked this to Sandcastle post at http://blogs.msdn.com/sandcastle/archive/2007/04/24/documenting-javascript-doc-comments.aspx
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.
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!
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/
You can also try this for really nice Aero Glass on your screenshots!
http://www.windowclippings.com/
Kenny has done a nice job
dm
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?
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.
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.
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.
Just break the damn keyboard on your desk like I do.
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
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.
Congratulations ! Even if I can't see the video on my Linux desktop...
See you soon in Paris ?
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
Frenchy Power!
I really like ASP.net Ajax. it really rocks, and is very easy to start with.
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?
mmh. Actually no, I can't get it to work either.
Did the orcas release fix it? Have the 'ajax bits' been released yet?
http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx
Yes.
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
The comments are the kicker, No one seems to care, or think its a big deal.
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.
Fact: 99% of people who would play God of War thought that looked like a cool party. Excellent PR.
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.
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
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.
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.
They should've used gringo soldiers killing Iraki children to keep up with the depraved barbaric environment.
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.
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.
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.
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....
Daniel, please file a bug on GotDotNet.
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.
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.
Man tough crowd <s>...
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.
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.
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?
Henry: that indicates a syntax error probably happened before. You probably made a mistake when you patched the release version of the file.
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?
How do u take current faceplates off....and put new ones on???????
Dom: please read through the previous comments, your answer is there.
Sebastian: I wasn't able to reproduce a problem with that code. Feel free to send me your repro.
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.
Todd
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.
When building Ajax applications, you basically deal with two kinds of events. First, there are DOM events
... for anything else than aiming and frantically moving up and down. In other words, slow movements
Ron: not sure what you mean. Can you be more specific?
On GotDotNet, but the project has been obsoleted now that ASP.NET Futures have a similar, but much more complete feature.
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..
Deepak: no need to shout. That indicates a syntax error. You probably made a mistake when you patched the file.
One of the things I'm going to try and start doing is to do a weekly post of useful links on .NET related
One of the things I'm going to try and start doing is a weekly blog post of useful/interesting links
In part 1 , I showed how to subscribe to events exposed by JavaScript classes built on Microsoft Ajax
Pingback from May 22nd Links: ASP.NET, Visual Studio, Silverlight, WPF and .NET « Gurusoft
Pingback from Links 22 de Mayo: ASP.NET, Visual Studio, Silverlight, WPF y .NET « Thinking in .NET
dcstarr: call support (1-800-4MY-XBOX) or go to www.xbox.com/.../support
As I mentioned in my post couple days ago that I am doing some web application performance evaluation
crosspost from http://blogs.msdn.com/rextang As I mentioned in my post couple days ago that I am doing
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.
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.
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.
Martin: I'll try to put something together and make a blog post with it. Thanks.
Marc: the fix is already in the Orcas Beta and will ship with all future versions.
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.
Oh, something I forgot.. My locale is ES-MX. Perhaps this is where I'm missing something??
Yendi: there doesn't seem to be a site there. Can you check the spelling of the url?
I can see it:
http://www.nortia.com.mx/
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...
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.
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.
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.
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.
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.
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.
Calios: thanks for the suggestion, that's a really good point.
Calios: thanks for the fix.
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...
I was super-excited to learn that Andrew Grant was able to run the Photo Handler unmodified on Windows
Thanks Mike! This rocks!
Pingback from Granville Barnett June 2007
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.
> 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.
Pingback from Links: ASP.NET, Visual Studio, Silverlight, WPF y .NET « Alexander Jim??nez
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.
It's a great thing.
I think MS should get out of the browser business, they murk it up too much
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?
Kearns: you should report it to Apple. Bugs can be filed at http://www.webkit.org.
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.
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!
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?
I agree. Its all about the iPhone and the windows developers.
No, offset values on what?
拷贝C:\ProgramFiles\MicrosoftASP.NET\ASP.NET2.0AJAXExtensions\v1.0.61025\目录下的MicrosoftAjaxLibrary...
Pingback from Mac Rumors Kicks Around the Yellow Box « Quod Ero Spero
Stefano: you should probably ask this question to the toolkit team.
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?
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!
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.
<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.
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.
Russ: can you look for the UpFolderStackHeight setting in the handler and check that it's not set to 1?
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.
UpFolderStackHeight = 3
Russ: then I have no idea, sorry. Never seen that happen.
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.
BTW - I'm using JQuery and Thickbox and my iFrame's called into the DOM work without a hitch. jquery.com/.../thickbox
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.
Russ
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?
Yes, hold on, I'm migrating to Codeplex. The new address will be: www.codeplex.com/PhotoHandler
Last night, I uploaded the source code and release package for version 2.0 of the photo handler . I'll
I just finished migrating my PhotoHandler workspace from GotDotNet to CodePlex. I have got to say that
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.
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.
Shane: urls with periods in the address? That's radical. Most of the web must be filtered out by this?
One of the features that web developers will really like with VS 2008 is its built-in support for JavaScript
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.
Pingback from Intellisense en JavaScript con VS 2008 « Thinking in .NET
VS 2008 JavaScript Intellisense
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
Anke: you should talk to your hoster. Apparently they disabled the build provider for ashx.
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
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.
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.
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?
Anke: I'm sorry, but no, I don't.
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)
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.
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?
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.
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.]
Ted: not in principle. How many pictures are we talking about? Did you try with the same settings but just a few images?
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?
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.
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
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.
ScriptDoc is a tool that extracts documentation from JavaScript files and packages it into XML files
Pingback from The format for JavaScript doc comments - Atlas and more
When I was talking at the Journées Académiques last week, someone in the audience asked me about documentation
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!
In April I blogged about Bertrand Leroy 's, cool document extraction tool (ScriprDoc 1.0) that will generate
Great works! Thank you Roy!
For background image try setting a custom attribute to reflect the css class for the menu item and set the background in a stylesheet.
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
Pingback from University Update-AJAX-ScriptDoc 1.0 available
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!
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?
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.
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.
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.
Caterwomtious: I agree, and I've passed this suggestion along to the right team for a future version (a while ago :) ).
Why don't you guys just provide us with the modified file?
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.
I just migrated my ObjectHierarchicalDataSource and CompositeHierarchicalDataSource projects from GotDotNet
Great works! It is very useful!
Hello Friends
i have added
<ajax:ScriptReference Name="MicrosoftAjax.js" ScriptMode="Auto" Path="~/Scripts/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js" />
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)
GAY
I've fallen behind on my weekly link-listing series - apologies for the delay. ASP.NET ASP.NET RSSToolkit
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.
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.
I found out about these ASP.NET controls by way of Bertrand LeRoy . "These data sources enable Menu and
I found out about these ASP.NET controls by way of Bertrand LeRoy . "These data sources enable Menu
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;
Dinesh: doesn't removeChild work?
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.
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.
This article about bad points in game design is kind of interesting... Source: weblogs.asp.net/.../seven-deadly-sins-of-game-design.aspx
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.
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
Check out this link for more...
www.dotnetuncle.com/.../71_page_life_cycle.aspx
In his recent post Bertrand Le Roy announced that he migrated his ObjectHierarchicalDataSource and CompositeHierarchicalDataSource...
Bas: did you make any changes to the style sheet? I just checked and it displays fine in Firefox, Opera, Safari and IE.
@ 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.
No sample up and running?
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
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...
I did the same thing that EB did from March 5, 2007 and it worked great.
AdmiralGanja: sorry, no.
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.
参考网址:support.microsoft.com/.../ho...
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..
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?
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!
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.
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.
Nathan: why not use regular SqlDataSources with the CompositeHierarchicalDataSource?
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).
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.
I shoed alert msg but after pressing button my aspx page get expired.how to solve this pblm
Kalpesh, what do you mean "expired"?
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">
where Scripts is the Virtual Path Folder of the project...
Now what else should i check...
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
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
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
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..
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.
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.
Deepak: did you check in Firebug that the script do actually get loaded?
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..
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.
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?
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.
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.
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
Great, works well!
Is it possible to put spaces between the icon and the text?
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.
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.
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 />
The following code worked but it's not the most practical.
<siteMapNode url="site.aspx" title="&nbsp;&nbsp;&nbsp;Site" ... />
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
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?
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?
the solution was very helpful n awesome .
It saved me .
thnx a lot
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?
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"/>
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) {
??????????????
Lance: you can't, sorry.
Pingback from callback asp.net 2.0 « Private: .NET + OO concept
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.
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.
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.
BTW: I am using Win XP Professional
Sona
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..!!!!!
Sona: not sure I'm following you, it seems to work fine on your site.
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">
In the lines below i have seen that the path appears twice. Is this normal?
Thanks.
Ziro: you probably included too much in the script path. Apparently in your case it should just be "scripts".
this so stupid because it did NOT HELP ME AT ALL! [deleted about a thousand exclamation marks]
LEARN HOW TO WRITE! [and here too]
How can I generate msgbox with three buttons Yes/No/Cancle when a user is updating his record.
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.
Suraj: the gridview example in the post is almost what you're looking for, except for the cammand name and the buttons, right?
This solution is mutch more simple!
forums.asp.net/.../1546323.aspx
:p
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.
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.
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?)
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
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?
Nicholas: no, IE doesn't use any of .NET or Windows Forms.
Luke: do you have a url where I could have a look at that?
John: you forgot to drop the meta data extractor dll into the applicaiton's bin folder.
Vladimiro: err, it is a simpler solution, but to a completely different problem so I'm not sure what you mean here...
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.
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?
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 « 10 astuces pour faire parler de,Beaucoup
Alberto, you're right. I've sent mail so that this gets fixed.
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!!!
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)
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?
Rafal: I confirm that the site map stuff is now in Futures.
quickstarts.asp.net/.../searchsitemaps.aspx
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.
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?
Just noticed that Martin Smith has asked the same question :)
My wiimote isn`t working and I put more than 1 pair of new batteries in. What`s wrong?
Has the link been fixed yet?
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.
Brandon: I have a feeling Nintendo's support would be much better qualified than I to answer this...
<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...
Kalyan: Err, not to be rude, but the only thing I can suggest is that you read the post...
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
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.
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..
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?
作者: Truly 日期:2007.8.5 首先我们要遵循JavaScript注释规范,详见 ScriptDoc 和 weblogs.asp.net/.../2007
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.
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..
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.
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.
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.
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?
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
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);
Jeff
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!
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
I figured it out. The ScriptReference path is relative, so once I removed the tilde, it worked. Thank you!
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.
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.
Jeff: I omitted it from the code in the blog post, not in the full source code.
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.
Man, your comments are really fast... It changes everytime I'm gonna refresh it..
"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.
Where can I get the ASP.NET Alerts control since the gotdotnet site has been phased out?
ok I found it and changed it to memory and all is well.
Thank you
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. :)
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.
John: I'm in the process of moving it to http://www.codeplex.com/alerts.
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.
Voici la réponse au Quizz JavaScript - gestionnaire d'evenements et boucles . Pour rappel la question
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.
Atanas: not for the moment but that's a good suggestion.
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
Voici les réponses au Quizz JavaScript : objet et abonnement d'événement Le problème était encore à cause
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.
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.
Awesome....exactly what I was looking for.
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.
dude its being painted
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.
Pingback from I’m CaLendarW Blog » Blog Archive » ASP.NET Event Validation
why photoshop and not expression design?
you know ? "eat your own dog foot".
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.
Joli modele :)
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 :)
A really cool photo plus your wife has done a great job carving that pumpkin! Great work!
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...
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 :-)
Nice design, very nice title ;-)
Great work but i think you have to add a link to the homepage behind the title of your blog.
Very nice :)
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 ...
How about posting some content? Those of us that just subscribe to your RSS feed could care less what you did in Photoshop.
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...
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.
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.
We are not evil Bertrand =). It is all fair in love, war and business. The carved pumpkin is awesome.
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?
George: there's probably a difference in config between the two. Are these the same versions of IIS, both fully updated?
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...
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.
Didn't realize you were on leave, my mistake. Looking forward to new content!
What about web.config? Can you try to reproduce the problem without the iframe?
Very intriguing. I like it. Congrats on a new family addition.
If you currently don't read Betrand Le Roy's blog then you need to start. I started reading it
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!
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.
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?
cool...i like it :)
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
Allan: I haven't had time to migrate the source code yet, but I will in the following days. Sorry about the delay.
George: At this point I would contact support. I'm sorry I don't have any better insight for the moment.
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?
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
Regardless of the new name, my feed reader will forever know you as "More Atlas stuff". :-)
I like it. Much better than mine.
"Tales from the Evil Empire".... What, you're working for Apple now? :)
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 ; ).
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.
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.
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.
Found the Alert source code still not migrated to codeplex,when can i expect it?
Vidya: it's in now. Thanks for your patience.
Pingback from » ASP.NET Alerts available with source code on CodePlex
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.
Steve
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!
Link Listing - August 26, 2007
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!
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!
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.
最近在使用Asp.NetAjax1.0的框架,遇到了在不同域名下抛出
select box is display over the div. How to overcom that
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
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.
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.
Bosker: please read the post before posting a comment. Not to be rude but that's exactly what it is about.
Thanks Bertrand!
We are truly honored that you and Scott wrote the foreword for us.
Pingback from » ASP.NET Ajax in action available
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!
Very good patching!
App now works smoothly
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.
Madtown: see above comments. Big doe had almost the same question.
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.
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.
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! =(
Why the quotes? I suppose it should work without them. The PermaLink property should just give you the right url iirc.
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.
You set the NavigateUrl of a hyperlink control to its value for example.
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>
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;
Anything is better than IE
I am completely new to DotNet..can anyone give me exact flow of asp.net page?
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
Thanks, It fixed the problem! Hope that MS would release some official patch as well, I assume there are plenty more to be fixed!
Shauheen: it's already patched in all recent versions of ASP.NET Atlas.
Sashidhar: that's exactly what the diagram is. For more details, please consult MSDN:
msdn2.microsoft.com/.../ms178472.aspx
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.
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
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.
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.
Thank you very much. The patch worked like a charm.
Yes. This being out of the way, let me explain why (just in case you haven't read one of the million
Pingback from Seven deadly sins of game design - Tales from the Evil Empire
Talked me into checking it out.
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
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!
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.
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.
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.
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.
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!
Pingback from OpenSource Connections » Blog Archive » Javascript Intellisense, Documentation, & Visual Studio 2008 (Orcas)
i used "BLOCKED SCRIPT'<html></html>" 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.
One new subscriber from Anothr Alerts
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?
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.
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.
Richard: I run it on Xbox.
Collin: the ads do look very much like the Fallout ones, yes.
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.
Dave: thanks for the kind comments. Good point about analytics, I should definitely do that. When I find time. :/
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 :(
Marcelo
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
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.
Morten: Yes, I agree. Thanks for the suggestion.
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..
What???
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".
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).
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.
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?
How do I know if I'm running AJAX Beta 1?
Peja: look in add/remove programs
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.
Αν θεωρείς κακό μπελά την ιστορία της έκτης, oh boy/girl, you 're so naive. Σε web developers απευθύνεται αλλά αφορά όποιον αναρωτιέται "Μα πόσο άχρηστοι είναι που δεν δουλεύει με όλους τους browser".
Pingback from 4 Links Today (2007-09-08)
I have an iPaq rz1715 and get the same message.
The guitar Harmonix chose for the Xbox 360 version of Guitar Hero II is not exactly my favorite guitar
There's already been several history tools developed for Adobe Flash which has historically had exactly the same problems as AJAX.
Thanks very much for your article. It was really helpful to fix the problem. Keep up the good work :)
Great post on managing across several browsers....
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.
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".
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...
Rick, I totally disagree with you. I need *a lot* more time...
I didn't mean to be condescending - thanks for the follow up response. It is an interesting topic.
Steve: I didn't think you were, don't worry.
Do you always give out awards without telling the recipients?
:-)
Glad you like it.
Works like a charm - thanks!!
Pingback from Ajax Girl » Blog Archive » How to build a cross-browser history management system
Pingback from Dylan Schiemann » Blog Archive » browser history: a pot meets kettle story
Pingback from Javascript News » Blog Archive » How to build a cross-browser history management system
Pingback from napyfab:blog» Blog Archive » links for 2007-09-14
Pingback from Deficiencias en algunos exploradores - Incubaweb 2.0 Bit??cora del Software, Web 2.0, Beta, Windows, Linux, Mac OS X, Open Source, ....
Pingback from 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
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!
Pingback from David Cumps » String Concatenation vs Memory Allocation
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
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!
Pingback from links for 2007-09-17 by The Third Part
When is support for v1.0.61025 of the extensions going to be available. Check out Codeplex and please respond to inquiries!!
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...
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.
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.
im getting sys.undefined only in firefox and not in ie can u help me out with this
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?
@Dave : The futur of the internet is not based on IE 5.5 -_-
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.
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.
Brett, you're right, I'm an idiot and I've updated the post.
Venk: you probably introduced a syntax error while patching the file. Please double-check.
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.
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.
"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.
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!
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!
The attribute has to be written *before* the tag.
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...
Shanmuganathan
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.
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
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.
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.
You should do this to a controller :)
Ah, Dave, you must be reading my mind...
Here's one more, when you know the variable
exists, but the value is undefined.
if (undefined != var)
[Tips][記事リンク](ASP.NET)ブラウザの履歴管理
[Tips][記事リンク](ASP.NET)ブラウザ種類別の履歴管理表
How to create aspx pages Dynamically?
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.
Ernie
PKINTAL: this is off-topic. Please send me mail through the contact form of this blog and I'll give you an answer offline.
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.
Pingback from Techy News Blog » OpenAjax InteropFest 1.0: Microsoft's entry
Pingback from Microsoft News Aggregator » OpenAjax InteropFest 1.0: Microsoft's entry
Pingback from OpenAjax InteropFest 1.0: Microsoft's entry : Celebrity News Corner
Recently Bertrand posted OpenAjax InteropFest 1.0: Microsoft's entry . The OpenAjax's InteropFest 's
Pingback from MSDN Blog Postings » Microsoft Passes the OpenAjax InteropFest Test
Recently Bertrand posted OpenAjax InteropFest 1.0: Microsoft's entry . The OpenAjax's InteropFest
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.
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.
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.
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.
Kirti
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. ;)
Pingback from Missing Features » Solving the Top AJAX Usability Problem: The Back Button
This question comes up from time to time , to time . If you understand how redirects work, then you also
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)
Thanks. This solution helped me a lot.
Pingback from Techy News Blog » Getting AJAX defined…
Pingback from MSDN Blog Postings » Getting AJAX defined...
Pingback from voip » Getting AJAX defined...
Pingback from Fine Art » The format for JavaScript doc comments - Tales from the Evil Empire
Are you referring to parameter currying? similar to passing in a hash (more or less)?
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).
Christian: not quite currying, but passing a hash, yes.
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.
Via Christopher Steen : Microsoft Passes the OpenAjax InteropFest Test Recently Bertrand posted OpenAjax
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 :)
Dev Girl: please contact me through the contact form of this blog, and I'll have a look.
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?
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.
Actually I just figured it out. Thanks for the quick response. It looks great!!
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
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.
Are all 70 photos .jpg files?
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.
Phil: yes, the handler only takes jpg files.
Pingback from The ServerSide Interoperability Blog » Sample of Ajax interop
Thanks, I converted all to Jpeg and they all show up now
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.
<g>, thanks Josh! Maybe because you go writing comments you should figure out how to read a post.
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.
Morten: you can get Intellisense on those files by including an explicit script reference to the page.
Коллеги Брэд и Бертранд написали о возможности использования Microsoft Ajax для работы с сообщениями OpenAjax.
Коллеги Брэд и Бертранд написали о возможности использования Microsoft Ajax для работы с сообщениями
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..
Thank for this, scanpst did the job for my OST this morning
wow, that is big news!
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.
I need .NET framework sample code
Thank you - you just saved my day :-)
Worked great!
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
?!?
A little more explaintion of the fix for black background on thumbnails please tried
but did not change anything
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.
M Anderson: thanks, but this is a known issue (and the project moved to Codeplex long ago):
www.codeplex.com/.../View.aspx
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
So what is the best way to reject scripts in input? anyone please...
Well, I prefer to have all the information in a single place. Thanks for the comment.
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.
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)
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.
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
Should I stay or should I go … with Visual Studio 2005 or 2008 is the question in this particular case
Is the bin directory directly below the IIS application folder?
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.
Congrat!
Keep up the good work.
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
man, you really do not belive yourself, pls stop wasting your time...
Almost a year ago Microsoft joins the OpenAjax Alliance , then a month ago, Microsoft Passes the OpenAjax
can anyone tell me whr i can find abt noise generated from tidal plants...any link or smthing...
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.
Pingback from MSDN Blog Postings » Microsoft Joins the OpenAjax steering committee
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";
default:
adminLogin.DestinationPageUrl = "~/admin/Default.aspx";
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:
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):
Response.Redirect("Login.aspx?p=a", false);
lblErrMsg.Text = "";
//...
protected void btnAdmin_Click(object sender, EventArgs e) {
Response.Redirect("Default.aspx", false);
It works but I get a strange javascript error: Unspecified error.
Can anyone help me? Thank you!
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?
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.
Gabe: the problem is that you can't get rid of it, so you might as well make it do something useful.
En JavaScript, il y a 2 grandes façons de faire une classe : le mode prototype et le mode closure . Méthode
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.
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.
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.
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 :-)
Errr, Morten, which version of IE are you using? I'm getting the error message in a dialog and it doesn't crash.
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.
John
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.
Erjan
Roy,
Good catch point learnt today.Thanks for sharing.
Prashant
prashantjalasutram.blogspot.com
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.
Alexandru: what's wrong with the code layout? I viewed the post under IE7, Firefox, Opera and Safari w/o a problem.
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!
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
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
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.
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????
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 :(
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.
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?
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.
Pingback from Nathanael Boehm - UI/UX designer & developer, Canberra
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.
Thanks a lot man, this solution worked fine on my website.
that is quite obtrusive! try the jquery way
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.
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!
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
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.
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
I'm pretty sure Safari should work. Can you contact me through the contact form and send me a simple repro?
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?
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
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).
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).
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.
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!
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.
It should be no surprise that JScript Documentation Comments power much of what you see in JScript IntelliSense
摘要
本期共有8篇文章: Refactor!forASP.NETBeta发布
如何解决ASP.NETAjax1.0中跨域名frame访问时出现的accessdenied问题...
yep its very good
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.
> "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
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.
It was awesome, but it ended way to quickly. I wish there were more levels.
Don't we all?
Has anyone got a good example of the Futures implementation?
Documentation is a little scarce to say the least!
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
Darksaint
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."
Darksaint: please verify that the IIS application is configured to use 2.0.
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.
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???
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.
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.
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.
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?
Rob: I was just kidding. Sorry, I have no clue why Applets would behave any differently.
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.
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.
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*
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?
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 :)
Here is a simple solution that supports multiple signatures differentiated by types, and it has a low overhead as well..
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
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.
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.
Pingback from napyfab:blog» Blog Archive » links for 2007-11-17
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?
I was reading this post by Bertrand Le Roy . And in many respects I agree with Bertrand and also with
Crile: yes, the fix is in 3.5 already.
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?
Chetana
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.
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
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.
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???
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?
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!
weird error..
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
Any Ideas ?
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?
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.
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....
The following items are covered XSLT JavaScript SQL CSS/XHTML Managed code (?) Tools & resources
Dude you just don't know how to code in a dynamic language if you think == is an error. pfft.
Cab: what's the error?
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.
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....
Matt, you probably didn't set the HandlerUrl and/or Path properties on the control (see above comments).
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
Matt: I'm suspecting that you have a .jpg file in that directory that is not a valid jpeg.
You try set backgroud-color, because this property is not set the controls under div can be accessed.
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.
Julien: the GH controllers work fine in Rock Band, but the Rock Band guitar does not work in Guitar Hero.
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.
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.
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.
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.
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.
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.
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.
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.
I spent 10 seconds on Google and found this article. Thanks for the heads up.
Hello all,
I've tried it and it works ! Thanks a lot
Thanks, Matt.
这周末不休息,差点忘了这件事……本期共有7篇文章: JavaScript文档注释的格式
VisualStudioOrcas中对JavaScript智能感知的支持
在ASP....
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 !
Nicholas: this may be caused by client-side caching. Did you check if the server gets hit at all by attaching a debugger?
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"){
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;
yPos += tempEl.offsetTop;
return yPos;
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.
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.
Nice article. Definately clears some things. I'll use High(or photoshop) for my thumbnails.
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
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
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)
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).
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?
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.
"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.
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.
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.
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.
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.
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.
Ok, ok, it took us a little longer than we expected, but we finally got the ASP.NET 3.5 Extension Preview
Pingback from MSDN Blog Postings » The Wait is Over: ASP.NET 3.5 Extensions Preview Posted
La ASP.NET 3.5 Extensions Preview est disponible sur le site asp.net. Téléchargez-la vite. Consultez
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.
Lionel, that is very good info. Thanks a lot.
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 ?
Roi: that is actually a fairly typical scenario that works well with async. Just disable the relevant pieces of UI during the callback.
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.
Rick: thanks for the info! Cheers!
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! :)
Your my hero, thanks for writing this.
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
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. ;)
WebSite.WebCameraInfo.prototype = {
ZoomLevel: 11,
....
Hi guys. Does any have any ideas how to comment prototype getter like this?
Jim: that's not technically a getter, but you can document it from the constructor using a field tag.
Ah, but they'd want it PREINSTALLED! Make Opera the DEFAULT Browser, non?
Good one...
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 :) )
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.
All the stuff provided by you, specially the links, are very helpful and interesting. They really helped me a lot.
Keep it up...
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.
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?
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.
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)
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.
Link Listing - January 4, 2008
the video is very small.
how can i enlarge it with good resolution?
Zahi: there is a link right under the embedded video that leads to the same video in a larger size.
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.
First the disclaimers/warnings. The following uses preview technology. It requires VS2008 and the ASP
who takes these tests? they r lame i already kno that i am sooo not a nerd...
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.
Thanks for the report. Please file a bug on CodePlex.
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!!
errr... slight modification to work with top-level menu items:
if (hideOnMenu != null && bool.Parse(hideOnMenu))
if (parent != null) parent.ChildItems.Remove(e.Item);
else (sender as Menu).Items.Remove(e.Item);
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?
Pedro: there are config entries in the handler as wel as forum posts and bugs on the CodePlex site that should get you started.
do u have any working example of a form using div layer and overlapping a select box.
ok, I think I've gone a little askew somewhere along the lines here. First I installed ASP.Net ajax
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
Yes, Julien, you're absolutely right.
Congratulations!
It works very well at first attempt.
Thanks a lot!
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.
Pingback from rascunho » Blog Archive » links for 2008-01-17
译给自己看
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)
Guido: right, there is the assumption here that the variable was declared.
>> 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).
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.
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.
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.
Thanks joe, that explains it.
Alex, do you have a specific example of such an inconsistency?
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.
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.
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. :-)
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
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???
How about a plastic Bathtub
Nice one!
It's fascinating to observe the childrens view of the world.
AH AH Excellent :-)
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?
Pingback from rascunho » Blog Archive » links for 2008-01-21
Pingback from Wöchentliche Rundablage: .NET 3.5, WPF, LINQ, Tests, System.AddIn, SubSonic, Sandcastle | Code-Inside Blog
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
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 :)
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.
Mike: why don't you put the handler in the images folder?
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 ;)
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. ;-)
Welcome to Dot net slackers :D
Welcome to the Club of Slackers.
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.
Welcome from me too ;) Great to have you on the boat!
That is great
Enjoy your daughters childhood, it goes way to fast.
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?!!
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.
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" />');
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:
iframeShim.style.visibility = 'hidden';
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...
摘要好久没写了,不为自己找借口,不管怎样,还是要继续捡起来。本期共有9篇文章:C#中的不可变类型使用System.Drawing生成缩略图时应采用什么样的InterpolationMode...
Zend doesn't even publish the price for the platform, just a blank "contact sales" link. Lame!
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.
Bertrand Le Roy had a post over the weekend (actually Friday, but I missed it) about the new IE8 meta
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".
Is the Field tag still part of JS intellisense? I can't find any documentation on it anywhere.
It should be.
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.
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.
Pingback from 4 ASP.NET AJAX JavaScript UI methods you should learn | Encosia
Working Around cross domain frame issue (ASP.NET Ajax 1.0)
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!
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
awesome guitar
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.
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.
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.
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!
Marcos: www.codeplex.com/.../View.aspx
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).
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.
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?
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.
Pingback from Brennan’s Blog » Blog Archive » Intellisense for jQuery in Visual Studio 2008
I'm with you up to the screenshot. But are you at liberty to disclose how you do the analysis of the image?
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...
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.
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?
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.
Ah, the Web browser version of DLL Hell. Sometimes I wonder if we will ever learn.
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.
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.
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...
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!
Where are you getting that message? Is it possible that someone disabled JavaScript on your browser?
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.
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.
Pingback from A JavaScript Stack Trace in ASP.NET AJAX « See Joel Program
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?
Something self-written. We wrote a .NET console app that grabs the screenshot and finds rectangles of a given color.
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)};
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 */ }
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.
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.
Robert
Good for you, Parag, but the name's Bertrand, not Roy.
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 ;-) ...
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)
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;">
Pingback from Wöchentliche Rundablage: ASP.NET, ASP.NET 3.5, ASP.NET MVC, Geocoding, WPF, WF, CardSpace, IIS7, LINQ, XNA… | Code-Inside Blog
Aptana has a cool Eclipse-based IDE for writing AJAX-y websites. It's got built-in support, via plugins,
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.
does the "enable history" on script manager exist in asp.net 2.0??
No.
This is the first time i have seen Eric's blog. Good site.
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
same with my comodore64 i am sooooooo upset i cry
Pingback from JS IntelliSense with Namespaces in VS 2008 at Coderoni.com
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.
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.
hello
i am like hack login admin panel in asp.net web applection !
Pingback from Tonya’s Teaching Blog » Blog Archive » Caps Lock?
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"
OK, so what don't you like about the Wii Play?
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.
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.
Pingback from Brennan’s Blog » Blog Archive » JavaScript Browser for Visual Studio 2008
"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.
I just added weblogs.asp.net/the&dark&and&mysterious&side&of&bleroy -- wow!
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.
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
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!
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.
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!
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?
That's known. I don't know of a workaround.
I was hoping that was not the case. :(
Thanks for the quick response.
[Warning: definitely not a technical post] Those 3 guys that normally read my blog (yes, I believe that
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.
Jeff, please contact me through the contact form, and I'll look into it.
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!
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.
Siempre oí hablar del infierno de las DLL pero cuando hablamos de desarrollos web no nos podemos olvidar
Iframe + AjaxControlToolkit v1 + IE = Access Denied Cross Domain Siempre oí hablar del infierno de las
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'>
@Brock: I don't think that's handled in 2008, no.
I'm also getting the same error as Ev.
Any progress on that one? This is the only Google result for that error message.
I want to change background color of thumbnail. I changed the following code:
However, the color remains blank.
Please help. Thanks.
@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!
Pablo, your fix works like a champ!
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.
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
ASP.NET AJAX Documentation Update, Videos and Cool Articles
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.
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.
Cathy: that's this issue:
The bug is not fixed in the current release but the discussion on it contains a fix.
what about:
if (!someObject)
is this true when someObject is null OR undefined, or just null?
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
@cis: sure, !someObject will be true for undefined and null.
I am really happy with how Json.NET 2.0 and LINQ to JSON is turning out. This release offers big improvements
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?
Lou
@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.
I've said some time ago that I personally would have preferred if IE8 was in standard mode by default
Passing a JSON object to a WCF service with jQuery
i tnink who all said these are all goat....its nothing seems me to be funny
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
@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
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.
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
@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).
@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.
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
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.
@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.
The page that the updates links to points you to another download for a completely different feature, not for sitemaps.
Wow, thanks a lot it really works!
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
@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.
Something called "degradable" AJAX?
@Andrei: yes. There are many ways you can achieve that, but UpdatePanel is an easy one.
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)???
@JA: UpdatePanel (as should be clear from the first sentence in the post ;)
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.
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.
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.
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.
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?
Bertrand Le Roy has an interesting post called " a case for partial rendering ." I started to comment
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.
@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.
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..
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();
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.
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...
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 )
@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...
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.
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.
@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.
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.
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?
sridhar.
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 :)
Stefan
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.
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.
Pingback from Construct Web » IE, the Hell That Thou Hast Wrought
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();
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).
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 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!
@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.
@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.
Given this simple Employee class: public class Employee { public int ID...
Given this simple Employee class: public class Employee { public int ID { get ; set ; } public string
Could it be that this doesn't work in IE8 beta? Thanks!
@rudgr: can you be a little more specific? What problem are you experiencing?
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
@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.
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
@Michael: I have no idea. You should check that with your hoster. Let me know what you find.
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
@Michael: are the broken images consistently the same images? Are they jpeg images? Is there a public url where I could have a look?
Has this been fixed with 3.5?
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.
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
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.
@Naor: err, sure, as does the ASP.NET menu, the popup control in the Ajax Control Toolkit and many, many other similar components.
@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.
@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.
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
So after using IE8 for a while now, there are a few things that are useful for people to keep in mind. 
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
I was alo facing the same issue with Redirection but Bertrand Le Roy's article solved it. Works fine now.
Thanks, very helpfull.
@Raghavendra: you should contact support.
It's Time for a Change -- We need Immutable Types
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.
This is awesome!
Seems pretty neat to me, I mean I always thought php was born to be with apache, I guess thats gonna change very soon
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."
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.
@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?
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.
@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".
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
Check that you configured the directory where the handler is as a web application.
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
@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.
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
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.
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
Excellent article and the update section helped here with regard to maximum number of worker processes with a value above 1
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)
Venkatesan J
Prince of Pammal
Is possible to change the backcolor to a thumb image?
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.
@Kid: www.codeplex.com/.../View.aspx
Where can i download this song?!
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
I'll try to insert the propose fix but doesn't resolve the problem!
create comments by php
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!
Hi egainey,
Can you give us more information ? :)
You can mail me at : fabien.molinet[you know what]gmail.com
I'll help you.
beware that if your PST file is over 2GB, this may not work.
So I tend to describe a lot of issues here, but we had some really great conversation in our blog chat. 
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.
Thanks This was very useful to me
CHECK YOUR RECIEVER IS IN FRONT OF THE TV!
YOU KNOW? THE LONG BLACK RECTANGLE THING THAT RECIVES THE WII REMOTE SIGNALS?
YEAH THAT.
Nice. I learned a great thing today.
Thanx
@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.
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?
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.
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.
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
How common is it for script code to do different things based on the type of the exception anyway?
@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?
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.
@Suman: what's your point? Are you saying that it's not useful to handle exceptions??
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.
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
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?
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.
@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.
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
@Wil: check that the server has ASP.NET 2.0 or higher installed, then check the web.config file.
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.
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.
i have tried that i even put new batteries in and nothing seems to work but my brothers mote still works
I think we are findign the browsers a big hurdle for our ajax developments. we will check it out. Thanks!
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.
Earlier today we shipped a public beta of our upcoming .NET 3.5 SP1 and VS 2008 SP1 releases.  These
Pingback from NZEYIMANA Emery Fabrice » Invalid JSON from NET - DateTime
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?
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.
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?
Deepak V
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.
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...
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.....
Excellent Article,
Note:The Path should be relative
I have the following errors in release mode :
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 ?
I'm facing the exact same problem as Hiruma...
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")
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.
@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.
@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.
@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.
@Hiruma: Thomas had incorrectly patched his file if I remember correctly. Please double-check.
@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.
@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.
@Jeff: difficult to say without looking at the server. Drop me a mail through the contact form and I'll have a look.
@linukalex: difficult to say without seeing the code. Feel free to drop me e-mail through the contact form.
From the hint to Lindsey on calculating the angle of the wake: Why is the wave_speed/duck_speed = 1/3? Thanks.
Den senaste tiden har en mängd sajter blivit infekterade av en SQL Injection-attack som använder SQL
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 ...
Give me the url of your page and I'll take a look.
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.
If I replace my ScriptPath by the ScriptReference it works !
so the files downloaded are corrupted ?
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"?
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!
与当今构建的绝大多数Web应用程序所采用的开发模式相比,AJAX对Web解决方案架构师而言意味着一种模式转变。它立足于一些新的原则和规则来解释基于Web的系统的行为,并要求采用一些新的算...
Having talked about the pain of capturing image snapshots , someone mentioned Cropper and its plug-in
It works like a charm...Dude your a genious. Thanks alot.
The motion detection is fine, it's the games that can't use it properly.
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.
ASP.NET Ajax 3.5 SP1 contains a new feature that enables the application developer to combine scripts
Awesome control...
your all stupid
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?
@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).
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?
@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.
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.
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:
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
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?
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.
@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.
@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.
@Brian: I don't know much about how this works in classic ASP. You should probably contact support on this one.
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);
@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].
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.
@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.
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.
Expensive indeed. There are quite a few free ones out there.
It would be a great help if you can comment on my issues.
Ashish
Hello Bertrand !
Any idea of a CTP release date ??? ;)
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!!
i checked it once again and MetaDataExtractr.dl is in this directory;/
@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.
@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.
@Bartek: is the bin directory in a directory that is configured in IIS as a web application?
I assured that I put MetaDataExtractr.dll into the appropriate directory.;/
@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.
yeah - this is a crap post - what about the free ones?
@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.
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.
Kevin
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.
Very nice article: it is more and more requested to work with image re-sizing.
Thanks and regards,
Davide
hi i am trainee programmer in comm-it india(p) Ltd at new Delhi-110017.your articles is very helpfullto me about postback event.
nice article.
You could also generate thumbnails using the GD-Sharp .NET wrapper for the GD Library.
@skhan : Tell me more about the free ones. I am interested in at least one.
@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).
my wiimote isnt working even though i adjust the "sensor" and the hand wont even show . the games are working fine though!
There's a great jquery plugin that automates this.
plugins.jquery.com/.../bgiframe
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?
@Dan: I updated the link. Thanks for the heads up.
excellent utility
Has anyone been able to get this into a DNN Module? Can I use this in DNN?
@Ty: I never tried, but if you use it as a user control, I don't see why not.
Ha, the SEO rapper, very funny.
After setting session varibales, I am redirecting page. Its working on local host but its not working on server.
sweet!!
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
@Stif: if you've tried all the workarounds in the post and it still doesn't work, I would advise that you contact support.
Show some realtime Example of This Roadmap implementation. so, that it can be easy to analyse how it is
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">
<asp:ScriptReference Name="MicrosoftAjax.js"S criptMode="Auto" Path="../JavaScript/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js"/>
</asp:ScriptManager>
@Oleg: check the path in the renedered HTML against the real location of the script and adjust your Path attribute accordingly.
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.
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!
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.
@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).
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?
@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.
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 ?
@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?
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
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.
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?
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?
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.
@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).
@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.
@Ray: please contact me offline (bleroy at microsoft).
@Rick: Jeff tells me this is fixed in SP1. Couldn't get it to work on SP1 Beta 1 though. Still investigating.
forget about the pcs and macs just see iphone. microsoft sucks at everything...
@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. :)
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.
@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.
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,
@Peter: feel free to contact me at bleroy at microsoft to tell me what needs to be cleaned.
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).
@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.
Not exactly the same league, but it's free:
teethgrinder.co.uk/open-flash-chart
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?
@Richard: Yes :)
Thanks Bertrand, I forgot that the fix was only for IE.
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
@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.
@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.
@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?
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.
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!
Max - thank you for your comment! works great :)
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!
but since a Menu control doesn't understand the imageURL property, how do you get it to display the image?
@Omego2K: err, the menu item does: msdn.microsoft.com/.../system.web.ui.webcontrols.menuitem.imageurl.aspx
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....
@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.
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
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.
Good point Richard.
how can i get microsoft.samples.Alert?
Is there any way to display the folders in date order and not alphabetically
@arunpulikkan: follow one of the two links in the post to the CodePlex project. http://www.codeplex.com/alerts
@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.
Any plans of sample website?
Eventually, yes, but we wanted to get the bits into your hands as early as possible.
Microsoft ASP.NET Ajax is Spam.
jQuery is Good.
Can't wait to start playing with this!!
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!
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!
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.
Will it be compatible with ASP.NET MVC?
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.
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.
@NirvanaViper - Apparently you have no clue what spam is. For a good example, see your last comment...LMAO.
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?
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
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.
@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?
@Andrey: There's a typo in the ReadMe.txt file. The actual class name is Sys.Preview.UI.DataView.
@Bertrand Le Roy: yes, I add ScriptManager on the page and add reference to script:
<asp:ScriptManager ID="scriptManager" runat="server">
<asp:ScriptReference Path="MicrosoftAjaxTemplates.debug.js" NotifyScriptLoaded="true" />
@Jason: good catch, thanks. I'm updating the readme.
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.
Sys.ApplicationLoadEventArgs.cast = function(obj)
{///<returns type="Sys.ApplicationLoadEventArgs"/>
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.
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.
@Jason: Thanks! The error is not occurs again.
But I get only {{name}} and {{description}} titles on the page, not data from someArray.
@Andrey: you can send me your code at bleroy at microsoft, and I'll have a look.
@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.
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.
@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.
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>
else
<span>Nothing :(</span>
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. :)
Drew
great idea!
wow..i think it's a great way.more simple and less code:-)
@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.
thanks, just what I was looking for.
Great tip! Simple and effective.
Yeah. Thanx, really cool.
Wow.
Very good idea we can implement that in othere areas also like gridview e.t.c
#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.
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,
@Attila: right, thanks, I fixed the post.
@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.
I wrote a post about how to do Master-Datails view with the DataView. I thought I'd put in a manual trackback.
-Phani
thanks for the javascript opera tick trick :)
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.
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...
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.
@Steve: yes on both accounts.
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...
@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.
cool! reminds me of those techniques from the classic asp style. =)
Mine problem is all on godaddy when the default.aspx hit this line of code it stops
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.
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.
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...)
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 !!
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.
@rblaettler: you should probably ask that question on the Live forums: forums.microsoft.com/.../default.aspx
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.
That's if you use regions...
Duh...
@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...)
I never heard of it.
But looks like its ALT-I and not CTRL-I for my configuration (vb key mapping).
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??
@Alex: The scenario you describe can be achieved by maintaining a simple queue of tasks.
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.
@Alex: what are you seeing when you try it? How does it fail? Are you getting an error message?
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;
FormsAuthentication.RedirectFromLoginPage(txtEmail.Text, true);
reader.Close();
Default.MessageBox(this, "Your username have not been registered", "key1");
//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);
cmd.ExecuteScalar();
catch
{ }
finally
kon.Close();
Session.Remove("CALLEDFROM_SB");
Session["CALLEDFROM_SB"] = null;
Response.Redirect("Shopping_Bag.aspx", false);
Response.Redirect("Welcome.aspx", false);
catch (Exception ex)
Default.MessageBox(this, ex.Message + " : Failed to get data", "key1");
kon.Dispose();
The code look great!
Thanks, this little insight helped me solve a tough problem in ASP.NET when I was using a TypeConverter.
Brian
"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 }}" />
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!!
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.
I can try again and let you know shortly. Thanks for your help.
Microsoft ajax is spam!!!
jQuery is best!!!!!!!!
@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.
@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.
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.
@Alex: send me your repro at bleroy at microsoft and I'll have a look.
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!
I sent a zipped VB.NET sample project. Thanks a ton!
@gt1329a: yes, we are working on server integration of those features. Thanks for the feedback, this is very helpful.
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
@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.
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.
{ FormsAuthentication.RedirectFromLoginPage(txtEmail.Text, true);
}else
@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.
Good idea indeed!
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
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.
@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.
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?
@Bertrand: Awesome! Very very handy now that I understand how to use it. Thanks.
@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.
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.
@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.
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.
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
Or just install ColdFusion 8 FFS! Dropkick!
Hmmm... this page (dotnetslackers.com/.../Default.aspx) doesn't seem to load...
Thank you very much
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.
How about:
{ if some-expression }
{ /if }
or
{{ if some-expression }}
{{ /if }}
Thanks for the info. This is going right into my toolbox!
Great! Thanks for the mention. I am proud to say, I am part of the devilish team.
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.
@jgd12345: text nodes like those are not allowed anywhere in XHTML so that doesn't work.
yesterday when i go to open my mails from microsoft outlook express it giving error *.pst file is not personal pst file.
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 :)
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.
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 :)
@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.
Actually the above solution is working for Firefox not in IE.Please advice us.
@Cathrine: it was never broken on Firefox. Chances are you improperly patched the files.
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.
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.
FUCK NUMLOCK! Thank you for this post.
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 :)
This is going to be a nice feature. When can we see this ship?
@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.
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?
Dave OS
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...
^_^
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
Um yeah, i use the final version of safari, and i love it. its great.
@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.
@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."
Thanks. I've tried but to no avail. My skill set dos'nt include C# :(. Any idea where i can start?
@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;
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.
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?
It is interesting.
@JeffEsp: Are you using ListView or another data control?
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)...
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?
Robin
@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.
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...
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?
@Jimmy: sorry, I know nothing about XPIDL.
@Raj: Do you mean the browser's status bar? Is the browser version the same in both cases?
Thanks for your quick response..
Yes, Roy its the browser's status bar. The browser version is also same in both the cases.
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.
Can we download Visual Studio Express completely wihout paying.
@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...
@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?
@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
Very cool. Is this the feature described in Omars book?
I don't know. I haven't read this one.
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.
@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.
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
@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.
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.
Shail
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.
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.
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.
@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.
Hi, Could we have a static "parse" method added to all classes, in order for clients to be able to cast to type?
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?
you should try overlord. that's evil in a funny way.
Most of my projects are running using vs2005, so i really wish that it still can provide update on this version too.
@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.
@Raj: you could try to use www.asp.net/.../ConfirmButton.aspx instead.
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.
Hi, i am not supposed to use AJAX, any other way to solve this problem other than using ajax?
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?
@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?
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.
@mike: maybe do a global search on your whole hard drive for *.pst files?
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.
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?
@VR2: we're looking at ways to enable type hint comments in the next version of Visual Studio.
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!
@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).
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.
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.
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?
Oh dear God, thank you! :D
@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.
@Ryan: you're welcome, but please, you may call me Bertrand.
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!
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.
@Daniel: they want the template as a string, we want it as a DOM fragment. This leads to very different constraints and ideal solutions.
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 :-).
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.
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.
Khurram.
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.
@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.
@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.
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.
@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}.
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?
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.
@Bertrand: That being said then, what exactly is the difference between using this new composite script combining versus the toolkitscriptmanager?
@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.
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.
@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.
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?
@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.
Make it a string and use your own converter (or parser).
@iron9light: that's assuming you know what is supposed to be dates in the data structure. That is sometimes true but not always.
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...
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.
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.
The *best* place to get facts is fox news................................. LOL! i'm sorry, i couldn't help myself with that joke.
factcheck.org rocks.
FSM = Flying Spaghetti Monster?
@Gabe: yes, I was touched by His Noodly Appendage.
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 ;)
Im mad my vista got the blue screen from safari fuck safari
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.
@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.
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.
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.
@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.
Nice to know that IE 8 is catching up with Firefox. Firefox has had this search feature forever!
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:
<span sys:script="if (Photo) {" />
<img sys:src="{{ 'Images/' + Photo }}"
alt="{{ FirstName + ' ' + LastName }}" />
<span sys:script="}" />
@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.
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)
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!
@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.
@Elijah: not it. It's an actual technically false statement.
Just delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Media Device Manager\Plugins\SP tree in the registry, that makes the error go away!
@M: Vista doesn't let me do this. Thanks for the idea though.
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 :<
System.TypeLoadException: Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
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.
@M: even after that, it doesn't work for me. Maybe I need a reboot...
@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.
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.
Thanks, very helpful
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.
@noel: spaces shouldn't be a problem. If you can send me a simple repro at bleroy at microsoft I'll have a look.
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";
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 name="Closed" type="Number" integer="true" mayBeNull="false">
/// The connection is closed.
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.
@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.
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.
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.
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">
<asp:ScriptReference Name="MicrosoftAjax.js" ScriptMode="Auto" Path="MicrosoftAjaxLibrary/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js" />
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
@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.
@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.
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.
The "Evil Empire" is turning good? Cool :D
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.
Great stuff, hopefully we can look forward to some great plugins from you guys now.
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
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. :-}
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?
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 ..
What will happen to the parts of current MS librairies that overlap with jQuery such as the ajax control toolkit animation framework ?
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 ?
Thanks a lot! Jquery is the most outstanding javascript framework i have ever used. This is really really exciting. Jquery rocks!
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.
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>
@Michael: hence the "finally" in the post. <g>. Obviously, *you* are not a fanboy ;)
I agree. Braid is not a contender for my limited gaming time.
Bring on an update for Portal!
@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.
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.
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.
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. ;)
Dude,
This is really excellent news. jQuery is indeed a awesome library. Where do we find more documentation on this integration?
Yep, love it. Good choice (of framework and strategic).
it's so excellent,jquery is a cool.i hope using in asp.net is firendly.
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!
Thank-you!!! This calls for a celebration, where can I send the beer?
@Adam: I'll be at PDC. Will you?
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...
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!
@Joe: we're not abandoning anything.
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.
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 ? :-)
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?
@Christoph: thanks. minification should really be done as part of the build process and not at runtime. It simply is too heavy.
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...
@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.
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?
Have to add.... It doesn't work on remote server, when you use this technique in .php file. With .htm it does work.
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?
@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.
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 :-)
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 :)
@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.
Great article! I'm looking forward to using this. When will the next version be out? Thanks.
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.
Nice article , but why is the screendumps taken with firefox ? :)
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.
Betrand, your article is exceptionally well-written and well-organized. Thank you!
@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.
@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.
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() )
{[...]}
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.
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
@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
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
this message out this file is not a personal folder and cant open the pst file
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
Jonas
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?
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.
Nevermind. I'm an idiot.
@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.
@gramic: blogged... weblogs.asp.net/.../hack-using-live-bindings-outside-templates.aspx
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: 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...
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
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
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>
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.
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. ;)
thanks for the article.i am digesting it! ;)
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.
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.
@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.
@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.
Thanks a lot for this neat little post. Helped me fix the bug like a charm...
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!
'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.
@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.
I am not able to find scanpst.exe
can you please help me
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.
Merci boudin ;P
@Ross: sorry for sounding pedantic. It seems only natural that Martin would step in to defend his work.
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?
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?
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.
@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
@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 ;)
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.
@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.
I like the bar picture of this blog so much . Really very impress!
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.
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.
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
Amit
@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.
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"
}, ...]
@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.
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.
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?
@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 :)
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"/>
@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.
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.
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;
return [a, b];
Can't wait to try that one, could never get it to work flawlessly with the previous 'hacks' :)
@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.
That's a great news.
Some instructions on how to get it working would be nice. ;-)
Previous info is scattered around with varying techniques that never seemed to work.....
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.
Nice... I love how you used FF rather than IE :)
Someone has bothered to do a full post...
blogs.msdn.com/.../rich-intellisense-for-jquery.aspx
the technology really going fast beyond my imagination:-(
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!
not bad, but any idea when we might see a 5.0?
@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.
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?
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
Great talk and thanks for answering all my questions at the end there Bertrand. ;)
>> 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.
@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.
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
Thank you Bertrand for sharing!
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?!
This did not work for me
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
@Steve: if you're using the min file, you need to rename the vsdoc file too, to jquery-1.2.6.min-vsdoc.js.
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.
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?
@Bruno: you should contact Sybase's support (Visual Studio shouldn't have anything to do with it).
@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.
Looks like
plugins.jquery.com/.../jquerytemplate
has had this for some time now.
Is this another invention of the wheel ?
@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.
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
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?
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
@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.
@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.
@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
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?
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!
Thanks for this tip. It really nice
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).
Urgggh ... scratch that comment about VSTS, I actually needed to get onto SP1 first!
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 ...
@Angus: If you haven't already, check out this presentation by Jeff: channel9.msdn.com/.../TL48
Hi all
i want to develop a gadget how can i?
please help me in this regard.
thankksss in advance
asif iqbal
@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.
Your source code link is giving me a 404 error...
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?
hmmm... tried it a couple of times this morning, just tried it again and it works fine. Definitely weird. Thanks for the tutorial/code!
Great example! it would be nice to see this edit in place along with other behaviors as you said the autocomplete and the watermark
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.
Thanks for the info, particularly about controlling the name expando. Is _all_ of this documented in the MSDN documentation?
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.
@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. :)
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.
When this thing will be integrated into visual studio . Can we expect this in Visual Studio 2010 ?
@MisterFantastic: we're currently not planning on integrating this into VS.
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
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
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?
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
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..
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.
@Chuck: well, Microsoft *has* fixed this bug back in IE7.
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.
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.
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.
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.
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... :)
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.
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.
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?
but do you think Safari 3, is good to download on Windows.
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
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
@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.
@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.
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
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!
@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
@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.
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.
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
@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.
@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.
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
@Vaishali: 1.1? Wow. that's old. Sorry, this is compiled against 2.0.
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
@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.
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.
"What do you think?"
Great!
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.
great tutorial.. I've been loking for similar one around the web and finally succeeded here :) *as always*
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.
@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?
if you don't know English, it is very hard to become a great programmer.
My 2 cents.
Just as I was about to go jQuerying...!
Very helpful post, many thanks.
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
@screwed: you should contact support.
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.
@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.
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?
@Lindsay: That sounds very strange. Can you send me a simple repro at bleroy at microsoft?
have a 6320 ipac same problem
its really nice tutorial, thanks for it.
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.
Did you know you have two "Rule #4"'s? :)
Good writeup, stuff every beginning programmer should know but most never learn.
@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.
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.
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) .
Samir
@KCC & @Samir: please contact me at bleroy at microsoft and I'll try to help.
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).
@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.
@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!
Thanks for that info, that is what i was looking for.
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
@Jeff: no, nobody is working of that that I know of. How would you keep up with new releases though?
You are correct, that is my dilemma. I am now looking for a option. Thanks for your response!
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
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
@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.
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?
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.
@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.
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)
edit your hosts file.
%SystemRoot%\system32\drivers\hosts
127.0.0.1 localhost
#::1 localhost <- comment out here
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.
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?
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.
i want to define avariable that can use in the other forms in c# application please how,
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!
@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...
@babji.sunny: I'm not following you. The photo album already works with subfolders.
@Ahmed: this should be a good starting point: msdn.microsoft.com/.../ms178581.aspx
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.
@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...
@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.
@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.
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 ?
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!)
@bahamas4ever: you should use integrated security to avoid sticking passwords in config msdn.microsoft.com/.../ms254500.aspx
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.
Rshaikh
@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
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.
Here is my list of asp.net developoment books:
http://www.riaguy.com/books/
And I am also a big fan of jQuery :-)
@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.
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.
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.
its very nice to use....thanks dude....
?? 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
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
@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.
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?
@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.
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
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!
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" ?
@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.
how to change bgcolor of folder, I want white color..............
:((((((((((((((((((((
pls tell me how to change....pls
@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.
wow, awesome, never seen such a thing
Have you checked dojo behaviors:
api.dojotoolkit.org/.../dojo.behavior
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.
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
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
Ben Nolan's Javascript Behaviour.js
scrap.dasgenie.com/.../applying-behaviour-without-behaviour-js
bakery.cakephp.org/.../behaviour-js-helper
JQuery Live Query
plugins.jquery.com/.../livequery
DHerman Behavior.js (without "u")
www.ccs.neu.edu/.../behavior
-- MV
@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).
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.
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.
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!
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.
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.
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.
@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.
this issue made me crazy!, thanks for sharing.
I know that this is pretty old topic, but can't figure out how to cover windows media player object in similar way..
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
@romek: windows media player objects should be subject to the exact same fix.
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
@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 ;)
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"
@Simon: sure, hence the bold 'object' in the post.
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
@George: you probably didn't upload the dll into the bin folder of the application.
Hi, thanks for the quick response, but yes, I have uploaded the bin file to the application. Any other ideas?
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)
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!!
Do you have a VB.NET Version?
@Tango: no.
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.
some additional information... the version of the dll I am using is 2.2.2.41745. Thanks - George
@George: you can use the album as a user control and set its path property.
Hi great job. Working fine on mine. Just wondering if it is possible to have image titles or description added.
@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.
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');
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.
With Microsoft adopting jQuery would it not be easier to use the :odd filter to style the rows?
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.
@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.
@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.
@Rich: What if the alternate coloring was a user preference? Then what?
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.
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.
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.
@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.
@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.
@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.
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?
@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.
@Buzz: I apologize about the delay. We'll try to get a new release out as soon as we can.
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: 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.
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.
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.
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/
@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.
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).
@Keith: yes, nested templates are an important feature, which we're handling fine.
Yes super.
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..
Thats really valuable news. Thanks for the sharin the info.
Thanks & regards,
Thanigainathan.S
@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.
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?
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.
Awesome! I love jQuery. I have been using it to implement some new features in the AjaxDataControls V2.
@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.
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
This is great by the way, but it doesn't add the js file specified by FrameworkPath into the CompositeScripts...?
@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.
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.
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..
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.
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?
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.
@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.
@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.
@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.
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!
@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.
Thanks Bertrand. I appreciate the feedback.
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?
I'll be glad to have a cross broswer version,
Best Regards,
Moshe Kaplan. RockeTier
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?
@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?
"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.
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.
@Rick: please read the post. It addresses precisely your problem. What you'll probably want to use is RedirectFromLoginPage.
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
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?
@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.
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?
@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?
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?
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
2. I also want to use session variable before Response.Redirect
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
@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.
@Bhushan: it's pretty much impossible to tell without knowing anything about your code.
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:
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 :( :(
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: "<%=" and "%>". 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
@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.
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
@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.
it doesnt work for me if i put it in datalist
Thanks very much. Bertrand Le Roy. I will also do some reading from the best parctice.
@Dan: and you can use CTRL+SHIFT+I to start searching from the bottom
Really worthful article.
It's really worked for me.
I am very much tahnkful to u as it saved my job.
I'm all for checking out preview 4!. Great work.
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?
@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...
This is great. I'm excited about this!
Excellent post! thanks
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.
@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.
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.
I didn't get what is the role of sys-key in the declarative markup. Is it some kind of global variable or what.
@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.
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
Daniel
P.S. Please write about your experience at getsatisfaction.com/openzoom
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
those links point to IIS 7 patches? is that right ? i would have thought these would have been for the CLR or something similar?
Yes, these are the right patches. I know the titles are a little off, but these patches do contain the menu fix.
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
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
how this is different from JQuery based on the performance ?
Thanks ,
Thani
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
Will this fix eventually make it to a windows update ?
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.
@Thanigainathan: well, jQuery does none of that so it's a tough question to answer...
@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.
Just a quick question. This patch is backward compatible for IE7 and IE6 correct?
Our sites are pre-compiled will the sites have to be re-pre-compiled after we apply the patch?
Tom B
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
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.
@Andrew: it needs to be "\/Date(1198908717056)\/", not "/Date(1198908717056)/". Then calling (new Sys.Serialization.JavaScriptSerializer()).deserialize will convert it to a date object.
@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.
i will use it
@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)\/"'.
@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:-
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".
@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.
@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.
@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.
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
@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.
@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.
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.
@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?
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.
@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
It works perfectly. thanks
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.
@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
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...
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?
For advanced chart, check out <a href="http://chart.inetsoft.com">style chart</a>. It's also free.
Is there any way to get this anymore? We are still using .net 2.0 so I can't use the futures implementation.
@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.
@Karen: follow the link at the end of the post... Let me paste that here for you...
weblogs.asp.net/.../432188.ashx
"We are exploring including a more elaborate editor that includes IntelliSense."
Is that an april fools joke?
@Mike: I don't do April fools jokes by company policy: weblogs.asp.net/.../396731.aspx
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... ;)
@Joel: I guess now that it's April 2nd, I can reveal that yesterday was in fact April 1st. :)
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
@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.
@Bertrand,
connect.microsoft.com/.../feedback works... until you login to Windows Live, after a login it breaks. Thanks anyway.
@vkelman: I can't reproduce that problem. You can report it the the Connect team on this page: connect.microsoft.com/.../emailsupport.aspx
Worked great. I think it's funny that microsoft didn't test their program and controls with their new ie release.
@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.
Thanks! That was helpful.
LOL...at least you were able to trick someone..the poor fool.
"and I might get fired for this post" was a dead giveaway!
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.
@Matt: apparently you didn't have SP1 installed on those machines. Is that correct?
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 ???
@Armando: please check you have 3.5 SP1 installed.
Please make sure that 2.0 SP2 is installed on the machine.
If you have more issues, you can contact hongli at Microsoft.
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.
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.
It's not work for me.. )-;
?????????????????????????
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.
<reset> element:
lists.whatwg.org/.../008777.html
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.
You're not the only one who wants it:
www.mail-archive.com/.../msg03931.html :)
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
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)
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.
@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.
how put paging in the photo thumbnails page..
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.
@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...
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 ;)
@Nick: actually I do: "Ajax templates *and data*" (emphasis added). The client-side support for ADO.NET data services is pretty awesome too.
I prefer less work. I changed to a WCF service and it works great. Can't wait to dig deeper into this stuff...
lol. didn't see the date in my rss reader. That was fun.
it is not working
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.
@sakhti: sorry to hear that, but what exactly is not working, and how?
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.
-Damien
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 :)
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
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?
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
@Jeff, right, but if you have no control over the main stylesheet, that doesn't work.
@Shankar: no need to change the code, just put the handler in that Album folder.
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.
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).
@Alex: you forgot to copy the alert/displayalert.htm file to your site.
@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.
Will check it today.
Cool!
I am looking for jQuery callout plugin. Something like Validator callout from AJAX control toolkit. Any ideas ?
This tool is so cool, can't wait for more wizards!
Having same problem. Using redirect ("xxx.aspx", false), but sometimes Im loosing session value on A HREF link.
How is it possible?
thx
@Dima: could it be a timeout?
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.
@Dima: let's follow-up offline. You can send me mail at bleroy at microsoft.
I've referenced the altered script like this:
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" EnablePageMethods="true">
<asp:ScriptReference
Path="~/scripts/AJAX/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js"/>
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?
@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?
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.
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 :)
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?
I've successfully migrated the code to use the newest MetaDataExtractor.dll (V2.4.0b)
Are you intersted in the (minor) changes?
Hmm, won't install on Win7 RC.
@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.
@John: You should contact support about that. My guess would be that the RTM of Win7 will have the fix built-in.
@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.
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.
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!)
Thanks Bertrand, this will make the client web applications easier to design.
Hi Sir,
The article is very nice but the starting is little bit confusing. Thanks for letting us know this.
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
WHY ???WHY ???WHY ???WHY ???WHY ???
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
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.
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...
@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.
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
If the globalization etc is indeed so good, then why not contribute to jquery ?
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.
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.
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!
@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.
@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.
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.
@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.
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.
@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.
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.
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.
Remove hoaxes once it's out, otherwise you clug the searches with junk.
Is it not available for Visual studio 2005 ?
@Shyju: no.
@AS: no.
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?
@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?
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.
Looks like this issues has been reported on the Codeplex site. Hopefully it gets worked on soon. aspnet.codeplex.com/.../View.aspx
Just what I was waiting for. Thanks
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.
HTML Editor......WOW!!!...Thanks...It has been a VERY MAJOR Pain Point...Thank obout...:)
Thanks a lot. Very Useful
Great!! I envy this.
Does AJAX HTML Editor has Spell Checker also.
great.
Thanks alot everyone who have worked on this.. Great help..
These are three really valuable additions to the control kit.
Can't wait to download. Thanks
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."
We love you guys. Simply cool. Dont know, how much of weight of gone off our backs.
Thanks a lot.
Awesome.... These are super cool controls. Thanks a lot!!
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.
Excellent addon's to the toolkit.
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 ;)
I. Qandil
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.
The Color Picker looks very old, reminds me year 2002.
Maybe the HTML Editor will be good enough to get rid of TinyMCE! Thanks Obout!
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 doesn't it degrade to a standard select?
Color Picker:
Why doesn't it degrade into a select list of colors?
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!
Now there's a step in the right direction. Nice!
I like the accordion control persisting which part was open.
This is great. Keep up the good work!
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!
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
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
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.
Wow, very good news. I'm glad!
but it won't support framework 2.0 :-(
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.
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?
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.
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
Its very good,........... enjoy new ajax control with u r website
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.
a lot of bugs, please fix them. for example calendar picker has problem if language is not english.
It's not a good idea to rely on timed events in scripting languages inside of a browser.
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?
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.
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.
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.
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.
I'm getting this format:
/Date(1233323754523+0100)/
I assume the +0100 is the timezone ? Not mentioned in your article.
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.
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 ?
@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.
Nice Article, I am waiting for this. Thanks
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.
Bertrand Le Roy THANKS!!!!!
So how do you get this to work with classic asp
@NIC: I don't know, I haven't touched classic ASP for about 6 years.
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.
@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...
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.
@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
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!
TP
So what's the prize for winning? :-)
How sad are you!
Hey, couldn't find your twitter username anywhere on the site... is it a secret? :)
Great idea!
Your search link isn't working though, it should be:
search.twitter.com/search
(...SEARCH.twitter.com...)
@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?
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.
@Ted & @Willem: thanks, I fixed the links.
Great, working now. :)
Very cool idea. :))
This is cool - twitter.com/.../1881388342
Done!
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...
looks great. looking forward to using it :)
I'm done!
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.
AJAX Technology. I have used in user login and register page in my website.
Good Survey, hopefully will see the result soon.
We stick to Microsoft.Net Ajax, and jQuery.
Thanks for your works! It's wonderful!
I have used ajax using jquery and avoid using .net ajax as it make use of large javascript files which really effect performance.
I was using ajax in many of my websites but have to remove them as it was effecting performance so much.
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!
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?
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.
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');
Thanks for the article and the hotfix.
Works fine now :-D
Jose
can u take off access denied on this computer?
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.
@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.
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.
Html Editor is Great but Color picker look old
I'd like to have a choice whether to instantiate components imperativly via $create, declaratively in markup or declaratively but not touching markup.
@Andrei: not sure what you're saying here: 200 is OK.
@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.
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".
@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.
#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);});}}
;-)
@Oskar: awesome, but you should add var in front of that c to avoid a warning in strict mode.
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.
my css fix didnt work either, installing hotfix tonight..
@Bertrand: Please see this MS Connect issue for a similar but 'real' issue: connect.microsoft.com/.../ViewFeedback.aspx.
@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.
Here you can find a very easy fix for it.
forums.asp.net/.../1216682.aspx
And use F8 to cycle through them!
//TODO: Follow Bertrand's advice.
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
Doesnt make any sense to me.
CTRL + SHFT + F ... search for TODO.
-Yash
Do I need to know about this framework MOQ ?
@MisterFantastic: if you're unit testing your code, you probably should check it out... :)
Thanks, very nice tips
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).
This is cool. I actually used the TODO: but forgot where to retrieve the list. Thanks!
So simple, yet so helpful!
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! :)
Good tip. Mine key combination was defaulted to ctrl-\, ctrl-t. That seems like a strange default.
The Task list is Ctrl+W, T
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!
Nice!, very useful.
probably the lamest tip ever. you got to come stronger than this
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
It is simple, just have a DIV mask then disable all the SELECT elements.
Its a Cool tip! Thanks
Wow, just what we need, more crap controls in the ajax framework, nothing worth using yet.
I would but I'm too busy doing something more important that will help our software ship. :)
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.
@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
It is sad to know that .NET 2 is not supported any more :-(
Works great. This has been driving me crazy.
Thanks for you help.
Stephen
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?
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
@Virgilio: you can get support from the SeaDragon team here: getsatisfaction.com/.../livelabs_seadragon_ajax
@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.
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).
@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.
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
The hotfix works, sortof. I now see the menu items however, the verticle spacing is off making the menu items overlap each other. :(
@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
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.
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.
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.
Would you share the code for the Include() extension method?
@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.
@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...
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.)
@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
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.
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.
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
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.
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?
@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.
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?
@John: that's absolutely right (see my previous post about master pages).
Presumable, that should be:
<%= this.Include("Header.ascx"); %>
instead of:
<% this.Include("Header.ascx"); %>
Otherwise, the control output will come before the page output.
@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.
ResolveUrl always goes absolute (e.g. /app/foo), ResolveClientUrl goes relative. No?
Oh and this.ResolveUrl will use the current template path as the base, so app relative paths wouldn't be necessary.
@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.
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. ;)
Couldn't fit the whole url in the tweet, so here's the actual coder behind it: http://blog.nihilogic.dk/
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. :(
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.
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.
Why is it that people don't prefer to Register their ascx file but persistently use include instead?
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.
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; }
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.
@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...
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.
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.
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
You're kidding, right? :)
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).
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.
ok, since you didn't publish my last comment, here's one:
master-detail grids
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.
At least in C#, my biggest complaint is the bracket mess.
WebForms views are untestable. No way to access the content during a test due to the dependency on HttpContext.
ViewData Dictionary magic strings.
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.
Similar to someone elses view, but MVC is the screw (a small machine screw), and WebForms is the 30lb sledge hammer.
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.
@Brett: yep. Still not getting IntelliSense on those properties. Working on an interesting solution, going almost full-circle to where we started...
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.
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.
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
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 :)
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.
+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.
ViewState, period!
Would like to use WebForms ViewEngine for email view templating, but WebForms writing directly to Response stream cuts this out.
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
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");
_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
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.
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.
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!
Just Dandy! ..It worked .. Great post
bracket mess! I would like better syntax for if/for, maybe something like Genshi genshi.edgewall.org/.../xml-templates.html .
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
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.
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.
@ram: you should read this post: weblogs.asp.net/.../truly-understanding-dynamic-controls-by-example.aspx and the one before it.
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
Can't install hotfix on Vista SP2? Says update is not for machine...
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)
@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.
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
@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.
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.
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.
@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.
Thanks a lot, it's exactly what I am looking for to unit test a class that uses Application variables.
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.
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
I gather you're only hiring US based devs, Australia might be a long commute :P
I'd apply otherwise ;)
Can I apply if I don't live in the USA. :P
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.
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.
this link in not opened....
careers.microsoft.com/JobDetails.aspx
Plz email me the correct Link
Muhammad Akhtar
toakhtar@hotmail.com
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...
@Peter: you can omit the quotes around the <%# %> block, they will get added for you in the rendered markup.
You can always apply even if not in the US. It's always harder but not impossible.
Just so you know careers.microsoft.com is horrendously slow, to the point of being unusable.
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?
Hooraay!!!!!!.........I just luv to learn and develop new techs, I m going to apply,
bad luck ..... the link is not working
Sounds good. But I am in India .What to do ?
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.
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 .
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.....
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.
@Kenny: hard to say, but I'd guess static variables in your code.
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?
@Kenny: no idea then, sorry. Web farm?
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! :-)
@Kenny: you should probably contact support. contact me if you don't know how.
Do we have to relocate to Seattle for this position? I'm Arizona right now. Thanks.
@Ray: preferably yes.
FYI, links no longer work...
Fixed.
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.
@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.
@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.
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
Actually, Tyson's post worked great. I must of had something wrong. Its working great now
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="~/Images/album.ashx" TagPrefix="photo" TagName="album" %>
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?
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.
I would also like to apply for Microsoft.
Can you please tell me, whether passing Microsoft Certification Exam will get me any benefit?
@Jamie: not sure I understand your question. Do you want to follow-up offline with me (bleroy at microsoft)?
@Kunal: not really, no.
I'm experiencing the same result as Dale. Can you post a solution, if one is available. Thanks.
Maybe we should make "for" and "if" as built-in tags.
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.
@Dale: I would reopen the incident. That is not right.
You should really read Anathem, if you haven't already.
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.
I have a question not necessarily just for you but for the community at large: why is NHibernate so popular?
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/
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..
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!!
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">
<asp:ScriptReference Name="MicrosoftAjax.js" Path="~/Javascript/System.Web.Extensions/1.0.61025.0/MicrosoftAjax.js" />
then it worked well without errors.
HTML Editor does not work in validation control
why not LINQ?
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.
@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.
@Gurvinder: thanks for the report. Could you please file a bug here: ajaxcontroltoolkit.codeplex.com/.../Create.aspx ?
@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
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?
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.
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?
@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;
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: not sure that's what you're asking, but you can put one handler in each of the folders.
@lucasbfr, Castle's ActiveRecord looks interesting. How does it compare to Subsonic?
Hey, ok, I get it, I guess - but does this really work?
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: why don't you put a handler.ashx in each of the image directories?
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.
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?
Just FYI, but as of 2.1, NHibernate can run in medium trust - see blogs.taiga.nl/.../new-adventures-under-medium-trust
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: no problem, feel free to e-mail me at bleroy at microsoft.
How would you access multiple databases with NHibernate? We have some data in Oracle and some in SQL Server.
@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
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
@Fern - EntitySpaces is a commercial product (from $300). I'd certainly expect autogen when I have to spend that sort of money!
@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)
@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.
Thanks for these posts! Keep it up.
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.
I think this is going to be a great series of posts... I am especially interested in the transition from the custom datalayer.
amazing! exactly what a n00b like me was looking for, thanks!
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.
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?
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: }
@MR: the picture directories have to be "under" the directory where the album handler sits.
@Dave: nhforge.org/.../index.html
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?
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.
@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.
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
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, 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.
Firefox 3.6 will support the hashchange event, just like IE8. See developer.mozilla.org/index.php
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.
So cool, I just applied successfully in first time :)
@Zoro: you need to handle the scrolling event and reposition the iframe.
@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?
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
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...
@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.
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
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 :).
"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
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.
@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.
Hey, thanks for that wonderful article.
Also, can you post something about configuring TFS?
Excelent article...!
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.
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?
@Navin: are you sure you downloaded the right release? The most recent one is:
ajaxcontroltoolkit.codeplex.com/.../ProjectReleases.aspx
In Visual Studio 2010, Team Explorer is now installed by default along with the client bits.
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. :)
I like this case of not having a choice )
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}})()
Nothing new on this thread in a while. Has anything changed? Is it possible now to subclass ScriptManager without loosing intellisense?
In 4.0, you don't need to subclass ScriptManager to do that sort of thing. I t's handled natively.
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. :)
NaN stands for Not-A-Number, but internally you can also assume it to be infinity. So 0/0 should churn out NaN
I use Virtual clone drive (freeware) to mount iso images:
www.slysoft.com/.../virtual-clonedrive.html
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?
@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...
@axsbrad: I'm not sure. The plugin logic is certainly staying.
@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.
@Jesús: yes, there are plenty of options. 7zip is another one that you can actually keep installed after you've used it...
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
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.
@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.
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.
@whuili_2006
Download it from here. You should read the whole article and not just look for links :)
code.msdn.microsoft.com/KB969612
"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.
@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.
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. :)
lots of preview is given, i do hope the beta and release version will have less difference
Right on. My thoughts exactly!
Hi Bertrand, do you know when the final release of Ajax 4 will be out? How many more previews are left?
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?
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.
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.
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>
};
Will this work with ASP.net 3.5?
@shaolin77: yes.
Is it possible to use this type from VB.NET 10.0 ?
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.
@Alex: which type?
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?
@petersga: I don't know. Does it work outside of the menu?
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?
@petersga: the hotfix is patching ASP.NET, not IE. You'd have to ask someone from IE, I suppose.
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
Well let's hope this one was tested better than the last release.
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...(?)
C'etait notre ballade au Mt. Pilchuck ca :) Cool!
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 ?
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 :)
AsyncFileUpload demo page is erroring.
nice to see new additions on ACT. I do not think www.asp.net/.../Seadragon.aspx is working
@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.
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.
Update: the sample site has been updated and the live demos of the upload and deep zoom controls are now available.
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) }}"
@bodar77: you can probably handle onItemRendering and instantiate the inner dataview from there.
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.
This is lovely code. thank you so much!!!!!!!!!!!!!!
@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.
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
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")
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
@Justin: you need to copy the dll that comes with the release into the bin folder of the application.
Try this.
var date_string = '/Date(1233323754523+0100)/'
var d = new Date(parseInt(/\/Date\((\d+).*/.exec(date_string)[1]))
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.
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
I have this in my web.config:
<customErrors mode="On" defaultRedirect="Forms/GenericError.aspx"></customErrors>
And this in my Global.asax:
Exception ex = Server.GetLastError().GetBaseException();
HttpContext.Current.Session[“LastException”] = ex.Message;
And this in my GenericError.aspx:
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?
Sanjeeb
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
WOW! Very nice.
@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.
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?
Regis.
a couple of random notes: love the pic, pre.code not really comfortable to read in chrome, font too small :)
@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 +.
i tried to apply this patch to the Windows SBS 2003 and doesnt works, any special patch for this OS ?
@Fran: I don't know. You should contact support.
@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.
@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.
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
@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.
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.
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.
The ASYNC Fille Upload example demo is not working on IE8 and FireFox 3.5
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?
@speedbird186: it has not, but the source code is still available. It's attached to this post.
niiiiiiiiice
Good solution, but this would work for say a paging solution when you would need to use the template over and over.
@Mike: absolutely.
I assume "isDetails" translates to "?jedi=all" in the query string?
@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).
"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.
@Joe: understood, and that's also the definition I've been going with.
This isn't the comment you're looking for.
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
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
@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.
@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.
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 ?
@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.
Have a 4700 and the same problem, running Vista and want to rid myself of the redundant Error on the Windows Media Player.
hai,
when the page is postback,navigated or revisited The ASYNC Fille Upload is not clear.can u give idea
@subha: you should file a bug here: ajaxcontroltoolkit.codeplex.com/.../Create.aspx and/or ask your question on forums.asp.net/1022.aspx
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
@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.
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
@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?
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.
@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.
@Bertrand: You were telling Russ...
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?
You can use -
eval('new' + dateStr.replace(/\//g, ' '));
this returns a Date and then use format function format the date as desired
@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...
@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.
@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. :)
@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.
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?
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.
@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.
@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.
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.
@Richard: thanks, this is now fixed.
> 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);
@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?
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.
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!
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.
Very useful. Thanks.
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
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.
@gummadi sri ramulu: if tweaking your CSS doesn't work, please contact support.
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.
@Greg: I'd bet for caching. Probably too aggressive.
@Monalisa1: I updated the post to use Preview 6.
@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!
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.
@Schubert: if you're still seeing problem after applying this patch, please contact support.
I'm getting the same problem on production server.on localhost it is working fine . do you suggest to use server.transfer instead?
@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 :)
Does Sys.Serialization.JavaScriptSerializer.deserialize() account for the timezone adjuster?
How do you whitelist, I'm trying to link into spotify but with no luck at the moment.
@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.
"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 ?
@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?
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?
@KiT: you mean even after you added the reference tag?
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 :)
@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.
@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.)
@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.
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.
Excellent post Bertrand!
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
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.
Nice post! It kinda sounds like a bait and switch advertising for NDepend at the end there but that made me check it out...
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????
@Billy, that's a serious accusation you're making here. No, I'm not getting paid to write this. Not by Patrick at least.
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.
Excellent article! An exquisite representation of applied physics!
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
@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.
@OmariO: I don't know. I forwarded your post to Dave just in case.
Would you consider non-US applications?
@Alberto: we'll consider all applications, although it is always more difficult for non-US because of visas.
Resume sent.
Are you considering remote candidates at this point, or must the developer be on-site in Redmond?
If intellisense doesnt work for jquery-1.3.2-vsdoc2.js
get rid of the "2" after vsdoc.
code.msdn.microsoft.com/.../View.aspx
@Jesse: we usually prefer to move people to Redmond, but you can always apply and negotiate.
Funny, I was just looking at ASP.MVC CMS applications on codeplex last night.
Would you consider H1 Visa status
@deepu.mi: I think I answered that already.
Nice post. It would be great if you can provide running sample of this. Thanks.
This looks like an incredible job :)
Damn!
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? :)
not able to open https://careers.microsoft.com
very slow and after lot of time throwing error, details not given by site.
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 ?
@Danny: thanks for the pointers. Yes, there will be a call for volunteers shortly.
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 ;)
AsyncFileUpload doesn´t work with the opera 10 browser yet... (25Nov2009)
@Jm6: did you file a bug?
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.
@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.
@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.
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.
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.
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)
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
@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.
@Ulr E: try deleting your VS settings and restarting.
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.
@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.
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 :)
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.)
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?
@Marcel: WHAT??
@Christofer: you are SO on your own on this one :)
"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
@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.
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.]
@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.
Coincidentally, Ars has an excellent article today on how scientific consensus emerges: arstechnica.com/.../the-complicated-truth-behind-scientific-findings.ars
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).
"Coincidentally, Ars has an excellent article today on how scientific consensus emerges:"
Yep, "lies for children" really sums it up :)
@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.
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.
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.
Just found some fun ammo for you, @Marcel ;) my.athenet.net/.../SkepticQuotes.html
@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!
Heh, cool, thanks :)
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.
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.)
@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.
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.
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...
@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?
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.
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.
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
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.
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.
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.
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.
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 :-)
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.
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 :)
1) We run all our apps in medium trust.
2) Bcoz shared hosting server we use allow medium trust
3) Yes
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.
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.
Igor Latyshev
1. yes
2. external hosters
3. yes , yes
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).
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
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.
As a user of NHibernate I need a fulltrust configuration.
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).
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.
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.
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
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.
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..)
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.
1. no
2. we dont
3. externally hosted, not constrained.
All good points, yes.
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.
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.
@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.
Binary Serialization / Reflection
System.Diagnostics (Tracing)
Custom Configuration (workarounds are available, tho)
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.
+1 Stephen M. Redd
+1 joelvarty
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.
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.
Custom Configuration
ASP.NET Charting (although 4.0 fixes this)
Reflection Permission
Web Permission
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.
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.
MySql.Data is not working in medium trust...
i think it requires some web permission.
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.
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.
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)
@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.
@Marcel: that is truly epic! Thank you so much for that link.
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.
OleDbPermission
I agree about ReflectionPermission (with the RestrictedMemberAccess flag) and WebPermission. Those will be very useful.
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".
We require full trust because we use the BinaryFormatter.
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.
@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
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.
UnmanagedCode permission. Exports to pdf from every single reporting product requires this ..
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
Encryption and Decryption are not allowed
Steve said:
I'm using SSRS to generate a PDF and I don't need UnmanagedCode permission.
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.
@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.
YES! Thank you for this. Resizing using GDI+ was never really acceptable. This is great.
Nice writeup Bertrand. Thanks!
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.
Really this is great solution. Thank you...:)
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!
I am actually maintaining a GDI+ resizing solution, when that needs to be updated, I will definitely use WPF.
Thank you for the highlight.
The WPF approach will not work on platforms other that Windows.
ahh fantastic. I use GDI+ too. Time to switch I suppose.
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?
@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.
Great research! This article saves me a ton of time in my current Silverlight project.
Klaus
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...
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.
@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.
WIC Decoders/Encoders and the RenderTargetBitmap pipeline are not using the GPU.
Thanks Gerhard.
Any idea what happened to the Visual Studio 6 (vb) CTRL+I that showed the value of the constant?
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? :-)
@Sel: no, but you could either "go to definition" or name your constants with an explicit name ;)
@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.
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.
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.
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.
"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.)
As I said, you are generalizing from a handful of cherry-picked debatable examples to millions of people.
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).
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).
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?
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.
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.
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?
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.
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.
"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.
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.
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".
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.
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 :)
I do.
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.)
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...
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.
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.
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
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.
This is quite interesting too:
thunderbolts.info/.../080403phobos.htm
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?
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.
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
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"
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).
Honestly? This is the best they can do? I mean, this is not even making an effort.
Oh no, there's a lot more where this came from.
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.)
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.
Hmm. People lie. News at 11.
True, especially to themselves.
(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?)
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?
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 :)
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)?
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 :)
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.
"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.
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.
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 :)
Yeah, well, he's wrong: relativity.livingreviews.org/.../lrr-2003-1
Randi: I linked an article showing not that he falsified data (others did that), but that he lied about it (as I said).
According to hearsay from one guy.
Velikovsky: sorry about that, my bad. The correct link would be www.webscription.net/p-236-kicking-the-sacred-cow.aspx
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?
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."
That some scientific knowledge becomes engineering is undeniable but what does it prove exactly, if not the success of those ideas?
"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.
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.
"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).
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.
Of course, if you have any evidence that Lewontin was incorrect, by all means, let it out :)
What is there to prove or disprove exactly in that quote? There is no reference to anything specific.
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.
@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
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
Perfect !!
The iFRame covers my DropDownBox under de (popup div)
Thanks a lot !!
ReflectionPermission
My commercial web controls have optional features that use reflection. It impacts about 1% of my customers.
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>
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.
yes this will work i have used it _target
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;
@Aamir: yes, that's GDI+ resizing. Not sure what your point was, seeing that you didn't write a comment besides the code.
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>?
@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.
Is there possibility for part-time?
@Markus: I don't think so.
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...
ah nice one. if only we could rid computers of ie most of our compatability issues would be solved!
thanks for this
check the link Adding IntelliSense for JQuery in Visual Studio
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?
@sking: not sure what the point of translating it to VB is, but you may use iff instead of if.
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.
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?
What model of keyboard you are using? Is it wireless?
@Alex: it's this IR keyboard www.amazon.com/.../B000AOAAN8
Fantastic post :)
oh, I guess mine is plain simple: tv connected to iomega screenplay disk :) (sorry to disapoint you, but that's it really!)
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?
@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.
What are you using to rip the dvd before encoding them with handbrake?
@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.
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.
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.
@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).
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,
Rajesh Singh
Asp.net Developer
www.indianic.com
Still this position opened?
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.
@Shoriful: yes, but probably not for long.
@Gilad: I'm surprised by what you're saying about the quality. Do you have a sample photo that I could look at?
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.
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
I am curious about your wireless network setup with regards to streaming HDTV using the HD Homerun. Or did you wire everything?
@Jeppe: yes, everything is wired with gigabit Ethernet, except for the laptops.
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.
@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.
I've made a super simple high performance template engine that allows you to insert values anywhere.
code.google.com/.../csharptemplates
evgeni said:
Baskar said: Thanks evgeni its working fine
HD DVD player counts, it's great as an extra slot :) Non-BR movies go there, games in the console.
@Dave: yes, I use the HD-DVD player to play regular DVDs too, so the the main optical drive lasts as long as possible...
John Resig's blog is at http://ejohn.org not .com
Respected sir,
what is SEO . i never heard about this and how it works?
@Hemant: Search Engine Optimization, S.E.O. Bing it.
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...
yup!...won't run on WinXP SP 3...my experience as well :-(
Hi, this work with BING?
@Williams: yes, it helps with all search engines.
can it run on sherhosting ?
Great,I've used it on my server!
Is it possible to install it without the Microsoft Web Platform Installer? We like to hear from you.
I try it and I love this toolkit. As developer it makes my life easier.
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
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.
@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.
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.
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!
@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.
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.
@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.
@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.
@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.
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...
I have an iPAQ 3115 with the same problem.
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.
@Chris: no, it won't work, which is utterly stupid as the equivalent APIs using GDI+ will work just fine under medium trust.
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
@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.
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.
@tomb: yes, well, if your enterprise policy doesn't allow you to do that... But thanks for the tip.
I've lost more work to Windows Update than I ever have to a compromised system...
Oh the irony.
[)amien
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.
@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 ;)
My favorite is when it happens to me on a production server :)
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.
Why are you still using windows xp ? this annoying "feature" has been removed in vista.
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)
@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.
@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...
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. :-)
@Ryan: Thanks. No, I don't think $1 will help much currently. Euros?
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.
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" ... :)
@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.
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 :)
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. :)
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.
@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.
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.
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.
@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.
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
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.
@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.
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.
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
Ah, but iFrames are fixed size and a lot less flexible. For interaction, you could use JSONP calls.
"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! :)
This is very interesting. I hate the fixed size of iframes. Thanks
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
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?
Are you still looking? Or have you guys already hired?
Oh and if you are... when are you looking for them to start? as that could stop me applying :(
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 :(
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]);");
-----------------------------------------------
@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.
@Nick: sorry, the position has been filled. Thanks for your interest and don't let that stop you from considering contributing ;)
@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).
@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.
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?
Badgers, what badgers?
@Hans: and more user blaming... I've answered all that several times. Please read above comments.
@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.
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.
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. :)
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.
@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>
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?
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 ...
Nice article. There are more advantages of using this over IFrames .
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.
It's like the Load method in JQuery API.
@Leon: jquery.load won't work cross-domain, which is kind of the whole point.
Really Good Article
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?
@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.
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.
@narenda: what kind of problem are you seeing? What doctype are you using? Did you apply any custom styles?
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
@narenda: what about the doctype? If you are using a supported doctype, then you should contact support.
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?
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.
It is posible to display submenu using
remove your old !DOCTYPE
and add <body scroll="no"> insted of <body
Please stop advocating removing the DOCTYPE: bad, bad bad idea.
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.
It's called the Secure Attention Sequence. There would be no sequence if it was just a single key.
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? :)
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...
The tablet/laptops given to PDC 2009 attendees has a CTRL+ALT+DEL button. :)
While we're at it, let's add an "any" key :)
@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.
Thanks a lot - it helps!
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)
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?
@Scott: this is a *server* patch. Your users don't need to be patched. This is *not* patching IE, it's patching ASP.NET.
@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. :)
I updated the post to reflect the current supportability of this.
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!
@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.
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.
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
@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.
@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.
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!
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.
@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...
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.
@Aejaz: I recommend you ask this question on the ASP.NET forums: http://forums.asp.net/139.aspx
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.
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!!!
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...
@Matthew: do you have a reference to another implementation of this?
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!
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
@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.
"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!
@andrew: well, they mean ASP.NET in general, not just web services.
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.
@Rubén: are you using the overload with false as the second parameter?
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.
@Rubén: then I don't know, sorry. You should probably contact support.
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.
Very interesting. CodePlex would be really nice if it's not too much a bother for you.
Please create a CodePlex project for it. It makes it easier to get the source.
Pretty slick.. :)
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?
Miguel
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?
Codeplex. ALWAYS!
THanks, nice work..
That is so cool! I wonder how many other set of APIs can benefit from a fluent api. stream readers/writers?
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.
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.
This is seriously cool, working with System.IO is always such a beat down, nice work.
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?
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.
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));
@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.
@vishwaraj1: looks like you have a corrupt file somewhere. Try re-downloading the files. If that fails, contact support.
Why not Ms-PL? BSD makes this hard on agile product teams,
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.
Awesome! A Codeplex site would be nice!
Interesting and I hope it catches on fire in the community.
I second Hightechrides's suggestion. Select() should be called Where(), because you're really filtering here.
Like it a lot! (+1 for CodePlex too.)
CODEPLEX!!
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:
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."
Excelent
@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.
@Peter: I wrote a post that hopefully answers your question... weblogs.asp.net/.../binding-a-select-in-a-client-template.aspx
I just love this new ASP.NET AJAX functionality.
how about just a fingerprint scanner?
passwords in general are so 20th century.
@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.
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.
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.
I would say that:
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") {
and don't forget, != is always faster then ==
@Bob: totally agree :) With an already done mock version was what I was thinking.
@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.
That's great. Many thanks for taking the time to write a post to explain it.
Thank you for this Bertrand. Where should I be looking to see this kind of thing explained in some documentation?
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.
I downloaded and installed, but no "Connect to Team Foundation Server" option appears under the Tools menu of VS2008. Please help.
@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.
@Peter: couldn't find it. Hence the post.
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.
@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.
So is WPF supported in ASP.NET or not?
@Elvin: no, it's not (see update 2)
Pingback from Client Side AJAX Applications in SharePoint 2010 - Part 3 rapidapplicationdevelopment.blogspot.com/.../client-side-ajax-applications-in_3617.html
Eric Lippert's blog is excellent - but I don't see any JavaScript (at least not on page 1)
Thanks for taking the time to make it "more" available to the community!
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.
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.
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...
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.
Funny, we're precisely working on a CMS here, and this is one of the many open questions at this time :)
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.
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 :) )
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
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.
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.
@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.
@bertrand unless there's an even bigger hive that is expecting you to move the hive in question for them...
@Rob: you seem to be deluded that a hive can expect anything. Oh well, I guess this great analogy just broke down.
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.
All this talk of Hives reminded me that you missed the Windows Registry off your list :-)
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.
@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.
@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.
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)
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] {
_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... :)
@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.
@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...
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.
@shafaqat309: I'd contact Jeff King on his blog post (linked) or contact support.
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
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)
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
@Roland: yes, that should be pretty natural in F#.
I somehow lost the sessionstate configuration line in my web.config and found that to be the problem in my case
@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: 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 :)
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.
@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.
Nice tip, Bertrand. I knew about the serverside comments, but I usually forget about the regex-based search and replace capability in VS. Thanks!
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.
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!
David
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.
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?
@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...
I had no idea. Thanks for the tip
Thank you for your tip. I'll use server comments more often when I need to comment anything.
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
Thanks... I didn't know it... Very usefull.
@atagaew: I'd actually encourage server comments: they're harmless. Plus, many people don't know to look in source control.
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.
@fmorris0: errr, it does: I just tried it in VS 2008, and the code I selected got surrounded by <%-- --%>...
using code betwin tag head
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
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.
@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.
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.
Just remember to avoid replacing any IE conditional comments that you might be using!
@Henrick: yes, one more reason to run the replace occurrence by occurrence. I guess you could have a more elaborate regex that handles it...
An iPad is not a large iPhone, it is a large iPod Touch!
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?
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...
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
@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.
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.
I want to check that is the div display is block or none with css anybody can help me
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.
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?
@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.
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
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);
Not only do HTML comments make your HTML fatter but they can also leak sensitive business information to possible hackers.
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.
Bert: You forgot to publish your test scorecard:
tuut.atdt.nu/.../b352a1d6af672df394ba59adcd7d9ad8-480.jpg
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.
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
@Daniel: :)
@Marty: Wow, that is so impressive!
@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.
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.
@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.
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.
@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.
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
@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.
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.
@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. =)
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
@Alex: yeah, you got me. :) No offense meant by the way, just being playful with this whole thing.
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.
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?
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?
Laurent
@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.
(and that's work you'd have to do anyways if you didn't have Orchard to help)
http://dbj.org/dbj/
There are CallStream parts 2 and 3 posted.
If anyone is interested ...
Thanks: Dusan
@Bertrand: Ok, I got the idea of mapping now. Thanks
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.
@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.
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?
Bertrand, simply brilliant. Tried and did see the comment not getting to the end user.
Arun
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?
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
-->
@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.
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.
@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.
Very Cool. Thanks for Posting
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)
am getting status 404 tomcat server error,when i followed what you have mentioned.Could anyone explain Why???
Priya
how to put links inside a grid that has been retrieved and build from an xml file
I'm sorry Dave; I can't do that.
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?
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?
@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.
@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
Excellent post. I do not know about it. Great work done. Thanks dude.
i never knew this fact...
thanks for telling us the core concept of HTML rendering.
great work...
Does the toolkit provide insight on why SEO is easier to achieve on BING?
@Andy: not that I know of.
Thank you for this article. I hate to work on IE6 bugs and I really would like people to definitely get rid of it.
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.
@Chance: well, I think it's a very appropriate comparison, and eh, Scott is the one who did it first :)
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)
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.
Ha! Thanks for the tip. Didn't think of that.
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.)
The problem with this though is for those people who convert their nullable types to optional parameters, they're now going to be required.
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".
/// // 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 ) ;
/// </example>
Wouldn't you want to wrap the overloads in version specific #if/#endif?
#define NET_Version3_5
#if NET_Version3_5
// some overloads
#endif
http://dbj.org/dbj/?p=626
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?
@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.
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
@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.
@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.
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.
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.
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.
Very impressive - right up until it crahed my Firefox.
Bertrand could you open a comment on Video CMS?
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).
@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.
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~!!
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!
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"}
]
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
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...
Interesting!
I also wrote a tutorial on quality image resizing www.mikeborozdin.com/.../High-Quality-Image-Resizing-with-NET.aspx
@Mike: thanks. I compared GDI rendering modes and qualities here: weblogs.asp.net/.../what-interpolationmode-and-compositingquality-to-use-when-generating-thumbnails-via-system-drawing.aspx
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
@Mike: very likely, you introduced a syntax error while patching the files.
Please consider upgrading to .NET 3.5SP1 or 4.0.
On the first glance it seems that CallStream-ing kind-of-a interface would elegantly hide these complexities ?
@DBJ: he he. Yes, a fluent interface (callstream or more conventional) for image processing would be nice...
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!
@ShadowChaser: you should try weblogs.asp.net/.../the-fastest-way-to-resize-images-from-asp-net-and-it-s-more-supported-ish.aspx
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?
@jahu: I think you do Sys.query(selector).setCommand instead.
IceFaces better than all .Net framework
Could you give me a link to web side documentation or tutorials, because i couldn't find it at all.
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.
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
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?
@Kevin: The latest WIC is not available for XP.
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.
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.
@Alexander: comments are great for that too.
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!)
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.
@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. :)
i very crazy about this
This is very nice article.
Thanks for the info. This will come in very handy for us.
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?)
Thankyou this was so helpful. Microsoft didnt give me any answers but now I can get my work done.
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.
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!
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.
@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.
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 ...
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.
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?
@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.
@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.
Ah, never mind, static methods seem like they work too. Trying it.
Thanks Rob for fixing the problem.
Now my site menu works in all browsers.
Context.Request.Browser.Adapters.Clear();
Cheers.
@segue: my name's not Rob, but you're welcome.
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.
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.
var local = {
mbox : global.alert ? global.alert : global.Echo
global.msgBox (m) { local.mbox(m); }
@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.
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.
@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 :)
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?
@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.
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.
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.
"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.
@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.
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).
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.
Kushal
@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.
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?
@Art: :) don't worry, the software I build doesn't self-replicate. This being said, software viruses do mutate to evade detection.
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.
Yeah, my point being that that threat is more remote than that of dumb self-replicators.
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.
Yeah, cause everything should be judged by how well it sells.
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.
@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.
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?
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)
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.
@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?
@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 :)
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!
@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.")
Excellent post; very illuminating to see an explanation in my native language. Thank you.
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)
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.
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.
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.]
Is Good Idea . Working Fine.
Iranian Programmers
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?
@Gauthier: thanks. Could you please submit a patch following the instructions on this page? orchard.codeplex.com/wikipage
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.
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
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.
I've said repeatedly in the past that applications should never steal focus - that's just crazy.
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. :(
@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.
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?
@Joerg: you should contact support.
I can't wait for the next post ;)
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.
@Justin: I stand corrected.
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.
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?
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?
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 ;)
@aefxx Could you describe what makes jQote2 way more powerful than PURE?
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.
The subtle but unavoidable differences between 'value' and 'state', deserve a whole new post ;o) ?
Not sure what you mean, but by all means go for it.
Thanks for your share.
Would you like to tell me
How can I permit user to upload image to current folder?
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.
@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.
@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.
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..
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.
@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.
@Lolo: you're probably missing a @register directive on you page.
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> works fine, thanks ramin.
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
Alexandra
+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).
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.
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...
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!
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.
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. :-)
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.
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.
@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 ;)
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 :)
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.
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.
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!
And for your viewing enjoyment, a tribute to everyone "doing it wrong". (via @codinghorror)
Started with Basic on a Sinclair Spectrum at the age of 6 - 7, 23+ years later... I still have it :)
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 :)
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
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.
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...
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
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.
Basic on Russian BK-0010 PC 20 years ago.
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.
Started with Borland Pascal 20 years ago (1990).
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
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.
@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 ;)
I started with Microsoft.Data API ;)
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".
@Andrew: great points you're making.
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 ...
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.
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...
...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... :)
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...
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.
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.
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.
ZX-Spectrum BASIC and then Assembler 15 years ago. It was amazing at that time :)
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.
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...
@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.
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)?
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.
When you put the blogging stuff in, your not going to copy Oxite right? Because Oxite was absolute crap.
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.
@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.
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?
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.
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).
Great, I'll check it out!
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"
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")
@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).
@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.
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.
Thanks Bertrand for the links you provided. The updated step-by-step is worth reading.
@John: you are absolutely right.
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?
@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.
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.
@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.
Fair enough, Bertrand. Thanks for taking the time to offer a thorough reply!
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.
@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?
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
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 :)
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
UCSD Pascal on Apple ][
Nobody could imagine ever need more than 64K RAM
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).
@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?
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.
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?
Niels Hartvig
Founder, Umbraco
@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 :)
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.
My first was the ti99 as well. I shared a story on Jenson Harris' blog here ( blogs.msdn.com/.../483041.aspx )
@speednet........thats hilarious....factcheck.org is a leftist organization?
Well, reality tends to act that way......
@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.
@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
@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.
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.
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.
Level-I Basic on a TRS-80 Model I
I still remember the manual with a cartoonized TRS-80 cheering up the pages...
Interesting, reminds me of my PropertyTree class that I've been blogging about here mfpedraza.wordpress.com/.../welcome-to-the-machine-introducing-propertytree
@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!
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 ?
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.
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?
This is cool!
My question is if Clay object supports data binding?
@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?
wait, I do get intellisense/serialization/compile time errors etc when I make classes for data...? Why is that the wrong way again?
@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.
@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! :-)
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.
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?
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 : ).
@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.
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.
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.
Hear, hear. Great post.
Really interesting stuff going on here. This functionality combined with document store databases will open a whole new world to C# programmers.
@Kevin: you're moving the goal post.
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?
@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.
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 : )
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...
I want show a message box which will first confirm if i click ok it wil redirect me to next page.
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?
@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.
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
mIRC
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.
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.
Thanks alot for the updates. I had an underscore in my hostname and it would have taken me ages to find that out.
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!
I'm looking forward to seeing this progress and following along, thanks
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)
@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...
Looking good so far, never noticed those blogpost.import.commands before....
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.
@Raj: it's not the milestone that ends Sept. 1st, it's the iteration. The milestone ends at the end of September.
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?
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.
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
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.
@Laurence: if that's irrelevant to you, good for you! Some people care.
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.
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
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.
@Krish: it's in the settings. Look for "ThumbnailSize" near the beginning of the file.
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)
@kris. Well, then you're on your own. Feel free to modify the code any way you want.
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.
How to get the hotfix hotfix 981201
@Caesar: call support.
@ ramin
Thanks, now submenu has no compatibility issue, its working with all other brower
Thanks, Thanks A LOT..
Thanks you for the heads up Bertrand.
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.
I assume WCF is safe, but could old style ASP.NET web service be impacted by this?
@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.
@Denzel: what do you mean?
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.
@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).
@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 :)
@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.
Has the project been stopped or moved? I can;t find anything here: http://clay.codeplex.com/.
mmm, no, it's still there. Last checkin is from Sept. 8th too.
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><%}%>
@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.
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.
Hurray!!!
You've done it! my dhtml popup now actually looks great
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.
@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.
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?
@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.
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.
United States Restaurant Guide - a guide to every restaurant, restaurants-us.com/.../48532
It was many years ago we first selected Top Restaurants in the U.S. See it. restaurants-us.com/.../77630
restaurants-us.com/.../78753
GvmsRl <a href="nrwbltsjfnme.com/.../a>, [url=http://bvzpozmincew.com/]bvzpozmincew[/url], [link=http://pxycktrinrku.com/]pxycktrinrku[/link], http://byujdhtulxzs.com/
B0zrv4 <a href="jdrkurwwalrg.com/.../a>, [url=http://hskxyuxrhehu.com/]hskxyuxrhehu[/url], [link=http://rvssqykwxhvm.com/]rvssqykwxhvm[/link], http://dxcuowiwgsyg.com/
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?
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.
@Richard: your comments are getting through just fine. You can't see them right away because I'm moderating.
So what widgets are in the pipeline for 0.8? Any hints?
@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.
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.
That dollardreadful site is one of the worst websites on the internet. It's not usable at all.
@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.
@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.
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.
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!
@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).
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/).
Sean
Sweet now I can easily dig into the SQL CE DB that I have been using with Orchard.
@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.
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)?
@Webturtles: I have no idea how you'd do that. The handler was built to work standalone, not to integrate with other similar products.
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.
This may also make sense when considered from the standpoint of the floating-point standard.
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+)\\)/$"
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.
My head just exploded... is this C#?
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?!
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...
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.
Orchard will be a very great platform... thanks for building such a great piece of software...
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.
@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.
Sure does look like an absolutely awesome start. Thank you for laying the foundation on this guy, going to start playing with it tonight.
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
@Gregg: we are talking about it, evaluating options. It's way too early to jump to conclusions though.
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
@Laique: what's all that stuff with SessionIDManager supposed to do?
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>
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);
Thanks to all who corrected me. I've updated the post.
Why dynamic properties in PropertyGrid are always read-only?
Because the implementation is incomplete: this is just a proof of concept.
Great article, this was our strigle for a while as GDI is not officially supported on ASP.NET.
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.
@Fabien: thanks for the correction, I updated the post. Your other explanations will be a perfect segue into the next post :)
@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
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?
@Andrew: the locid is a hook that can be used to handle translations. It doesn't "do" anything out of the box.
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?
@SDG: seriously, just upgrade ASP.NET already, this has been fixed for the last two versions.
Thanks mauli and chetali
It works fine
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?
@sankayan: upgrade?
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.
@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.
Nice. Would be great to see it extended with some async/Task<T> goodness so those fluent calls could build async execution trees.
@Damian: yeah, I'll probably do that once C# 5.0 is out.
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...
@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.
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.
@Marc: thanks!
Really great to hear you're planning mockable layer of abstraction.
> 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"}
Bite the bullet BLR ;o)
Use CallStream ... this lib is perfect for it ...
Thanks: DBJDBJ
@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.
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.
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
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);
Thank you in advance!
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).
@CW2: true. I'll look into that in the next post. Thanks for the heads up.
@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.
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
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
@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.
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.
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);
The links are broken. Could you post the new ones? Thanks.
I have the same issue and tried all of the "solutions" posted.
Is there anything else that could be causing this?
@Andy: if you've tried all the solutions above and they didn't work for you, please contact support.
@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.
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.
@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.
Thanks a lot Bertrand ! I was searching for a kind of hardware like this. I found adruino, but it was not in .NET ;)
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!!
@duminda: the simplest is probably to create a folder where you put nothing but the images and the handler.
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?
@Mary: well, it's your call really.
i dont really get it to be honest. where do i remove the errors from?
i really dont get this at all. what do i delete? where do i go to delete it
@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.
What happened with this? Didn't seem to ever make it into asp.net 3.5 sp1?
I'm not sure. The code for this is still available, and it's not too complex. Feel free to use it.
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.
Did you actually publish from Visual Studio using FTP or by separate FTP client?
Awesome stuff, I'm glad the module helped you to migrate quickly!! :)
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.
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.
@Pekka: I use Filezilla.
When will Orchard support custom themes? I would like to migrate my site soon.
@jonathon: custom themes have been supported for several versions.
Lots of fun reading the top most popular blog entry ;o)
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?
@mark: you should be fine. Just copy your theme's folder over. Few things changed since 0.8.
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').
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 :(
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.
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.
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...
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!!
Trying to make it work with the orchard site installed from WebMatrix but doesn't work
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!
James
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\'.
[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()
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.
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 :-))
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.
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 :)
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 ?
@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.
@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.
Thanks so much! This worked brilliantly. I would never have thought to hook the ResolveScriptReference event to determine which scripts we needed.
Great.
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.
What about seo ?
Wordpress sucks on SEO so to kill wordpress with orchard it needs ace seo.
@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.
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.
@Russ: none at all. Can you install other modules fine?
@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
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
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)));
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.
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!
@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.
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?
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?
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.
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
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.
@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.
@Bertrand - I gotcha programmer free maintenance. I stand corrected :)
@Siva: don't. All this is pretty much obsolete. Use a JSON web service and jQuery.
@Jeff: oh, and multi-tenancy is another reason to use this: you want each tenant to be able to choose their icon.
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?
@Herman: contact support.
@ 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!
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?
oh, looks like I haven't worked with latest source code from codeplex. It works now!
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?
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?
@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
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.
@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.
@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.
@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.
@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.
Nice one! This should definitely land in the Orchard docs.
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.
@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.
Thanks Bertrand, now it does exactly what it says on the tin! Many thanks.
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.
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
you might want to check this out: weblogs.asp.net/.../testing.aspx
Warning: the correct link for Orchard Translation Manager is www.orchardproject.net/.../Orchard.Module.Vandelay.TranslationManager
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
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...
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?
I fixed the link.
Nice post. I was wondering how to get at the stuff inside the nuget package!
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.
Thanks for a great talk Bertrand! Keen to get lots more technical info on Orchard in the near future.
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!
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!
@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.
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.
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?
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.
@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...
@Mathias: weird. I've filed a bug to track this: orchard.codeplex.com/.../17558
Very cool! The more I get to know Orchard, the more I love it. Keep up the awesome work!
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.
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?
@Skywalker: sure, but what do you want to base the decision on?
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.
The right way to do this is to create alternates for the shape, I think. I have a post about that.
Just the direction that I needed. Thanks, I will look that up!
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?
@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.
Thank you for the post! I'am really looking forward to 1.1 version. This feature seems very helpful.
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.
Migrating a blog from orchard 0 5 to 0 9.. Dandy :)
Sorry, now it works! I had to download the "Microsoft Application Screen Decoder 1 (MSA1)" to get it to decode the video file.
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.
++
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.
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?
@RJ: you can't, except if you give them ftp access or build it yourself.
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.
Will LINQpad be updated to have built-in support for Entity Framework 4.1 (containg Code First)?
@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.
@Test: you should ask the authors of LinqPad.
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).
@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.
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?
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.
This one worked for me. Thanks Bertrand!
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.
@Michael: it will never happen.
This is similar to DotNetNuke. I will be giving this a try in a few weeks.
Wow, nice updates. What does the license say about someone integrating Orchard with another app (closed source) and selling the resulting combination app?
The license is BSD, which is very permissive towards this kind of thing.
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?
Thanks Bertrand.
This solves a lot of problems that I might have had with my module development. The WCF feature is extremely cool.
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.
@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.
Looks good.
Any comparison with DotNetNuke?
@ Heinz: http://2d-glasses.com/
Is there a significant speed advantage to using Sql Express over SqlCe?
SQL Express maybe not that much but SQL Server makes a huge difference and the migration process is the same.
Menu item doesn't show up in Orchard 1.1
What menu item?
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
I sure hope not!
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.
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)?
@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.
Why no password iteration count?
@Rich: because you haven't contributed it yet.
Thanks, I've sent you the code.
Nice solution.
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.
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.
This is great Bertrand... Thanks...
I would choose:
node.Attributes["rating"].Value
because then I could make it:
node.Attributes[someVariable].Value
and have it do other work.
@Donald: you can get that result by implementing your own Clay behavior.
Very nice! Just what I needed now!
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
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.
What's bind and unit in Parallel.ForEach() and dynamic? I don't think these are monads...
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 &, images jsut doesnt work.
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.
@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.
@SLa: you might want to re-read the post. ASP.NET is doing the right thing here.
@Bruce: this code is antique. You should consider using more modern alternatives, such as jQueryUI.
@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...
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
@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.
Oh man, the timing of this video could not be better. Great stuff, Bertrand - thank you!
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.
This is great! Thank you!
It should be built in to the next version.
btw, do you know why this hasn't been built in?
Does it have any negative side-effects?
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?
Adam
@David: you should check out the designer tools module and its url alternate feature.
@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.
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.
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?
Sure: orchardtaxonomies.codeplex.com/.../Create
Please file a bug in orchardtaxonomies.codeplex.com
Thanks, that's very easy!
I started reading the documentation just before the release of version 1.1, must have just overlooked this part.
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?
@Ranman: couldn't agree more. Apparently third party software is doing fine.
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?
Attach a debugger and look at that list variable. I wouldn't be surprised if it was null.
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.
@Saeed: care to look at the date for this post?
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)
I needed to add the following using statement to get this to compile.
using Microsoft.CSharp;
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?
Hello Bleroy,
do you have any details or any demos for building WCF service in Orchard Module?
@Chiliyago: do you have debug=true in your web.config?
@Ling: that's what we have at the moment.
Anyway to navigate through multi pages of a tif image?
@Rosh: not with this. Quite off-topic actually.
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
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!
Great video! Thank you
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?
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 :)
@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.
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?
@Brett: feel free to do that if you want to.
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?
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.
@Chris: hard to say without seeing your code. But yes, you are obviously doing something wrong.
@Joe: edit the dates.
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
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?
@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.
@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.
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 :)
I did create an issue tracker on codeplex :
Work Item Details
Item # 17963
@jp: merci m'sieur.
wow, I wish I noticed this 10 days ago ... oh well, much better than the cshtml hacks I was resorting to. Thanks :-)
The link www.asp.net/.../default.aspx doesn't works
And now? With ASP.NET 4, is it posible to do this easy? or I need to use Bertrand method yet?
Can i define a Custmon Event on the ASMX Webservice, and run a javascript function on the client site with this event??
I agree with Piotr Szmyd that this should go into Orchard docs
It's a wiki...
The link www.codeplex.com/.../DirectoryView.aspx is broken,
but
aspnet.codeplex.com/.../13356 is OK.
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?
@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.
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.
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.
Interesting quote from Eric Lippert: "LINQ was designed to bake the "monad" pattern into C#" blogs.msdn.com/.../following-the-pattern.aspx
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.
Hush, that thing about zones is the second post I'm writing today. How did you know? ;)
Ha, looks like Orchard is causing some kind of quantum entanglement effect ;)
Sweet, looking forward to that second post!
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.
Oooh, yes, missed that one. Updating the post.
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!
@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.
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?
@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.
Nice and very well explained!
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!
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!
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. :)
Dear Sir
I am a beginner in asp.net.
I want to use this Photo gallery in my project.
How can i do it?
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 ;)
@JonVee: you might want to use Shape Tracing's Model tab to determine how to get to the data you want to display.
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
@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.
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>
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...
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?
@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.
@Luke: you would have to ask the Visual Studio team about their implementation.
Have you seen HTML5 microdata? Is it an option for your tokens?
@Bruno: I have, but I'm not sure how this would relate to it.
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.
@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.
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.
Gokhan
Very Cool. Cannot wait for v2.0!
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?
Seems cool. hoping can see more scenarios the tokens are targeting to in part 2.
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?
Refactoring. You'll actually notice the code that was removed was not consistent with the code in this post.
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
@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.
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.
Nathanael
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 ;)
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.
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.
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 ?
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.
I think this will find its way into a lot of SEO uses! (prepending/postpending categories, hierarchy, etc..)
Stay Awesome!
@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.
@Alexandre: I'm afraid not. You might want to try the MSDN forums.
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" ?
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...
@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.
@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.
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
very good.
when orchard 2.0 come?
It's a bug. It only works on widgets for now.
Early Spring 2012.
Looking forward to it! really good.
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!
preview version for 2012? or release version
i cant't wait too .hehe
Release.
have the plan for preview version? and when?
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.
@shrikant: if you tried all the solutions in the post and it didn't work, please contact Microsoft support.
First preview will be around September.
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.
Oh ... and are you using Sketchflow to prototype the UI here?
@Richard: no, that's Balsamiq.
Liked the idea but is there some other alternate to do so.
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
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.
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
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(...))
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?
@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.
@Kevin: yes, you should try that second solution, in order to avoid having to create a new shape and reuse the existing one.
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
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!
Nice post, It solved my problem, i was looking for many hours that why session value is acting weird.
If I already using the free Team Explorer 2010, could I upgrade it to VS Professional?
Would there be an issue?
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.
@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.
@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.
@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?
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
@Dan: "If you only have a single partition, and you're on Windows 7, shame on you." Whaaaaaat?
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?
@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.
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!
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.
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.
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
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.
@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"?
"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.
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.
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.
Naresh Kumar
@Naresh: please don't cross-post. Your question will be answered on the CodePlex discussions.
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!
It may help you: forums.asp.net/.../1718185.aspx
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?
Doesn't work. It says character is not valid and highlights the row
@grinnellja: it does work just fine. You have an invalid character there. Try to re-type it and save.
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...
So is there anyway to specify that I want the DateTime to serialize to the iso format?
@labshasan: the solution in that thread is just horrendous, and nobody should follow those directions.
@Ben: there is a new route debugging module on the gallery that you will probably like then...
@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.
After install I can't seem to find the admin menu link that goes to /Admin/VandelayThemePicker
@Arra: wrong version of Orchard maybe?
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.
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
@Omar: can you please ask on the discussions forum on CodePlex and specify version numbers of both Orchard and the Taxonomies module?
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.
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.
@Mark: you should contact support.
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? :)
@Robert: once the feature is enabled, there is an additional tab under Themes.
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.
@Arra: it appears as a tab on the right side when you click on themes.
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.
@Arra: are you sure you enabled the right feature?
@Bertrand: VandelayThemePicker under Design.
@Arra: yeah, well, I don't know. Works on my machine. Do you have the latest Orchard and Vandelay Industries module?
@Bertrand: Vandelay = 1.0
Orchard is v.1.2.41.0
I will check the logs.
The latest version of this code can be found in orchardproject.net/.../1.2.3
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
@Chandra: this is a different issue. Please contact support.
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.
@arpita: write your own controller action, with a query on the blog post part, with a where on tags.
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 ;-)
@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.
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
@John: the upgrade docs mention both cases, but in the Hg case, it's ridiculously easy. Just update and you're done.
Ok, found it orchardproject.net/.../Upgrading-a-site-to-a-new-version-of-Orchard.ashx thanks Bertrand.
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.
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!
@Scott: yes, that's normal. The version number in the dashboard never reflects the build number (the third number in the version).
Thanks guys! nice work! love Orchard! Looking forward to your next releases.
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?
@Dylan: only holds what for 30 days?
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?
@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.
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?
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?
@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.
+1 one thanx for Markdown!
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
@Matthew: I'm guessing you're not using Orchard 1.3 because that problem was fixed in the latest release.
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.
Thanks. Please file a bug if necessary.
The new Projector feature is exactly what I need in 1.4. Any Ideas when there will be a beta release of this module??
Your the best!
@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.
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 ...
@dbj: I don't have a Win8 machine, but I'll try to grab one.
Very useful, thank you. Please keep it up if you see any other options for image resizing in the future!
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)
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,
// new CSharpArgumentInfo(CSharpArgumentInfoFlags.None, null),
// new CSharpArgumentInfo(CSharpArgumentInfoFlags.LiteralConstant |
// CSharpArgumentInfoFlags.UseCompileTimeType, null)
SetterSite.Target(SetterSite, dyn, val);
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.
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. :)
Yes, Phil, that's the code I'm using as well for Orchard.
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
@Naresh: it's not classy that you need for that. Look at the meta feature in Vandelay Industries.
It doesn't appear you've made that repro public yet. Just an "access denied" here.
Good news! Access denied for repository :)
It's public now.
thank you for your review. I was looking for this kind of solution. I will give it a try!
Did you post the original images somewhere?
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.
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.
@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.
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.
Thanks, very useful information and benchmarks.
@Axel: you can doanload the hummingbird image from here: www.flickr.com/.../photostream
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.
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.
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 :)
@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.
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.
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.
@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 ;)
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.
[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.
@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.
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!
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?
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
Hey, is the comment I posted 2 days ago regarding WIC and Marshal.ReleaseComObject still in moderation, or are some comments getting lost?
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!
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.
@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.
@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.
What spam filtering system does it use?
I don't know, it's whatever Community Server uses. In other words it's a piece of crap.
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?
@nathanael: I run the Orchard CMS project.
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.
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?
@Sean: That's because you need a project in your theme for code to get picked up.
@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.
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?
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 !!
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.
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);
I am on MS Vista, ASP 4.0, should I upgrade to Win7 to use WIC? Thanks.
@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.
@Avie2: you should upgrade to Windows 7, period.
@Chris: just use the ImageResizer library.
@Anunay: please contact support.
@william: these things probably get cached. Try restarting the server and see if it makes a difference.
@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 :)
As I said, you should upgrade in any case. I don't know about Vista support.
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?
M.
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.
@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.
@Avie2: I'm pretty sure MSN uses WIC.
@Bertrand Le Roy, *LOL*
beautiful post and exactly what I need for orchard. Thanks for sharing!
Maybe the site config shouldn't go in a SQL database
(sigh)
NuGet.org uses NHibernate ?
That's second MS site then.
First I heard of was http://channel9.msdn.com
nhforge.org/.../success-stories.aspx
Why not using Orchard to power the new asp.net site ?
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.
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
NuGet stats are public at http://stats.nuget.org. FYI.
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
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)
You can find NuGet stats at http://stats.nuget.org/, though it's not exactly fast.
wld you prefer if I blog that my comment never made it thru moderation & isnot visible on your site?
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!
Good work with Orchard. It's too bad that other Microsoft teams are not eating the dogfood.
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 :)
Why are you not using Orchard for your blog?
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.
Usage of WPF libraries in server side code is not supported nor advised.
@secgeek: you could have bothered to read the post.
@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.
@Yex: maybe. Does it work with Azure?
@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?.
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.
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.
Uuummm...no. You definitely got me on that one, doesn't support Azure...which is a pretty significant difference (that I missed).
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.
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.
@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?
@Venkat: I doubt Scott monitors the comments on my blog. You'd have better luck contacting him directly.
@Petar: not anymore from what I understand: it's EF now.
how can we make the properties editable not read-only??
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
#csharper: this is just a proof of concept. You'd need a more complete implementation of the interfaces in play here.
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.
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.
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!
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
My OnPageLoad code looks like this
Album1.Path = "~/images/propertys/1"
What am i doing wrong
Many thanks inadvance
Oops, sorry... I didn't know that when I posted that comment.
BitmapImage bi = new BitmapImage();
// **Set only one side** !!
bi.EndInit();
@wadison: that's using GDI+
Attach a debugger and find out...
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:
[...]
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).
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.
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.
@Sarkie: please file a bug for that on vandelay.codeplex.com/.../Create
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.
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 ;)
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.
@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.
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.
This can be reason 10 billion why I love Orchard.
This is what makes Orchard so awesome and fun to work with. This is what gives Orchard that extra edge over other opensource cms.
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.
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!
@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.
How does this differ to how .Net MF is run?
@Joe: I don't know. How is .NET MF run? I couldn't find any info on governance on their site.
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.
@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.
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?
One of the best engineered CMS's out there and great job guys.
@stromblon: no, we have had meetings every single week since the election. What made you think we didn't?
I dunno - that's why I asked about it. I figured you might know Scott.
@Joe: I don't, sorry.
@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.
@stromblom: that's because I didn't send notes last week.
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?
@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.
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.
@Todd, that hypothesis doesn't resist scrutiny: Orchard was open source from day 1.
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.
Doesn't withstand scrutiny :)
Thanks for Orchard
@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 ;)
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.
@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.
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.
@Alexandre: I would recommend you contact support if your forum post doesn't receive answers from the WIC team.
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?
@Binu Jo: It's probably time to move on to a recent version of ASP.NET. This was fixed about a century ago :)
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.
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.
@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
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.
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 ;)
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
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..
Best of luck with your new adventure, and keep rocking the World with Orchard!!
Out of curiosity, is Nwazet pronounced as noisette?
Simo
You're probably not looking at the right shape. The alternate should be layout-url-aboutpage.cshtml if you're using URL alternates.
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.