am creating a web page that allows users to enter their product name and purchase date.if they do? i check these inputs against what i have in the database and if theres a match, i display the next page and parsing the entered values into another textbox in the next page.
am using response.redirect("nextpagename.aspx") to display the next page after the button is clicked and the above is corect. how do i send the values from the text box to the other page to be displayed in the textboxes?
i tried a get items form the first page and in the page load on the next page i declarwe a new instance of the form and pass the getitems from the previous page to the textbxes i want them to be displayed in the next form. however the fields display notheing and yet the code dosent catch anyerrors.
my guess is am passing an empty string..am i right? if i am howdo i fix this..
more details in the code below...
protected void Button1_Click(object sender, EventArgs e)
{
string strConn;
strConn = "Provider=MIcrosoft.Jet.OLEDB.4.0;data Source=" +
Server.MapPath("App_Data/test.mdb");
OleDbConnection mDB = new OleDbConnection(strConn);
mDB.Open();
prodSnStr = pSnTextBox.Text;
purDate = Convert.ToDateTime(purDateTextBox.Text);
productClass aProduct = new productClass();
if (aProduct.Prods(mDB, prodSnStr, purDate))
{
//Session["userId"] = Login1.UserName.ToString();
Response.Redirect("Warranty.aspx");
}
else
{
//e.Authenticated = false;
}
}
public string getProd()
{
return prodSnStr;
}
public DateTime getDate()
{
return purDate;
}
In the next page that loads i have this code there
public partial class Warranty : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Warranty1 war1 = new Warranty1();
pSNoTextBox.Text = war1.getProd();
dateTextBox.Text = war1.getDate().ToString();
}