Published
by

Comments

# LA.NET [EN] : Writing better OO with ATLAS ??? part II said on Wednesday, July 26, 2006 7:38 AM

PingBack from http://msmvps.com/blogs/luisabreu/archive/2006/07/26/105828.aspx

# LA.NET [EN] said on Thursday, July 27, 2006 6:20 AM

In the previous
posts, I’ve spoken about classes and namespaces. Today I’m writing about interfaces....

# LA.NET [EN] said on Thursday, July 27, 2006 6:20 AM

In the previous
posts, I’ve spoken about classes and namespaces. Today I’m writing about interfaces....

# john doe said on Friday, August 25, 2006 1:56 PM

Nilsson not Wilson

# luisabreu said on Saturday, August 26, 2006 8:23 AM

oopss...thanks.

# LA.Net said on Sunday, August 27, 2006 5:20 PM
# LA.Net said on Sunday, August 27, 2006 5:20 PM
# horny gay toons said on Tuesday, August 29, 2006 7:36 AM

boys in swim suit
when does puberty start in boys
*** fox s golden boys
boys dont cry cure
cute handsome boys

# Atlas notes said on Monday, September 04, 2006 1:33 PM

Here are the URLs for two nice Atlas articles about the UpdatePanel: Luis Abreu will show you how to

# Garbin said on Wednesday, September 06, 2006 3:03 AM

This is cool content, thanks!

# luisabreu said on Wednesday, September 06, 2006 11:52 AM

Thanks for the kind words :)

# Ramzy Ebeid said on Friday, September 15, 2006 5:26 PM

Dear Mr.Luis

My name is Ramzy N.Ebeid

first of all sorry for interruption.

i am using ASP.NET 2.0 C#

i have a question related to the part of Atlas:AutoCompleteExtender.

i want to pass more that 2 parm., i am also asking if there is a way to make this issue manully, if yes then can you tell me how to do it.

i saw in your posts that you said

"the scriptmanager controls get's the js file that is embedded in the atlas.dll. when you install atlas, you'll also get the js files on the installation dir. if you weren't using the scriptmanager control, you could get it working by adding the atlas.js file to your web app and then you could change it so that it would let ou pass more that 2 parameters..."

1 - so please can you tell me which file exactly is responsible for this part.

2 - this list that opens in the AutoCompleteExtender can you please tell me also from where it run in that fille too.

i am thinking and i want to know how the filling of this list is done, so that i can make it manully.

i am sorry again, but i am really stuck in this part.

thank you.

Ramzy N. Ebeid

Team Leader – Development Division

USBC

Telephone:(720)212-0810

email:zonzone@hotmail.com

# LA.NET [EN] said on Tuesday, September 19, 2006 1:46 PM

Most guys that have been using ATLAS till now haven’t had the time (or patience) for understanding

# Max Mulawa said on Friday, September 29, 2006 4:30 AM

Hi

Great post, thx for help.

I think you should change CSS code from

<style type="text/css">

#test div

{

   text-decoration: underline;

}

</style>

to

<style type="text/css">

#<%=test.ClientID %> div

{

   text-decoration: underline;

}

</style>

because if you add runat server attribute to the div element ASP.NET will rename it using containers name also.

It was work working ok for IE 6, SP2.

# Atlas notes said on Wednesday, October 04, 2006 6:08 PM

Luis Abreu posted an interesting article about the xml-script, that is the base of the declarative programming

# Bertrand Le Roy said on Wednesday, October 04, 2006 6:31 PM

The xmlns:tagprefix="some string that nobody really cares what it is as long as it's unique" declares to the xml parser that you intend to use tagprefix inside of this tag. So if you change it, you must also update all tags inside of that so that it uses your new prefix. "script" happens to be the default prefix for the Atlas classes, so you can not specify it or specify it, it doesn't matter. We still declare the namespace in case someone wants to use the namespaced tags and still have valid XML.

Now the tag prefix can't be arbitrarily changed in the CTPs because it's also being declared by the components themselves when they register their tag.

This is the thing that kinda sucks and that we're changing.

In Atlas 1.0, the page developer is responsible for mapping the tag prefixes to namespaces, like this:

xmlns:tagPrefix="My.NameSpace"

Once you've done that, we're going to use that information to parse the tags. For example, <tagPrefix:somecontrol/> will instantiate My.NameSpace.SomeControl.

# Luis Abreu said on Thursday, October 05, 2006 5:35 AM

glad to know that it's going to be fixed in the release. btw, i've never heard of default prefix in xml...i've heard about default namespaces which is what you get when you simply use the xmlns="...". regarding the current behavior, it's really wrong since what's important is the uri, not the prefix. I can't really understand why the behavior you describe as being used in the final release isn't available in current and previous versions of the CTPs.

btw, and judging by your words and by what other members of the team have said in the atlas forums, it really looks like there are a lot of changes prepared for v1.0. should you guys start sharing with us?  

I mean, there are already lots of guys that are using atlas in their apps and if you ask me, seeing that v1.0 is completly different from

what we've been working for months now isn't really what you expect, is it???

thanks.

# Joel Rumerman said on Thursday, October 05, 2006 1:58 PM

Congrats!

Your posts on MS AJAX are fantastic.

# Bertrand Le Roy said on Monday, October 09, 2006 1:46 PM

I'm not sure about your first paragraph, it feels a little like being asked why our pre-beta CTPs aren't perfect ;)

Yes, there's going to be a lot of changes in 1.0, the design of which we've started getting feedback on through ASP Insiders and dev labs a while ago, and we're preparing a new CTP, but it's just not ready yet. I think we've been pretty clear from the start that even though there's a go-live license that enables you to publicly experiment with the technology, the CTPs are pre-beta and are subject to change. Actually, that's the point of CTPs: getting feedback as soon as possible so that we can make changes based on that feedback.

Hope that helps.

# luisabreu said on Tuesday, October 10, 2006 3:19 AM

hello again.

well, you're right about ctp: they aren't prefect...btw, i was not asking why the ctp had bugs. i was just curious on why you guys decided to use xml validation based on the prefix name when everyone else does it according to the standard (ie, based in uri). if everyone follows a specific rule, why re-invent the wheel?

at least this has been corrected for v1.0 :)

# LA.NET [EN] said on Monday, October 23, 2006 12:13 PM

It's been a long time since the last time i've posted here...However, i'll try to compensate the days

# Bertrand Le Roy said on Monday, October 23, 2006 5:07 PM

Luis: you might want to retry the download. The Array problem you mention has been fixed and the build that's online now has the right bits.

# luisabreu said on Tuesday, October 24, 2006 3:41 AM

Hello Bertrand. yes, garbin has tol me about that and it seems like it's working now (though I've still got several things to test :) )

# LA.NET [EN] said on Tuesday, October 24, 2006 7:59 AM

In my previous post , I've presented an alternative to using the old page instance methods that existed

# Joel Rumerman said on Tuesday, October 24, 2006 11:07 PM

Luis,

Nice post.

One thing I'll add in favor of the instance based page methods is that with the .NET control hierarchy and the way that clientIds end up being concatenations of parent Ids and so forth, it can be difficult and a bit unruly to know the exact id of the DOM element you're trying to access when you're on the client. If I have a control that's three levels deep, MyPanel1_ctl0_ctl_0_1_MyLabel I have to emit the exact Client ID of MyLabel to the client in order to access it through JavaScript. This can be quite a pain in the ass. (Something like Script# could definitely help.) On the other hand, if I'm back on the server I can probably access the label's value through MyLabel or at least in a simpler way. The control tree is a *** to work with when you're solely working with it through JavaScript.

However, I definetly agree with your suggestion at the end of the post recommending that MSFT end the debate by supplying both static and instance based page methods. Let us make the decision, but don't take away our capabilities. Especially for us early adopters who may have relied upon them. Ahh-HEM! We don't need to be saved from ourselves.

(BTW, I'm writing this using FF2.0 and the inline spell checker rocks!)

# Luis Abreu said on Wednesday, October 25, 2006 3:25 AM

hello Joel.

well, i understand your point of view (that's why i proposed getting back page methods). I still think that page methods don't give us any additional value and I do think that we would be better without them.

the main problem i see with them is that they send a lot of data back to the server and you can only use that info as read-only info (which is was i still think that the proper thing to do in a ajax page is to use javascript to get the values from the dom).

i agree that sometimes it's hard to get the reference to the html element, but let's face it: you can easily inject global variables which point to the controls from the server side page (at least, that what i do and it really simplifies my client code)

# vikram said on Wednesday, October 25, 2006 7:30 AM

Hi Really nice post.

I wanted to know one more thing. NOW you do not get the Microsoft.Web.Ajax dll. This is installed in the GAC. but the hosting provider might not be good enough. What Can i do about that.

http://www.vikramlakhotia.com/New_Beta_version_of_the_ASPNET_AJAX_released.aspx

# vikram said on Wednesday, October 25, 2006 7:34 AM

Good writing. I liked the article

# Joel Rumerman said on Wednesday, October 25, 2006 10:59 AM

"you can easily inject global variables which point to the controls from the server side page (at least, that what i do and it really simplifies my client code)"

-- Something like "var myLabel = new Sys.UI.Label('myPanel_ctrl0_myLabel');", right being emitted through server code? That's normally what I've been doing too.

I guess I'm also a bit frustrated that MSFT used the Beta release to make this change. It's not so much an under-the-hood change as say switching from closures to prototypes, but a feature change. I guess I'm just not sure why they didn't make this a CTP change previously so it wouldn't feel like such a big change at the Beta release point.

# Luis Abreu said on Wednesday, October 25, 2006 3:00 PM

Hi guys.

vikram: though it may not be full proof, you can try to put the atlas dll in the bin folder and set the trust level of your web app to full trust. i haven't tested it yet.

Joel: i agree with you on the breaking change thing. however, i do really think that nobody should be using them due to the performance problems associated with them.

# LA.NET [EN] said on Wednesday, October 25, 2006 4:07 PM

It seems like Dino Esposito isn't happy with the changes made to the AJAX extensions . I certainly agree

# Bertrand Le Roy said on Thursday, October 26, 2006 2:39 PM

Believe me, we all wish it could be case-sensitive (it's actually a lot easier to implement). Unfortunately, Safari doesn't let us.

One thing to note is that xml specs require the namespace to be a uri. We don't enforce that but we recommend that you use the javascript protocol: xmlns:test="BLOCKED SCRIPTLA".

# Luis Abreu said on Thursday, October 26, 2006 5:25 PM

hello again.

didn't know that, but then i'm not a mac user and the last time i looked safari only run in mac (and it was a long time ago :) )

so, regarding the javascript protocol, that means that i'd have to register the namespace with: xmlns:test="BLOCKED SCRIPTLA". is this correct or did i got it completly wrong? if i got it correct,  i'm curious on the need to do this since it looks like the method strips the javascript prefix when it finds it...

btw, and since you've mentioned it, why don't you guys add a method that would let us associated a xmln namespace to a code namespace instead of trying to get that automatically?

thanks.

# Luis Abreu said on Sunday, October 29, 2006 3:11 PM

i've just noticed that there's a mistake in my previous comment. i meant: xmlns:test="BLOCKED SCRIPTBLOCKED SPRIPTLA"

# Eyal said on Monday, October 30, 2006 1:41 AM

The xml-script don't work for me in add-on CTP.

Can you post please full simple solution, that I see what I do wrong.

Thanks.

# EPISODE6-360 WIRED Weekly News Recap and Xbox MVP ApperanceWeekly Recap -- Centplus Tech said on Monday, October 30, 2006 2:59 AM

PingBack from http://www.centplus.com/episode6-360-wired-weekly-news-recap-and-xbox-mvp-apperanceweekly-recap/

# Mike McIntyre said on Monday, October 30, 2006 8:59 AM

I get an exception when I use the samle code.

At the point where the program tries to divide by 0 I get the a pop-up in the IDE that says:

"DivideByZeroException" was not handled by user code."

To try the code I created a new VS 2005 ASP.NET Ajax Beta 1 project and pasted your code into a web page.

I have been having the same issues when I try to use the new error handling based on the "How to: Customize Error Handling in Partial-Page Updates" tutorial at:

http://ajax.asp.net/docs/tutorials/usingMsAjaxLibrary/displayErrorMessage.aspx

And, when I run the example at that URL it doesn't appear to work either.  It returns a page that says the Ajax web site is down everytime and yet the site is not down.

Have you been able to get your code to work?

If so, do you have any thoughts on why it would not work for me?

Thanks,

Mike McIntyre

# Luis Abreu said on Monday, October 30, 2006 12:47 PM

Hi.

I'm assuming that you're hitting the start debugging option in the VS IDE (a full green arrow head). if that is the case, you'll always have the exception  popup in the IDE. hitting that button again should make you go throught the exception and you should get the expected results.

btw, if you right click the page and choose view in browser, you should get the normal behavior without the IDE popup.

# Mike Weerasinghe said on Monday, October 30, 2006 9:24 PM

Hi Luis,

Does the ScriptManager AsyncPostBackError fire HttpApplication Error event?

The reason I am asking is because I have a web site that uses ELMAH(Error Logging Modules And Handlers) module from GotDotNet to log all ASP.NET errors to a database. It works by hooking in to HttpApplication Error event. Previous CTP versions of Ajax (Atlas) did not log any errors to the database when and Ajax related error occured.

Do you have any information on this?

Thanks for a great article.

Mike

# Joao Paulo Carreiro said on Tuesday, October 31, 2006 7:46 AM

Won't this cause a "memory leak" on the application?

You're keeping the pages "live" by having a event hook up but by never removing it.

Why not use PreRequestHandlerExecute to hookup and PostRequestHandlerExecute to remove the hook?

# scottgu said on Friday, November 03, 2006 3:41 AM

Luis Abreu是ASP.NET MVP,在 http://msmvps.com 博客站上拥有一个精彩的博客。今天早些时候,他贴了一篇精彩的教程帖子,描述如何使用ASP.NET AJAX Beta1版中的一些新特性,来给你的应用添加更健壮(robust)的出错处理。我强烈推荐你去阅读以及为将来之用而收藏它。

# Keyler said on Monday, November 06, 2006 6:47 PM

今天在 LA.NET的blog 看见一个有趣的东西

# Atlas notes said on Tuesday, November 07, 2006 6:29 PM

This is an important change from beta1. In the new beta2 release, scripts added through the ScriptManager

# Atteint de Javascriptite aigüe said on Tuesday, November 07, 2006 8:02 PM

Fox nous a TRES brievement annoncer la mis en ligne de la beta 2 de Microsoft Ajax Extension : ASP.NET

# riceboyler said on Wednesday, November 08, 2006 7:12 AM

Luis, great post.  I asked this question on the ASP.NET forums yesterday, but perhaps you'll have an answer as well.  I've noticed that SetFocus() only seems to work on the first async postback, and fails thereafter.  Can you tell if I'm correct in what I'm seeing?  Thanks.  Jason

# luisabreu said on Wednesday, November 08, 2006 1:32 PM

To be honest, i just tested it in firefox and it worked. in fact, even in opera it works without a problem...i'll try to run it with IE to see if it works...

# luisabreu said on Wednesday, November 08, 2006 4:50 PM

hi.

you're right...i'm seeing this too...i'll try to find more info on what's going on...

# Brian Donahue said on Thursday, November 09, 2006 10:14 AM

This sounds a lot like an issue we're having.  Feel free to contribute, or follow along our forum thread:  

http://forums.asp.net/thread/1458862.aspx

# Brian Donahue said on Thursday, November 09, 2006 12:05 PM

Hi Luis,

Thanks for the informative post.  I posted the following question to your response on the asp.net forum:

Very interesting... how did you override it?  The BridgeHander is generated at compile time, right?  Are you editing the generated class in Temporary ASP.NET Files, or doing it some other way?

# luisabreu said on Thursday, November 09, 2006 12:57 PM

hello.

sorry, i've lost the frame id so i can't reply on the forums. well, simple add the method on the partial class maintained in the asbx.cs file

# Brian Donahue said on Thursday, November 09, 2006 1:07 PM

Hmm.  We are using the Website Application Project rather than the Atlas Website Project.  I do not see an an accompanying .cs file for our .asbx files at all...  I was only able to find this file by getting the stack trace from javascript, and finding the generated class in our Temporary ASP.NET Files folder.  Is this something you could/should manually add?  BTW, forum link here:  http://forums.asp.net/2/1459049/ShowThread.aspx#1459049

# luisabreu said on Thursday, November 09, 2006 3:12 PM

hello.

when you create the asbx file you can also add a codebehind file. can't you do that in the web app project?

# Mitch said on Sunday, November 12, 2006 2:01 AM

Trying your example produces an odd error error in IE 7.  After the alert displays with the message and I hit ok, I drop into test.js in VS 2005 with the breakpoint at Sys.Application.notifyScriptLoaded() - runtime error: object doesn't support this property or method.

I check off Disable script debugging in IE and get the Error on page after I dismiss the alert that says: Sys.ScriptLoadFailedException:  The script "test.js' could not be loaded or does not contain the Sys.Application.notifyScriptLoaded() callback.

Do I have something configured incorrectly?  Or? Thanks in advance.

Mitch

# Dmitry Bogatykh said on Tuesday, November 14, 2006 4:29 PM

Thank you very much for this post!

Because of lack of AJAX documentation, it was really helpful!

# Eilon (Microsoft) said on Thursday, November 16, 2006 1:14 PM

This is a bug in IE6 and IE7. I just checked in a fix to ASP.NET AJAX a couple hours ago for this issue.

Thanks,

Eilon

# Chris said on Thursday, November 16, 2006 6:02 PM

Thanks for the post.  I follow why this is happening, but I added the controls to the page from the control panel in VS 2005.  Would you mind posting a possible solution. I do not know how to carry the Init event.  I'm fairly new to coding so, please elaborate.

# Bill Robertson said on Friday, November 17, 2006 4:00 AM

I added a manual ScriptReference to an embedded resource but was receiving a client side error: Error:

# Daniel Balla said on Tuesday, November 21, 2006 2:30 AM

Hi and thanks for this useful post.

While fully digesting it I was wondering ... would you mind to elaborate a bit on: "....if you use extenders (which is not a problem to me since i'm a firm believer in client behaviors ;) )"

# Luis Abreu said on Tuesday, November 21, 2006 5:37 AM

well, you could say that i'm a believer in the client side approach and do prefer to use client behaviors instead of extenders (though i must say that i do like the new model where you have a mapping from one to one between extenders and behaviors)

# Daniel Balla said on Wednesday, November 22, 2006 5:15 AM

That's something I like about the extenders as well (even though I didn't get to look deep enough to learn if that still works if you encrypt the viewstate). But in the idea of using just client behaviours instead of extenders, how would you manage them (associate to given server control)?

# Luis Abreu said on Wednesday, November 22, 2006 1:59 PM

several options here, though in that case, i'd say that you should go on using extenders (i still think that an ajax page should be client based and not server based, though i agree that this is not allways possible)

# Daniel Balla said on Thursday, November 23, 2006 5:32 AM

Ok. Thanks for sharing your thoughts

# Garbin said on Thursday, November 23, 2006 10:44 AM

Congratulations!

# Bertrand Le Roy said on Friday, November 24, 2006 12:40 AM

And thanks!

# cpjolly said on Friday, November 24, 2006 1:20 PM

Luis, do you know of anywhere that xml-script is documented ?

It's really hard to know how to get started, especially as lots of the examples out there don't seem to work in the November CTP...

Thanks for any suggestions

Chris

# Luis Abreu said on Friday, November 24, 2006 4:44 PM

hello.

well, the best way i know is to read the source files. all the objects that can be used from xml-script have a descriptor property applied to the class and there you'll be able to see the properties, methods and events which you can use from xml-script.

# Joel Rumerman said on Saturday, November 25, 2006 12:31 PM

Seriously, take a week off and let the rest of us catch up :-)

# Joel Rumerman said on Saturday, November 25, 2006 12:40 PM

So this leads to the question: If I have custom JavaScript that executes a web service method and then loads a dropdown with the results and I want to then post this page back, I would need to turn Event Validation off, correct? Otherwise, the dropdown values would be invalid and throw the EventValidation exception that complains that I'm attempting to postback an invalid value. EventValidation is protecting me against JavaScript injection attacks, but that's exactly what I'm doing on purpose to my own site.

That being said. What do I do? Do I leave EventValidation on be able to use Extenders or do I turn it off so I can on demand load bits of information using web services that affect my dropdown's values?

Also, doesn't the cascading dropdown execute a webservice and load up the dropdown's values on the fly? If so, how does it get around the problem if its put into an UpdatePanel? I haven't looked at it in a long time, so maybe the implementation changed.

# Luis Abreu said on Saturday, November 25, 2006 5:50 PM

Joel, there's already a post on the toolkit forum (i think) where a guy from the team explains that there is a new intermediate release which fixed the problem i've described. with that version, there shouldn't be any problems with turning off event validation

# Joel Rumerman said on Sunday, November 26, 2006 12:00 PM

Cool. I'll take a look at the toolkit forum and find the post.

Thx.

# Alex Lindgren said on Monday, November 27, 2006 9:29 AM

As someone who benefitted recently from your contributions to the forum, THANKS!

# Pete said on Monday, November 27, 2006 3:59 PM

Hello Luis,

I am bumping into the same problem that Joel described.  I have searched quite a bit on ajax.asp.net.  I did find one link that you recommed he look at.  Can you suggest some buzz works to help me find the link you described?   Here is what I used "ClientScriptManager.RegisterForEventValidation Webservice"

# Joel Rumerman said on Tuesday, November 28, 2006 12:58 AM

Just in case people are looking for the post that describes the work around...

http://forums.asp.net/thread/1471011.aspx

Luis, excellent job as usual.

# Atteint de Javascriptite aigüe said on Tuesday, November 28, 2006 2:27 AM

Avec les anciennes versions d'Atlas la gestion des erreurs avec les UpdatePanels n'étaient pas des plus

# SeBeuH's WebBlog said on Saturday, December 02, 2006 11:50 AM

Je me suis retrouv lors d'un dev d'une application Web dans une petite galre avec l'ASP.NET AJAX Extention ! La situation est simple, j'ai une page ASPX contenant une gridview dans un UpdatePanel qui est protge par un formulaire...

# Bertrand Le Roy said on Sunday, December 03, 2006 10:40 PM

You'll be glad to know that in the RC release, you can't redefine a class at all. So in this case you'd get an error message telling you that the class is already defined.

# Luis Abreu said on Monday, December 04, 2006 3:32 AM

that's is good, though we still need to solve the double insertion issue which happens when you register a file on a script control (IScriptControl) and also in the scriptmanager control (currently, you get both files inserted on the page and even though i'll get an exception in rc1, what i need is to download only a file).

# Luis Abreu said on Monday, December 04, 2006 4:46 AM

just to be more explicit: can you tell me why the scripts registered by script controls aren't "persisted" in the same list as the ones you add through the scripts property of the scriptmanager control? though i may be wrong, i think that not doing this will let me add two times the same file (as happened in the link i've provided above).

# raffaeu said on Tuesday, December 05, 2006 9:19 AM

I receive this error

Assembly 'Microsoft.Web.Preview, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not contain a Web resource with name 'Microsoft.Web.Resource.ScriptLibrary.PreviewScript.js'.

# raffaeu said on Wednesday, December 06, 2006 3:24 AM

If i try to open Microsoft.Web.Preview with reflector i can see in the resources folder the Preview.js file but when i try to load it into my ScriptManager i receive this strange error.

Do you solved the rpblem?

# ourblogs said on Friday, December 08, 2006 11:18 PM

I added a manual ScriptReference to an embedded resource but was receiving a client side error: Error:

# Thomas Wagner said on Monday, December 11, 2006 12:18 AM

Any specific section of the video? Its 75 minute I believe....

# Luis Abreu said on Monday, December 11, 2006 3:11 AM

Hello.

well, if you watch the first 20 mins, you'll see Jeff saying that updatepanels are good, but aren't great if you really want to have a performant ajax web app (which is why i don't like the updatepanel very much; i mean, it's really cool to see that they've managed to build a control which "ajaxes" a page in seconds, but when you're building ajax pages, you should really need to learn javascript and do most things on the client).

# David said on Thursday, December 14, 2006 7:11 PM

Thanks for the good explanation. Unfortunately, i am droping a user control into a custom Panel control that frames the user control in some common HTML plumbing - a bit like a webpart does for a user control. Anyhow, the user control has an embedded update panel. The custom Panel control overrides the CreateChildControls() method and takes any nested controls (the user control in this instance) and inserts them into the correct HTML container control. This is obviously where the UpdatePanel unregisters itself. How would I force the control tree construction to occur after the PreInit phase? I cant see how i can effect he timing of the control construction.

# Rob said on Friday, December 15, 2006 3:13 PM

I'm having the same problem as David.

# Rob said on Friday, December 15, 2006 6:06 PM

I found a kludge that works for some very specific cases.  Here it is:

I'm no longer inheriting from Panel.  I inherit from WebControl.

I added an ITemplate property to my my Control.

I created ANOTHER control that implements INamingContainer.  Within the constructor of this container I create all my framing controls except for user controls (keep reading).  For those, I have private properties for their containers once they're instantiated.

My CreateChildControls method instantiates a new sub-container control.  Then I call MyTemplate.InstantiateIn(mySubContainer.MyExposedContentContainer) THEN I add this sub-container to this.Controls.

The problem is that I have to instantiate the user controls in preRender and disable their viewstate otherwise my viewstate gets out of whack.  It works for me since those controls are stateless.  Is there another way around this?  Am I doing something out of order?

I would like to be able to instantiate those user controls much earlier than prerender, since I know down the line I, or someone else will need to have programmatic access to them.

# AJAX Extender: Upload de Arquivos sem Postback « PersistentMan said on Monday, December 18, 2006 9:56 AM

PingBack from http://acdelemos.wordpress.com/2006/12/15/ajax-extender-upload-de-arquivos-sem-postback/

# Cyril said on Wednesday, December 20, 2006 7:23 PM

I'm not sure that my previous comment was OK

this.save.apply(this, parameters); and this.save(parameters) is not equivalent

I will take an example

var foo = function(a,b,c){}

We can call it like this foo.apply(this, [1,2,3]) and this is not the same thing as foo([1,2,3]). There is also the call method : foo.call(this, 1, 2, 3)

But this is not the first bug I find this one : http://forums.asp.net/thread/1499508.aspx and I have some other issue more difficult to explain (i can send you a mail if you want)

# Cat Chen said on Friday, December 22, 2006 11:09 AM

相信很多使用过GMail的读者都会觉得它的文件上传功能作得好,首先它支持无刷新上传,其次它能够隐去丑陋的文件上传框。本期的RandomClipping重点推荐两篇与上传有关的英语技术文章,希望对大家...

# cnblogs.com said on Friday, December 22, 2006 11:46 AM

相信很多使用过 GMail 的读者都会觉得它的文件上传功能作得好,首先它支持无刷新上传,其次它能够隐去丑陋的文件上传框。本期的 Random Clipping 重点推荐两篇与上传有关的英语技术文章,希望对大家制作一个GMail那样的上传界面有所帮助。

# mic said on Saturday, December 23, 2006 11:41 PM

How Skype &amp; Co. get round firewalls Skype是如何穿越防火墙的 (tags: security p2p ) 解决IE7以下版本不支持无A状态伪类的几种方法

# A9@Tencent said on Saturday, December 23, 2006 11:42 PM

How Skype &amp; Co. get round firewalls Skype是如何穿越防火墙的 (tags: security p2p ) 解决IE7以下版本不支持无A状态伪类的几种方法

# Luis Abreu said on Sunday, December 24, 2006 2:23 PM

hello Cyril.

Yes, i know they're different. there's a difference between making a call and performing a call and "applying" it to another object (which, btw, is the base of inheritance in the ajax client script type). what i was trying to say was that the apply doesn't make sense in that case since it's trying to perform a call and apply it to the method that it's calling. thus, in this case (and this is my opinion), the correct call should be the one i've written since the save method is being called from another member method (hope this time i've managed to explin it correctly).

btw, regarding the bug, i do recall having seen it. i'm not sure that it's a bug on the platform (i though that parsing was based on localization, but i'm not sure since in the last weeks i've been busy working on non-ASP.NET projects). if you want, you can write me a mail with that bug (and maybe others you've found?) and i promise to take a look. i don't know if i'll be able to help, but i'm really interested in finding out more about those problems.

oh, and merry christmas to you too! :)

# Amit Lohogaonkar said on Wednesday, December 27, 2006 1:33 AM

We have aspx pages with ajax beta and updatepanels.

When session ends it shows

Sys.WebForms.PageRequestManager message received from server could not be parsed

I tried scriptmanager endrequest but it still shows the same error

How to handle this error when session ends.

amit.lohogaonkar@comdaq.net

# LA.NET [EN] said on Wednesday, January 03, 2007 5:09 PM

Here's another generics post (yes, i know I've promised to start writing about WF, but the truth is that

# Rob Kent said on Thursday, January 11, 2007 8:11 AM

Thanks for the useful tip and code. However, I would like to add one caveat to people who are using the scriptmanager on a Master page, as I am.

If you wire up the client-side endrequest handler, either in a global script file or in a master page script block, it will error if the content page does not contain an update panel (possibly other Ajax controls will do).

It seems that the script include for the WebForms lib is only generated in this instance, which means that when the event handler is assigned you get the error: 'Sys.WebForms.PageRequestManager is null or not an object'. If you step into the debugger at this point and look at the Script Explorer, you will see that there is only one ScriptResource.axd file showing.

If you make the assignation conditional, it will avoid the error: if (Sys.WebForms != null) Sys.WebForms.PageRequestManager.getInstance().add_endRequest( endRequest );

# Stefan's Blog said on Friday, January 12, 2007 1:24 PM

Gute Sites &amp; Blogs Alex on Asp.nethttp://blogs.dotnetgerman.com/alexonasp.net/Nikhilik.netExtrem...

# Stefan's Blog said on Friday, January 12, 2007 1:31 PM

Gute Sites &amp; Blogs Alex on Asp.nethttp://blogs.dotnetgerman.com/alexonasp.net/Nikhilik.netExtrem...

# Garbin said on Monday, January 15, 2007 5:00 PM

Great news Luis, congratulations! I'm sure it will be a very accurate book. Let us know when the book is out :)

# michael. said on Friday, January 19, 2007 10:33 PM

i think i'll hold off until there's a "go live" license.

# Kris van der Mast said on Sunday, January 21, 2007 8:57 AM

Hi,

I hope the book also comes available in English. I speak several languages but Portugese isn't one of them.

Grz, Kris.

# Stefan said on Thursday, January 25, 2007 1:51 AM

How dp i upload pdf files only??

# Stuart said on Thursday, January 25, 2007 10:22 PM

How is it?  Is it viable to use instead of VS2005?

# Lucian N. said on Friday, January 26, 2007 2:29 PM

Luis,

Please comment a bit this scenario: I want AllowCustomErrors="false" in ScriptManage and <customErrors mode="Off"/> in web.config because I lilke to custom handle the errors in global.asax (or in a http module class) based on a custom exception class I built on top of ApplicationException.

Made a few tests on current MS AJAX RTM and it looks like there is no way to make ScriptManager to skip its verifications. Is there something I should know, or this scenario is just not possible yet?

Thanks in advance,

Lucian

# .net_2.0 said on Monday, January 29, 2007 4:49 AM

Even with AJAX capabilities - there are times that a multi-frame page must be generated. Some reasons

# Developer said on Tuesday, January 30, 2007 3:47 AM

Based mail from one of the developer on web parts project in MS we used web parts in developing site like pageflakes or netvibs, however, at the end we did not get what we wanted drag/drop web parts w/o postback... any solution/alternative from any one one urgent basis... please post it here

# Jason Hanford-Smith said on Wednesday, January 31, 2007 5:03 PM

It IS out... yesterday, actually (Jan 30th)

http://www.microsoft.com/downloads/details.aspx?familyid=C6EF4735-C7DE-46A2-997A-EA58FDFCBA63&displaylang=en

# Susan said on Wednesday, January 31, 2007 8:17 PM

http://www.thundermain.com/rss

follow that feed and you'll know when stuff is out.

# Luis Abreu said on Thursday, February 01, 2007 4:01 AM

Hello.

Susan: yes, I could do that. But i think that updating the main page of PowerShell is the way to go...

# Lucian N said on Thursday, February 01, 2007 5:14 PM

Luis,

I need your help -- I believe both of your hands :).

Please comment this scenario: I want AllowCustomErrors="false" in ScriptManage and <customErrors mode="Off"/> in web.config because I lilke to custom handle the errors in global.asax (or in a http module class) based on a custom exception class I built on top of ApplicationException.

Made a few tests on current MS AJAX RTM and it looks like there is no way to make ScriptManager to skip its verifications. Is there something I should know, or this scenario is just not possible yet?

Thanks,

Lucian N

# Luis Abreu said on Thursday, February 01, 2007 5:25 PM

Hello.

Does this help (it's old an i haven't tried it in the final release...):

http://msmvps.com/blogs/luisabreu/archive/2006/10/31/Handling-errors-globally.aspx

# Luis Abreu said on Thursday, February 01, 2007 5:25 PM

Hello.

Does this help (it's old an i haven't tried it in the final release...):

http://msmvps.com/blogs/luisabreu/archive/2006/10/31/Handling-errors-globally.aspx

# Lucian N said on Friday, February 02, 2007 4:33 AM

Luis,

Thanks for replying.

I took Joao's approach and is working fine.

