Click here to Skip to main content
15,885,546 members
Articles / Web Development / HTML

ASP.NET AJAX: State or no State?

Rate me:
Please Sign up or sign in to vote.
4.47/5 (13 votes)
2 Jan 200710 min read 75.8K   386   56  
An article covering the two different design paths we can take when using the ASP.NET AJAX framework
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ConditionalUpdateProperty.aspx.cs" Inherits="State_ConditionalUpdateProperty" %>

<!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>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    <asp:ScriptManager 
        ID="sm" 
        runat="server" />
    
    <asp:UpdatePanel ID="up" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:DropDownList 
                ID="ddlPeople" 
                DataSourceID="odsPeople" 
                DataTextField="FirstName" 
                AppendDataBoundItems="true" 
                OnSelectedIndexChanged="ddlPeople_SelectedIndexChanged" 
                runat="server">
                <asp:ListItem 
                    Enabled="true" 
                    Text="--Please Choose--" />
            </asp:DropDownList>
            
            <asp:Label 
                ID="lblPerson" 
                runat="server" />
        </ContentTemplate>
        <Triggers>
            
            <asp:PostBackTrigger ControlID="ddlPeople" />
        </Triggers>
    </asp:UpdatePanel>
    
    
    <asp:ObjectDataSource 
        ID="odsPeople" 
        runat="server" 
        SelectMethod="GetPeople"
        TypeName="PeopleTableAdapters.PeopleTableAdapter" />
    </div>
    </form>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer
Europe Europe
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions