Search
January 07, 2009   |  Login  |  
 Archive of Entries Minimize

 Print   
 DayOfDotNet Code Minimize
Location: BlogsThe Woolston Blog    
Posted by: daniel 10/24/2007 4:59 AM

The source code for the DayofDotNet - Ann Arbor presentation is here.

I've received a few emails asking about the client side event code, so if thats what you're really after, I will save you the process of digging through the zip file:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Page_4_ClientEvents.aspx.cs" Inherits="Page_3_NestedPanels" %>
<%@ Page Language="C#" AutoEventWireup="true" 
   CodeFile="Page_4_ClientEvents.aspx.cs"
   Inherits="Page_3_NestedPanels" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Client Side Events</title> <style type="text/css"> body { text-align:center; min-width:780px; background-color:white; color:white; } .divContainer { margin:0 auto; text-align:left; width:780px; height:580px; background-image:url(images/voteforVaderBackground.jpg); background-repeat:no-repeat; padding-top:20px; padding-left:7px; } .left { float:left; width:200px; text-align:left; padding-left:10px; } .right { float:right; width:300px; text-align:left; padding-right:15px; } .top { padding-top:80px; } .content { float:right; text-align:left; padding-top:10px; padding-right:5px; border-color:White; border-width:thin; border-style:dotted; width:200px; } </style> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <script type="text/javascript" language="javascript"> var manager = Sys.WebForms.PageRequestManager.getInstance(); manager.add_beginRequest(updateStarted); manager.add_endRequest(updateEnded) manager.add_initializeRequest(CheckForCurrent); function CheckForCurrent(sender, arg) { var manager = Sys.WebForms.PageRequestManager.getInstance(); if(manager.get_isInAsyncPostBack()) { arg.set_cancel(true); ShowCancelled('visible'); setTimeout("ShowCancelled('hidden')", 1000); } } function ShowCancelled(showString) { var warningDiv = document.getElementById('warningDiv'); warningDiv.style.visibility = showString; } function updateStarted() { var img = document.getElementById("imgDeathstar"); img.src = "images/reddeathstar.jpg"; } function updateEnded() { var img = document.getElementById("imgDeathstar"); img.src = "images/bluedeathstar.jpg"; } </script> <div class="divContainer"> <div class="left" ><img src="images/deathstar.jpg" id="imgDeathstar" /></div> <div class="right" style="padding-top:80px;padding-right:45px;"> <div class="content"> <asp:UpdatePanel ID="updVote" runat="server"> <ContentTemplate> <center
>
                        <
asp:Label ID="lblVote" runat="server"
                           Text="Vote for your favorite video:"
/>
                    </
center> <table> <tr><td valign="middle"
>
                           <
asp:RadioButton ID="rb1" GroupName="vader" runat="server"
/>
                        </
td><td><a href="http://www.youtube.com/watch?v=5blbv4WFriM" target="_blank"
>
                           <
asp:Image ImageUrl="~/images/sarcasticVader.jpg" ID="img1"
                              runat="server" style="border:0px;" /></a><br
/>
                              
Sarcastic Vader</td></tr> <tr><td valign="middle"
>
                           <
asp:RadioButton ID="rb2" GroupName="vader" runat="server"
/>
                        </
td><td
>
                           <
a href=http://www.youtube.com/watch?v=4wGR4-SeuJ0&mode=related&search=
                              target="_blank"
>
                           <
asp:Image ImageUrl="~/images/chadVader.jpg" ID="img2"
                              style="border:0px;" runat="server"
/>
                           </
a><br
/>
                           
Chad Vader</td></tr> <tr><td valign="middle"
>
                           <
asp:RadioButton ID="rb3" GroupName="vader" runat="server"
/>
                        </
td><td
>
                            <
a href=http://www.youtube.com/watch?v=3eZBevXohCI
                              target="_blank"
>
                           <
asp:Image ImageUrl="~/images/vaderBlues.jpg" ID="img3"
                              style="border:0px;" runat="server" /></a><br
/>
                           
Vader Blues</td></tr> </table> <center
>
                     <
asp:Button ID="btnVote" runat="server"
                        Text="Vote!" OnClick="btnVote_Click"
/>
                    </
center> <div id="warningDiv"
                        style="background-color:Red;visibility:hidden;"
>
                     
Still processing previous vote...</div> </ContentTemplate> </asp:UpdatePanel> </div> </div> </div> </form> </body> </html>
         
Permalink |  Trackback

Your name:
Title:
Comment:
Add Comment   Cancel 

  
 Search_Blog Minimize

 Print   
You are here: - Blogs
Copyright 2005 Dan Woolston
www.danwoolston.com
Terms Of Use
Privacy Statement