<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>ASP.Net</title>
        <link>http://theruntime.com/blogs/jaykimble/category/53.aspx</link>
        <description>ASP.Net</description>
        <language>en-US</language>
        <copyright>Jay Kimble</copyright>
        <managingEditor>jkimble@gmail.com</managingEditor>
        <generator>Subtext Version 1.9.5.0</generator>
        <item>
            <title>Writing Better JS Components</title>
            <link>http://theruntime.com/blogs/jaykimble/archive/2008/08/12/writing-better-js-components.aspx</link>
            <description>&lt;p&gt;Perry (my boss... a developer/manager... he codes and manages) and I have been having a recurring conversation lately. One that keeps bringing to my mind a product that I knew about when I worked for ZAC Catalogs (way back in the day). I would daresay that none of you had even heard of it (although we did pick it up as a result of Xtras carrying it, so maybe a few of you knew about it). I believe it was a called "MFC DataGrid Wizard" or something like that. Anyway what it did was build a custom DataGrid component for you based on selections in a wizard. You selected what features you needed and then it would take it’s full-featured Grid source code (which came with the component) and would dynamically generate a full blown component for you with just the features you needed. &lt;/p&gt;  &lt;p&gt;There are two reasons this has become a topic for discussion for me. The first is that we are currently struggling with a set of third party components that a prior developer/manager pushed all over our main site. The components are ones that you have probably heard great things about them and they are pretty cool. The problem is when you shove these components everywhere! We are having ViewState issues among other things... One of the components is a full-featured Grid control (client-side) that while nice we usually only use as a glorified listbox (we use it for selecting an item). As a result I built a specialized DataGrid for our company (one that I’ll be doing a walkthrough on its codebase at the first &lt;a href="http://theruntime.com/blogs/jaykimble/archive/2008/07/17/tampa-user-experience-tux-user-group-is-coming-september-10th.aspx"&gt;TUX user group meeting next month&lt;/a&gt;)&lt;/p&gt;  &lt;p&gt;The other reason is this &lt;a href="http://weblogs.asp.net/bleroy/archive/2008/08/05/need-a-simple-grid-for-asp-net-ajax.aspx"&gt;post from Bertrand LeRoy&lt;/a&gt; where he talks about a &lt;a href="http://weblogs.asp.net/bleroy/archive/2008/08/05/need-a-simple-grid-for-asp-net-ajax.aspx"&gt;simple grid for ASP.NET&lt;/a&gt;. Here’s my problem with Bertrand’s post. The grid he talks about as being simple really doesn’t sound all that simple to my ears. Let me list a couple features:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Column drag/drop&lt;/li&gt;    &lt;li&gt;Different column types&lt;/li&gt;    &lt;li&gt;Data Sorting/Paging&lt;/li&gt;    &lt;li&gt;Inline editing&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Now mind you these are awesome features if you need them all then you would want to use something like this, but a lot of times what we need is something simpler. You could use the aforementioned grid for this, but the grid will probably still use ViewState (because it needs it maintain state for the paging, sorting, and editing features). It might need several more scripts or &amp;lt;shudder /&amp;gt; it’s script might be 500-1000 lines longer because of the added features.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;A Better Way&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I have been thinking about a better way to "do" script components. We really need to have a wizard that asks us what we will be needing in the components and then the main script file can be customized (as can the server side code) to remove certain things. It could be done really easy with templates for the script. You need a template for the main file, and additional includes based on features. The server side would work pretty much the same way. I know that no company really wants to give away their source, but even if they were able to do this for script code that would make our lives a lot easier.&lt;/p&gt;&lt;img src="http://theruntime.com/blogs/jaykimble/aggbug/2658.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jay Kimble</dc:creator>
            <guid>http://theruntime.com/blogs/jaykimble/archive/2008/08/12/writing-better-js-components.aspx</guid>
            <pubDate>Tue, 12 Aug 2008 12:04:33 GMT</pubDate>
            <wfw:comment>http://theruntime.com/blogs/jaykimble/comments/2658.aspx</wfw:comment>
            <comments>http://theruntime.com/blogs/jaykimble/archive/2008/08/12/writing-better-js-components.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/jaykimble/comments/commentRss/2658.aspx</wfw:commentRss>
        </item>
        <item>
            <title>MS MVC Thoughts</title>
            <link>http://theruntime.com/blogs/jaykimble/archive/2008/07/24/ms-mvc-thoughts.aspx</link>
            <description>&lt;p&gt;[NOTE: I haven’t quite had much of a chance to look at the new Preview 4, so take this as someone nearly informed. I haven’t read about anything in the Preview 4 that changes what I’m going to say. Also, remember that I am the admin/editor of the blog site which is Alt Alt.NET... so testability/mockabilty doesn’t really resonate with me.]&lt;/p&gt;  &lt;p&gt;I know it’s shocking that I would have something to weigh in on MS MVC, but I do. For those who don’t know. I took some issue with Ayende’s "leaky abstraction" back in my CodeBetter days (they had to love having me around). BTW, I understood and agreed in some respects, but in others I was less than agreeable. I still think Web Forms are viable and usable, but in some cases the paradigm breaks down, so the need for another paradigm is both welcome and interesting (and before anyone brings up Castle, PixelDragon, or CodeStory MVC frameworks, I have looked at them as well and found them --in general--way too complex to get started with which is not to say that a couple templates could help you guys out...).&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Why I’m interested?&lt;/strong&gt;    &lt;br /&gt;Ok, the reason I’m interested is summed up in one word: RIAs. I could have summed that up in 2 words: Ajax, and Silverlight2. The other thing is that I have used the MVCContrib’s Restful feature to build REST services (way cool).&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The Good&lt;/strong&gt;    &lt;br /&gt;I really like the simplicity. I mean MVC isn’t simple, but the MVC framework makes it easy to keep your layers separate... you still have to think about what you are doing, but on the whole it’s pretty easy to use. The MVC paradigm allows for a truer coding experience (the engine doesn’t pretend to be a Windows application in any way although you can still use things like session and the forms authentication engine in ASP.NET).&lt;/p&gt;  &lt;p&gt;The MVCContrib library is indispensable. It’s an open source library that is a community project that adds additional features to the MS MVC architecture. For instance there are a number of alternative view engines; I haven’t investigated all them yet (and for the most part I am sticking with the ASPX engine... although my later comments may lead you otherwise).&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The Not So Good&lt;/strong&gt;    &lt;br /&gt;Before I say this I want you to realize I have written a grand total of 2 apps with this. App1 used the Restful plugin and really shouldn’t count, so I have written exactly 1 app (so definitely take this with a grain of salt).&lt;/p&gt;  &lt;p&gt;Complaint number 1 is that I felt like I was writing old ASP code. I used the inline code method for writing output into my HTML. I probably could have written in the codebehind and had a clean web template with code separation (something I’m a believer in, but it was my first app)... probably more my fault than the engines, but there is a lot of sample code out there already that lead you down this path.&lt;/p&gt;  &lt;p&gt;Complaint number 2 really is valid. The whole idea of MVC is that I should be able to swap out the view engine. Or better yet, be able to respond to a request and supply a view that is more suited for the client. Someone pointed out to me that one of the big features of ASP.NET 1.0 was that it would supposedly do this... I would really love for MVC to make it easy to determine that "this is a mobile browser" supply the mobile template (if one exists). Or better yet, this client is requesting that I send XML... evidently it’s some kind of Rich Client. Specific methods can be triggered to deliver a specific type, it would just be nice if the framework would detect that the client "accepts" (that’s a ServerVariable pushed in the header) only "Application/Json" so the MVC app should use a JSON result or convert the result I got to JSON and push it directly down to the client.&lt;/p&gt;  &lt;p&gt;This would make the MVC part of this more useful to me (remember all the stuff I said up front... and Yes, I know I can do this myself and have... it just would be nice if I could get the controller framework to make it easy for me to configure and then do this for me)&lt;/p&gt;&lt;img src="http://theruntime.com/blogs/jaykimble/aggbug/2650.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jay Kimble</dc:creator>
            <guid>http://theruntime.com/blogs/jaykimble/archive/2008/07/24/ms-mvc-thoughts.aspx</guid>
            <pubDate>Thu, 24 Jul 2008 13:45:05 GMT</pubDate>
            <wfw:comment>http://theruntime.com/blogs/jaykimble/comments/2650.aspx</wfw:comment>
            <comments>http://theruntime.com/blogs/jaykimble/archive/2008/07/24/ms-mvc-thoughts.aspx#feedback</comments>
            <wfw:commentRss>http://theruntime.com/blogs/jaykimble/comments/commentRss/2650.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Tampa User eXperience (TUX) User Group is coming September 10th, 2008&amp;hellip;</title>
            <link>http://theruntime.com/blogs/jaykimble/archive/2008/07/17/tampa-user-experience-tux-user-group-is-coming-september-10th.aspx</link>
            <description>&lt;p&gt;I am proud to announce that I and a couple other guys are starting User Group that revolves around User Experience (or UX) in the MS tools eco-system. The other guys are Shawn Cady, Perry Panagopoulos, and Bill Reiss (MVP) [Bill always gets his MVP props].&lt;/p&gt;
&lt;p&gt;I could give you all their backgrounds, but I’ll make them do it at the first meeting. I’m sure Papa Fish (aka &lt;a href="http://www.devfish.net"&gt;www.devfish.net&lt;/a&gt;) the local MS Dev Evangelist (my Blog Father) Joe Healy will be around (at least for the first meeting).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;TUX' Focus &lt;br /&gt;
&lt;/strong&gt;Our focus will be on the "now" of Ajax and how it integrates with ASP.NET (in all its various forms), and the "future" of Silverlight2, and anything in between (like adding Silverlight2 controls to Ajax sites, etc); we’ll not be stuck in just Web either... we’ll probably do some WPF as well. We’ll also be  dealing with some of those more abstract things that you need to get better at (like how to be a better designer, creating good user experiences, etc.), and we will do our best to keep this group "devsigner-friendly" (devsigner is a developer who is also a designer).&lt;/p&gt;
&lt;p&gt;We have a lot of really creative ideas to make this fun and useful to you today as well as with an eye for the future (but I don’t want to blow them all)... We will definitely keep this interactive and will try to help you solve your problems as well (at least we’ll be around to chat with you before and afterward).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;First Talk: Intro To MS Ajax Scripting&lt;/strong&gt; &lt;br /&gt;
The first person to present will be me. I will be pulling a talk out of my paid pile which means that you have probably never seen me give this talk (unless you work at one of the companies I gave it at)... this is very special and will never be repeated (well, maybe). This talk is one that I have yet to see anyone give (for free). It’s an introduction to the MS Ajax scripting framework. Oftentimes you see a demo where someone shows you how to build an Ajax Extender control where a JavaScript is thrown in, but rarely (I’ve never seen it done) does someone talk to you about building the script behavior which is used to create the Server-Side Extender (I will in fact be doing just this). You will leave this talk with the knowledge of how to do it. As is often the case when I talk about JavaScript, I’ll end with a Script# demo which will make your life a lot easier (so we’ll build the last demo in C# which will be compiled to MS Ajax-style JavaScript); this big demo is a selection grid behavior that I built for my employer to replace a commercial grid component that we were using; you’ll definitely have a use for it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Bonus&lt;/strong&gt; &lt;br /&gt;
We’ll have Pizza provided by Answers Systems, so just get there after work... you don’t need to eat first.&lt;/p&gt;
&lt;p&gt;AND!!!! Bill Reiss (MVP) has graciously given us an &lt;strong&gt;&lt;em&gt;MSDN Premium Subscription&lt;/em&gt;&lt;/strong&gt; (used to be MSDN Universal) to &lt;strong&gt;&lt;em&gt;give away&lt;/em&gt;&lt;/strong&gt;, so don’t miss it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Where/When will it be?&lt;/strong&gt; &lt;br /&gt;
We will be holding these events at my workplace: Answers Systems in Oldsmar, FL. Better directions than this will follow in the near future (we will have a web site soon), but it’s right next to (West of) the Oldsmar Fleamarket on Tampa Rd (aka Hillsborough Ave). We plan to open the doors at 6:30pm with the activities starting at 7:00pm.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Can’t make it, but you really wanted to see my session?&lt;/strong&gt; &lt;br /&gt;
&amp;lt;sarcasm&amp;gt;So you are in my fan club (Eric Wise, I know that’s you since you maintain some of my stellar code), but you live in another state (like say the cold state of Ohio... where it’s 40 degrees Fahrenheit in August) so there is no way you could see this session by me, but you really, really want to see it, but the plane ticket is so expensive.&amp;lt;/sarcasm&amp;gt;&lt;/p&gt;
&lt;p&gt;Well, we plan on videoing our sessions and making them available online (as long as the speaker is OK with it, and I am... SO this is the LAST time I’ll be able to charge for this session... unless I revamp it which I will).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Afterwards...&lt;/strong&gt; &lt;br /&gt;
I’m not Joe Healy so I can’t pick up the tab, but there is a Starbucks down the street that many of my colleagues and I like to frequent (Stimulants... I need a good stimulant not a depressant... but we could be talked into depressants), so don’t be surprised if we all end up somewhere afterwards or maybe somewhere else... &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;RSVP&lt;/strong&gt; &lt;br /&gt;
If you plan on coming please drop me a line via the contact form on this site. We need this to help us figure out how much Pizza to buy. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;PS&lt;/strong&gt; &lt;br /&gt;
In October (the 2nd Wednesday), Bill will be doing a Silverlight2 talk (He’s a Silverlight MVP and a soon-to-be Silverlight book author). It will be more of an intro, but he plans on really giving a nice overview from both the diesgn standpoint and the development standpoint.&lt;/p&gt;
&lt;p&gt;And, yes, we actually have a a list of things we’re thinking about for November... nothing definitive (yet), but we plan on being way ahead of the game (as best as we can).&lt;/p&gt;&lt;img src="http://theruntime.com/blogs/jaykimble/aggbug/2645.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jay Kimble</dc:creator>
            <guid>http://theruntime.com/blogs/jaykimble/archive/2008/07/17/tampa-user-experience-tux-user-group-is-coming-september-10th.aspx</guid>
            <pubDate>Fri, 18 Jul 2008 03:35:18 GMT</pubDate>
            <wfw:comment>http://theruntime.com/blogs/jaykimble/comments/2645.aspx</wfw:comment>
            <comments>http://theruntime.com/blogs/jaykimble/archive/2008/07/17/tampa-user-experience-tux-user-group-is-coming-september-10th.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/jaykimble/comments/commentRss/2645.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Types of Silverlight2 apps</title>
            <link>http://theruntime.com/blogs/jaykimble/archive/2008/07/07/types-of-silverlight2-apps.aspx</link>
            <description>&lt;p&gt;I want to go on record for a prediction. I believe when the dust settles with Silverlight2 (SL2, hereafter), we will have 2 major types of apps. To me this is fairly obvious, but if all you did was look at SL2 tutorials you would get a different view altogether. You see all the tutorials that exist out there show you what I think is the preferred way: a single application that lives in the browser as a plugin.&lt;/p&gt;  &lt;p&gt;I also see another SL2 type of app: the SL2 enhanced Ajax App. Seriously, there will be those who will use some of the fancy SL2 controls (and I’m talking about the third party ones that will be developed) to bring their Ajax apps into a new domain. So from a plumbing perspective they will stick with the familiar page model we have today. I think the draw of Ajax is strong and I would rather this not happen because it is my view that the SL2 framework is way better than classic DHTML/Ajax/Web2.0. There are those who will say, "I can’t leave the rich experience of JS on the client." (phooey... just code in DLR JScript instead if you want JavaScript).&lt;/p&gt;  &lt;p&gt;BTW, I also see a third model. The old model built with a single Sl2 applet on each page. I think this will be a minor idea, but I see it coming.&lt;/p&gt;  &lt;p&gt;-----------&lt;/p&gt;  &lt;p&gt;On another note, I’ll be putting up a few SL2 posts. I have been doing a fair bit of work with it in the last month or so. It definitely involves a slightly different mentality than classic web apps. &lt;/p&gt;  &lt;p&gt;My SL2 prototype actually uses a REST service built with MS MVC and with the MVC Contrib project’s Restful feature. I will write some on this in the not too distant future. I have really grown to like REST (and building a service the way I have is really great for quick prototyping).&lt;/p&gt;  &lt;p&gt;I’m actually starting to chew on Databinding (and doing CRUD operations on the data), so in time I’ll be writing about some of that stuff too.&lt;/p&gt;  &lt;p&gt;--------------&lt;/p&gt;  &lt;p&gt;Additionally, I am also working on starting a .NET UX user group here in Tampa Bay. I’m working with a couple of the local personalities to bring together a really good group. The group would focus on MS Ajax (and other Ajax Frameworks with ASP.NET and MS MVC) and Silverlight2 based apps. I can’t wait. It’s really exciting!&lt;/p&gt;&lt;img src="http://theruntime.com/blogs/jaykimble/aggbug/2641.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jay Kimble</dc:creator>
            <guid>http://theruntime.com/blogs/jaykimble/archive/2008/07/07/types-of-silverlight2-apps.aspx</guid>
            <pubDate>Mon, 07 Jul 2008 21:03:02 GMT</pubDate>
            <wfw:comment>http://theruntime.com/blogs/jaykimble/comments/2641.aspx</wfw:comment>
            <comments>http://theruntime.com/blogs/jaykimble/archive/2008/07/07/types-of-silverlight2-apps.aspx#feedback</comments>
            <wfw:commentRss>http://theruntime.com/blogs/jaykimble/comments/commentRss/2641.aspx</wfw:commentRss>
        </item>
        <item>
            <title>An Answer to my post for young programmers</title>
            <link>http://theruntime.com/blogs/jaykimble/archive/2008/06/24/an-answer-to-my-post-for-young-programmers.aspx</link>
            <description>&lt;p&gt;My good buddy (actually my best friend from High School), "The Witt" complained that I wasn’t being helpful to programmers who are trying to learn the craft when I posted two weekends ago on "&lt;a href="http://theruntime.com/blogs/jaykimble/archive/2008/06/14/a-question-you-should-ask-when-hiring-a-non-entry-level.aspx"&gt;A Question you should ask when hiring a non-entry level developer&lt;/a&gt;." (OK, he wasn’t the only one... but, hey, we have a history, so he can get me to post a response, and you can’t... deal...) &lt;/p&gt;  &lt;p&gt;I decided that our subsequent conversation in email would make a good followup post for those who want to know what they should be doing, and with his blessing I am posting an edited version.&lt;/p&gt;  &lt;p&gt;[It started with this comment]&lt;/p&gt;  &lt;p&gt;&lt;font color="#008000"&gt;The Witt - &lt;em&gt;OK I know that I am new to the ASP codeing info.       &lt;br /&gt;I understand the security issues ( or at least, what might happen with leaving every thing wide open). BUT, Having just completed two semesters of nothing but ASP I just don’t see what wrong... I AM NOT a seasoned programmer...and my classes taught us to connect inthis very manner you discribe...        &lt;br /&gt;can you eleborate for those of us that are trying to learn? show us what you would do instead?        &lt;br /&gt;thanks in advance&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Jay (in Email now)- I know I probably made some harsh statements there (in my blog post). I meant it to be hard, but it was as much about seeing some consultant coming in and writing crappy code against my APIs and leaving HUGE security holes in my website.&lt;/p&gt;  &lt;p&gt;The major point is for ASP.NET that you should always use Command objects with parameters... something like this (code may not compile cause its off the top of my head... there’s probably an error in there somewhere...)&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; query &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; = &lt;span style="color: #006080"&gt;"select field1, field2, field3 from someTable where ID = @TableID"&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; Cmd.CommandText = query&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; Cmd.Parameters.Add(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DbParameter(&lt;span style="color: #006080"&gt;"TableID"&lt;/span&gt;, cbo.Value)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #008000"&gt;' Code continues....&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The trick is in using the "@" variable in the query, and using the Parameters collection. When this gets shoveled down to the database it gets sent differently and if someone tries to change that "cbo.Value" within the http post by trying to add their own SQL it will fail.&lt;/p&gt;

&lt;p&gt;I know that changing the variable in the http post statement sounds advanced... go here --&amp;gt; &lt;a href="http://www.bayden.com/TamperIE/"&gt;http://www.bayden.com/TamperIE/&lt;/a&gt;, download the TamperIE tool (for IE)  and try it out... You’ll see that you can in fact force whatever values you want into the post.&lt;/p&gt;

&lt;p&gt;As far as other dev environments go (I know you deal with a couple others), you want to figure out how to send a prepared statement to whatever SQL Server you are dealing with (ms access has these as well, so does Oracle and everything else I can think of... even the free PostgreSQL has them). &lt;/p&gt;

&lt;p&gt;Anyway, I see you as someone who’s growing as a developer... you’d not go into an interview and present yourself as more than you are... that too is the problem...&lt;/p&gt;

&lt;p&gt;Do you mind if I post this (more or less?) as a new blog post?&lt;/p&gt;

&lt;p&gt;&lt;font color="#008000"&gt;The Witt- I don’t mind in the least…&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#008000"&gt;          Like I said I am trying to learn. The “@” tucked in front… I always thought that was just to get the info from the current page. It’s nice to know what that really does. I do use that for most of my sites. I just never knew all the reasons.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;&lt;font color="#008000"&gt;I think that is the problem with a lot of the schools today. They are just pushing the students out and they really don’t know what they are doing. (Not that I always know what I’m doing). &lt;/font&gt;&lt;/p&gt;