There is a problem with Server.Transfer(...) who cannot stop current page processing and ends with a javascript alert window. Still Request.Redirect(...) to error page saved the day, but with some downsides (and I'm not sure I like that :)).

The idea is -- as you pointed out -- to move the error handling scope from application to page. Global.asax or a http module is a good place to do that.

Great help!

Thanks,

Lucian

# Lucian N said on Friday, February 02, 2007 4:34 AM

Thx for pointed it out.

Lucian

# Luis Abreu said on Friday, February 02, 2007 5:16 AM

Hello again.

Lucian, you'll never be able to use Server.Transfer because doing that will return the HTML from the destination page and the client side is expecting a predefined message format (that's why you can't use server.transfer). on the other hand, when you do a response.redirect, the response is "intercepted" in the server side by the scriptmodule and it'll transform the response so that the client side object understands the response. that's why response.redirect rowks and server.transfer doesn't.

# Rahul Bhansali said on Friday, February 02, 2007 7:30 PM

Hi !!

I don't believe this ! 10 mins back I had been sitting for about 2 hours trying to understand about what is the Always, Conditional, PostBack Trigger etc and had reached my own conclusions of how certain things are just not possible in AJAX, cursing Microsoft.

Your blog has cleared it up all. I am amazed at how visiting ths single page when I began my search, I have got my understanding just 'right'. Your analysis,, findings and expalnation is simply 'clear-cut'. Thanks a lot. Will look forward to seeing more 'gyaan' from u. Do let me know, if possible, when u write ur next blog. You already have a student.

Keep the good work going.

# アフェリエイトのためのブログ製作までの流れ said on Monday, February 05, 2007 7:28 AM

TB失礼します。ブログ記事とても参考になりました。ID Manager で検索していてこちらにたどり着きました。またお邪魔させて頂きますね。今後とも宜しくお願いします。

# Alex said on Tuesday, February 06, 2007 10:16 AM

Cumprimentos!

# Saravanan Sivashanmugam said on Thursday, February 08, 2007 10:32 AM

Hi luisabreu,

Very good post.I referred lot of posts but this one worked.Thanks a lot.

# Li Chen said on Sunday, February 11, 2007 3:38 PM

Can you place the MultiView inside an UpdatePanel instead?

# Luis Abreu said on Sunday, February 11, 2007 3:55 PM

hello. yes, you can. in fact, in the previous example, that's what you should do if you want to change the view shown to the user without a full postback.

# Cyril said on Friday, February 16, 2007 7:44 AM

Why don't you use the AsyncPostBackSourceElementID property of the ScriptManager ?

# Luis Abreu said on Friday, February 16, 2007 4:38 PM

howdy!

you're not going to believe it but I've looked at the ScriptManager API and didn't see that! thanks Cyril!

# shinhee.kim | frontend technologist » Blog Archive » Forcing a partial postback from an HTML control said on Monday, February 19, 2007 12:08 AM

PingBack from http://www.shinstudio.com/sh.kim/?p=237

# rkm said on Tuesday, February 20, 2007 6:26 AM

hi, i'm developing an application and yesterday i receive the nice zebra tlp 2844... :S

i have ti print label on it, only text and i am working in visual studio 2005 in C#,,, muy question... do i need some dll to make the printer work, or i should do like your example, writing a text  file o sending to the printer... i'm confused and afraid... thankz

# rkm said on Tuesday, February 20, 2007 7:22 AM

i've tried your code, but it give's me this

{"Identificador no válido.\r\nNombre del parámetro: handle"}

not valid identifier. parameter name: handle

:(

# LA.NET [EN] said on Wednesday, February 21, 2007 1:35 PM

After posting about the new release of reflector , I've just noticed that there's a ppt file that gives

# Kitu said on Thursday, February 22, 2007 12:42 AM

Hi,

   i have a page whcih uses partial post backs ,i have some  server side validations in the page, if  validation fails i used throw an application exception to get the message to the client tha validation has failed. All this is working fine when i am setting the Cutom errors mode "Off"  in web.config ,but when i set it to "on" the exception raised is gettign habled some where and i am able to get the exception but with the exception message cleared message.

Does any body have any suggestions on this problem?

Thanks in advance

Kitu

# Gopala said on Thursday, February 22, 2007 4:03 AM

Hi,

I am facing the same problem as Amit stated above....

When Session ends and i try to do a partial postback i get the same error popup.

# Paul.Vencill said on Thursday, February 22, 2007 5:49 AM

Luis,

Have you managed to get the draggableListItem behavior to work w/o using xml-script?  If so, do you have a code sample?  I've been beating my head against it for a while now, and it's getting more than frustrating. THe problem seems to be that I can't figure out how to create the templates correctly.

Thanks in advance!

paul (from ajax.asp.net forums)

paul.vencill@velocitydatasolutions.com

# Luis Abreu said on Thursday, February 22, 2007 10:32 AM

Hello.

the code I've written won't work if you try to print to the usb port. on the other hand, if you have the printer on the usb port, you can share it and then you can pass the name of the shared printer to the printing code (ex.:\\machinename\sharedprintername).

btw, note that the sample writes to a file only for tests. you can remove that line and send it directly to the printer by using the interop code.

# Bruno 'Shine' Figueiredo said on Friday, February 23, 2007 5:23 AM

why not use other js library, like prototype, mootools or scriptaculus? all of them support OO development. As I call, none have support for namespaces, but this is a simple function to implement. Mootools is the most flexible, allowing you to choose the packages it contains.

# Luis Abreu said on Friday, February 23, 2007 8:24 AM

Yes, i could do that too. but why must i use yet another framework when AJAX extensions already has what i need?

# Bertrand Le Roy said on Friday, February 23, 2007 3:31 PM

Why don't you just use a scriptpath and customize the file to remove everything you don't need?

We're also thinking about that problem for future releases.

# Luis Abreu said on Friday, February 23, 2007 4:01 PM

Hello Bertrand.

yes, i thought about that but i really have some trouble with understanding everything those licenses say...since you've mentioned it, i'm assuming that's ok to do just that and copy/paste only the OO part that i need for this current project. thanks for the tip.

# Manuel Abadia said on Saturday, February 24, 2007 1:46 AM

Why don't you use Nikhil's Script# to generate your code? It will let you develop in c# and it's type system is compatible to the Microsoft AJAX one.

# Luis Abreu said on Saturday, February 24, 2007 5:47 AM

Hello Manuel.

To be  honest, i don't know Nikhil's script# framework. the problem is not with AJAX OO. it's that by default, if i want to use it, i get to include lots of things which i don't need...

# rkm said on Sunday, February 25, 2007 2:25 AM

i got problems now printing several labels

# Luis Abreu said on Monday, February 26, 2007 3:35 AM

hello.

what sort of prpblems? I had some problems until i got the size of the label right. after that, i'm able to print several labels at a time...

# ... said on Wednesday, February 28, 2007 2:31 AM

Very nice site! Good work.

# Jerome's TOT said on Thursday, March 01, 2007 12:15 PM

ASP.NET AJAX: How to call client-side Javascript once an UpdatePanel request is over

# Bertrand Le Roy said on Sunday, March 04, 2007 11:52 PM

Yes, funny. The Mac will prompt you for pretty much the same stuff, only it will ask for your password every time...

# Bertrand Le Roy said on Sunday, March 04, 2007 11:55 PM

You should declare _deferred, or you'll get a warning in Firefox strict mode.

# Luis Abreu said on Monday, March 05, 2007 2:30 AM

howdy.

you're right. I did declare it, but it got deleted when i was tabbing the content. thanks.

# ASif said on Tuesday, March 06, 2007 8:48 AM

Hi,

I have Added a control In udatePanel through loadcontrol() but ehrn I cause some postback from the control then I lost the data of the control. How can I load a control in UpdatePanel and work as any other control.

# Cat Chen said on Friday, March 16, 2007 7:08 AM

新一期的RandomClippings又来了,这次介绍的两篇文章都很容易读,单词不会太难,语法也简单。在AJAX中制作自定义验证服务(Buildingacustomauthenticati...

# Kris - TECH said on Friday, March 16, 2007 8:24 AM

新一期的 Random Clippings 又来了,这次介绍的两篇文章都很容易读,单词不会太难,语法也简单。 在AJAX中制作自定义验证服务 ( Building a custom authentication

# cnblogs.com said on Friday, March 16, 2007 8:29 AM

新一期的 Random Clippings 又来了,这次介绍的两篇文章都很容易读,单词不会太难,语法也简单。 在AJAX中制作自定义验证服务 ( Building a custom authentication

# Bubba Ole said on Friday, March 16, 2007 6:01 PM

How do I reduce the size of the file to less than 64 k?

I send in  21 to 54 k and the label size baloons to megabytes and the printer would just ignore it.

# Luis Abreu said on Saturday, March 17, 2007 12:26 PM

Hi.

Well, note that in the previous example I always load a control during a postback, ie, that's necessary to make things work out.

# Manuel Abadia said on Sunday, March 18, 2007 10:25 AM

Luis,

I think that a CS degree is a lot easier to get than some years ago.

IMHO, using a language like Java in most CS courses isn't a bad thing. If the course is about implementing an AI algorithm and the student feels more comfortable and productive doing it in Java, it's fine for me.

However, a CS degree needs to teach how to use pointers, recursion, assembly, algorithm complexity and other important things to the students.

If after 5 years of studies you don't know to program in assembler for at least one CPU I think something is failing. I know that assembler is very little used nowadays, that's why there doesn't need to be more than one or two subjects about it, but it is required IMHO.

I have seen people without a CS degree who only know how to use a language and not much more. They don't know how to measure the complexity of an algorithm or what caching is and the implications of iterating through a matrix by rows or by columns... Of course there are always brilliant individuals who don't have a CS degree and are better than people who does have it.

# Bertrand Le Roy said on Monday, March 19, 2007 12:21 AM

Yeah, right, and real men code in assembly.

Seriously, when I interview candidates, I don't care if they have a degree in CS (I don't have one myself) or what language they prefer (I used C# when I interviewed for MS). What I care about is their problem solving abilities and coding skills. C or Java does not make a difference to see those.

# Luis Abreu said on Monday, March 19, 2007 5:20 AM

Bertrand, that's not what I mean. What I'm trying to say is that CS courses should give you the basics about computer science. I do think that knowing something about C, C++ and assembly is a must after completing a CS degree. Do note that I'm not against using Java on  CS courses. What I'm saying is that concepts like pointers are needed and when you need to explain it, you do really need C (or other language that supports it)

# Pedro Costa said on Tuesday, March 20, 2007 11:49 AM

Hi, i'm using ajax 1.0 and after postback the validators desappear. i saw your post but the link to download the project for the dll is no longer available, can you post a new link?

Tks,

Pedro Costa,

Aveiro

Portugal

# Joel Rumerman said on Wednesday, March 21, 2007 10:29 AM

Congratulations Luis! That's great! I'm sure that it took a lot of hard work to put this book together and hope that an English translation comes out in the near future. Your contributions to the community have been extremely valuable and I hope that you continue to be active even now as your book is complete.

# Luis Abreu said on Wednesday, March 21, 2007 3:06 PM

Hello Joel.

thanks for your kind words. Even though I'm not currently monitoring the AJAX forums, I'll try to compensate by adding more entries in my blog :)

# Jim Cheseborough said on Monday, March 26, 2007 2:22 PM

Does not work for me (I need the full postback!).

Maybe it's do to the fact this control is nested in two usecontrols?

Please help!

Thanks!

Jim *AT* Cheseborough.com

# Garbin said on Wednesday, March 28, 2007 4:42 AM

Congratulations Luis! One more reason for learning Portuguese (I don't speak it, but it's not difficult for Italians to understand it - and I love its sound) :)

# Luis Abreu said on Wednesday, March 28, 2007 9:05 AM

thanks :)

btw, italian does sound really better than portuguese!

# LA.NET [EN] said on Wednesday, March 28, 2007 4:57 PM

Some time ago, I've written a small sample that abstracts some of the details associated with printing

# Morten said on Thursday, March 29, 2007 3:02 PM

So basically this means that I can't add an updatepanel in createchildcontrols, since this occurs after OnInit? Hmm...

# ... said on Saturday, March 31, 2007 2:03 AM

Du musst ein Fachmann sein - wirklich guter Aufstellungsort, den du hast!

# Ashish said on Monday, April 02, 2007 1:24 AM

I am dynamically loading control in UPDATEPANEL and once the post back on control takes place, the control disappears. I could not find the script managers AsyncPostBackSourceElementID  property.

What can I do to solve this problem?

Please help me out.

Thanks

Ashish

# Husain said on Sunday, April 15, 2007 3:00 AM

Hi,

I tried your approach and it works very nicely.. my only issue is how do I get information back from the printer.. some commands return values from the printer.. any ideas?

Thanks!

Husain

# Cale said on Wednesday, April 18, 2007 5:09 PM

It seems to be sending the data to the printer but all i'm getting is a flashing data light. Its a ZebraZ4M Plus.

# Tom said on Friday, April 20, 2007 4:13 AM

Thx for your article, works great with my Zebra S4M

# Cyril said on Sunday, April 22, 2007 8:14 AM

I see the same things with Reflector, .net 2.0 controls manage their own viewstate, they don't use childs controls' viewstate. I found this pattern very stupid, I prefer the "proxy" method.

But with the proxy method, where do we have to call the EnsureChildControls() method ? we have 2 solutions on the constructor or on each properties accessor which is very boring. If we call the EnsureChildControls() on the constructor the designer is firing an error because we can't modifiy the controls collection on the constructor. The DesignMode property isn't yet set so we have to test the validity of HttpContext.Current in our control constructor.

If you have an another solution i'm listening to you :-)

# Luis Abreu said on Monday, April 23, 2007 3:57 AM

hello Cyril.

Well, I'm following the ASP.NET 1.X recommendations: i'm calling ensurechildcontrols on all the properties. Since I'm inheriting from compositecontrol, the controls property is already implemented correctly by that base class (ie, it already calls ensurechildcontrols before calling the base class property).

# Israel Aece said on Monday, April 23, 2007 9:51 AM

Hi Luis,

All references that I found in a Google's search, go to this link: http://atlas.asp.net/docs/atlas/doc/wcf/default.aspx, but it isn't avaliable.

# Luis Abreu said on Monday, April 23, 2007 10:04 AM

Hello Israel. I think those are the old docs...unfortunately, those features were removed during the final betas and rc versions :(

I'm hoping that they add it again during the next version...which, btw, I don't know when it'll be releases

# Scottgu said on Monday, April 23, 2007 10:10 AM

Hi Luis,

The support for ASP.NET AJAX with WCF is in the "Orcas" release of ASP.NET and ASP.NET AJAX.

Hope this helps,

Scott

# Luis Abreu said on Monday, April 23, 2007 12:35 PM

Hello Scott!

that's great. btw, is it already there (ie, does the current beta already has WCF support)? thanks again.

# ... said on Monday, April 23, 2007 4:17 PM

http://www.9cicerone.info/piccole

# ... said on Tuesday, April 24, 2007 12:16 PM

http://www.jazrson51.org/sondaggio

# Dave Reed said on Thursday, April 26, 2007 12:55 PM

Silverlight doesn't support triggers like other than 'loaded'. To get that behavior your have to listen to the events in code and fire the animations that way.

# Luis Abreu said on Thursday, April 26, 2007 2:26 PM

Hello Dave.

thanks for the info. If you're reading this, 2 other questions:

1. are there any plans for supporting them in the final release?

2. maybe you should put that info in the docs because I didn't find anything out there that says what you've just confirmer (in fact, the link i've provided shows the exact opposite behavior)

# Dave Reed said on Friday, April 27, 2007 3:02 PM

1. I don't know one way or the other so I can't really comment on this, sorry.

2. Its definitely an error in the docs, only the Loaded event can be a routed event in Silverlight. I'm also not familiar with what docs there may be out there, but I'm sure docs will be improving with the next iteration.

So in short I'm not all that helpful :)

# Luis Abreu said on Friday, April 27, 2007 3:28 PM

on trhe contrary! You've confirmed the most important thing: there is only a routed event in the current Silverlight version: the Loaded event.

thanks again.

# Mike said on Sunday, April 29, 2007 7:26 PM

I'm doing exactly this work as well right now. One thing I haven't figured out is how to get a good design time experience. I can't get a wpfe control to render using a ControlDesigner. Any ideas?

# faisal said on Monday, April 30, 2007 12:34 AM

iam doing programming. I want javascript codes

# faisal said on Monday, April 30, 2007 1:46 AM

iam doing programming. I want javascript codes

# Luis Abreu said on Monday, April 30, 2007 3:15 AM

Hello Mike.

i'm developing only client side components (ie, javascript wrappers). if you're goingo from the server side, then i think that designers are the way to go. i think that you have several approaches here, though i haven'tr tried any. for instance, you can use the designer to inject the top control? i think that the strategy depends on the way you're generating your controls (for instance, how do you insert the silverlight control on the page...)

# Garbin said on Monday, April 30, 2007 5:02 AM

Hi,

in order to register event handlers, one approach is to assign the handler to a global-scoped variable. In this way, you have created a global method that can be referenced in XAML.

Btw, this is the approach used in the "WPFE-Pad" sample to create a Button control.

# Luis Abreu said on Monday, April 30, 2007 5:25 AM

Hello Garbin.

yeas, you can do that...by using something like that, you should end up with less code that the sample i've wrote. but it still sucks because of the fact that you'll have to "translate" all the events to unique method names which are mapped back to instance methods. that's why i don't like having events exposed as strings...

# Tourism aew,Your know end news! What is this? Discounts! <a href= ></a> said on Tuesday, May 01, 2007 4:00 PM

Your know end news! What is this? Discounts!

<a href=  ></a>  

# Yuvi said on Wednesday, May 02, 2007 9:55 AM

Thanks guys! You just saved me a day of trying to figure out why the Triggers collection was there...

# cmwalolo said on Friday, May 04, 2007 5:41 AM

dev.cmwa.eu/.../Default.aspx

Here some sample that can make it ... The idea is to load your customcontrols only on the prerender.

I made some test pages with some PanelManagement class. That can handle this easily.

# Christopher Bennage said on Friday, May 04, 2007 7:00 AM

Can you imagine a whole new breed of Silverlight ads that go fullscreen on load?  Ugh, I'm glad they don't allow it. :-)

# Luis Abreu said on Friday, May 04, 2007 9:48 AM

yeah...i can agree that it might not make sense for most cases (if not all). However, i don't agree that you can only make it in response to an event fired by a silverlight control...

# akhil said on Sunday, May 06, 2007 11:55 AM

This is actually in response to only user initiated events. It is more of a safety/security feature. The intent is to disallow apps that take over the desktop and give the perception of being the computer screen.

# Luis Abreu said on Sunday, May 06, 2007 2:59 PM

Hello.

well, i understand that, even though i still think that it should be possible to do that from an html control event...

# Manuel Abadia said on Monday, May 07, 2007 11:23 AM

Luis,

Unfortunately the link stopped working: This video is no longer available due to a copyright claim by NetResult

# Jonathan Hawkins (jhawk) said on Monday, May 07, 2007 3:47 PM

Hi luisabreu For the current CTP bits you need to do a little more work to get diagnostics to log on the server 1) add a DiagnosticsService.asmx to your web application that points to the DiagnosticsService class 2) add entries to your web.config to enable Diagnostics and 3) write a small amount of app code to log the diagnostics to a store (file, memory, database, etc) of your choice You can find a QuickStart at http://quickstarts.asp.net/Futures/services/doc/diagnostics.aspx that describes the steps. You can find sample code at: http://quickstarts.asp.net/Futures/util/srcview.aspx?path=~/services/samples/diagnostics/default.src Please email me on my blog at http://blogs.msdn.com/jhawk with feedback on the diagnostics service. jhawk

# Luis Abreu said on Monday, May 07, 2007 4:10 PM

Hello Jonathan. yes, you're correct. As you can see by the update, I've discovered it some time after posting the article. Unfortunately, i didn't had the time to write it right away :( After looking at the sample code, i think that my biggest question is why don't you follow the patterns you're using with the authentication and profile services?

# luisabreu said on Monday, May 07, 2007 4:39 PM

hello Manuel.

you're right...and I can'find the video anywhere. damn...

# Loco said on Tuesday, May 08, 2007 1:57 AM

cmwalolo.... can't seem to find the link to download your sample. I'm getting the dreaded "Cannot unregister UpdatePanel " error too. Help a brother out.

# Luis Abreu said on Tuesday, May 08, 2007 3:34 AM

Hello.

I believe that doing that might work since you're loading your control. It wont work, however, if you load you control (that has your panel) and then remove it from the current hierarchy and add it as a child control of another control.

# gonzolder said on Tuesday, May 08, 2007 8:23 PM

ja krevetko! Vsem sasat'!

# Dimiz0r said on Wednesday, May 09, 2007 7:59 AM

sry to bother you guys...

but i'm trying to use the fullscreen option with C#..

Could you tell me where I can find the "BrowserHost" object ?

Thx in advance

# Luis Abreu said on Wednesday, May 09, 2007 8:08 AM

it's in the system.silverlight dll, on the System.Windows.Hosting namespace.

# p3dro said on Wednesday, May 09, 2007 9:11 AM

Now, there's a coach I'd love to have again in my Benfica! :) We had him there, but we sent him away ...

# Jonathan Hawkins (jhawk) said on Wednesday, May 09, 2007 2:50 PM

Hi Luis The Diagnostics work is still in preview stage, so I thought we should get what we have out to customers and listen to the feedback. Yes, one of the areas for the future is to enable a similar model for exposing the diagnostics service as we currently do today for the authentication and profile service. A question for you: You currently have to write app code to log the diagnostics information. If we did something automatic what options you like and what should be the default? integrated with IIS health monitoring (Web Events) or log to text file or log to a database or integrated with System.Diagnostics trace listeners etc or ? I look forward to your feeedback. jhawk

# luisabreu said on Wednesday, May 09, 2007 4:20 PM

Hello Jonathan!

yeah, i'd really love that it would behave like the current services (authentication and profiles) provided by the current version of ASP.NET AJAX.

regarding your second question, it's a tricky one. I've played with the health monitoring system during the betas of ASP.NET (i'm assuming that we're talking about the health monitoring services introduced by ASP.NET 2.0?). I really loved it. Not sure if many use it in their apps though. for instance, even though i really like the health monitoring services, the truth is that I've only used it in production code once (in the other cases, logging is performed through the logging application block or log4net). If you ask me, i think that in my case, i've been using text files and databases for diagnostics purposes.

# LA.NET [EN] said on Thursday, May 10, 2007 1:20 PM

The auto.axd handler is a cool handler that lets you navigate through all the data maintained on a database

# aarst said on Saturday, May 12, 2007 12:28 PM

higuys!What yourblog powered by?

# aarst said on Saturday, May 12, 2007 3:46 PM

higuys!What yourblog powered by?

# airline tickets said on Monday, May 14, 2007 10:41 AM

Hi. Great site.

# airline tickets said on Monday, May 14, 2007 11:16 AM

Hi. Great site.

# airline tickets said on Monday, May 14, 2007 11:18 AM

Hi. Great site.

# airline tickets said on Monday, May 14, 2007 11:22 AM

Hi. Great site.

# LA.NET [EN] said on Tuesday, May 15, 2007 3:43 PM

The DynamicFilter control is a special kind of control: it will let you use ListControl to filter the

# timheuer said on Wednesday, May 16, 2007 6:04 PM

you don't need to instantiate it -- use the silverlight.js file and the createSilverlight() functions to create the correct <object> tag for you --

# Christopher Bennage said on Thursday, May 17, 2007 7:58 AM

I stumbled onto this one myself, well, at least, when I was complaining to my buddy about the mouse events seeming inconsistent he asked "maybe the canvas isn't firing mouse events?"  Doh!

# Luis Abreu said on Thursday, May 17, 2007 8:23 AM

That is waht i'm doing. the problem is that, during the version testing, the silverlight.js code tries to creatre a new Activex AgControl and it throws that error.

I've tested on another 32 bits machine and it worked. not sure on why it's not working on the 64 bits machine.

# Hristo Deshev said on Friday, May 18, 2007 1:23 AM

sender.Content.Managed.SomethingHappened = myMethod;

The above code makes me think that the event handling does not do multicasting. Can we have several event handlers attached there?

--

Hristo Deshev

# Luis Abreu said on Friday, May 18, 2007 3:53 AM

Hello.

yeah, i believe that in this version you can only hook up one method.

# aditya said on Friday, May 18, 2007 7:05 AM

no it isnt,

using System.Windows.Interop

<then>

BrowserHost.isFullScreen = true/false

# Luis Abreu said on Friday, May 18, 2007 7:38 AM

Yeah, you«'re right....the other is internal.

# LA.NET [EN] said on Friday, May 18, 2007 5:54 PM

The DynamicNavigator control does what its name tell you: it&#39;ll build you a list that lets you navigate

# LA.NET [EN] said on Friday, May 18, 2007 6:57 PM

well, almost, that is. And what a ride it was, letting me get some important info on several aspects

# LA.NET [EN] said on Monday, May 21, 2007 2:57 PM

Dave has a nice post showing how to call JS methods from C#. As I&#39;ve also said in the past , it&#39;s

# LA.NET [EN] said on Monday, May 21, 2007 4:07 PM

As we&#39;ve seen, by default pages must have the same name as the table from which it gets the data

# LA.NET [EN] said on Monday, May 21, 2007 4:49 PM

The DynamicRssLink control generates a link that you can put in your page and that is responsible for

# Tassos said on Tuesday, May 22, 2007 3:39 PM

Interesting...

# LA.NET [EN] said on Tuesday, May 22, 2007 3:56 PM

I&#39;m just putting this here for the sake of completeness (since I&#39;m trying to run through all

# Pavlos said on Wednesday, May 23, 2007 12:42 AM

interesting

# Garbin said on Wednesday, May 23, 2007 3:15 AM

Hi,

I love cats, and yours are beautiful!

Btw, "Ravanelli" comes from the name of the soccer player?

# Luis Abreu said on Wednesday, May 23, 2007 3:20 AM

howdy!

yeah, that is correct. btw, at the time i think he played for Juve and they had eliminated benfica from uefa's cup quarter final. since the cat loved to play with a paper ball and, at the time, was white, i though: "what the heck...lets call him Ravanelli" :)

# Constantine said on Wednesday, May 23, 2007 9:21 AM

Interesting...

# ladyada said on Thursday, May 24, 2007 11:17 PM

wow exactly what i need, ive been struggling w/python & GW for 2 hours trying to setup a nice backend fedex label printing thingy.

ps. typo in your first example, should be 'A20,20,0,1,1,1,N,"Testing"' (only 7 args)

# ladyada said on Thursday, May 24, 2007 11:21 PM

(or maybe its only a typo if you're using an LP2844? dunno if TLP's have different syntax)

# Jeff Deville said on Thursday, May 24, 2007 11:24 PM

I was wondering if you could tell me what path to use if I'm hosting the service in an outside application, like a windows service, or console app.  There's no .svc file in this instance, but I thought that putting in the service's address would work.  When I do, I get: "The server method '[METHOD_NAME]' failed with the following error:... HTTP Error 404..."

Any suggestions?  Thank you.

# Luis Abreu said on Friday, May 25, 2007 3:11 AM

Husain:

hum...can you give me an example of command that works like that? I'm not a zebra guru, so i thought that when a command returned info, it would do that by priting it in a label.

ladyada:

i wrote the code for the EPL2 programming language, which means that if your zevra understands it, it should work without any problems. i've jus topened the EPL2 manual and this is what's shown there for the A command:

Syntax Ap1,p2,p3,p4,p5,p6,p7,"DATA"

Are you saying that your zebra understands epl2 but this command doesn't work?

# Luis Abreu said on Friday, May 25, 2007 3:17 AM

hello jeff.

i believe that the same restrictions you had for asmx web services still hold true, ie, you can't make xdomains calls. if i recall correctly, this happens because, by default, browsers won't let you use the xmlhttprequest object to perform xdomain calls.

to solve this, normally we just create a local web service which works as a proxy for the remote service:

dotnetslackers.com/.../MashitUpwithASPNETAJAX.aspx

# Jeff Deville said on Saturday, May 26, 2007 12:06 PM

Good to know, thanks Luis.

# sherwinzhu said on Sunday, May 27, 2007 3:02 PM

I use "\\machinename\sharedprintername" in the code, but the exception is also throw. why?

Can you explain the "_printerPath" para of  CreateFile method. I am also confused with the port of printer, how can I user the remote printer?

I am a chinese student, my english is not well.

Thank you!

sherwinzhu@buaa.edu.cn

# luisabreu said on Sunday, May 27, 2007 3:23 PM

hello.

hum...i think that when i've written the code, it worked without any problems with shared printers. the _printerPath field is supposed to  indicate the path to the printer (for instance, you can use LPT1 if you have the printer attached to your pc and you normally instantiate it through the constructor of the class). the _port is used to keep the safe file handle used by the code.

btw, do note that this class will not print if the printer is connected through the usb port (in that case, you can simply share the printer and use the printer's shared name to make it work).

# luisabreu said on Sunday, May 27, 2007 3:24 PM

hello.

hum...i think that when i've written the code, it worked without any problems with shared printers. the _printerPath field is supposed to  indicate the path to the printer (for instance, you can use LPT1 if you have the printer attached to your pc and you normally instantiate it through the constructor of the class). the _port is used to keep the safe file handle used by the code.

btw, do note that this class will not print if the printer is connected through the usb port (in that case, you can simply share the printer and use the printer's shared name to make it work).

# luisabreu said on Sunday, May 27, 2007 3:24 PM

hello.

hum...i think that when i've written the code, it worked without any problems with shared printers. the _printerPath field is supposed to  indicate the path to the printer (for instance, you can use LPT1 if you have the printer attached to your pc and you normally instantiate it through the constructor of the class). the _port is used to keep the safe file handle used by the code.

btw, do note that this class will not print if the printer is connected through the usb port (in that case, you can simply share the printer and use the printer's shared name to make it work).

# luisabreu said on Sunday, May 27, 2007 3:24 PM

hello.

hum...i think that when i've written the code, it worked without any problems with shared printers. the _printerPath field is supposed to  indicate the path to the printer (for instance, you can use LPT1 if you have the printer attached to your pc and you normally instantiate it through the constructor of the class). the _port is used to keep the safe file handle used by the code.

btw, do note that this class will not print if the printer is connected through the usb port (in that case, you can simply share the printer and use the printer's shared name to make it work).

# venkatesh said on Monday, June 04, 2007 12:44 AM

I am using the Atlas beta version. I have textbox focus problem. The Solution suggested by you is not available in that version. Is there any way,to transfer the textbox focus?

Please help?

# luisabreu said on Monday, June 04, 2007 4:13 AM

hello.

i think that you should really migrate to the most recent version since there were some problems with focus on the previous version.

anyway, you can try to handle the endrequest event on the client side and then set the focus on a control.

# luisabreu said on Monday, June 04, 2007 4:15 AM

hello.

i think that you should really migrate to the most recent version since there were some problems with focus on the previous version.

anyway, you can try to handle the endrequest event on the client side and then set the focus on a control.

# » Future bits: enabling sitemaps search said on Tuesday, June 05, 2007 12:02 AM

Pingback from  &raquo; Future bits: enabling sitemaps search

# yinix said on Tuesday, June 05, 2007 12:07 AM

【原文地址】Tip/Trick:HandlingErrorswiththeUpdatePanelcontrolusingASP.NETAJAX【原文发表日期】Sunday,Oc...

# UltraRob said on Wednesday, June 06, 2007 2:29 PM

I'm the same except that I'm Solo instead of Team.

# Bertrand Le Roy said on Wednesday, June 06, 2007 4:54 PM

DLSB

# Brian said on Wednesday, June 06, 2007 6:17 PM

Another great .NET 3.0 - WPF learning resource for developers here:

www.innerworkings.com/.../Catalog.aspx

# majid said on Thursday, June 07, 2007 7:40 AM

i am using detailview in update panel, infact inside nested update panel

but it is not working

If any one can help me to sort it out

do mail me at

ismail.majid@gmail.com

If you know any link that can help me

Regard majid

# Bassam said on Friday, June 08, 2007 10:03 AM

Hi there

well i am getting the same error which you have discussed about, and i am not able to understand what / how to get a fix round of it.

my scenario is that i have a user control, UC1. i will drop it in an UpdatePanel UP1 on a wizard control WC1 step page, on the Main .aspx page. like

WC1 contains UP1; UP1 contains UC1

i have the script manager declared rite under the form tag on the master page, and all seems good / smooth to me, but still I WILL GET THIS ERROR :(.

please help me over this error. Waiting for your reply.

- Bassam

# Yannas said on Sunday, June 10, 2007 7:47 AM

Interesting...

# Yannas said on Sunday, June 10, 2007 6:52 PM

Interesting...

# Sergi Carreras said on Monday, June 11, 2007 6:15 AM

Hello Luis, thanks for your help !!!!

I'm trying filtering, and works well.  But I want to sort ( alphabetic ) the DropDownList content, and I don't know how to do it.  It's possible ?

<asp:Content runat="server" ContentPlaceHolderID="ContentPlaceHolder1">

<asp:DropDownList runat="server"   ID="DropDownList1"

       BackColor="LemonChiffon" Font-Italic="true" />

   <asp:DynamicFilter runat="server" ColumnName="id_cli"

       ControlID="DropDownList1" />

   <asp:DynamicList runat="server" />    

</asp:Content>

Thank you a lot, and "saludos from Barcelona"

# LA.NET [EN] said on Monday, June 11, 2007 4:15 PM

Well, guess what: i had just finished posting this and I&#39;m already seeing a bug on the maximize behavior

# Valio said on Monday, June 11, 2007 4:31 PM

That's cool, thanks mate!

# LA.NET [EN] said on Monday, June 11, 2007 5:55 PM

Currently, you&#39;ll only get tool support for ASMX web services that render JSON. This doesn&#39;t

# Anastassios said on Monday, June 11, 2007 7:00 PM

interesting

# Sebastien.warin.fr» Blog Archive » FormAuthentication, Session et UpdatePanel : PageRequestManagerParserErrorException said on Tuesday, June 12, 2007 5:14 AM

Pingback from  Sebastien.warin.fr&raquo; Blog Archive &raquo; FormAuthentication, Session et UpdatePanel : PageRequestManagerParserErrorException

# Fritz Onion said on Tuesday, June 12, 2007 2:29 PM

Just to clarify, it's the concept of encapsulating Silverlight content in a control with embedded .xaml and .js resources that appeals to me. I also find the use of the <embed> tag slightly annoying in the asp:Xaml and asp:Media controls. The potential is there to build controls that create Silverlight content with the traditional script and then instrument it through properties, events, and methods - that's what's so compelling (in fact I just built one as a proof of concept).

 -Fritz

# luisabreu said on Tuesday, June 12, 2007 3:54 PM

Hello Fritz.

yeah, i agree that the concept is good but, as i've said, the implementation sucks. Again, I'm not sure on why they simply didn't embed the silverlight.js file and generated the inserted a call  to the createSilverlight method...oh well, I believe that you're in a better place than me to get an answer to this question :)

# Delay said on Tuesday, June 12, 2007 4:17 PM

Luis, Great write-up! If you're interested, please have a look at my blog for a little more detail on how ToolkitScriptManager works - and why. :) * http://blogs.msdn.com/delay/archive/2007/06/11/script-combining-made-easy-overview-of-the-ajax-control-toolkit-s-toolkitscriptmanager.aspx. I've just created a work item for the WebResourceAttribute issue you mention - thanks for pointing that out. * http://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=11023 Your comment about notifyScriptLoaded is good - though you'll notice that none of the AJAX Control Toolkit scripts called that method because ScriptResource.axd adds it automatically for any scripts it serves. Thanks!

# Bertrand Le Roy said on Tuesday, June 12, 2007 4:47 PM

Minor remark: if you use the regular script manager, you don't need to add the notification line either.

# luisabreu said on Tuesday, June 12, 2007 4:52 PM

howdy.

thanks.

yeah, you're right about extenders and scriptresource. and if i'm not mistaken, you can also add that line automatically when loading a script by using the notifyscriptloaded property of the scriptreference object.

however, i  thought it was best to mention this because there's always the chance of having a dll with  embedded js files and you might be using a scriptelement to add a reference to that js file.

maybe there should be a recommendation for not adding the notifyScriptLoaded method to the end of the file (making us use the notifyscriptloaded property of the scriptreference element).

btw, a question: isn't there a possibility of running out of chars on the query string when you have several js files and several assemblies?

# luisabreu said on Tuesday, June 12, 2007 4:55 PM

Yes, Bertrand. As always, you're correct. :)

# Delay said on Tuesday, June 12, 2007 5:11 PM

Luis, Yes, the length of the combined script URL is something we'd like to decrease. I mention it briefly in my blog, but hadn't gotten around to opening a work item until earlier today. (Just a bit before you asked, in fact!) http://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=11025

# luisabreu said on Tuesday, June 12, 2007 5:46 PM

Delay: the query string length was something i forgot to mention in my initial post. compressing it looks good to me :)

# Michael's Coding Den said on Wednesday, June 13, 2007 2:01 PM

.NET Tips &amp; Tricks Michael Nemtsev, Microsoft MVP Last update: June 13 , 2007 Document version 0

# Marios said on Thursday, June 14, 2007 4:16 AM

interesting

# Alexios said on Thursday, June 14, 2007 5:28 AM

interesting

# .Net Adventures said on Thursday, June 14, 2007 3:11 PM

Drag-n-drop on Silverlight alpha 3D in Silverlight Download DinnerNow.NET Sample Application Silverlight

# Evripides said on Friday, June 15, 2007 7:01 PM

interesting

# AAS said on Saturday, June 16, 2007 11:55 AM

HM2irD Hey, there is what you need.

# Halu said on Sunday, June 17, 2007 7:24 PM

interesting

# Spyros said on Monday, June 18, 2007 5:21 AM

interesting

# almhml said on Monday, June 18, 2007 1:52 PM

Thank you very much

# Kymon said on Tuesday, June 19, 2007 6:23 AM

Interesting...

# Kosmas said on Tuesday, June 19, 2007 7:28 AM

Interesting...

# Odysseas said on Wednesday, June 20, 2007 1:50 AM

interesting

# LA.NET [EN] said on Wednesday, June 20, 2007 5:41 AM

You can use the initParams property of the Siverlight control to pass aditional infomation during the

# Delay said on Wednesday, June 20, 2007 5:26 PM

FYI, as of the 10618 release of the AJAX Control Toolkit, WebResourceAttribute is now required and the combined script URLs are much shorter. Additionally, there's a new CombinedScriptsHandlerUrl property that's pretty handy:

blogs.msdn.com/.../script-combining-made-better-overview-of-improvements-to-the-ajax-control-toolkit-s-toolkitscriptmanager.aspx

# ASP.NET AJAX Forum Posts said on Thursday, June 21, 2007 12:23 AM

I have a page that has a scriptmanager, updatepanel, and timer in it. This page is iframed by another

# luisabreu said on Thursday, June 21, 2007 3:28 AM

Hello.

yes, I've been told that there are improvements, but still wasn't able to download and test the latest version.

# LA.NET [EN] said on Thursday, June 21, 2007 3:40 AM

And it seems like it solves some of the issues i&#39;ve mentioned before and brings improves to other

# DG said on Thursday, June 21, 2007 11:41 AM

Hi,

I'm very interessed to try Partial rendering a my own risk, but how do I do... ? I cannot find the "EnableLegacyRendering" porperty (and the "SupportsPartialRendering" by the way...)

ManyThanks

DG

# luisabreu said on Thursday, June 21, 2007 1:14 PM

hello.

well, EnableLegacyRendering is a private property of the internal PageRequestManager class. What i was trying to say was that you can bypass the3 default logic by explicitly setting the supportspartialrendering of the scriptmanager control class.

# » More tutorials on Silverlight and blend said on Thursday, June 21, 2007 4:57 PM

Pingback from  &raquo; More tutorials on Silverlight and blend

# links for 2007-06-22 said on Friday, June 22, 2007 10:23 AM

Pingback from  links for 2007-06-22

# Theofanis said on Friday, June 22, 2007 7:14 PM

Interesting...

# Truck g,Great site and pretty colors! <a href= ></a> said on Saturday, June 23, 2007 5:15 AM

Great site and pretty colors!

<a href=  ></a>  

# Panagiote said on Sunday, June 24, 2007 12:22 AM

interesting

# » Working from home said on Sunday, June 24, 2007 7:54 AM

Pingback from  &raquo; Working from home

# Constantine said on Sunday, June 24, 2007 9:18 AM

interesting

# Christopher Bennage said on Sunday, June 24, 2007 1:37 PM

Agreed.

# Bertrand Le Roy said on Sunday, June 24, 2007 3:50 PM

My experience is the exact opposite. Too many distractions and occasions for procrastination at home. Much easier to focus at the office.

# luisabreu said on Sunday, June 24, 2007 3:56 PM

Bertrand: i think that it all depends on "how you work". when you think about the time you need just to get to the office (which in my case is not much, maybe about an hour), the stress you endure during that time (most of the times, i'm driving), the ammount of times you get disturbed by a phone ringing or a co-worker that is talking with another guy about the soccer game during the weekend...oh well, sometimes i really think that doing anything at the office is really a miracle :)

# daniel said on Sunday, June 24, 2007 5:22 PM

From my experience, if you're a key employee you'll get a lot of distractions @ your workplace, since most people are not self reliant and you have the means to help them.

But there are a lot of employees (most) that are not self reliant, nor independent, and in these cases they'll slack or thrash a significant amount of time if they won't get a nudge in the right direction.

# Bertrand Le Roy said on Monday, June 25, 2007 12:02 AM

Well, I can be at the office in less than ten minutes, and everyone there is self-reliant, but I guess I'm super-lucky :)

# Zenon said on Monday, June 25, 2007 7:06 AM

interesting

# Vassilis said on Monday, June 25, 2007 5:00 PM

Interesting...

# Vassilis said on Monday, June 25, 2007 10:40 PM

Interesting...

# Papayma said on Friday, June 29, 2007 9:41 PM

Thank you.

# Papayma said on Friday, June 29, 2007 9:41 PM

Thank you.

# Papayum said on Friday, June 29, 2007 9:41 PM

Thank you.

# Papaype said on Friday, June 29, 2007 9:41 PM

Thank you.

# Papayqv said on Saturday, June 30, 2007 7:48 PM

Thank you!

# p3dro said on Saturday, June 30, 2007 11:27 PM

I hope you had a happy birthday.

So does this mean that we won't have a Portuguese book (written by you, of course) about Silverlight? :(

You mentioned on your post, LINQ, it's a really good new technology, do you have any future plans to start on posting about this subject? (I think you didn't talk about LINQ very often, at least I used the search and only retrieved one post, if not, than sorry :))

# Papaywq said on Sunday, July 01, 2007 2:12 AM

Thank you!

# luisabreu said on Sunday, July 01, 2007 6:19 AM

hello.

yeah, it was fun (that is, if you forget about the age thing :) ).

silvelright book: not sure. still thinking about that.

LINQ: i haven't really talked much about it. why? well because time is always short :) but i do intend to study it and discuss it here :)

# AAS said on Sunday, July 01, 2007 7:08 PM

Hey, there is what you need.

# AAS said on Sunday, July 01, 2007 7:23 PM

Hey, there is what you need.

# anon said on Monday, July 02, 2007 1:10 PM

URL expired ;(

# Manuel Abadia said on Monday, July 02, 2007 3:51 PM

How many pics can you stich with the camera?

Take a look at this:

www.manuelabadia.com/.../london.html

It takes a while to load because it's 8 MB. Initially is displayed in black and white and in low res, and then it starts to load it in its full glory from left to right.

about 30 pics stitched together but using the computer. It isn't perfect as I skipped some parts without shooting as many pics as needed but after some hand tunning the result isn't as bad as before :P

# luisabreu said on Monday, July 02, 2007 4:13 PM

Laurent: i'm sorry but it seems like i can't approve your comment (i'll try again tomorrow since it looks like msmvps.com is always getting intro trouble when i approve it)

Manuel: it looks like you had lots of fun on your trip to England. i still didn't manage to see the pic because i'm getting some nasty problems with quick time. ragarding my s3, it can take up to 26 photos and it really has a cool layout which lets you get the previous pic while taking the next (and it lets you go from left-to-right, right-to-left, top-to-bottom, bottom-to-top and clockwise :) )

# Manuel Abadia said on Monday, July 02, 2007 4:32 PM

Luis,

Yeah, it was a cool trip.

When I compared some cameras two years ago they were able to stich only 3 or 4 pics. 26 pics... I'm impressed! And that previous pic feature that you mention sounds cool too. Nice purchase ;-)

Regarding your quicktime problems, I haven't installed quicktime since I a few months. There is a codec package called "Quicktime alternative" that install all the necessary quicktime stuff without the bloated apple stuff. Maybe that can help you.

# luisabreu said on Tuesday, July 03, 2007 5:01 AM

Manuel, the picture is pretty cool and impressive! I'm almost thinking about making an effort to go there...

# Manuel Abadia said on Tuesday, July 03, 2007 5:21 AM

Thank you Luis. It's a nice place to visit but it seems that now it isn't the best moment to do it.

# luisabreu said on Tuesday, July 03, 2007 5:44 AM

yeah...the last couple of days have not been very good...

# W James said on Thursday, July 05, 2007 8:53 AM

Thanks for your work.  I've tried to duplicate a WCP service call at my end.  Unfortunately, I get an "Operation is not valid due to the current state of the object." error.  Forgive me for being a WCF newb.  I'm hoping that you can provide an answer to my dilema.  Here are some code snippets:

<Web.config>

<system.serviceModel>

<services>

<service name="TestService">

<endpoint contract="ITestService"

   binding="webHttpBinding" address=""

   behaviorConfiguration="jsonBehavior" bindingConfiguration="jsonBinding" />

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>

</service>

</services>

<bindings>

<webHttpBinding>

<binding name="jsonBinding" messageEncoding="Json"/>

</webHttpBinding>

</bindings>

<behaviors>

<serviceBehaviors>

<behavior name="metadataSuport">

<serviceMetadata httpGetEnabled="true" httpGetUrl=""/>

</behavior>

</serviceBehaviors>

<endpointBehaviors>

<behavior name="jsonBehavior">

<enableWebScript />

</behavior>

</endpointBehaviors>

</behaviors>

</system.serviceModel>

<TestService.svc>

<%@ ServiceHost Language="C#" Debug="true" Service="TestService" CodeBehind="~/App_Code/TestService.cs" %>

<app_code/ITestService.cs>

[ServiceContract]

public interface ITestService

{

   [OperationContract]

   string GetDataRows(string serviceName);

   [OperationContract]

   string HelloWorld();

}

<app_code/TestService.cs>

public class TestService : ITestService

{

   public string GetDataRows(string serviceName)

   {

       return "Dummy result";

   }

   public string HelloWorld()

   {

       return "Hi world!";

   }

}

<Default.xaml.cs>

   public class Proxy : SoapHttpClientProtocol

   {

       public Proxy(string url)

       {

           this.Url = url;

       }

       public string GetDataRows(string serviceName)

       {

           try

           {

               ServiceParameter[] parameters = new ServiceParameter[]

               {

                   new ServiceParameter("serviceName", serviceName)

               };

               object[] obj = this.Invoke("GetDataRows", parameters, typeof(string));

               return (string)obj[0];

           }

           catch (System.Exception error)

           {

               return error.Message;

           }

       }

       public string HelloWorld()

       {

           try

           {

               object[] obj = this.Invoke("HelloWorld", new ServiceParameter[0], typeof(string));

               return (string)obj[0];

           }

           catch (System.Exception error)

           {

               return error.Message;

           }

       }

   }

...

Proxy proxy = new Proxy("localhost/.../TestService.svc");

proxy.HelloWorld();

I'm sorry about posting all this code to your forum.  I'm stumped and didn't know where else to turn.  It's probably not the best way to introduce myself.

I've followed your code examples as closely as possible.  I've tried the proxy url without the ".svc" extension as well and come up with the same issue.

Any help you can lend is greatly appreciated.

W James

# luisabreu said on Thursday, July 05, 2007 3:16 PM

hello.

send me a running sample to labreu at gmail.com and i'll try to take a look at it

# Tarique said on Friday, July 06, 2007 8:32 AM

Great help for me. Lots of QA bugs solved.

# Cassio said on Monday, July 09, 2007 12:47 AM

Sure, as a developer I think working from home is far more productive, as long as you have enough self-discipline.

# Jeet said on Tuesday, July 10, 2007 10:46 AM

Luisabreu,

I spent all day search on google and test to printing to my Zerbra 888-TT, you just save my bacon, thank you.

# luisabreu said on Wednesday, July 11, 2007 3:26 AM

hello.

agreed. and if you can't, your employer can always fire you. what i don't get is why is so hard to get that chance (maybe that's because i've always been an employee and never an employer)

# Joao Paulo Carreiro said on Friday, July 13, 2007 4:45 AM

Finally, a nice Alfa. Must drop by a dealer when it comes out and give it a spin. Although the right place for a engine on a sports car is on the rear, not the front!

# analsex t,Great site and pretty colors! <a href= ></a> said on Friday, July 13, 2007 4:52 AM

Great site and pretty colors!

<a href=  ></a>  

# luisabreu said on Friday, July 13, 2007 5:01 AM

I think you won't be that lucky. I've heard they're only producing 500 units and they're all sold. so, i'm guessing that you'll have to keep using that cool rx8 or maybe the gallardo, right?

# Kurbli said on Friday, July 13, 2007 5:48 AM

technet2.microsoft.com/.../d3e3edb9-2d32-4089-949c-5f215c9787771033.mspx

("CTRL+ALT+DEL always goes to the local desktop. If you need to send CTRL+ALT+DEL to the remote computer, you must use CTRL+ALT+END.

")

# luisabreu said on Friday, July 13, 2007 6:03 AM

hello again.

yeah, and i've just discovered that link after publishing the previous post. there are other cool keys too...

# Joao Paulo Carreiro said on Friday, July 13, 2007 6:08 AM

Oh well... I'm betting that I'll be able to find one eventually. And if it's second hand, it's even better. Alfas  loose value here in the UK faster than a sinking rock!

# luisabreu said on Friday, July 13, 2007 6:18 AM

Not only there :) but if there are only 500 units, i think you'll have a hard time finding one.

# Joao Paulo Carreiro said on Friday, July 13, 2007 7:13 AM

Those are fighting words, they are!!!  

# Luis Abreu said on Friday, July 13, 2007 8:30 AM

lol...well, i guess that you can prove i'm wrong by buying one and then inviting me to take a ride :)

# HowerS said on Friday, July 13, 2007 12:53 PM

Your Brilliant... Saved me hours of trying to get this fixed.  Thanks

# André Luiz Sobreiro said on Monday, July 16, 2007 1:49 PM

Thank you. It's really a very good article.

I'd like to extend this with using of master page.

In my case, the script manager is on the master page, and I'd like to have a handler for each page. Its a big project, end in my reality I am developing webparts for a sharepoint project where the script manager is not under my hands. My solution was to make a pattern with the sharepoint team to have the ID of the script manager control, so, I can find the control with the findcontrol method in my webpart and add my especific handler to the "AsyncPostBackError" event. I dont like this kind of thing. I couldnt even use the scriptmanager proxy to do this. So, does anyone have a better solution ? thanks in advance. André Luiz Sobreiro

# Metrophanes said on Monday, July 16, 2007 8:46 PM

interesting

# LA.NET [EN] said on Tuesday, July 17, 2007 7:28 AM

If yes, then don&#39;t forget that it need to run in full trust, so adding it to the GAC is something

# David Lawton said on Wednesday, July 18, 2007 6:20 AM

You are a life saver! This is exaclty what i was looking for here:

silverlight.net/.../2832.aspx

I have been faffing about with custom event handlers trying to do exactly this!

Your a champion!

David Lawton

Hyperion Technologies Ltd (UK)

Electric Hornet Design Studios

# sherwinzhu said on Wednesday, July 18, 2007 4:03 PM

I send these command to printer,

but it doesn't work.

The printer can't start to print, unless i send another bar code command which can work.

Can you help me?

I want to print text only on a label using Zebra 888.

sherwinzhu@buaa.edu.cn

command code

N

Q880,30

q800

I2

A260,10,0,8,1,1,N,"整 机 配 置 列 表"

A70,50,0,8,1,1,N,"种类"

A300,50,0,8,1,1,N,"名称"

A500,50,0,8,1,1,N,"数量"

A620,50,0,8,1,1,N,"物料编号"

A20,84,0,8,1,1,N,"奈奈奈奈奈奈"

A188,84,0,8,1,1,N,"奈奈奈奈奈奈奈奈奈奈"

A532,91,0,3,1,1,N,"1"

A556,91,0,3,1,1,N,"8888888888888888"

A188,118,0,8,1,1,N,"奈奈奈奈奈奈奈"

A20,152,0,8,1,1,N,"ABCDEFG"

A188,152,0,8,1,1,N,"abcdefgabcdefg"

A532,159,0,3,1,1,N,"1"

A556,159,0,3,1,1,N,"8888888888888888"

A188,186,0,8,1,1,N,"abcdef"

A20,220,0,8,1,1,N,"abcdefg"

A188,220,0,8,1,1,N,"ABCDEFGABCDEFG"

A532,227,0,3,1,1,N,"1"

A556,227,0,3,1,1,N,"8888888888888888"

A188,254,0,8,1,1,N,"ABCDEF"

A20,288,0,8,1,1,N,"abc奈奈奈"

A188,288,0,8,1,1,N,"ABCDEFGabcdefg"

A532,295,0,3,1,1,N,"1"

A556,295,0,3,1,1,N,"8888888888888888"

A188,322,0,8,1,1,N,"奈奈奈奈奈"

A20,356,0,8,1,1,N,"奈奈奈奈奈奈"

A188,356,0,8,1,1,N,"奈奈奈奈奈奈奈奈奈奈"

A532,363,0,3,1,1,N,"1"

A556,363,0,3,1,1,N,"8888888888888888"

A188,390,0,8,1,1,N,"奈奈奈奈奈奈奈"

A20,424,0,8,1,1,N,"ABCDEFG"

A188,424,0,8,1,1,N,"abcdefgabcdefg"

A532,431,0,3,1,1,N,"1"

A556,431,0,3,1,1,N,"8888888888888888"

A188,458,0,8,1,1,N,"abcdef"

A20,492,0,8,1,1,N,"abcdefg"

A188,492,0,8,1,1,N,"ABCDEFGABCDEFG"

A532,499,0,3,1,1,N,"1"

A556,499,0,3,1,1,N,"8888888888888888"

A188,526,0,8,1,1,N,"ABCDEF"

A20,560,0,8,1,1,N,"abc奈奈奈"

A188,560,0,8,1,1,N,"ABCDEFGabcdefg"

A532,567,0,3,1,1,N,"1"

A556,567,0,3,1,1,N,"8888888888888888"

A188,594,0,8,1,1,N,"奈奈奈奈奈"

A20,628,0,8,1,1,N,"奈奈奈奈奈奈"

A188,628,0,8,1,1,N,"奈奈奈奈奈奈奈奈奈奈"

A532,635,0,3,1,1,N,"1"

A556,635,0,3,1,1,N,"8888888888888888"

A188,662,0,8,1,1,N,"奈奈奈奈奈奈奈"

A20,696,0,8,1,1,N,"ABCDEFG"

A188,696,0,8,1,1,N,"abcdefgabcdefg"

A532,703,0,3,1,1,N,"1"

A556,703,0,3,1,1,N,"8888888888888888"

A188,730,0,8,1,1,N,"abcdef"

A20,764,0,8,1,1,N,"abcdefg"

A188,764,0,8,1,1,N,"ABCDEFGABCDEFG"

A532,771,0,3,1,1,N,"1"

A556,771,0,3,1,1,N,"8888888888888888"

A188,798,0,8,1,1,N,"ABCDEF"

P1,1

# Gustavo Frederico said on Friday, July 20, 2007 10:28 AM

Saudações,

Eu segui os passos acima e tudo correu bem. Você teria algum exemplo de como usar o serviço afinal? Vejo o código JavaScript gerado, mas não estou certo sobre como utilizá-lo.

obrigado - Gustavo

# MIGUEL said on Friday, July 20, 2007 11:19 AM

HI

I AM TRYING TO USE the project  but this send problem with

Error 1 Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. C:\Documents and Settings\msam\Desktop\atlassites\fileupload\web.config 39

i have the last version ajax

some one can help me

i need implementar upload without postback

thansk for the time

# luisabreu said on Friday, July 20, 2007 12:31 PM

Claro, sem problema. quando quiseres chamar o servico numa pagina js, basta fazeres algo do genero:

ITest.MyOperation1( "Luis", succeddedCallback);

function succeededCallback(res){

  //res tem o objecto retornado do servidor

}

# luisabreu said on Friday, July 20, 2007 12:31 PM

Claro, sem problema. quando quiseres chamar o servico numa pagina js, basta fazeres algo do genero:

ITest.MyOperation1( "Luis", succeddedCallback);

function succeededCallback(res){

  //res tem o objecto retornado do servidor

}

# Alex said on Saturday, July 21, 2007 11:33 AM

Hi2all! Can me anyone give a little help?

How could I debug atlas to find out where the exception is thrown?

I've got a gridview in updatepanel and there is a linkbutton, when I click it, atlas alerts with exception message, but I can't determine why..

The exception is thrown only in IE6

# Swati said on Monday, July 23, 2007 8:08 AM

Thanks for this useful information:

Actually i am trying to call a WCF Service from a SilverLight application. Silverlight provides add webreference but i cann't get the object of reference and hence can not call the WCF service..

Would you please highlight more upon your writeup.

# Dave Reed said on Wednesday, July 25, 2007 5:34 PM

Have you tried this in Firefox? (hint: remove the DOCTYPE...)

# luisabreu said on Wednesday, July 25, 2007 5:43 PM

honestly: no :) as always, you're right.

# Robert said on Thursday, July 26, 2007 11:35 PM

Managed Hosting, Colocation and Data Center Services by victoryushchenkonashpresudent ...

# Walter said on Friday, July 27, 2007 2:59 AM

Hi, Can you upload your sample code here?

# Anaklets said on Friday, July 27, 2007 4:52 PM

interesting

# Maximos said on Saturday, July 28, 2007 4:32 AM

interesting

# Mamadshah said on Saturday, July 28, 2007 6:05 AM

interesting

# Hermes said on Saturday, July 28, 2007 2:46 PM

interesting

# Iannis said on Sunday, July 29, 2007 12:31 AM

Interesting...

# Othon said on Sunday, July 29, 2007 12:59 AM

Interesting...

# Vassilis said on Sunday, July 29, 2007 4:44 AM

interesting

# Angelos said on Sunday, July 29, 2007 9:53 PM

Interesting...

# Internet Broker WebLog » Blog Archive » Da Chronic NewsBoard - said on Sunday, July 29, 2007 9:54 PM

Pingback from  Internet Broker WebLog  &raquo; Blog Archive   &raquo; Da Chronic NewsBoard -

# Stathis said on Monday, July 30, 2007 12:58 AM

interesting

# Wilson said on Monday, July 30, 2007 1:16 AM

I tried to save .pcx graphic into printer with GM command. But it looks no working. Could you pls tell me how to save graphic?

# Dimitrios said on Monday, July 30, 2007 1:55 PM

interesting

# peter said on Monday, July 30, 2007 6:10 PM

HI!

can you use AutoCompleteExtender in a Master page?

I can't seem to get it to work...

# Sergios said on Tuesday, July 31, 2007 2:17 AM

interesting

# luisabreu said on Tuesday, July 31, 2007 3:18 AM

hello.

not sure on what's your problem, but you should be able to do that.if you're strying to set the style, then use max's tip

# Efstathios said on Tuesday, July 31, 2007 2:26 PM

interesting

# Milos said on Wednesday, August 01, 2007 7:12 PM

Interesting...

# josh said on Monday, August 06, 2007 10:19 PM

I noticed Nikhil's does not leave the address bar looking so ugly/scary , will microsoft address this?

Cause if they dont I'm to horrified to use it.

# Bill said on Monday, August 06, 2007 10:42 PM

MSN I NIIPET

<a href= http://msn.com >MSN</a>

# level said on Wednesday, August 15, 2007 9:41 PM

eye and easy to You excellent very on navigate. an have site the ,

# Kevin said on Monday, August 20, 2007 9:57 AM

Heya,

Any idea why this would be an issue only in some browsers? I have an application that works fine in IE, but throws this error in Firefox. I've double checked the assembly path and it looks good.

# Hillary said on Tuesday, August 21, 2007 9:01 AM

Hello, nice site look this:

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

+1 Interesting theme I can place it with myself on blog?

End ^) See you

