pass the right form input to the right control

Discussion in 'ASP .Net' started by Tom, Dec 11, 2003.

  1. Tom

    Tom Guest

    Hi,

    I have this question below but still cannot fix it.

    http://communities.microsoft.com/newsgroups/previewFrame.as
    p?
    ICP=msdn&sLCID=us&sgroupURL=microsoft.public.dotnet.framewo
    rk.aspnet&sMessageID=%253C01e601c3bef5%25240e272fe0%
    %253E


    Here are my code:

    A register.aspx includes 2 user controls.

    register.aspx

    <%@ Page language="c#" Codebehind="register.aspx.cs"
    AutoEventWireup="false" Inherits="web.register" %>
    <%@ Register TagPrefix="web" TagName="top" Src="_top.ascx"
    %>
    <%@ Register TagPrefix="web" TagName="left"
    Src="_left.ascx" %>
    <%@ Register TagPrefix="web" TagName="bottom"
    Src="_bottom.ascx" %>
    <%@ Register TagPrefix="web" TagName="register"
    Src="_register.ascx" %>

    <form runat="server" method="post" ID="Form13">
    <web:top ID="top1" runat="server" />
    <table align="center" width="780" border="0"
    cellspacing="0" cellpadding="0">
    <tr valign="top">
    <td width="140">
    <web:left ID="left1" runat="server" />
    </td>
    <td width="640">
    <web:register ID="register1" runat="server" />
    </td>
    </tr>
    <web:bottom ID="bottom1" runat="server" />
    </form>

    You can see that I put the form tag on a single aspx page
    which includes several user controls and each of them has
    a form to submit.

    _left.ascx

    <table width="100%" border="1" bordercolor="#9999e7"
    cellspacing="0" cellpadding="2">
    <tr bgcolor="#9999e7" align="middle">
    <td>user register</td>
    </tr>
    <tr>
    <td>
    <table width="100%" border="0" cellspacing="0"
    cellpadding="0">
    <tbody>
    <tr>
    <td width="5">&nbsp;</td>
    <td nowrap>user name:</td>
    <td>

    <asp:TextBox id="username" runat="server"
    CssClass="form" Width="70px"></asp:TextBox>

    <asp:RequiredFieldValidator id="RequiredUserName"
    runat="server" ErrorMessage="pls enter user name!"
    Display="None" EnableViewState="False"
    ControlToValidate="username"></asp:RequiredFieldValidator>
    </td>
    </tr>
    <tr>
    <td width="5">&nbsp;</td>

    <td>Password:</td>
    <td>

    <asp:TextBox id="PassWord" runat="server"
    Width="70px" CssClass="form"
    TextMode="Password"></asp:TextBox>

    <asp:RequiredFieldValidator id="RequiredPassword"
    runat="server" ErrorMessage="Pls enter password!"
    Display="None" EnableViewState="False"
    ControlToValidate="PassWord"></asp:RequiredFieldValidator>
    </td>
    </tr>
    <tr>
    <td width="5">&nbsp;</td>

    <td><asp:button id="ibtnLogin" runat="server"
    text="Submit"></asp:button>&nbsp;</td>
    <td><a href="lostpassword.aspx" target="_blank">Lost
    password</a></td>
    </tr>
    <tr>
    <td width="5">&nbsp;</td>
    <td colspan="2"><asp:ValidationSummary
    id="ValidationSummary"
    runat="server" ShowSummary="False" ShowMessageBox="True"
    EnableViewState="False"></asp:ValidationSummary>

    <asp:Label id="labErrorMSG" runat="server"
    CssClass="node"></asp:Label>
    </td>
    </tr>
    </tbody>
    </table>
    </td>
    </tr>
    </table>


    _register.ascx

    It also has a register form.

    Here is the _register.ascx.cs

    private void Page_Load(object sender, System.EventArgs e)
    {
    // Put user code to initialize the
    page here
    if(!IsPostBack)
    {
    this.Bind_New();
    }
    }

    Here is the _left.ascx.cs

    private void Page_Load(object sender, System.EventArgs e)
    {
    // Put user code to initialize the
    page here
    }

    I am not sure how to write code for these 2 Page_Load and
    PostBack.

    Thanks for any kind help
     
    Tom, Dec 11, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tricky
    Replies:
    0
    Views:
    580
    Tricky
    Mar 19, 2009
  2. Tricky
    Replies:
    0
    Views:
    1,008
    Tricky
    Mar 19, 2009
  3. Reuven
    Replies:
    0
    Views:
    597
    Reuven
    Mar 19, 2009
  4. Walter
    Replies:
    6
    Views:
    242
    Bob Barrows [MVP]
    Sep 17, 2004
  5. Leon
    Replies:
    3
    Views:
    176
    TaeHo Yoo
    Nov 26, 2004
Loading...

Share This Page