Основы ASP.NET 2.0



         

Отправка данных другой странице - часть 2


<%@ 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) { if (PreviousPage != null) { TextBox pp_Textbox1; Calendar pp_Calendar1; pp_Textbox1 = (TextBox)PreviousPage.FindControl("Textbox1"); pp_Calendar1 = (Calendar)PreviousPage.FindControl("Calendar1"); Label1.Text = "Здравствуйте, " + pp_Textbox1.Text + "!<br />" + "Вы выбрали: " + pp_Calendar1.SelectedDate.ToShortDateString(); } } </script>

<html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Вторая страница</title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label1" Runat="server"></asp:Label> </div> </form> </body> </html>




Содержание  Назад  Вперед