Click here to Skip to main content
15,885,278 members
Articles / Programming Languages / C#

WebParticles: Developing and Using Web User Controls as WebParts in Microsoft Office SharePoint Server 2007

Rate me:
Please Sign up or sign in to vote.
4.90/5 (61 votes)
27 Mar 200714 min read 509.7K   1.1K   165  
Using Web User Controls in SharePoint WebParts
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebParticleControl.ascx.cs" Inherits="SmartParticles.WebParticleControl" %>
<table cellpadding="2" cellspacing="2" border="0" width="100%">
    <tr>
        <td valign="top" width="50%" align="right">
            <asp:Label ID="lblFirstName" runat="server" Text="First Name:"></asp:Label></td>
        <td valign="top" width="50%">
            <asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox></td>
    </tr>
    <tr>
        <td align="right" valign="top" width="50%">
            <asp:Label ID="lblLastName" runat="server" Text="Last Name:"></asp:Label></td>
        <td valign="top" width="50%">
            <asp:TextBox ID="txtLastName" runat="server"></asp:TextBox></td>
    </tr>
    <tr>
        <td align="right" valign="top" width="50%">
            <asp:Label ID="lblCity" runat="server" Text="City:"></asp:Label></td>
        <td valign="top" width="50%">
            <asp:TextBox ID="txtCity" runat="server"></asp:TextBox></td>
    </tr>
    <tr>
        <td align="right" valign="top" width="50%">
            <asp:Label ID="lblState" runat="server" Text="State:"></asp:Label></td>
        <td valign="top" width="50%">
            <asp:DropDownList ID="ddlState" runat="server">
                <asp:ListItem Selected="True">Select...</asp:ListItem>
                <asp:ListItem>Georgia</asp:ListItem>
                <asp:ListItem>North Carolina</asp:ListItem>
            </asp:DropDownList></td>
    </tr>
    <tr>
        <td colspan="2" valign="top">
            <asp:Label ID="lblResults" runat="server"></asp:Label>
            <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label></td>
    </tr>
    <tr>
        <td align="right" valign="top" width="50%">
            <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" /></td>
        <td valign="top" width="50%">
            <asp:Button ID="btnReset" runat="server" Text="Reset" OnClick="btnReset_Click" /></td>
    </tr>
</table>

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
Architect Dell
United States United States
I am a Big Data Architect working with MPP Database Systems and Hadoop.

Comments and Discussions