# Hillary said on Wednesday, August 22, 2007 5:32 AM

Hello, nice site look this:

End ^) See you

# Andrew Davey said on Monday, August 27, 2007 6:21 AM

If you want to see some C# pushed to the limits check out what my C# syntactic macro system can achieve:

www.aboutcode.net/.../Tier+Splitting+C+Screencast.aspx

# luisabreu said on Monday, August 27, 2007 6:48 AM

Hello Andrew.

yeah, it seems promising and i'll check it out later. thanks for the link.

# teksnqmbam said on Monday, August 27, 2007 10:13 PM

Hello! Good Site! Thanks you! gegisbiuwfcwwk

# Alexandre said on Wednesday, August 29, 2007 2:39 AM

Por acaso o de AJAX ainda não comprei, mas tenho o de ASP .NET 2.0 e acho que me ajudou a perceber algumas coisas do ASP .NET.

Ainda sou novato (1 ano) nisto do desenvolvimento Web), mas já fiz um portal aqui para a empresa que trabalho e acho que ficou bem catita.

O de AJAX ainda não olhei para o rapaz, mas numa das minhas idas à FNAC eu vou dar uma espreitadela a ver se me interessa.

Uma coisa à parte, estou fartinho de procurar um emprego como informático aí na Madeira(sim sou do Continente e quero ir viver para a ilha da Madeira), mas não consigo achar nada, se souberes de alguma coisa diz-me.

A continuação do excelente trabalho.

# luisabreu said on Wednesday, August 29, 2007 3:02 AM

oki, mas previno ja q o mercado aqui n e la muito (especialmente a nivel de desenvolvimento)

# Dave Reed said on Thursday, August 30, 2007 6:57 PM

Yeah I've heard those explainations... never really thought of it any other way.

If I'm not mistaken, in music "C Sharp" is the same as "D Flat". Good thing it isn't called D Flat.. yuck.

As for why its called "C", thats a bit more interesting. There were languages A and B, too... someone wasnt very creative with their naming.

I shall call it, A!

Shrug :) Somewhere out there there's a big diagram of all the languages and what they were influenced by. Too lazy to fish it out of the cloud right now...

# luisabreu said on Friday, August 31, 2007 3:06 AM

D flat: lol

yes, i've seen it too. someting along these lines

people.mandriva.com/.../diagram.pdf

though this isn't really one of the best i've seen.

as i've said, if there's any more theories on this, please share  it with us :)

# Dan said on Friday, August 31, 2007 1:28 PM

Nice post, I didn't know about the behavior with rsp files

# Neil said on Saturday, September 01, 2007 5:18 PM

I also like that it's pronounced "See sharp". I guess proper grammar would be "See sharply".

Here's the skinny on why the original was called C: "It was named "C" because many of its features were derived from an earlier language called "B", which according to Ken Thompson was a stripped down version of the BCPL programming language."

en.wikipedia.org/.../C_programming_language

# vikram said on Tuesday, September 04, 2007 11:41 PM

Its all about your style of coding. It depends on individual. I prefer int i=10;

# Luis Abreu said on Wednesday, September 05, 2007 3:23 AM

Hello.

Well, yes it's a matter of style. Nothingwrong with using it if you really know what you're doing. however, you cannot deny that using the correct type name will make your code more readable and less error prone.

I'd really prefer that the c# compiler wouldn't have defined those keywords for the FCL type.

# Paulo Morgado said on Wednesday, September 05, 2007 5:03 PM

I suppose you also use System.String instead of string, right?

And you plan to use:

collection.Select()

instead of:

from collecction select

:D

# luisabreu said on Wednesday, September 05, 2007 5:23 PM

Hello again.

>msmvps.com/.../c-should-you-use-the-simple-type-aliases.aspx

wrong, wrong. you see, I only need to use String since we have the using directive. I'm not saying that we should use the complete name of the type. only that we should be specific about it.

> collection.Select()

not sure. you won't believe me, but i've installed vs 2008 beta 2 in 2 different machines and i still haven't managed to have intellisense for the linq expressions :D btw, and since you're mockering the extended methods, must i remind you that you can't really access all the available funcionality with linq syntax?

# luisabreu said on Wednesday, September 05, 2007 5:25 PM

small adenda to the previous comment:

should be

>I suppose you also use System.String instead of string, right?

instead of:

>msmvps.com/.../c-should-you-use-the-simple-type-aliases.aspx

# swnbaaicur said on Friday, September 07, 2007 6:43 PM

Hello! Good Site! Thanks you! niyorrasggsxb

# andreas said on Monday, September 10, 2007 7:27 AM

trust me it will come to some use :)

great examples

# vikram said on Tuesday, September 11, 2007 1:20 AM

Thanks That was helpful

# Interesting said on Thursday, September 13, 2007 7:01 AM

If you mo-fo's don't know the answer, just say so..!

Some of us would actually appreciate the help.

# car detail said on Thursday, September 13, 2007 10:43 PM

Hi! It`s no bad.

See my site too!<br>

<a href=" car-detail.infocatalogs.info/car-detail-undefined-used.html ">car detail undefined used</a><br>

Bay, bay.

# ford 9n tractor said on Saturday, September 15, 2007 12:04 AM

Hi! It`s no bad.

See my site too!<br>

<a href=" ford-tractor.infocatalogs.info/ford-9n-tractor.html ">ford 9n tractor</a><br>

Bay.

# Dominic Pettifer said on Monday, September 17, 2007 4:26 PM

I had this problem and it was because i had a space in my project name "Silverlight Overview". It was creating a "Silverlight Overview" dll file but the dll being referenced in the Page.xaml was "Silverlight_Overview" (notice the underscore?).

If I changed the dll file to use an underscore instead of a space it worked but of course screwed up my Visual Studio 2006 project files. So I recreated the Project as "SilverlightOverview" and it worked fine.

It's alpha software for a reason I guess :)

# vikram said on Tuesday, September 18, 2007 12:00 AM

Good one.....

# Deza said on Wednesday, September 19, 2007 1:29 AM

Could you extend your solution? Mainly the public scriptable method in your canvas. That would be great for me.

TIA

Deza

# Sudeep said on Thursday, September 20, 2007 3:45 AM

Thanks a lot luisabreu!

For more then 2 weeks i was searching a way to add usercontrol on a page dynamically, where the main page and the user control both have update pannels (sort of nested update pannel). What was happeing in my case is that as soon as i call the submitt of my user control the entire user control was disappearing. Now with your solution it is working fine. Thanks a lot once again.

# daniel said on Thursday, September 20, 2007 1:09 PM

Hi ,

I'm not a Nhibernate jedi, but in order to save the object you should commit the transaction or flush the session.

calling session.save is like telling nhibernate : persist the data when you think is right . flushing the session (or committing the transaction) forces Nhibernate to persist. p.s. transaction.rollback in the middle is making a big mess there...

# daniel said on Thursday, September 20, 2007 1:14 PM

p.p.s an automatic way to create the database schema via code is :

Configuration cfg = new Configuration();

           cfg.Configure(DB_PATH);

           NHibernate.Tool.hbm2ddl.SchemaExport se = new NHibernate.Tool.hbm2ddl.SchemaExport(cfg);

           se.Create(false,true);

# luisabreu said on Thursday, September 20, 2007 1:28 PM

Hello Daniel.

Yes, i know what you're saying...however, do notice that even though the code might not make lots of sense, but it still doesn't explain how the cascading isn't being performed on the inner component collection as it should. in fact, that's why i get the inner collection elements persisted even though the mian element isn't.

# Eric Hauser said on Friday, September 21, 2007 7:04 AM

I only have experience with Java Hibernate, but I am assuming the APIs are the same.  If you want to change the default behavior of how that works, then you can just change the FlushMode on the Session.  I believe in your case it sounds like you want FlushMode.ALWAYS, so that the SQL is executed when you make the call to save.

# luisabreu said on Friday, September 21, 2007 8:51 AM

Hello Eric.

I'm not sure if i'm esplaining myself correctly, but to me the problem is that I have an entity which is saved to the db by using an existing transaction. the main problem is that a save operation on this entity should affect 2 tables, and so i expected to find all the necessary insert statements inside the same transaction. unfortunately, i'm not seing this. for instance, in my scenario (it was a simple test), i had something like this:

begin tran

session.save(myentity)

roll back tran

ok, for this simple scenario, the logs showed something like this:

...

begining ado.net transaction

generating insert command for main table

rollback

what's the problem? well, in my opinion, the logs should have something like this:

...

begining ado.net transaction

generating insert command for main table

generating insert command for secondary table

rollback

in fact, that is what happens when you have an entity has a collection of other entities. but it does not happen when an entity has a collection of components! to get the behavior i want, i need to do something like this:

begin tran

session.save(myentity)

session.flush() ---> this generates the sql for the secondary table

roll back tran

again. i really know little about nhibernate, but if i'm wrong about this behavior, then i'm really ready to drop it and go back to writing sql...

# Eric Hauser said on Friday, September 21, 2007 11:32 AM

Without defining a flush strategy, it is not guaranteed to work like the way you want it to.  If you look at Section 10.9 of the Hibernate docs (www.hibernate.org/.../objectstate.html- again I am assuming that NHibernate works the same) it states:

"Except when you explicity flush(), there are absolutely no guarantees about when the Session executes the JDBC calls, only the order in which they are executed."

You pretty much have to call Session.flush() or commit the transaction to guarantee that any SQL will get called.  It is not even guaranteed that the SQL for your entity gets executed when you call save(), it gets happens to work like that.

Hibernate takes a little getting used to, but my experiences by far have been more positive than negative.  Especially when you are working with an existing schema and generate your mappings and validations from it.  Good luck =).

# rob said on Friday, September 21, 2007 1:57 PM

i totally agree.. Why have a non-standard dialogue box that is so confusing? I love the new functionality but the presentation needs work

# luisabreu said on Friday, September 21, 2007 3:41 PM

Hello again Eric.

hum...yeah, i understand what you're saying. now, the problem is that something like this (even though it's completly wrong):

begin tran

session.save

rollback tran

session.flush

should never never persist the items of the collection maintained by the entity in the db table (and in nhibernate - not sure if that is the case with hibernate) it happens. that's why i'm so pissed with it. as i've said before, if you have a collection of entities (instead of components) it works as it should...but again, maybe next wekk i'm feeling alittle better :)

thanks again for  helping me!

# Mike said on Sunday, September 23, 2007 11:38 PM

I think the problem is really more one of sematics. It was confusing to me at first to call 'save' and then not actually have a persisted object. What is important to remember with NHibernate is its concept of a Unit of Work, so that when you call 'save' you are actually saving it to the current Unit of Work, which will be flushed (synched with the db state) either transparently or manually by your application. Once you start to work within the context of a Unit of Work/Identity Map things with NHibernate start to clear up.

Mike

# Paulo Santos said on Monday, September 24, 2007 3:09 AM

I found this one based on Wıkıpedia: <a href="bluebones.net/.../a>

<br>

