student Box Office

Learn more from here.

student Box Office

We will prepare the best articles for you to acquire knowledge.

student Box Office

We will help you always. Just follow our guidelines.

student Box Office

Come and join here to share the knowledge in latest Technologies.

student Box Office

Share your views with us. And update your knowledge.

Showing posts with label FAQ in Web Forms. Show all posts
Showing posts with label FAQ in Web Forms. Show all posts

Nov 10, 2011

How to use Server.Transfer


page1.aspx,
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    protected void Button_Click(object sender, EventArgs e)
    {
        Server.Transfer("page2.aspx", true);

    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button_Click" />
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    </div>
    </form>
</body>
</html>

page2.aspx,
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write(Request.Form["TextBox1"]);
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
</head>
<body>
    <form id="form1" runat="server">
    <div>
        
    </div>
    </form>
</body>
</html>

Related posts:

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More