Follow me on Twitter at Twitter.com/wbm
FYI, I'm blogging most of my stuff over at More Wally now.
You might want to add my rss feed to your reader at:http://morewally.com/cs/blogs/wallym/rss.aspx
ASP.NET Podcast Show #52 - Its our Birthday and Wally talks about the Atlas Update Panel - Wallace B. McClure

Wallace B. McClure

All About Wally McClure - The musings of Wallym on Web, HTML5, Mobile, MonoTouch for iPhone, MonoDroid for Android, and Windows Azure.

News

Personal Blog

Work Blog

.NET

Book Authors

Business

Family

Friends

Georgia Tech Bloggers

Personal

Archives

ASP.NET Podcast Show #52 - Its our Birthday and Wally talks about the Atlas Update Panel

http://aspnetpodcast.com/CS11/blogs/asp.net_podcast/archive/2006/05/19/316.aspx

Subscribe – Really the only way to do things.  Use Juice, iTunes, or something, but just SUBSCRIBE!

Download – Snore and boring (you really should subscribe)

Show notes:

  • Its our first birthday.
  • Craig Shoemaker.
  • Simone Chiaretta.
  • Wally and Paul chew the fat.
  • Atlas Update Panel.

ASPX Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PartialUpdates.aspx.cs" Inherits="PartialUpdates_PartialUpdates" %>

<!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>Update Panel Page</title>

</head>

<body>

    <form id="form1" runat="server">

        <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />

        <div>

        </div>

    <div>

<table>

    <tr>

        <td><asp:Label runat="server" ID="lblEmployee">Employee:</asp:Label></td>

        <td><asp:DropDownList runat="server" ID="ddlEmployee"></asp:DropDownList></td>

    </tr>

    <tr>

        <td colspan="2">

            <asp:Button runat="server" ID="btnSearch" Text="Search" OnClick="btnSearch_Click" />

        </td>

    </tr>

</table>   

    </div>

    <atlas:UpdatePanel runat="server" ID="upSearch" Mode="Conditional">

        <ContentTemplate>

            <asp:GridView ID="gvSearchResults" runat="server" AutoGenerateColumns="False">

                <Columns>

                    <asp:BoundField AccessibleHeaderText="Last Name" DataField="LastName" HeaderText="Last Name" />

                    <asp:BoundField AccessibleHeaderText="First Name" DataField="FirstName" HeaderText="First Name" />

                    <asp:BoundField AccessibleHeaderText="Project Name" DataField="ProjectName" HeaderText="Project Name" />

                    <asp:BoundField AccessibleHeaderText="Date Work Performed" DataField="DateWorkPerformed"

                        DataFormatString="{0:MM-dd-yyyy}" HeaderText="Date Work Performed" HtmlEncode="false" />

                </Columns>

            </asp:GridView>

        </ContentTemplate>

        <Triggers>

            <atlas:ControlEventTrigger ControlID="btnSearch" EventName="Click" />

        </Triggers>

    </atlas:UpdatePanel>

    </form>

</body>

</html>

 

Code Behind Code:
using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using System.Data.SqlClient;

using System.Xml;

 

public partial class PartialUpdates_PartialUpdates : System.Web.UI.Page

{

 

    protected void Page_Load(object sender, EventArgs e)

    {

        ListItem liItem;

        if (Page.IsPostBack == false)

        {

            DataTable dtData = cCommon.GetEmployees();

            this.ddlEmployee.Items.Add(String.Empty);

            foreach (DataRow drData in dtData.Rows)

            {

                liItem = new ListItem(Convert.ToString(drData["LastName"]) + ", " +

                    Convert.ToString(drData["FirstName"]), Convert.ToString(drData["tblEmployeeId"]));

                this.ddlEmployee.Items.Add(liItem);

            }

        }

    }

    protected void btnSearch_Click(object sender, EventArgs e)

    {

        string EmployeeId = this.ddlEmployee.SelectedItem.Value;

        try

        {

            if (EmployeeId != String.Empty)

            {

                DataTable dtData = cCommon.GetData(Convert.ToInt32(EmployeeId));

                this.gvSearchResults.DataSource = dtData;

                this.gvSearchResults.DataBind();

            }

        }

        finally

        {

        }

    }

}

Posted: May 19 2006, 01:09 PM by Wallym | with 3 comment(s)
Filed under: ,

Comments

Simone Chiaretta said:

I think there are some problem with this page :-)
# May 20, 2006 8:24 AM

Granville Barnett said:

I think I've been listening to the podcast now for about 6 months, and I must say Paul and yourself have done a great job, I've not found anything as good as the podcast in any media format regarding asp.net.

As for improvements I can't really say anything, personally the thing I like most about the show is that its proactive in that it covers technologies that are not out yet (so to speak) but will be in the near future and thats invaluable.

Keep up the good work and congratulations!!

Granville.
# May 20, 2006 8:46 AM

FoxyBlog said:

# May 25, 2006 4:17 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)