Assuming your view.aspx
page has a TextBox control for the class name called txtClassName
, you can add a query string to your edit.aspx
like this:
<asp:LinkButton ID="EditLink" runat="server" Text="Edit" PostBackUrl='<%# "edit.aspx?classname=" + txtClassName.Text %>' />
This creates the url in this format:
edit.aspx?classname=class1
Then, in the Page_Load
event of your edit.aspx
page, you can retrieve the selected class name like this:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string className = Request.QueryString["classname"];
// code to output the class details
// for example, if you want to add the class name to a dropdownlist:
DropDown1.Items.Add(className);
}
}