Exploring the depths and potentials of ASP.NET RSS 2.0 or Subscribe to .BenRush by Email
 Thursday, May 11, 2006

....is more than a name.


kick it on DotNetKicks.com
Thursday, May 11, 2006 11:57:57 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Ranting
 Wednesday, May 10, 2006

This is an interesting exception that you might get when dealing with Ajax; more specifically, when trying to assign an EventName to a trigger. The situation might look something like this in your .aspx code:

                                <atlas:UpdatePanel runat="Server" ID="MainBody">
                                    <Triggers>
                                        <atlas:ControlEventTrigger ControlID="LinkButton1" EventName="OnClick" />
                                    </Triggers>
                                    <ContentTemplate>
                                        <%=System.DateTime.Now().ToString()%>
                                    </ContentTemplate>
                                </atlas:UpdatePanel>

What this block of xml script is telling the Atlas server framework to do is find the server control "LinkButton1" in the control tree and handle it's event "OnClick". It does this by telling the <ScriptManager> to first swallow any submit events for this client control (so that the form doesn't do a full postback) and then send back an asynchronous form post instead (basically intercepting the full postback and turning it into a partial postback). The stack trace for the exception is raised from within the Initialize() method of the Microsoft.Web.Atlas.ControlEventTrigger type:

protected internal override void Initialize(Control ownerControl)
{
   ....
   EventInfo info1 = null;
   string text1 = this.EventName;
   if (text1.Length != 0)
   {
      info1 = control1.GetType().GetEvent(text1);
   }
   if (info1 == null)
   {
      throw new InvalidOperationException("The EventName must be set to a valid event name on the associated control.");
   }
   ...
}

Note that it does a control1.GetType().GetEvent() on the data type of the control you're hooking the event on. So...go back and look at your control. As the exception suggests, you're hooking an event on the control that doesn't exist. The confusing part, however, is that you may think that it's hooking CLIENT events, but it's not...the ScriptManager is snagging the client events that cause a postback on this client control, doing a parital postback for it, and then updating the region of the UpdatePanel based on the response from that partial postback. The UpdatePanel, itself, isn't actually doing the postback (in other words, it's the ScriptManager control doing the partial postback, not the UpdatePanel).

....in the case of the XML Script above, to fix it you simply replace "OnClick" (the clientside eventname) with "Click" (the server side eventname).


kick it on DotNetKicks.com
Wednesday, May 10, 2006 2:46:12 PM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Computing

....then I'd recommend downloading the Windows Live Messenger (basically, the next generation of MSN messenger) from here. I'm currently in the process of the download right now, so I can't give any critical feedback at the moment.


kick it on DotNetKicks.com
Wednesday, May 10, 2006 1:26:10 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Computing

....I created this outline of how runtime types are loaded by the CLR. I just re-discovered this outline and thought I would post it for everyone's bedtime reading enjoyment ;)

 


kick it on DotNetKicks.com
Wednesday, May 10, 2006 1:23:42 AM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Computing

Today I was checking the referrer URLs in my blogs statistics and one of them came out to be this address: http://alternativeviagra.drugsmedic.com/.

After visiting the site, I still am confused as hell as to how THAT referred someone to MY blog.


kick it on DotNetKicks.com
Tuesday, May 09, 2006 11:00:02 PM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Ranting
 Tuesday, May 09, 2006

....come and get em.


kick it on DotNetKicks.com
Tuesday, May 09, 2006 3:26:52 PM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Computing

....I would treat this post by Scott Gutherie as the landing page for any questions you may have regarding Roles, Membership and Profile providers.


kick it on DotNetKicks.com
Tuesday, May 09, 2006 3:24:09 PM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Computing

....point yourself here. Notice the smooth, clean user experience and the lack of browser postbacks when using them - this is what Atlas is all about.


kick it on DotNetKicks.com
Tuesday, May 09, 2006 1:38:47 PM (Central Standard Time, UTC-06:00)  #    Comments [0] - Trackback
Computing

Computers Blogs - Blog Top Sites

Archive
<May 2006>
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2009
Benjamin Rush
Sign In
Statistics
Total Posts: 444
This Year: 0
This Month: 0
This Week: 0
Comments: 128
Themes
Pick a theme:
All Content © 2009, Benjamin Rush
DasBlog theme 'Business' created by Christoph De Baene (delarou)