defaut.aspx page coding
</head>
<body>
<form id="form1" runat="server">
<div>
welcome:
<asp:Label ID="Label1" runat="server" Font-Bold="True" Text="Label"></asp:Label><br />
You visted on:
<asp:Label ID="Label2" runat="server" Font-Bold="True" Text="Label"></asp:Label></div>
<br />
<hr width="40%" align="left" />
<br />
<br />
Enter your name:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Save" />
</form>
</body>
</html>
defaut.aspx.cs coding
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string hh;
hh = Request.QueryString["name"].ToString();
Profile.Name = hh;
Profile.Save();
Label1.Text = hh;
protected void Page_UnLoad(object sender, EventArgs e)
{
Profile.VisitedOn = DateTime.Now;
Profile.Save();
}
gg.aspx
page coding from which i will send a name to default page through
query string
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
</div>
</form>
</body>
</html>
gg.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("default.aspx?name=" + TextBox1.Text);
}
}
now question is that values changed of label in default.aspx page when i go from gg.aspx page to defaut.aspx page but when i open directly default.aspx page
values of label text retained.
i want that when i enter through default.aspx page values shoud be changed.
plzz anybody