Hy all,
I am sure its very simple thing and I am not just getting it, I am trying to send textbox value from one page to another and its keep giving me an error, basicaly its not finding the class I created in previous page. My web pages are inherited from Master pages so that might be a problem. My code on First page is as follows
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Members_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
int chid;
chid = Convert.ToInt32(DetailsView1.Rows[0].Cells[1].Text);
TextBox1.Text = chid.ToString();
}
public string meetingID
{
get
{
return Convert.ToString(TextBox1.Text);
}
}
My Code on Target page is as follows.
Html code
<%@ Page Title="" Language="C#" MasterPageFile="~/Members/MasterPage.master" AutoEventWireup="true" CodeFile="invitemem.aspx.cs" Inherits="Members_Default" %>
<%@ PreviousPageType VirtualPath="~/Members/Members.aspx"%>
c# Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Members_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Pre_meetingid.Text = PreviousPage.meetingID; //Here I am getting Error on meetingID as ASP.net doesnt contain definition of meetingID
//if (PreviousPage != null)
// {
// ContentPlaceHolder cp = Page.PreviousPage.Form.FindControl("ContentPlaceHolder1") as ContentPlaceHolder;
// if (cp != null)
// {
// TextBox tb = cp.FindControl("TextBox1") as TextBox;
// if (tb != null)
// {
// Pre_meetingid.Text = tb.Text;
// }
//}
// }
}
}
I have also tried second way which is being commented and the returns no value.
Any Idea where I am going wrong or do we need any other assembly apart from Html code one?
Thanks in advance.
Gibz