&lt;p&gt;---------------&lt;/p&gt;

&lt;p&gt;Ok. it’s not all that edited. One more thing I forgot to mention. If you use an ORM or something that builds classes for you, then you probably are getting this type of functionality (just about every ORM I know of uses prepared SQL statements to push data). My favorite ORM is SubSonic (and I know others rave about NHibernate)... It the Java world I use Apache Cayenne (and people rave about Hibernate over there)&lt;/p&gt;

&lt;p&gt;---------------&lt;/p&gt;

&lt;p&gt;BTW, I take great pleasure in mentioning that The Witt turns $28 (that’s hex) in a little less than 2 months... unfortunately I turn $28 about 2 weeks before him.&lt;/p&gt;&lt;img src="http://theruntime.com/blogs/jaykimble/aggbug/2429.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jay Kimble</dc:creator>
            <guid>http://theruntime.com/blogs/jaykimble/archive/2008/06/24/an-answer-to-my-post-for-young-programmers.aspx</guid>
            <pubDate>Wed, 25 Jun 2008 01:15:35 GMT</pubDate>
            <wfw:comment>http://theruntime.com/blogs/jaykimble/comments/2429.aspx</wfw:comment>
            <comments>http://theruntime.com/blogs/jaykimble/archive/2008/06/24/an-answer-to-my-post-for-young-programmers.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/jaykimble/comments/commentRss/2429.aspx</wfw:commentRss>
        </item>
        <item>
            <title>To Cache, To Static, or To Session &amp;quot;When?&amp;quot; is the question</title>
            <link>http://theruntime.com/blogs/jaykimble/archive/2008/06/10/to-cache-to-static-or-to-session-quotwhenquot-is-the.aspx</link>
            <description>&lt;p&gt;DonXML has an interesting article over &lt;a href="http://donxml.com/allthingstechie/archive/2008/06/06/Cache-Or-Session-State-_2D00_-Similar-But-Different.aspx"&gt;here&lt;/a&gt; that got me thinking about a technique I have been using for years now, and I’m not sure I’ve seen much written about it.&lt;/p&gt;  &lt;p&gt;The basic tenet begins like this: I avoid session like the plague (not sure why except I have visions of some abuses I have seen... like full DataTable’s stored in session). The only time and I mean the ONLY TIME I use Session is if I have a value that needs to be associated with a user across the WHOLE site. As a result I really try to design my model where there are minimal values that need to be associated with a user site-wide.&lt;/p&gt;  &lt;p&gt;What I have seen is that values come in 3 basic variations as far as Web site variables go: Values associated with a user everywhere, values associated with a user necessary for a few pages, values that really are application level values.&lt;/p&gt;  &lt;p&gt;My suspicion about "&lt;strong&gt;Values associated with a user everywhere&lt;/strong&gt;" is that they are not as prevalent and are often the result of programmers either not fully understanding web apps, they just aren’t thinking things through, or they are pushing a value into session site-wide when they only need it in a couple places. Treat Session like you do ViewState: it is a snake (maybe a poisonous one) that while necessary to kill the rats in your back yard due to the citrus trees, you don’t want a dozen snakes in the backyard either... Only use the number of snakes that you need (if you have no rats then 0 is the perfect number of snakes). So the lesson here is to really look at your user-related values: determine if they really are used everywhere, and determine if they need to be available in memory the whole the user is on the site.&lt;/p&gt;  &lt;p&gt;For &lt;strong&gt;values associated with a user necessary for the a few pages&lt;/strong&gt;, I tend to use cache, or I do use Session (but I clean up immediately after I’m done). When I use Cache I factor in the user’s Session ID. The thing I like about Cache is that I have a much richer set of expiration options. Session sticks while a user is clicking around the site... Cache let’s me absolutely set an expiration time. I also am aware of the fact that Cache can be unloaded early (so I use Cache as a temporary place for a value knowing that I may need to retrieve it again). If it’s something that isn’t stored elsewhere then into Session it goes (even if I have to delete that Session var later). It’s really about managing the data in memory.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;For the application type values&lt;/strong&gt;, I usually forget about the whole Application mechanisms (you might use them, but I do something else), I like to use static/shared values on individual classes. This has the effect of better organizing your code (and if you do any else with the class it simplifies things... I suspect some automated test guys would agree with me on this point). Why mention these here? Well I have seen my share of things that were really application related or indexed application related (such as storing this customer’s company info in session... that really should be either a cache or a static, and it should be retrievable by some company id).&lt;/p&gt;  &lt;p&gt;Don’s post was originally spawned by the new Velocity cache from MS. Honestly the only comment I have on it is that I wish they had chosen a different name. I hear Velocity and I think about the text template engine (the one for Java... but the one for .NET is nvelocity)&lt;/p&gt;&lt;img src="http://theruntime.com/blogs/jaykimble/aggbug/2420.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jay Kimble</dc:creator>
            <guid>http://theruntime.com/blogs/jaykimble/archive/2008/06/10/to-cache-to-static-or-to-session-quotwhenquot-is-the.aspx</guid>
            <pubDate>Tue, 10 Jun 2008 15:15:35 GMT</pubDate>
            <wfw:comment>http://theruntime.com/blogs/jaykimble/comments/2420.aspx</wfw:comment>
            <comments>http://theruntime.com/blogs/jaykimble/archive/2008/06/10/to-cache-to-static-or-to-session-quotwhenquot-is-the.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/jaykimble/comments/commentRss/2420.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Cool ScriptManager stuff I missed...</title>
            <link>http://theruntime.com/blogs/jaykimble/archive/2008/05/29/cool-scriptmanager-stuff-i-missed.aspx</link>
            <description>&lt;p&gt;So the last week or so I have been doing some heavy handed UpdatePanel development (stuff where I needed to fix an existing form that needs help to support an UpdatePanel or stuff where I needed to do something special while the page was posting back asyncronously).&lt;/p&gt;  &lt;p&gt;In the midst I discovered some cool mechanisms that I missed!&lt;/p&gt;  &lt;p&gt;For instance you can determine whether the current request is an async request by doing something like this:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; ScriptManager sm = ScriptManager.GetCurrent(Page); &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (sm != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; sm.IsInAsyncPostBack)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// do something special here&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The other problem I had was that I needed to emit a startup script that should execute after the async request finished rendering. It turns out that the ScriptManager control has some really nifty static methods. Here’s the example of what I was trying to do:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #008000"&gt;//                                  (control, type,   ScriptID,ScriptToRun, AddScriptTags)  &lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; ScriptManager.RegisterStartupScript(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;, GetType(), &lt;span style="color: #006080"&gt;"someID"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"SomeScript"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Investigate it for yourself... there’s a lot of handy stuff here that corresponds to the same stuff you can do with the Page’s ClientScript object (with the difference being that ScriptManager’s stuff works during a Async Postback)&lt;/p&gt;&lt;img src="http://theruntime.com/blogs/jaykimble/aggbug/2415.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jay Kimble</dc:creator>
            <guid>http://theruntime.com/blogs/jaykimble/archive/2008/05/29/cool-scriptmanager-stuff-i-missed.aspx</guid>
            <pubDate>Thu, 29 May 2008 21:20:57 GMT</pubDate>
            <wfw:comment>http://theruntime.com/blogs/jaykimble/comments/2415.aspx</wfw:comment>
            <comments>http://theruntime.com/blogs/jaykimble/archive/2008/05/29/cool-scriptmanager-stuff-i-missed.aspx#feedback</comments>
            <wfw:commentRss>http://theruntime.com/blogs/jaykimble/comments/commentRss/2415.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Script#: Events/Delegates in an Atlas/MS Ajax style script</title>
            <link>http://theruntime.com/blogs/jaykimble/archive/2008/05/22/script-eventsdelegates-in-an-atlasms-ajax-style-script.aspx</link>
            <description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;First of all if you don’t know what &lt;a href="http://codeplex.com/scriptsharp"&gt;Script#&lt;/a&gt; is, it is a C# language variant available in VS2005/2008. The difference is that it can be used to create JavaScript. The compiler produces an assembly (usable in other Script# projects) and a set of JS files (a release and a debug version). Nikhil Kothari (the author) also has 2 script frameworks you can target: Nikhil’s framework, and the "Atlas"/MS Ajax (aka MS ASP.NET Ajax) framework. There are difference in what you can do when using the "Atlas" framework.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Event Limitations&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Let me start with a quote from the Script# Dox (regarding limitations in "Atlas" targeted scripts):&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;"No support for auto-generated event accessors. Auto-generated event accessors require the existence of a Delegate class with Delegate.Combine/Remove semantics, which are not provided      &lt;br /&gt;by ASP.NET AJAX. The workaround is to explicitly implement the 2add/remove accessors for events in your code, rather than have the compiler generate it. "&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Basically this is saying there are issues with building events in your classes with Script#. It’s not impossible, but it’s not automatic like it is in Nikhil’s Script# (client-side) framework.&lt;/p&gt;  &lt;p&gt;Since I recently had to do this and had to search the Internet for a solution (which there is no answer for), I thought it would be good to document how to do it (for both my reference and for others).&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;How To Add/Remove Events&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;That comment about needing to create your own add/remove logic is really simple to handle, but your class needs to derive from Sys.Component (or a class like behavior and control which derive from Sys.Component). The code looks like this (In Script#):&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #008000"&gt;// add a handler to an event&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; add_MyEvent(EventHandler fn)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Events.AddHandler(&lt;span style="color: #006080"&gt;"MyEvent"&lt;/span&gt;, fn);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt; &lt;span style="color: #008000"&gt;// remove a handler from an event&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; remove_MyEvent(EventHandler fn)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Events.AddHandler(&lt;span style="color: #006080"&gt;"MyEvent"&lt;/span&gt;, fn);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The reason we need to derive from Sys.Component is that Sys.Component gives us the Events property. Events is the container for all our events. New ones will be dynamically generated within that container. Let’s see a simple property we can build to easily get the event back when we want to invoke it.&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; EventHandler MyEvent&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     get&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;          &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (EventHandler)&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Events.GetHandler(&lt;span style="color: #006080"&gt;"MyEvent"&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;All of this is well documented. The hard part is. Now I have the event how do I call it with Script#? You might start looking for invoke or apply syntax (which I did. But the answer is quite simple. The EventHandler is a function/method that you can call directly like this:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; EventHandler evnt = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.MyEvent;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; evnt(sender, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; EventArgs());&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;BTW, you can do the same type of thing with delegates... they’re just simp0le functions.&lt;/p&gt;

&lt;p&gt;I hope that helps someone...&lt;/p&gt;

&lt;p&gt;[I really need to write a fuller post on building Behaviors with Script# (in case you don’t realize Behaviors are the foundation of ASP.NET Ajax Extender Controls).]&lt;/p&gt;&lt;img src="http://theruntime.com/blogs/jaykimble/aggbug/2412.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jay Kimble</dc:creator>
            <guid>http://theruntime.com/blogs/jaykimble/archive/2008/05/22/script-eventsdelegates-in-an-atlasms-ajax-style-script.aspx</guid>
            <pubDate>Thu, 22 May 2008 13:30:48 GMT</pubDate>
            <wfw:comment>http://theruntime.com/blogs/jaykimble/comments/2412.aspx</wfw:comment>
            <comments>http://theruntime.com/blogs/jaykimble/archive/2008/05/22/script-eventsdelegates-in-an-atlasms-ajax-style-script.aspx#feedback</comments>
            <wfw:commentRss>http://theruntime.com/blogs/jaykimble/comments/commentRss/2412.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Silverlight2 Programming: The Designer Rule</title>
            <link>http://theruntime.com/blogs/jaykimble/archive/2008/05/13/silverlight2-programming-the-designer-rule.aspx</link>
            <description>&lt;p&gt;I’m starting a new series on Silverlight2. I am currently building a little SL2 prototype, and as I am learning things I thought I would write them down here.&lt;/p&gt;  &lt;p&gt;The first rule deals with working with Designers. It is stated as such.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;"Prefer XAML code to CLR/DLR code when it comes building interfaces"&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Note the word "prefer" here. That word means "usually", "normally", or "unless there is an exception."&lt;/p&gt;  &lt;p&gt;This is best explained by some C# code I saw the other day. It looked something like this:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; ElementX = &lt;span style="color: #006080"&gt;@"&amp;lt;div class='twocolumndiv'&amp;gt;&amp;lt;span class='singlecolumn'&amp;gt;{0}&amp;lt;/span&amp;gt;&amp;lt;span class='singlecolumn'&amp;gt;{1}&amp;lt;/span&amp;gt;"&lt;/span&gt;;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The problem with the above code is that you’ve embedded it into your code. It’s effectively buried. If someone else needs to change this template to say add a field or to make changes in any manner, they are scanning the code looking for this (provided they know where to look); this will be the cause of much swearing and maligning of your name.&lt;/p&gt;

&lt;p&gt;To make matters worse, if you have a web designer you have effectively removed their visibility to this code (maybe this point is made a little sharply; I know some web designers who would be scanning the code as well, but they wouldn’t be happy).&lt;/p&gt;

&lt;p&gt;So how does this relate to SilverLight 2? Simple, you should try to avoid instantiate controls on your Silverlight views (pages??) that a designer has no visibility to (in other words, using a UserControl that has an associated XAML is fine, but instantiating a new UserControl and throwing a new layout and a bunch of text boxes should be done with great care... you should know why you did it that way). &lt;/p&gt;&lt;img src="http://theruntime.com/blogs/jaykimble/aggbug/2407.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jay Kimble</dc:creator>
            <guid>http://theruntime.com/blogs/jaykimble/archive/2008/05/13/silverlight2-programming-the-designer-rule.aspx</guid>
            <pubDate>Tue, 13 May 2008 16:04:43 GMT</pubDate>
            <wfw:comment>http://theruntime.com/blogs/jaykimble/comments/2407.aspx</wfw:comment>
            <comments>http://theruntime.com/blogs/jaykimble/archive/2008/05/13/silverlight2-programming-the-designer-rule.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/jaykimble/comments/commentRss/2407.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Necessary Evil??</title>
            <link>http://theruntime.com/blogs/jaykimble/archive/2008/05/09/necessary-evil.aspx</link>
            <description>I want to write today about the 300lb Gorilla that none of us really wants to talk about. I'm talking about the people we use to find new jobs. As you may be aware I closed down &lt;a href="http://intradynamics.net"&gt;IntraDynamics, LLC&lt;/a&gt; (well, I have greatly curtailed my company's offerings),and got a new job (at &lt;a href="http://www.answers-sys.com"&gt;Answers Systems, Inc.&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
I was "exchanging notes" with my new boss regarding the process and discovered some things (none of this is surprising, but you may want to think about it next time you are pursuing a new job). &lt;br /&gt;
&lt;br /&gt;
I had two recruiters that were aware of my interview process with Answers. One was the company who placed me and the other was a company I trusted (in the past) who appeared to be working hard to place me somewhere else (even asking about where I was in the process with Answers). In fact I was actually told that Answers (who offered me a job in less than a week) was slow in their hiring process. All this makes sense (the other recruiting company was trying to get the fees for me and wanted to do the placement with Answers, so they needed me out of the way). They inappropriately asked Answers about me.&lt;br /&gt;
&lt;br /&gt;
There's that side of things. The other is that it took a long time to get my deal finalized (almost another week). Why? Recruiter placement fees. Now mind you there was a slight change in things with me (I went from "contract to hire" to just "hire"). The company wanted as much as 35% of my yearly salary for placing me (now mind you it wasn't because they did a great job finding me, etc.. they were in the right place at the right time).&lt;br /&gt;
&lt;br /&gt;
To be honest all Answers needed was someone else to pre-screen candidate's technical abilities. All that the placement firm did was monitor Monster.com and send out an email. There were a few additional things they did (like call me everyday regardless of whether there was new info or not).&lt;br /&gt;
&lt;br /&gt;
I don't mean to be trashing on someone (that's why I left the company names out), but I was in shock of the fees they wanted to collect. My boss, Perry, and I started talking about what would be better.&lt;br /&gt;
&lt;br /&gt;
Eric Wise' idea of having a computer programmers trade association seems like a good idea. We would pay dues, but the organization would allow us to take tests and "prove" our abilities (or at least allow it to be easier to pre-screen applicants). Maybe there would also be a mechanism for referring. &lt;br /&gt;
&lt;br /&gt;
I've been thinking about this. We could do it now you know. We could set up a site to create the organization. There would need to be a set of testing sub sites (maybe you would only be allowed to test every 6 months or every year). When the companies we work for are looking for people we could simply look in the organizations site to see who is currently available and match up test thresholds to what we are looking for. We could then refer these folks to our companies avoiding the whole recruiting industry.&lt;br /&gt;
&lt;br /&gt;
Maybe I'm just dreaming...&lt;img src="http://theruntime.com/blogs/jaykimble/aggbug/2405.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jay Kimble</dc:creator>
            <guid>http://theruntime.com/blogs/jaykimble/archive/2008/05/09/necessary-evil.aspx</guid>
            <pubDate>Fri, 09 May 2008 19:30:01 GMT</pubDate>
            <wfw:comment>http://theruntime.com/blogs/jaykimble/comments/2405.aspx</wfw:comment>
            <comments>http://theruntime.com/blogs/jaykimble/archive/2008/05/09/necessary-evil.aspx#feedback</comments>
            <slash:comments>8</slash:comments>
            <wfw:commentRss>http://theruntime.com/blogs/jaykimble/comments/commentRss/2405.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>