and this has the dates: <a href="www.levenez.com/.../">Computer Languages History</a>

# luisabreu said on Monday, September 24, 2007 3:27 AM

Hello Mike.

I still think that i'm not explaining myself correctly here...if you run the sample i'm talking about and perform the session.flush after the rollback, you'll end up with the wrong result. to me the problem is that if you're generating the insert instruction for the main entity, then you must also generate the other inserts since you must garantee that they are all commited or aborted. this isn't really the case when you're using nhibernate.

# bakuuu said on Monday, September 24, 2007 7:20 AM

Great, but I have an another problem.

I have been trying to set programatically visible and unvisible of some Controls in my WebPage. On this Controls there are UpdatePanels.

On each control - one UpdatePanel.

I have to set visible = true/false in "Page_PreInit" method, it works on single test site, but...

In my project I have a MasterPage, and in method Page_PreInit a reference to my control is null, so I can't change visible, and masterpage has no PreInit method.

How to solve it ?  Maybe you know some other solution to dynamic hide controls with updatePanel in it.

# BUbba Ole said on Tuesday, September 25, 2007 10:40 AM

Can you print this character on y our Zebra?

The division sign    ÷

# bor!s said on Wednesday, September 26, 2007 12:37 AM

Is it possible to pass parameters to the js function from managed code and get any returns?

I'm trying to get/set some cookies from my silverlight app - but have not figured out a way to do this as of yet...

# xx said on Saturday, September 29, 2007 12:29 PM

I get the following error Unrecognized attribute 'messageEncoding'

# Madu Alikor said on Saturday, September 29, 2007 12:52 PM

I was wondering how would you apply this drag-n-drop but instead of it object sundenly snapping to the top left hand corner of the element have it remember where within them element was clicked and keep that as the point at which the object is moved

Emm not sure if i made any sense just imagine you clicked 2/3 at the top of the rectangle how would you keep that point as the point of movement?

# Alberto Silva said on Monday, October 01, 2007 4:25 PM

I'm sure that a chance to drive a 8C would be enough to put Luís on a plane!!!

# luisabreu said on Monday, October 01, 2007 4:28 PM

yeah! btw, if it could be arranged, I'd prefer that we'd all go to the Canarias Island since the flight time from here (Madeira) to there is around 55 minutes :) (and it has some nice hotels that work on the everything included model ;) )

# p3dro said on Tuesday, October 02, 2007 6:51 AM

Congratulations Luis!

I'm curious, can you please give me a brief explanation (or maybe point a link) on how this MVP thing works? You have to apply or Microsoft contacts you ? (not that I want to be a MVP, I don't have all that knowledge :), just curiosity)

Best Regards!

# luisabreu said on Tuesday, October 02, 2007 8:16 AM

Hello.

you can get all the info about it  here: mvp.support.microsoft.com

# Justin Megawarne said on Friday, October 05, 2007 11:46 PM

Hi there

I have had this problem too. Here is my workaround:

1. Maximize Safari on second monitor

2. Press ALT+SPACE to drop down context menu

3. Press M to select Move

4. Use LEFT key to move Safari into position

5. Press ENTER to set position

Hope this will sort you out for now: it is a little better than having to fumble with that grip in the bottom-right corner of the window!

# Rob Philpott said on Tuesday, October 09, 2007 3:57 AM

Interesting stuff.

I believe this is something which some of the .NET obfiscators seize upon. Because overloading on return type is fine in MSIL but not in practically everything else, changing a method name so that it creates an a new overload on return type means it can't be dissasembled back into something like C#.

# Kant said on Tuesday, October 09, 2007 10:24 AM

Easy to follow the concept. Thank you

# Mike Volodarsky said on Tuesday, October 09, 2007 5:12 PM

Good writeup, Luis.  I'll probably post more info about TransferRequest in the near future, as its not very well documented at all at this point.

The most interesting area is TransferRequest as general replacement for RewritePath, as there are some very interesting scenarios where RewritePath does not give you what you want, even in the Integrated pipeline.

Thanks,

Mike

# luisabreu said on Tuesday, October 09, 2007 5:23 PM

Hello Mike.

yeah, that would be great. btw, one question about the iis.net site: can we trust its docs section?

# Israel Aece said on Tuesday, October 09, 2007 9:28 PM

Hello Luis,

I believe that my test worked well because I hadn't Global.asax file in my sample application.

# Luis Abreu said on Wednesday, October 10, 2007 3:10 AM

Hello Israel.

Yes, you're right...It took me several hours to be able to reproduce the bug. In fact, I had to start removing everything from my app until I stop getting the error. Unfortunately, the global.asax was the last thing I removed :)

# Dave Reed said on Wednesday, October 10, 2007 4:37 PM

In Fiddler settings, disable IPv6 support.

# luisabreu said on Wednesday, October 10, 2007 4:59 PM

Hello Dave,

yes, that is the best option (and that's what the link says). Another option is to disable IPv6 on vista (which would envolve removing the checkbox on the network settings and fiddling around with a registry key)

# Mike Volodarsky said on Thursday, October 11, 2007 12:54 PM

Luis,

The articles on IIS.NET are the best source of information on IIS7 so far, but some of them are outdated.  Be mindful of the article update date and the tested with build to know how up to date the article is.

Also be mindful of the differences between Vista and Windows Server 2008, which will be there until Vista SP1.  Until RTM, the server release is also in flux so at times the product is ahead of the articles.

I also try to cover special topics of interest on my blog, http://mvolo.com.  If there are certain topics you'd liket to hear more about, let me know.

Thanks,

Mike

# JR said on Monday, October 15, 2007 8:25 PM

Thank you.  GREAT STUFF

# Bekir Sıtkı ERTUĞRUL said on Tuesday, October 16, 2007 3:40 PM

hi! I'm looking for compiling of rsp files.How can I write that files and how can ı run that that files?

Can you help me,please?

My e-mail is bsertugrul@gmail.com

# luisabreu said on Tuesday, October 16, 2007 4:01 PM

rsp files are simple text files where you put the options you want to pass to the csc compiler (one per line) .  I'm not sure on what you want to know...

# Bertrand Le Roy said on Tuesday, October 16, 2007 5:51 PM

Also, if you're creating a component, you should consider yourself responsible for disposing of it. True, if you added the component to the application (which is not an obligation for nested components), the app is going to do the disposing eventually, but as a component developer, how do you know when this is going to happen? So as a responsible component developer, you should dispose of everything you created from your own dispose method.

# Luis Abreu said on Wednesday, October 17, 2007 3:11 AM

Hello.

I agree with you. however, in that case, I think that adding the component to the component collection is really optional, rigth?

# Seba said on Wednesday, October 17, 2007 11:13 AM

Could you post your config files to use them as an example?

# sacha barber said on Thursday, October 18, 2007 2:33 AM

any chance of working source code. COuld you send it to me at sachabarber@hotmail.com

# achintya said on Thursday, October 18, 2007 1:19 PM

This still postbacks . Am I doing something wrong ?

I can still see the progress bar in the IE bottom right corner.

# Christian Weyer said on Tuesday, October 23, 2007 12:04 AM

Actually, the format of either the request or the response is already defined on the contract by leveraging RequestFormat and ResponseFormat properties.

The webScript behavior is just there for compatibility reasons with ASP.NET AJAX and is not needed if you want to have plain JSON support (which is defined on the contract, as said).

Why is it on the contract and not on the binding? Well, the semantics of XML and JSON differ significantly and it is really a decision of the contract modeler - JSON (the infoset, if you like ;)) does not support the full feature set of XML, and this is by design as we all know.

# Luis Abreu said on Tuesday, October 23, 2007 2:40 AM

Hello Christian.

Thanks for the clarification. btw, any comments on the response being "wrapped" on an anonymous objecto which has only one property that points to the returned object? here's an example. suppose i had a class called person which was returned from the method. it has only 2 proeprties: Name and Address. in beta 1, i used to get somethjign like this on the client side:

{ "Name" : "Luis", "Address": "Fx" }

which is the exact representation of my object in JSON.

In the current release, I'm getting something like this:

{ "d":{ "Name" : "Luis", "Address": "Fx" } }

maybe I might be failing to see the obvious, but i'm still not sure on why this is being done...

thanks again.

# Christian Weyer said on Tuesday, October 23, 2007 1:06 PM

Hm, this doesn't happen for me. Pls send me the code cw __AT_ thinktecture.com

# luisabreu said on Tuesday, October 23, 2007 2:54 PM

hello again.

hum...not sure on why but it seems like i was having a problem with my old project which was created with previous beta version of vs. i've copied the files to the a new web site project created with 2008 beta2 and everything is working smoothly (ie, it still receives the the anonymous object with the d property i was talking about but in this version the callback js method gets the correct object). thanks again.

# Jacky_xu said on Tuesday, October 23, 2007 8:37 PM

[1]PHPonIIS7w/FastCGI(IIS7中的PHP和FastCGI模块)

最新版本的IIS7.0即将随着WindowsVista一同发布,在极大增强了其主要支持的ASP.NET...

# Silverlight and JSON « Tales from a Trading Desk said on Friday, October 26, 2007 3:02 PM

Pingback from  Silverlight and JSON &laquo; Tales from a Trading Desk

# dashda » Blog Archiv » Deployment problems with ASP.NET AJAX applications said on Friday, October 26, 2007 9:45 PM

Pingback from  dashda  &raquo; Blog Archiv   &raquo; Deployment problems with ASP.NET AJAX applications

# RICHARD said on Tuesday, October 30, 2007 11:51 AM

hello i'l wanna study ajax.. and i'l to know where i can find some example and book !

tnx !

# Ghillie Suits » Calling a WCF service from your Silverlight application - LA.NET [EN] said on Tuesday, October 30, 2007 1:46 PM

Pingback from  Ghillie Suits &raquo; Calling a WCF service from your Silverlight application - LA.NET [EN]

# ASP.NET AJAX: some ideas on how to export the contents of a … said on Tuesday, October 30, 2007 7:51 PM

Pingback from  ASP.NET AJAX: some ideas on how to export the contents of a &#8230;

# Zhiming Xue's WebLog said on Wednesday, October 31, 2007 9:08 AM

While you can easily use XML web services in your Silverlight applications, working with WCF is much

# Zhiming Xue's WebLog said on Wednesday, October 31, 2007 9:11 AM

While you can easily use XML web services in your Silverlight applications, working with WCF is much

# Noticias externas said on Wednesday, October 31, 2007 9:50 AM

While you can easily use XML web services in your Silverlight applications, working with WCF is much

# Noticias externas said on Wednesday, October 31, 2007 9:51 AM

While you can easily use XML web services in your Silverlight applications, working with WCF is much

# software configuration management » Changes on the configuration of WCF to use JSON said on Wednesday, October 31, 2007 10:15 AM

Pingback from  software configuration management &raquo; Changes on the configuration of WCF to use JSON

# software configuration management » Changes on the configuration of WCF to use JSON said on Wednesday, October 31, 2007 10:15 AM

Pingback from  software configuration management &raquo; Changes on the configuration of WCF to use JSON

# Reece Sim said on Thursday, November 01, 2007 2:06 AM

Hi,

I don't quite get everything that you say. Can I get a full sample?

My email address is CheeSiang.Sim@acs-inc.com

# Eric Hauser said on Saturday, November 03, 2007 9:46 AM

Luis,

I spent a few days stuggling with this as well.  If you are still having issues, I put together an end to end example on getting it working:

http://erichauser.net/?p=33

It would be nice to see some documentation on the serialization model though.  Lots of trial and error in getting that hacked out.

# luisabreu said on Saturday, November 03, 2007 11:28 AM

Great post Eric.

thanks for sharing it...

# Bertrand Le Roy said on Monday, November 05, 2007 6:13 PM

I think a really important point about var is that it is made necessary by anonymous types, which themselves are necessary for Linq. So it's not just random syntactic sugar to make C# look more dynamic, it's an essential part of a very nicely thought out puzzle.

# Luis Abreu said on Tuesday, November 06, 2007 5:04 AM

hello Bertrand.

yes, i agree with you. that why i said that i still haven't build any LINQ aware applications :)

# SoSoSO said on Tuesday, November 06, 2007 9:07 AM

So a postbacktrigger is there just to make sure controls within an update panel can do a full postback?  Is that what I'm understanding?

# jxp said on Thursday, November 08, 2007 1:42 AM

what is PrintingRotation and PrintingMultiplier ?

# anchoret said on Thursday, November 08, 2007 2:39 AM

how to print chinese font?

# Bertrand Le Roy said on Monday, November 12, 2007 12:11 AM

I believe you can use /// <field> xml-documentation in your prototype (no matter where the field actually is initialized).

# Robert said on Monday, November 12, 2007 1:10 AM

forums.asp.net/.../1946825.aspx

You posted to me and helped me on that thread.  Now I read your blog all of the time. Thanks!

# Luis Abreu said on Monday, November 12, 2007 3:19 AM

Hello Bertrand.

Yes, that really seems like a better option. I've noticed several /// entries on the asp.ent ajax client libs, so i thought that those entries should be used. Anyway, I was jus complaining about the approach that was offered in the JScript blog :) if i'd had to do that for getting intellisense, i'd really prefer not to have it...

# Bart said on Monday, November 12, 2007 12:09 PM

I don't know if you'll check this, But I have an interesting one for you:

I have nested datalists (master-detail) set up to appear like an explorer window and when you click the master it shows the div that was hiding the detail items.  I am trying to get the detail to do a partial page update when it gets shown.

my update panels are named dynamically and so are the triggers.  how do I assign the triggers to specific panels through javascript or in the code behind?

thanks,

--bart

# luisabreu said on Monday, November 12, 2007 1:25 PM

hello.

yes, i do read the comments, but sometimes i do take some time to answer.

regarding your question,  if you're adding trigers from the code behind, then maks sure you add them until the init event (if i recall it correctly, doing it after won't work correctly).

from jscript, it's really simple, you just need to submit the form by using the good old __doPostback methof and passing the client id of the update panel:

encosia.com/.../easily-refresh-an-updatepanel-using-javascript

hope this helps.

# LA.NET [EN] said on Monday, November 12, 2007 5:31 PM

Hurray! Pete has just announced this on his blog . Good news for the SL ASP.NET controls I&#39;ve kept

# RodeoFive » Deployment problems with ASP.NET AJAX applications said on Monday, November 19, 2007 12:32 AM

Pingback from  RodeoFive &raquo; Deployment problems with ASP.NET AJAX applications

# David Barkol's blog said on Monday, November 19, 2007 9:02 PM

Recently, along with a few others , I've received the honor of joining the ASPInsiders . It has been

# LA.NET [EN] said on Thursday, November 22, 2007 4:02 AM

The ASP.NET AJAX platform has some client services which you can use from your client Javascript code

# Reece Sim said on Thursday, November 22, 2007 7:55 PM

Hi,

I am trying to use a duplex service in Silverlight. Is that possible? If it is may I know how?

# espslrczik said on Monday, November 26, 2007 3:41 AM

Hello! Good Site! Thanks you! iqombeemhsohd

# xsobwkulfv said on Monday, November 26, 2007 3:41 AM

Hello! Good Site! Thanks you! vovafkhfpbr

# ujlqazfxln said on Monday, November 26, 2007 3:41 AM

Hello! Good Site! Thanks you! tkodfwiwrih

# Alessandro said on Monday, November 26, 2007 10:07 AM

Luís,

Muito obrigado, seu código foi de grande ajuda.

Abraços,

Alessandro

# MSDN Blog Postings » SoCal MSDN events for Web Developers - slide deck and links said on Monday, December 03, 2007 6:33 PM

Pingback from  MSDN Blog Postings  &raquo; SoCal MSDN events for Web Developers - slide deck and links

# Contagious Curiosity said on Wednesday, December 05, 2007 10:11 AM

Presentations given in Irvine and Riverside, CA - here's the deck and links for more information about

# Thoughts on Silverlight » BIT-101 Blog said on Tuesday, December 11, 2007 5:30 PM

Pingback from  Thoughts on Silverlight &raquo; BIT-101 Blog

# blahbal said on Friday, December 14, 2007 12:26 PM

it sucks. See how easy is to drag stuff in Flash.

# arenda kvartir peterburg bystro said on Friday, December 14, 2007 8:29 PM

energosnabzhenie kvartiry blagoveschensk arenda kvartir 2 aya kvartira kupit kvartiru predlozheniya <a href="betaflat.com/">arenda kvartir peterburg bystro</a> kuplyu 1komnatnuyu kvartiru oformit pokupka kvartir ekaterinburg sdat kvartiru marksistskaya rynok kvartir sankt peterburg

# nedvizhimost sdayu tomsk said on Sunday, December 16, 2007 10:00 AM

nedvizhimost sdayu tomsk nedvizhimost sdayu tomsk <a href="omegaflat.com/">nedvizhimost sdayu tomsk</a> nedvizhimost sdayu tomsk nedvizhimost sdayu tomsk nedvizhimost sdayu tomsk

# Trevor said on Monday, December 17, 2007 3:21 PM

Thanks for identifying the cause of the problem, but I don't understand how to fix.  Using VS2005, what do I need to do in property pages?  I used to have my app running but since i installed VS2008 it doesn't work when I publish to server.

# luisabreu said on Monday, December 17, 2007 4:38 PM

hello.

in this case the problem was that the web app is configured to user .net 2.0 but the ajax toolkit dll taht was copied into the bin folder was compiled against the 3.5 version....

# Bhabesh said on Wednesday, December 19, 2007 7:00 AM

Really Good Post.......Cheers!!!

# ASPInsiders said on Friday, December 21, 2007 11:43 AM

[Update: this will only happen if you don&#39;t set up the web.config properly. You don&#39;t need to

# Allan Gobin said on Sunday, December 23, 2007 5:27 PM

Just put a panel in the UpdatePanel and add the user control to it.  Works fine :)

# Kevin said on Tuesday, December 25, 2007 12:50 AM

But, 'panel' can't be found in javascript while runing in IE. Why?

# Chipl said on Tuesday, December 25, 2007 5:22 AM

The command on JS such as :

   onload: onLoaded

// to hook up a function

my JavaScript engine alway throw out a message like:

"c.charCodeAt is not a function"

How do I solve it ???

BS

# Dimitris said on Saturday, December 29, 2007 3:32 PM

Hi. Thanks for the post. But unfortunately I cannot make this code work. I can see that the SetAuthCookie method does set the cookie but afterwards no access is allows to the secure items. I mean, the forms authentication ignores the cookie set... or misses something else... I don't know... Even after successful authentication I am stuck to the login page no matter what I do. Any ideas ?

# Marc said on Monday, December 31, 2007 1:11 PM

Unable to make the SilverLight application transparent while seeing its content over my HTML web page.

As you can see

I did use your properties above

# jhlee said on Wednesday, January 02, 2008 1:28 AM

chipl,

onload: onLoaded -> onLoad: onLoaded

notice 'l' and 'L'. ^^;

# ksirg said on Wednesday, January 02, 2008 1:00 PM

Kevin: try to add width and height attribute, I have the same problem and i notice that firefox dosn't display canvas without height atribute.

# Samuel said on Wednesday, January 02, 2008 4:28 PM

Hello there, I am currently writing my thesis on rich web apps with silverlight... the 4th point( calling cross domain..) is actually burning me up... i tried to test to download an image from another server, not hosted on my machine and  silverlight complained about runtime error...How can i pass through this..?

samuelbalcha@hotmail.com

# Jon said on Thursday, January 03, 2008 9:26 AM

I am using Visual Studio Express 2008 when I save to a .cs I get 2 other files (3 Total) Example.cs Example.Designer.cs Example.resx.  Which one am I compiling? Everytime I try to compile Example.cs I get some error The name or namespace "Linq" does not exist in the name space 'System' (Are you missing an assembly reference?)

# luisabreu said on Thursday, January 03, 2008 2:10 PM

Jon, you're probably adding a new form item. that's why you get 3 items. you're supposed to compile the cs files and you do need to pass a reference to the dll that has the linq namespace. btw, if you're using VS express, you can build your project from within the environment. You should use it whenever possible. I only wrote this post to show some basic concepts which many still don't know...

# Patrik said on Friday, January 04, 2008 2:54 PM

I used to do it all the time, it's even part of the code standard I developed for a company I worked for. One of the reasons for using "this" is that it immediately opens the intellisense dialog, another is that it's easier to see what are member fields and what are method variables. However I've recently started to move away from this habit because it makes refactoring a method from being an instance method making it static a tad harder since all calls to the method has to be updated.

However as I think of it now, I think that's a silly argument and that the arguments for outweighs the arguments against, so my answer is simply. I use it.

# AJAX coding school » Blog Archive » AJAX Code [2008-01-06 10:28:33] said on Sunday, January 06, 2008 5:32 AM

Pingback from  AJAX coding school  &raquo; Blog Archive   &raquo; AJAX Code [2008-01-06 10:28:33]

# AJAX coding school » Blog Archive » AJAX Code [2008-01-07 08:18:00] said on Monday, January 07, 2008 3:22 AM

Pingback from  AJAX coding school  &raquo; Blog Archive   &raquo; AJAX Code [2008-01-07 08:18:00]

# Max said on Monday, January 07, 2008 3:57 PM

