My Linux Stuff - Complete Blog For Linux Articles

My Linux Stuff - Complete Blog For Linux Articles

A Website For Complete Linux OS,Step by Step linux Installtion, Linux Tips and Tricks and Linux Stuff and so on... Connect and sharing here....

TOP 50 ENGINEERING COLLEGES IN INDIA 2014

TOP 50 ENGINEERING COLLEGES IN INDIA 2014

This below survey was taken many form many colleges in India. These Top 50 Engineering Colleges in India have Good Infrastructure, Good Environment, Educations , Staff, Placement , Research Activities and other Facilities are good.

Top 10 Government Engineering Colleges in India

Top 10 Government Engineering Colleges in India

These Government Engineering Colleges in India are really good for all kind of stuff like Education , research , Placement and New Innovation Ideas etc... But Getting seat in these colleges are heavy competition in students .....

Top 10 Colleges In India 2014

Top 10 Colleges In India 2014

Indian Institute Of Technology Delhi,Indian Institute Of Technology Bombay,Indian Institute Of Technology Kanpur,Indian Institute Of Technology Madras,Indian Institute Of Technology Kharagpur,Indian Institute Of Technology Roorkee,University Of Delhi,Indian Institute Of Technology Guwahati,University Of Calcutta,University Of Mumbai, National Institute Of Technology,Trichy.

2014 LATEST SURVEY TOP RANKING ENGINEERING COLLEGES IN INDIA

2014 LATEST SURVEY TOP RANKING ENGINEERING COLLEGES IN INDIA

This below survey was taken many form many colleges in India. These Top 100 Engineering Colleges in India have Good Infrastructure, Good Environment, Educations , Staff, Placement , Research Activities and other Facilities are good. If you want to do Engineering as your dream and try out these colleges

Subscribe Now!

Enter your email address:

Wednesday, June 1, 2011

Asp.net Cross-Page PostBack example & Post Back

 Post Back means sending the data to server and return the data in same page.

 Cross-Page Post Back means sending the data from one page to another page.

Example:
 CrossPagePostBack.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">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>asp.net cross page postback example</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Red">asp.net Cross-Page PostBack example</h2>
        <asp:Label
            ID="Label1"
            runat="server"
            Text="ProductID"
            ForeColor="DodgerBlue"
            >
        </asp:Label>
        <asp:TextBox
            ID="TextBox1"
            runat="server"
            ForeColor="AliceBlue"
            BackColor="DodgerBlue"
            >
        </asp:TextBox>
        <br />       
        <asp:Label
            ID="Label2"
            runat="server"
            Text="Product Name"
            ForeColor="DodgerBlue"
            >
        </asp:Label>
        <asp:TextBox
            ID="TextBox2"
            runat="server"
            ForeColor="AliceBlue"
            BackColor="DodgerBlue"
            >
        </asp:TextBox>
        <br />
        <asp:Button
            ID="Button1"
            runat="server"
            Text="Submit data"
            Font-Bold="true"
            ForeColor="DodgerBlue"
            PostBackUrl="~/NextPage.aspx"
            />
    </div>
    </form>
</body>
</html>

NextPage.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, System.EventArgs e) {
        TextBox pvProductID = (TextBox)PreviousPage.FindControl("TextBox1");
        TextBox pvProductName = (TextBox)PreviousPage.FindControl("TextBox2");
        Label1.Text ="You came from: "+ PreviousPage.Title.ToString();
        Label2.Text = "Product ID: " + pvProductID.Text.ToString();
        Label2.Text += "<br />Product Name: " + pvProductName.Text.ToString();

        string imageSource = "~/Images/" + pvProductID.Text + ".jpg";
        Image1.ImageUrl = imageSource;
        Image1.BorderWidth = 2;
        Image1.BorderColor = System.Drawing.Color.DodgerBlue;
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>asp.net Cross-Page PostBack example: how to submit a page to another page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Teal">asp.net cross page postback example</h2>
        <asp:Label ID="Label1" runat="server" ForeColor="Crimson">
        </asp:Label>
        <br />
        <asp:Label ID="Label2" runat="server" ForeColor="SeaGreen">
        </asp:Label>
        <br />
        <asp:Image ID="Image1" runat="server" />
    </div>
    </form>
</body>
</html>
 

 OUTPUT:
[CrossPagePostBack1.gif] 

[CrossPagePostBack2.gif]
 

Wallpaper

Related Posts Plugin for WordPress, Blogger...