how are you
I am using asp.net C# and
I have problem that I have textbox and two buttons(yes,no) in one aspx page and what I want if the user click on yes button the label on another aspx page will write successful and when user click no the same label will write failed
and these are my pages
this is 3.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="3.aspx.cs" Inherits="lubna._3" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
enter id<br />
<asp:TextBox ID="id_no" runat="server"></asp:TextBox>
<br />
<asp:Button ID="Button1" runat="server" Text="yes" OnClick="Button1_Click" />
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="no" />
<br />
<br />
<br />
</div>
</form>
</body>
</html>
and 3.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace lubna
{
public partial class _3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Label label1 = (Label)this.Master.FindControl("Label1");
label1.Visible = true;
label1.Text = "successful";
id_no.Text = "";
}
protected void Button2_Click(object sender, EventArgs e)
{
Label label1 = (Label)this.Master.FindControl("Label1");
label1.Visible = true;
label1.Text = "failed";
id_no.Text = "";
}
}
}
label.aspx
<!DOCTYPE html>
<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" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
and label.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace lubna
{
public partial class label : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
I hope to get an answer thank you so much