This is a nice explanation.

I was stuck for 3 days finding a way to add a user control dynamically to an update panel. I used the notation "new Control1" instead of LoadControl("Control1.ascx"). That was my trouble. I found no explanation to this behavior but finally am happy to find a solution.

Thank you Luis!

# AJAX coding school » Blog Archive » AJAX Code [2008-01-08 03:19:38] said on Monday, January 07, 2008 10:23 PM

Pingback from  AJAX coding school  &raquo; Blog Archive   &raquo; AJAX Code [2008-01-08 03:19:38]

# tron said on Thursday, January 10, 2008 12:14 PM

<a href= http://index1.sdsob.com >curtis w lassiter</a>

# tron said on Thursday, January 10, 2008 1:20 PM

<a href= http://index1.sdsob.com >curtis w lassiter</a>

# tron said on Thursday, January 10, 2008 2:19 PM

<a href= http://index1.sdsob.com >curtis w lassiter</a>

# Steve said on Thursday, January 10, 2008 10:04 PM

Thank you for this example!  

Something interesting happens when I change the size (fontSelection) from 4 to 5, it jumps in size to gigantic.  I'm trying to understand how to get a little bigger than size 4.

# Steve said on Thursday, January 10, 2008 10:14 PM

I figured it out.  I set the size to 2 and both PrintingMultipliers to two.  

Thank you again for the wonderful example!

# tron said on Thursday, January 10, 2008 11:19 PM

<a href= http://index1.sdsay.com >breast nodularity at a posterior depth</a>

# tron said on Friday, January 11, 2008 12:33 AM

<a href= http://index1.sdsay.com >breast nodularity at a posterior depth</a>

# tron said on Friday, January 11, 2008 1:32 AM

<a href= http://index1.sdsay.com >breast nodularity at a posterior depth</a>

# cqgyr said on Friday, January 11, 2008 4:13 AM

<a href= http://rpz3zmr75a.com >Google</a>

# cqgyr said on Friday, January 11, 2008 4:13 AM

<a href= http://rpz3zmr75a.com >Google</a>

# JT said on Sunday, January 13, 2008 1:56 AM

I found this post after running into similar issues with the CompositeControlDesigner.

I found a simple solution in the Microsoft's Composite Web Control example (msdn2.microsoft.com/.../3257x3ea.aspx).  The solution is to override the CompositeControl's RecreateChildControls() function.  The function should look like:

       protected override void RecreateChildControls()

       {

           EnsureChildControls();

       }

To understand why this fixes the issue, take a look at the CompositeControlDesigner's CreateChildControl() function.

# fegni said on Sunday, January 13, 2008 5:09 PM

<a href= http://rpz3zmr75a.com >Google</a>

# fegni said on Sunday, January 13, 2008 5:09 PM

<a href= http://rpz3zmr75a.com >Google</a>

# goro said on Monday, January 14, 2008 11:49 AM

<a href= http://index1.gofjf.com >frederick douglass biography</a>

# goro said on Monday, January 14, 2008 12:59 PM

<a href= http://index1.gofjf.com >frederick douglass biography</a>

# goro said on Monday, January 14, 2008 2:04 PM

<a href= http://index1.gofjf.com >frederick douglass biography</a>

# yyony said on Monday, January 14, 2008 9:44 PM

<a href= http:// >Google</a>

# tloqx said on Tuesday, January 15, 2008 8:59 PM

<a href= http://ezgwa.com/ugtytgty.html >Google</a>

# tloqx said on Tuesday, January 15, 2008 8:59 PM

<a href= http://ezgwa.com/ugtytgty.html >Google</a>

# omar said on Wednesday, January 16, 2008 3:43 AM

need silverlight for vs 2005

# John McFetridge said on Wednesday, January 16, 2008 12:12 PM

This is great as the LinqDataSource is a wonderful RAD tool but useless in a Tiered application. Now we can return List from the DAL and still use the LinqDataSource.

# Shane N said on Monday, January 21, 2008 1:30 PM

ASPInsiders commented that you need to set up web.config properly. What specifically is wrong or needs to be done with it?

# Trent said on Wednesday, February 06, 2008 3:40 PM

Has anybody noticed the increased PreRenderComplete times when using this control?  My best guess is that there is some expensive operation during this method when trying to combine scripts.  The implications were significant within our app.  Script combination only saved a *fraction* of total download size, where I gained .7 seconds on the server for rendering this script.  Definetly a deal breaker.

# Alberto Silva said on Thursday, February 21, 2008 6:28 PM

Welcome back, we forgive you!

# Paulo Morgado said on Friday, February 22, 2008 5:24 AM

I don't. You left. Now, keep out.

# Robert said on Saturday, February 23, 2008 1:30 PM

I think anyone who acts negative towards a blogger is ridiculous...  Bloggers like this take time out of their professional lives to help everyone with problems they encounter.  It's very rude to say negative things to people who help you, would you be rude to a calculus teacher who shared what they did last weekend? (Keep in mind the teacher is teaching for FREE)

# Elson said on Friday, February 29, 2008 6:10 AM

Welcome back, Luis!

# karthik said on Tuesday, March 04, 2008 6:22 AM

im getting cross domain calls are not supported byHttpWebrequest error.how to resolve this error

# Ofek Cohany said on Tuesday, March 11, 2008 12:01 AM

Hello,

Thank you for this beautiful solution! I have a question though:

I'm trying to raise an event from the ASCX and capture it on the ASPX.

The event is raised properly (I can see it on the debugger) but for some reason the ASPX does not capture it.

My code on the ASPX page is:

Protected objAscx As New ascx1

on page_load:

AddHandler objAscx.SaveForm, AddressOf SaveForm

Protected Sub SaveForm()

  'Some code here

End Sub

# Bruno Kenj said on Wednesday, March 12, 2008 1:42 PM

Luis, tudo bem? Eis a solução:

www.brunokenj.net/.../utilizando-servertransfer-e-aspnet-ajax-10

abraços!

# Bruno Moniz said on Thursday, March 13, 2008 8:50 AM

Boas Luís. Parabéns pelo lançamento. Tenho a versão anterior que já me livrou de muitas horas de pesquisa :)

Tenho uma dúvida: Tendo o livro anterior e além da passagem do 2.0 para 3.5, que mais diferenças o livro apresenta? (por míudos: vale a pena comprar este tendo o outro?)

Cumprimentos,

Bruno Moniz

# luisabreu said on Thursday, March 13, 2008 9:13 AM

Ola Bruno.

Uma pergunta de dificil resposta :)

Para ajudar, posso fazer um pequeno resumo com as alteracoes que foram efectuadas. A nivel de conteudos, foram adicionadas paginas aos capitulos existentes com exemplos dos novos controlos e funcionalidades introduzidas pela ultima versao, foram corrigidos alguns bugs do texto e foi tb adicionado um novo capitulo sobre asp.net ajax.

so tu podes decidir se vale a pena investir no livro :) recomendo que passes numa livraria e des uma olhadela ao novo livro.

# Bruno Moniz said on Thursday, March 13, 2008 9:38 AM

Obrigado pela resposta Luís. Pois talvez a melhor opção é mesmo passar numa livraria :)

# pedrocorreia.net said on Thursday, March 13, 2008 2:27 PM

Adquiri os 2 livros anteriores (asp.net e o de ajax), são ambos de fácil leitura e com muitos exemplos, o que ajuda sempre neste tipo de livros, não sendo livros "maçadores".

Tenho de dar um salto àquela loja que começa por "F" acaba em "C" e pelo meio tem as letras "NA" e dou uma vista de olhos.

Quando é que lanças um(ns) livro(s) sobre asp.net mvc, silverlight e linq? ^_^''

Keep up the good work!

# pedrocorreia.net said on Thursday, March 13, 2008 4:46 PM

Adquiri os 2 livros anteriores (asp.net e o de ajax), são ambos de fácil leitura e com muitos exemplos, o que ajuda sempre neste tipo de livros, não sendo livros "maçadores".

Tenho de dar um salto àquela loja que começa por "F" acaba em "C" e pelo meio tem as letras "NA" e dou uma vista de olhos no novo livro.

Quando é que lanças um(ns) livro(s) sobre asp.net mvc, silverlight e linq? ^_^''

Keep up the good work!

# Ajeet said on Sunday, March 16, 2008 6:33 AM

Thanks a ton dude. :)

You are my hero.

luv u.

# Lisber said on Tuesday, March 18, 2008 9:09 AM

Parabens!, gostei muito do livro de Ajax. Espero ler o livro e perceber as maravilhas do LINQ :P.

# luisabreu said on Tuesday, March 18, 2008 2:32 PM

Em relacao ao LINQ, acho q deves ficar em stand by...podem haver noticias nessa area nos proximos tempos :)

# Mike said on Tuesday, March 18, 2008 6:01 PM

Thank you. I spent two hours on this before I found this post.

# Swati Jain said on Thursday, March 27, 2008 9:00 AM

Hi

I am getting the following error after executing the code

Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.

# luisabreu said on Thursday, March 27, 2008 9:17 AM

If I'm not mistaken, the code uses SQL Express 2005. Do you have it installed in your machine? If you have another version of SQL Server, then it should work too: you just need to change the connection string.

# Goldfinger said on Thursday, March 27, 2008 3:32 PM

FOR GOD.... WRITE THE DAMN SOLUTION

# Alex said on Thursday, March 27, 2008 5:07 PM

Well if you know a solution to play local files with silverlight please let me know. Can Silverlight open an XML file from the disk and use it?

# Travis Fleming said on Wednesday, April 02, 2008 2:40 PM

I'm getting an error message when trying to view a live baseball game on MLB.TV on the 1.2 MB stream. The message is as follows:

Silverlight error message

Error Code: 2203

Error Type: RuntimeError

Message: AG_E_RUNTME_SETVALUE

MethodName: Source

How do I fix this?

# JH said on Thursday, April 03, 2008 9:55 AM

Thanks for the post!

# Elena said on Friday, April 04, 2008 12:06 PM

Thanks a lot, I was looking for the Ajax solution for quite a while!

# Anz said on Sunday, April 06, 2008 1:48 AM

We can use the cross page posting to make similar functionality of Server.Transfer

here is an interesting post

forums.asp.net/.../1391157.aspx

# Serializer said on Sunday, April 06, 2008 6:49 PM

Yet another example of how broken ASP.NET is.

Why design this great component model, yet not actually build in the flexibility to use it properly?

It makes building web applications ultimately take about 100x as long, rather than saving time as it's supposed to - since I seem to spend all my time figuring out how to work around ridiculous inflexibilities like this.

I can't use the Page_PreInit event to insert my user control containing the update panel - because Page_PreInit has fired *way* before my other nested controls are ready to set themselves up.

Microsoft recommend that dynamically-added controls should be added in the Load method. This dynamically added control contains a templated control, which in turn instances a further user control within itself - sometimes this control will also contain an UpdatePanel. I simply can't do this at PreInit - the other page controls that I need to insert into aren't available at this time.

Don't know what to do but somehow I will kludge this mess, then wait for MVC toolkit to drop so I can start building things *properly*.

# Luis Abreu said on Monday, April 07, 2008 3:19 AM

Hello.

yeah, the web forms model has some gotchas....

but do notice that you can still add the UpdatePanel during the load event. what you cannot do is add/remove/add again after the event i've mentioned...the problem I'm describing happens because there are some cases where a control (which internally contains an UpdatePanel) is initially added to an existing control, then removed and then added again to another controls's collection. if you do this, then be sure to do it until the preinit event.

If you're just adding a control to the page (and you're nov removing it/adding it to another place later) you should be able to do it until the end of the load event...

# xOR said on Thursday, April 10, 2008 4:48 AM

HI,

i have tlp 2844 and working with Serbian language, but my printer can't print some serbian characters. č,ć,ž etc.

I've tried the I command (codepage1250) like:

I8,B,001

but it still doesn't print. Can someone help me with this please?

Thanks.

# ASP.NET AJAX Forum Posts said on Thursday, April 10, 2008 4:52 PM

OK. I&#39;ve been working on this for 2 days, and scouring the forums for answers. I hve found many and

# jim said on Saturday, April 12, 2008 4:05 PM

I am getting the same message amd MLB said it was my problem

# Kominsky said on Wednesday, April 16, 2008 1:13 PM

Well, as som have said, there's a lot of complaining about this issue, but I can't see solutions, plx! if someone has a solution, post it here, I really need it, and well, I'm still lookin' for it, so if I get it, I'll post it here for sure.

My problem is:

aspx-contains the follow:

scriptManager1

   updatePanel1

        ascx1{updatePanel2[ascx2]}

when I try to update updatePanel2, I got that error...

By the way, my ascx 1 and ascx2 are loaded in the Page_Load cuz they are dynamic too...

PLX! HELP!

# Mike said on Thursday, April 17, 2008 3:13 AM

But did you actually get this code to build ?

In VS2008, I get two errors :

1. 'Dummy' in explicit interface declaration is not an interface

2. 'CSharpGotchas.Dummy' does not implement interface member 'CSharpGotchas.IDummy.Increment()'

So I guess the correct answer should be that it won't compile !

# Mike said on Thursday, April 17, 2008 6:27 AM

But if you replace :

void Dummy.Increment()

with

void IDummy.Increment()

then it does compile

# Vinh said on Friday, May 02, 2008 10:24 AM

Great!, can you document details step by step please. Thank you.

# Kalam said on Saturday, May 03, 2008 1:02 PM

I have migrated to .Net 2.0. There are some custom controls on the page including form and panel. This controls are mandatory for the page and form. Now while I want to implement ad ajax withih the page I get this error. How to deal with ajax and custom control in VS 2005. Any suggestion will be appriciated.

Please help

Thanks

# Tim said on Sunday, May 04, 2008 9:06 PM

aspinsiders, please clarify...

# Tim said on Sunday, May 04, 2008 9:13 PM

I did what you recommended, no luck ('Always' and false visible updatepanel).

# Luis Abreu said on Monday, May 05, 2008 3:18 AM

Hello guys,

ASPInsiders is the aggregate feed of the asp insiders group. If you follow the link, you'll see that it's another post by me that talks about problems with the authentitcation services that will occur if you don't set up the web. config correctly. In this case (ie, regarding the code example that is presented on this post), you don't need to do anything to the config file.

# Zeroth said on Wednesday, May 07, 2008 8:40 PM

How does that relate in any way at all to Silverlight? Sorry for my confusion, but I don't see the connection. Have you actually tried Silverlight? I am very pro-FOSS, but its a decent platform to code in/for, whatever.

# luisabreu said on Thursday, May 08, 2008 2:48 AM

Hype. that's how it's related to SL. Both technologies are great, but they simply don't justify the current hype around them.

Regarding your question, yes, I have tried SL a long long time ago. I did knew something about it, but I must admit that I haven't really tested the latest beta version. I intend to that in the next days though.

Just to make my point clear, I'm not agains it. only against the hype which tries to push it as the best platform for the web.

# Jen said on Friday, May 09, 2008 11:39 PM

need to add  mlb.com to you trusted sites (this seems to be a Vista issue, since did not have same problem on my XP computer)

In Internet Explorer -->  Tools

Internet Options

Security Tab

click on green check "Trusted Sites"

click SITES button

UNCHECK the box that says "Require servier verification..."

to add ALL the mlb sites, type  http://*.mlb.com  in the box and click add.

# ASPInsiders said on Monday, May 12, 2008 4:02 PM

You can get them from here (VS) and here (.NET). I&#39;m reading what&#39;s new on Brad Abrams post and

# Brad Abrams said on Tuesday, May 13, 2008 9:57 AM

Great!  I am glad you like these features... On the Combine scripts, what is cool with the work we did in the platform is that it can combine even the system scripts!   It is also nice to have it built in.

# Sandhu said on Thursday, May 15, 2008 10:28 AM

Hi,

I read your page, its really good. I also had the same problem. Mine solved by deleting the line

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

   Namespace="System.Web.UI" TagPrefix="asp" %>

Then I changed it to

<%@ Register Assembly="System.Web.Extensions, Version=2.0.50727.1433, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

   Namespace="System.Web.UI" TagPrefix="asp" %>

But I still receive the same error so finally I deleted this. Now Ajax and the page , both are working fine.

# Perry said on Friday, May 16, 2008 7:30 PM

I am doing this in the Global.asx.vb:

       Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)

           Server.Transfer("Error.aspx")

       End Sub

This works for non ajax errors but it fails for my ajax pages. I need to do a transfer rather than a redirect because I need the context error from the CLR which can not be passed through a querystring that the redirect would need. The other option would be to conditionaly opt out of the Server.Transfer for partial post backs in the global.asx. Anyone know how to tell if we are in a partial post back in the global.asx? There is no page context or script manager there.

# LA.NET [EN] said on Saturday, May 17, 2008 6:01 PM

Now that we know the basics, it&#39;s time to see how we can use this new API with LINQ. In this post

# LA.NET [EN] said on Saturday, May 17, 2008 6:01 PM

Now that we know the basics, it&#39;s time to see how we can use this new API with LINQ. In this post

# LA.NET [EN] said on Saturday, May 17, 2008 6:07 PM

I&#39;ve thought it would be good to post an entry which aggregates all my LINQ To XML entries for future

# LA.NET [EN] said on Saturday, May 17, 2008 6:07 PM

I&#39;ve thought it would be good to post an entry which aggregates all my LINQ To XML entries for future

# ASPInsiders said on Saturday, May 17, 2008 6:51 PM

I&#39;ve thought it would be good to post an entry which aggregates all my LINQ To XML entries for future

# ASPInsiders said on Saturday, May 17, 2008 6:51 PM

Now that we know the basics, it&#39;s time to see how we can use this new API with LINQ. In this post,

# Rod Trent said on Saturday, May 24, 2008 8:28 PM

Depends on your needs, I guess...

myitforum.com/.../xobni-gone.aspx

# luisabreu said on Sunday, May 25, 2008 6:05 AM

Well, I'm not sure if I'm going to like in in 3 years, but now I'm really enjoying. It just makes using my inbox really easy...

# Scott said on Friday, May 30, 2008 12:23 PM

Thanks!  I suspected this, but wasn't sure until I found this post.

# Reaper said on Sunday, June 01, 2008 3:03 AM

She had to play this gig or the American tour was cancelled ... well now it is cancelled for sure. Poor, sad Amy not long for this world now.

# Giovanni Bassi said on Tuesday, June 03, 2008 5:34 PM

Hello Luis,

They used Abstract Classes for a purpose: to do not create versioning problems on future releases.

Take a look at Phil Haack's posts:

haacked.com/.../versioning-issues-with-abstract-base-classes-and-interfaces.aspx

haacked.com/.../abstract-base-classes-have-versioning-problems-too.aspx

It makes sense, right?

Um abraço,

Giovanni Bassi

# luisabreu said on Tuesday, June 03, 2008 5:52 PM

Yes and no.

I'm not sure that this model is good. I would prefer interfaces with new functionality being added to a new derived interface.

Even though versioning might have been the main idea behind this approach, I still think that the biggest advantage is in testing...

abraços!

# Josh said on Tuesday, June 03, 2008 8:10 PM

Another reason for abstract class. Is an interface requires you to override all methods while an abstract class you can choose to just override what you want to mock for unit testing.

undev.spaces.live.com/.../cns!6526A337A687E45D!214.entry

# fubeidong said on Wednesday, June 04, 2008 1:42 AM

Can use this MVC in ASP.NET2.0?

# Reflective Perspective - Chris Alcock » The Morning Brew #107 said on Wednesday, June 04, 2008 1:52 AM

Pingback from  Reflective Perspective - Chris Alcock  &raquo; The Morning Brew #107

# Damon Wilder Carr said on Wednesday, June 04, 2008 1:26 PM

Great post. Your obviously highly accomplished in these areas.

I would only add that one emerging pattern to achieve this with far less pain and 'uncertainty' in regard to future support and maintainability is the pattern of:

'Use Extension Methods with Qualified Interface Type for Multi-inheritance Style Extension'

I have seen this written up by a few and I have used this myself (before really even thinking much about it) since I got mt hands on C# 3.0 beta X whatever that was..

public interface IDomainQueryService {

}

# Damon Wilder Carr said on Wednesday, June 04, 2008 1:58 PM

Sorry I accidently submitted. To continue (one arbitrary example - the pattern not the types I use are the idea):

publlic interface IDomainServiceResolver  {

       TTypeService Resolve<TTypeServive>(params Predicate<TTypeService>[] resolveConditions) where TTypeService : IServiceProvider

}

That's it. We extending this using extension and IDomainServiceResolve (or IServiceProvider) as a nice option moving forward.

The idea is create an interface with (typically) 1 core element to the functionality. For file services it could be the path, for XML is could be the Stream for the DOM, for images it could be a SystemDrawing.Image....

So for this to work extensions work off an instance, so we need an instance of any IServiceResolver. Here is a simple example assuming it gives us a nice instance of some IDomainServiceResolver  :

Predicate<Customer> predCondition = cus => cust.IsActive;

var customerProjection =

Resolver.For<IQueryService>.Get<CustomerRepository<ByPastDueBalanceProjection>>(predCondition );

Ok fine... What if we have addition needs on the interface? Such as for an ability to see if the service is available?

public static TTypeService IsAvailable<TTypeResolver, TTypeService>(this TTypeResolver providerTarger) where TTypeResolver : IServiceProvider {

          return providerTarget.ServiceExists(x => typeof(TTypeService));

}

then

IQueryService serviceInstance = Resolver.For.IsAvailable();

if (serviceInstance.Equals(Resolver.NullService<IQueryService>))

             /// do whatever...

}

I am writing this from memory so I may have missed a . or a ( somewhere. If you like I can send you a more compelling example we use almost every day using this as a factory (it's cool I think):

var _sb = true.InstanceOf<StringBuilder>(); or:

StringBuilder _sb = true.InstanceOf();

or

var _sb = typeof(StringBuilder).InstanceOf(); (you get the idea...)

as true is an instance of bool this extension (instanceOf) simply extends the 'bool' interface....

Thanks,

Damon Wilder Carr

# luisabreu said on Wednesday, June 04, 2008 3:57 PM

Good example Damon.

Yeah, if you have a simple example, i'd love to play with it :)

# Valentin Vasiliev said on Saturday, June 07, 2008 7:03 AM

Thanks, you saved my day!

# Adrian said on Monday, June 09, 2008 8:58 AM

Kevin, panel is the id of a control.  The author has used IE only syntax, but also if you're using master pages, or the "panel" is nested, the id will change dynamically.

# Steve Allen said on Thursday, June 12, 2008 1:20 AM

The default membership provider in aspnet uses the "ApplicationName" combined with username/password to authenticate. How does one set he ApplicationName (i.e.; aspnet_Applications table in the database) using client services?

# Fredrik said on Thursday, June 12, 2008 1:31 AM

So-called "expert" commentators on local tv here said that a defender cannot be out of play; its the refs job to stop the play in case of an injury. Whether they actually know what they're talking about I can't really say.. :p Either way, it was an awesome game!

# Luis Abreu said on Thursday, June 12, 2008 3:14 AM

that means that when a guy is down and is outside the pitch getting medical assitance, then if he's behind the goal line, then he's putting everyone else of the other team ok for scoring a goal...the offside rule is really simple: it's just one page! and the 2nd page that has the decisions doesn't mention any case of a player being outside the field. So, that only means one thing: outside the field and injured couldn't really count...

# luisabreu said on Thursday, June 12, 2008 3:19 AM

You don't. You do it at the web.config file of your site that is hosting the provider...

# Asia said on Thursday, June 12, 2008 5:46 AM

I have the samay problem and I don't really get the solution to this:

"...Fixing this was simple: they changed the code so that the active user control was loaded dynamically by the page." - You meen what? The resign from using MultiView and dit it another way or they fixed the MultiView solution?

thx

# luisabreu said on Thursday, June 12, 2008 6:15 AM

What I'm saying is that instead of using a multiview control, they changed their code so that only one user control exists on the page. To know which control to load, they check a query string parameter and load the control according to that value. So, if you have several components that do complex stuff during its lifetime in each view, then remove the multiview control and just load the controls dynamically during the initial page processing. If you think about it, you'll just need one control at each time, so using the MultiView control in these scenarios won't really giv you much...

# Mike said on Thursday, June 12, 2008 4:27 PM

It's called football because the ball is 1 foot long. :)

# Lee said on Saturday, June 14, 2008 10:38 AM

hi

is there anyway to solve this?

Silverlight error message    

ErrorCode: 2203

ErrorType: RuntimeError      

Message: AG_E_RUNTIME_SETVALUE    

MethodName: Height    

thanks!

# Filip said on Monday, June 23, 2008 11:38 AM

I think you are missing the point. The class visibility level is, in this case, separate from the method visibility level. Say you have 2 internal classes, and one of them has public and protected methods. Should the other class be able to access protected methods just because both classes are internal? No, it should not. That's why if you want classes to call each other's methods, you either need to make them public or internal. That's why there is no warning issues by the compiler.

Cheers,

- Filip.

# luisabreu said on Monday, June 23, 2008 1:08 PM

Hello Filip.

That's not the scenario I'm complaining about. I'm not saying that all the methods on an internal class should be internal.

what I'm saying is that there really is no purpose on letting an internal class declare a public method since you can apply internal to a class' member. Ie, the "maximum" visibility any member of an internal class will get is internal, which is "less" than public. That's what I'm complaining about.

# skeet said on Wednesday, June 25, 2008 4:08 AM

Well, you already need to be able to allow public methods if you implement an interface (leaving explicit interface implementation aside for the moment).

Likewise an internal class may derive from a public class and override one of its public methods.

I don't see that there's much benefit to prohibiting public methods where they *aren't* useful... and that's even leaving aside the reflection side of things (something may well want to find all the public properties of a class which is internal - binding, for example; similar uses for methods wouldn't be impossible to think of).

Jon

# silverlight drag and drop said on Thursday, June 26, 2008 7:53 AM

Pingback from  silverlight drag and drop

# Garbin said on Friday, June 27, 2008 5:40 AM

Happy Birthday!

# luisabreu said on Friday, June 27, 2008 9:08 AM

Thanks!

# Angel "Java" Lopez said on Saturday, June 28, 2008 4:38 PM

Ayer fue el último día de Gates como "full time" en Microsoft. Encontré una lista de videos

# ecards said on Saturday, June 28, 2008 5:03 PM

I get a ASP.Net page "hanging" just like you describe if I define the Session_Start event with no code.

If I remove the even, the entire app works perfectly.

This has been the worst problem switching over to Server 2008.

I wonder if it's related to your issue somehow, even though I'm not using TransferRequest?

# Jeff said on Saturday, June 28, 2008 8:17 PM

Lee,

Do what Jen says. Thanks Jen

# luisabreu said on Monday, June 30, 2008 11:26 AM

Hello Jon.

Well, I guess that some of those scenarios are valid.

Now, my problem with letting you define public methods on internal classes is that it doesn't "flow". Let me explain this better: You can't inherit from a base class that "is less visible" that the derived class. Example:

internal class T{}

public class R:T{}

This does "flow". In my limited brain, this does makes sense and I'm failing to see where internal class + public method is really a valid design approach. Again, I'm known for being slow, so maybe in a week or two it starts to make sense.

# Scott said on Tuesday, July 01, 2008 1:09 PM

I have seen several posts on various forums related to this issue, many of which have said the same thing.  It doesn't seem to be all machines, just some of them, making the problem even more troubling.  To make matters worse I have applied all of the service packs and I am still having an issue.

# meera said on Wednesday, July 02, 2008 2:11 AM

Is it possible to make  a file upload control  inside an update panel  with an associated updateprogress control work with AsynPostbackTrigger ??

# luisabreu said on Wednesday, July 02, 2008 3:04 AM

Hello.

Well, not likely. What you can do is search my blog for some old code that mimics gmail upload feature. The code was written for an older version of ASP.NET AJAX (I believe it was at CTP at the time I've written), so you'll need to port it to the current release.

# ASP.NET MVC Archived Blog Posts, Page 1 said on Friday, July 04, 2008 3:26 AM

Pingback from  ASP.NET MVC Archived Blog Posts, Page 1

# Community Blogs said on Saturday, July 05, 2008 6:48 PM

I’ve have just sent this email to the developers exchange group in my company: I think you all know the

# Jim O'Neil's Blog said on Monday, July 07, 2008 4:36 PM

ASP.NET routing is a new feature incorporated in the upcoming .NET 3.5 Service Pack 1 release. While

# Joao Paulo Carreiro said on Wednesday, July 09, 2008 9:22 AM

And I guess you refuse to use phones on mobile phones operators? :p

# luisabreu said on Wednesday, July 09, 2008 9:33 AM

No, no. What I'm not doing is paying 129 euros + 2 years paying 60 euros month for having that phone. I really prefer to pay 200 euros for htc touch and then switch mobile operator without having to google for how to unblock the phone.

btw, I didn't know that you still had time to read the blog:)

# Giovanni Bassi said on Wednesday, July 09, 2008 11:54 PM

Hey Luis, how are you?

Check this blog post on ZDNet, by Mary-Jo Foley (a professional blogger):

blogs.zdnet.com/microsoft

It looks like Silverlight was designed to be search friendly. I would expect that, after all, it's all a bunch of XML, right?

And also, MS still doesn't index flash.

...

Are we gonna have to wait for the competition to push them a little more, so they will start indexing other companies' technologies? After all, I'd like my preferred search engine to index Flash and Silverlight. Let's wait and see.

Um abraço,

Giovanni Bassi

# NIels Hansen said on Friday, July 11, 2008 12:48 AM

Somehow I have a feeling your holding out for the Microsoft Zune Phone! :)  

# Crave said on Friday, July 11, 2008 3:10 AM

Nice workaround man!

My problem was a bit different though, but this solution helped me resolve it. I was actually creating hyperlinks at runtime which was being done inside a DynamicPopulateExtender. Needed to show the save as dialogue.

Thanks again! ;o)

# luisabreu said on Friday, July 11, 2008 6:18 AM

Who knows :) I've been happy with my htc till now, so I'd say that I'm curious to check the new HTC diamond...

# b2b said on Friday, July 11, 2008 7:38 PM

have the same issue...

# Waleed Eissa said on Tuesday, July 15, 2008 9:19 AM

Well, despite the fact that the post was extremely helpful (and thanks a lot for that), I have to say that it really frustrated me. I came across the MultiVIew control quite recently and was going to use it in some project but being a performance aware developer I always read about anything before I use it and so I came across this post. I really like the idea of the MutliView control because it helps keep the markup (which usually contains more than server controls) in the .aspx file instead of the code behind file, sure I can use inline code (script block with runat=server) but I'm not a big fan of this, I prefer to keep the code in a code behind file. Now, I can't really find an alternative to MutliView (using the panels approach, ie. placing the controls in multiple panels and show/hide the panels as necessary, suffers from the same problem, all the controls will be loaded with every request), is there a way to keep the markup in the .aspx file without sacrificing performance?

# Waleed Eissa said on Tuesday, July 15, 2008 9:32 AM

> you simply cannot live without Reflector and C# 3.0!

I agree with the Reflector part but why C# 3.0? I use C# 2.0 and I'm very comfortable with it (planning to upgrade soon though) .. but initially I have read about the new features and I don't find any of them really tempting esp. that it still uses CLR 2.0 (but probably I can't judge correctly as I didn't use it), so, what do you like about C# 3.0? (may be you'll encourage me to upgrade even sooner :))

# luisabreu said on Tuesday, July 15, 2008 1:25 PM

hello.

I love everything about C# 3.0 :) You'll see that after using them, you cannot live without them. Linq To Objects is simply great, but let's forget about it for a minute...let's think about lambda expressions! with it I'm able to write a method in place and let the compiler infer types of parameters and return types. Just by using this expressions, you'll end up with some pretty cool stuff.

Do yourself a favor and start using C# 3.0 and then you'll see what I mean :)

# Bertrand Le Roy said on Tuesday, July 15, 2008 5:48 PM

You're right that this rule is very debatable and as a matter of facts, our team (ASP.NET) always prefixes private fields (which pretty much maps to fields 1:1 nowadays) with an underscore.

Now, the hungarian notation or m_, no way.

# luisabreu said on Tuesday, July 15, 2008 6:27 PM

Well, I'd say no. You'll have serious problems with the multiview control specially if your views have controls that perform several database calls. in this case, it's best to have several user controls and only load the current "view" that is shown to the user.

# Dave Ward said on Tuesday, July 15, 2008 7:24 PM

Personally, I'm sticking with "_".  I find that littering code with "this." is very distracting.

# Waleed Eissa said on Thursday, July 17, 2008 7:50 AM

Thanks a lot for your prompt reply but actually I'm not sure I get the answer. How can I load the current view only? Could you give more details please? Also, is there a way to keep the markup in the .aspx file without sacrificing performance?

BTW, I know it's completely unrelated to the post, so I'm sorry for asking this, but how do you keep spam out of your blog? I don't see any captcha in here ..

# luisabreu said on Thursday, July 17, 2008 8:04 AM

Hello again.

well, you need to break up the views into several user controls. then you'll be able to load only one view (ie, only one user control that has the html for the  view you want to render). do notice that it all depends on your objective. for instance, if your views don't go to a database to fecth data, then you probably can keep using the multiview control without any problems.

regarding the spam, I'm using community server which takes care of that for me.

# Waleed Eissa said on Thursday, July 17, 2008 8:07 AM

Sorry for spamming your blog :) but actually I wanted to say something about the MultiView control. Well, I say it still can be useful depending on how you use it. In my case (as I referred in my previous post) I was looking for a way to keep the markup in the .aspx file, I very often come across having to return some useful message to the user after some action (have a look on my post on asp.net at forums.asp.net/.../2490577.aspx). So, I say in this case I could put the controls needed for this action in a view and add another view for the success message, and instead of showing/hiding panels I just switch the view, seems good to me and it shouldn't affect performance as the controls will be loaded anyway when getting and posting the page, what do you think?

# luisabreu said on Thursday, July 17, 2008 8:16 AM

Again, it depends. suppose you have 2 views. view 1 has some code that hits the db (you've put the db cod on the load event of the page) and view 2 has a simple message. If you don't take care, you'll have a problem: even though you're showing the view 2 with the message, the db code will still be run. that's the problem with the multiview control. This might not be a problem, so, as I've said, it all depends on your scenario :)

# Ollie said on Friday, July 18, 2008 5:50 AM

I bet you like 'Regions' as well...

# luisabreu said on Friday, July 18, 2008 6:07 AM

no comments on that :)

# Dave Reed said on Friday, July 18, 2008 1:20 PM

Another reason I dislike NOT having "_" is that a property and its backing field may only differ by the capitalization of the first letter (e.g. Mode and mode). Then, whether or not you use "this", its quite easy for statement completion to give you the wrong reference without you immediately realizing it, and it gets quite annoying dealing with that.

# Giovanni Bassi said on Sunday, July 20, 2008 9:51 AM

Just as Le Roy said, I don't like hungarian. I actually used it a lot before, but I have changed my mind, because the code gets less readable (in my opinion).

Regarding "_", I do use it, but I have also been using "this" to prefix the field names, just because it gets clearer. The same thing to point to class names outside the assembly: I use the "usings" directive quite carefully, because I want to know where that class comes from, most of the time. Unless the namespace is just really big, then an alias usually solves the problem.

Now, with this post from StyleCop you pointed, I am considering dropping the "_", because it makes sense if I am already using "this", anyway. The problem is that I might forget to use "this" and end up with the wrong variable... but I think that would be very unlikely.

And I don't particularly like the "m_". Its just ugly and makes the code less readable, just like hungarian (again, in my opinion). Anything that gets it more like human words and less like machine words is worth considering.

# luisabreu said on Sunday, July 20, 2008 4:30 PM

I don't use hungarian either (altough I think that  the definition of hungarian notation would be another interesting "religious war" post), but I prefer to use the _ convention to the this convention. As I said, it's all about personal style :)

# Paulo Morgado said on Sunday, July 20, 2008 6:59 PM

For those who need _ to know that it's a field, how do you know when you are accessing a local varible or a parameter?

I really can't understand the use of "m_" in .NET.

If you need to prefix stuff, why nhot go all the way?

msmvps.com/.../naming-conventions-for-c.aspx

# Suneel said on Monday, July 21, 2008 2:58 AM

I am also getting the same error  Unrecognized attribute 'messageEncoding'. Any update on this.

# luisabreu said on Monday, July 21, 2008 3:22 AM

that question answers itselt. the _ is only applied to fields. parameters and local variables don't have the prefix.

btw, there is a place where some sort "hungarian" pays off: with controls on windows forms.

# luisabreu said on Monday, July 21, 2008 4:18 AM

(just noticed that the previous comment got published before I ended it)

Regarding the parameter vs local variable thing, I haven't found it important to make that distinction in the code I write. It's not as important as seeing if you're working with a field. Since I don't like using the unecessary this prefix (btw, in these scenarios isn't the "this." really a "special" prefix?), I will keep using the _ to indicate a field.

Regarding the m_ prefix, I believe that it exists for historical reasons.

At the end of the day, it's a matter of taste, so everyone is entitled to having his own style.

# Matt said on Monday, July 21, 2008 6:43 AM

This is good - I don't agree with the custom error page handling though. I see this a lot in examples and developers do not realize the effect this has on spiders:

<error statusCode="404" redirect ="error.aspx"/>

If a spider gets this, it will punish or more likely remove the page from the search engine index. The default redirect for asp.net custom error pages should be statuscode 500, when spiders see this code they assume an error has occured and will come back later - as opposed to assuming the page is not there anymore. You should have a custom 404 page too, but this should be used automatically by .net when a page is not found or has moved - not for handling errors.

I know this is not an seo asp.net article, but part of good error handling should take into account all kinds of visitors - spiders and humans. If a really important page gets dropped from Googles index due to a simple error, that won't be nice.

# Paulo Morgado said on Monday, July 21, 2008 2:47 PM

How do you name private static fields?

# Interesting articles(June 14) | devintelligence.com said on Saturday, July 26, 2008 9:37 AM

Pingback from  Interesting articles(June 14) | devintelligence.com

# Yordan Georgiev said on Monday, July 28, 2008 8:05 AM

public static void SettersAndGetters ()

{

string copyPaste = @"

how-to generate those in textpad F8

how-to Generate member accessors , properties for C# asp.net with textpad

how-to setters and getters

find: ^col(.*)$

replace: private string _\1 ; \n public string \1 { \n \t\t get { return _\1 ; } \n  \t\t set { _\1 = value ; }  \n } //comm -- eof \1 property \n\n

find:^(.*) (.*)$

private string s\1 ; \n public string \1 { \n \t\t get { return s\1 ; } \n  \t\t set { s\1 = value ; }  \n } //comm -- eof \1 property \n\n

private \1 _\2 ; \npublic \1 \2 { \n \t\t get { return _\2 ; } \n  \t\t set { _\2 = value ; }  \n } //eof property \2 \n\n\n

//for the constructor

_\2= this.\2 ;

//for the passing to the constuctor

\1 _\2 ,

";

} //eof method SettersAndGetters

# Anonymous said on Tuesday, July 29, 2008 5:27 PM

I can't believe Microsoft would release such amateurish controls, oh wait, yeah I can. This is, for a lack of a better word, absolute junk, written so unprofessionally. Why are we paying these people for their products when they do not work right?

# Bertrand Le Roy said on Wednesday, July 30, 2008 2:44 PM

Did you actually try that? Don't see why it wouldn't work.

# luisabreu said on Wednesday, July 30, 2008 4:20 PM

They do work...the idea of having new ones was clearing up the non-used stuff (viewstate, etc) and add some properties which make sense with MVC (for instance, having some sort of specify a route declaratively woudl be really great)

# Simone said on Thursday, July 31, 2008 2:41 AM

In Italy you can buy iPhone from any Apple retailer with no simlock...

# Simone said on Thursday, July 31, 2008 2:43 AM

Yep, a bit complicate, but all these extra coding sample will probably turn out in feature that the ASP.NET MVC team will include in the RTW of the framework.

Btw: great blog... subscribed!!

# chrismo111 said on Thursday, July 31, 2008 9:29 AM

I think this is one of those issues that programmers get all bent out of shape over and waste time bitching about that ultimately do not matter. What matters is consistency within your team.  Microsoft is just one vendor among many; why do we care what Microsoft recommends? Microsoft is neither an industry association nor a standards body?  Would anyone care if General Motors declared that all right hand turns in GM cars must be preceded by flicking the right hand blinker at least 23.416 seconds before commencing a right hand turn? No.  Some might care if the American Automobile Association or the National Highway Traffic Safety Administration (NHTSA) said the same thing and others would not; some states might issue their own right hand turn/blinker protocol and perhaps some counties too. What matters is that we understand what others drivers are doing when they implement their RightTurn methods (and does it really matter if you are driving alone in Death Valley at 4Am anyway?? It seems to me that it only matters when you are driving on the road with others – which happens to be the case with the majority of traffic – just not all.)

# Pedro Santos said on Thursday, July 31, 2008 9:38 AM

Hey Luís :)

Have you tried Prison Break and Heroes?

# p3dro said on Thursday, July 31, 2008 10:32 AM

Greetings Luis,

If I'm allowed I'll give my short list too :)

4 - Prison Break

3 - House MD

2 - Seinfeld (I keep watching the re-runs at Sic Radical and still laughing at it)

1 - Lost

Best Regards and have a nice vacations.

# Israel Aece said on Thursday, July 31, 2008 2:12 PM

Ouch :(

Where is 24 Hours, Prison Break, Two and Half Man? :P

# luisabreu said on Thursday, July 31, 2008 4:46 PM

Pedro: Prison break is just too  damn boring. Two series just for getting out? not really my kind of series. Heroes, cool, but still not enough for making into my top :)

Israel: 24H is cool but it's becoming a little repetitive :)

# p3dro said on Thursday, July 31, 2008 9:37 PM

Just for fun, I remembered an old Portuguese series, I saw it when I was a kid (and nowadays when I catch it in RTP Memória, while zapping) Duarte & Companhia :)

# Jaziz said on Wednesday, August 06, 2008 3:22 AM

I am also facing the same issue. Any idea?