DEV Community

0 seconds of 4 minutes, 56 secondsVolume 90%
Press shift question mark to access a list of keyboard shortcuts
00:00
00:00
04:56
 
vblover programmer
vblover programmer

Posted on

2

Asp.Net: Send Information To another page (Using Post Method of Form)...

First Page (body):

<form id="form1" runat="server" method="post" action="Register.aspx" >
        <asp:Panel runat="server" Width="450">
        <asp:Table ID="Table1" runat="server" HorizontalAlign="Center">
        <asp:TableHeaderRow >
        <asp:TableHeaderCell HorizontalAlign="Left" ColumnSpan="2">Your Information:</asp:TableHeaderCell>
        </asp:TableHeaderRow>
        <asp:TableHeaderRow>
        <asp:TableCell Width="70px" HorizontalAlign="Right"></asp:TableCell>
         <asp:TableCell Width="300px" HorizontalAlign="Right"></asp:TableCell>
        </asp:TableHeaderRow>
        <asp:TableRow>
        <asp:TableCell>
        <asp:Label runat="server">Name:</asp:Label>
        </asp:TableCell>
        <asp:TableCell>
         <asp:TextBox ID="FullName" runat="server"  ></asp:TextBox>
        </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
        <asp:TableCell>
        <asp:Label ID="Label1" runat="server">Email:</asp:Label>
        </asp:TableCell>
        <asp:TableCell>
        <asp:TextBox ID="Email" runat="server" ></asp:TextBox>
         </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
        <asp:TableCell>
        <asp:Label ID="Label2" runat="server">Site:</asp:Label>
        </asp:TableCell>
        <asp:TableCell>
        <asp:TextBox ID="WebSite" runat="server" ></asp:TextBox>
        </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
        <asp:TableCell>
        <asp:Label ID="Label3" runat="server">Phone:</asp:Label>
        </asp:TableCell>
        <asp:TableCell>
        <asp:TextBox ID="PhoneNumber" runat="server" ></asp:TextBox>
        </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
        <asp:TableCell>
        </asp:TableCell>
    <asp:TableCell HorizontalAlign="left">
       <asp:Button ID="SendData" runat="server" Text="Send Data" UseSubmitBehavior="true" />
    </asp:TableCell>
        </asp:TableRow>
        </asp:Table>
     </asp:Panel>
    </form>

Enter fullscreen mode Exit fullscreen mode

Target(Action) Page (body):

<asp:Panel ID="Panel1" runat="server">
   <asp:Table ID="Table2" runat="server" Width="500px">
    <asp:TableRow>
    <asp:TableCell>
       <asp:Table ID="Table1" runat="server" HorizontalAlign="Center">
        <asp:TableHeaderRow >
        <asp:TableHeaderCell HorizontalAlign="Left" ColumnSpan="2">Your Information is:</asp:TableHeaderCell>
        </asp:TableHeaderRow>
        <asp:TableHeaderRow>
        <asp:TableCell Width="70px" HorizontalAlign="Right"></asp:TableCell>
         <asp:TableCell Width="300px" HorizontalAlign="Right"></asp:TableCell>
        </asp:TableHeaderRow>
        <asp:TableRow>
        <asp:TableCell>
        <asp:Label ID="Label1" runat="server">Name:</asp:Label>
        </asp:TableCell>
        <asp:TableCell>
         <asp:Label ID="FullName" runat="server"><% = Request.Form.Get("FullName")%></asp:Label>
        </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
        <asp:TableCell>
        <asp:Label ID="Label2" runat="server">Email:</asp:Label>
        </asp:TableCell>
        <asp:TableCell>
        <asp:Label ID="Email" runat="server" ><% = Request.Form.Get("Email")%></asp:Label>
         </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
        <asp:TableCell>
        <asp:Label ID="Label3" runat="server">Site:</asp:Label>
        </asp:TableCell>
        <asp:TableCell>
        <asp:Label ID="WebSite" runat="server" ><% = Request.Form.Get("WebSite")%></asp:Label>
        </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
        <asp:TableCell>
        <asp:Label ID="Label4" runat="server">Phone:</asp:Label>
        </asp:TableCell>
        <asp:TableCell>
        <asp:Label ID="PhoneNumber" runat="server" ><% = Request.Form.Get("PhoneNumber") %></asp:Label>
        </asp:TableCell>
        </asp:TableRow>
        </asp:Table>
    </asp:TableCell>
    </asp:TableRow>
      </asp:Table>
</asp:Panel>
Enter fullscreen mode Exit fullscreen mode

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

๐Ÿ‘‹ Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay