Registration page and preview page values retaining

Posted by Shalini4duck under ASP.NET on 9/10/2009 | Views : 1756 | Status : [Member] | Replies : 1
I have two pages


i have the following code for "Registration page"

public partial class _Default : System.Web.UI.Page
{
string[] strdetails;
protected void Page_Load(object sender, EventArgs e)
{
strdetails = new string[]
{
drplstTitle.SelectedItem.Text,
txtFirstName.Text,
txtMiddleName.Text,
txtLastName.Text,
txtCompany.Text,
txtOfficePhone.Text,
txtHomePhone.Text,
txtMobile.Text,
txtFax.Text,
txtOfficialEmail.Text,
txtPersonalEmail.Text,
txtJobTitle.Text,
txtWebSite.Text,
txtOAStreet.Text,
txtOACity.Text,
txtOAState.Text,
txtOACountry.Text,
txtOAZipCode.Text,
txtPAStreet.Text,
txtPACity.Text,
txtPAState.Text,
txtPACountry.Text,
txtPAZipCode.Text

};

Session["AddContact"]=strdetails;

}

protected void btnSave_Click(object sender, EventArgs e)
{

Response.Redirect("PreviewPage.aspx");

}




i have following code for "preview page"



public partial class PreviewPage : System.Web.UI.Page
{
string[] strprv;

protected void Page_Load(object sender, EventArgs e)
{

strprv = (string[])Session["AddContact"];

drpvalue_prv.Text = strprv[0];
lbl_firname_prv.Text = strprv[1];
lbl_midname_prv.Text = strprv[2];
lbl_lastname_prv.Text = strprv[3];
lbl_company.Text = strprv[4];
lbl_offphone_prv.Text = strprv[5];
lbl_homephone_prv.Text = strprv[6];
lbl_mobile.Text = strprv[7];
lbl_fax_prv.Text = strprv[8];
lbl_offemail_prv.Text = strprv[9];
lbl_peremail.Text = strprv[10];
lbl_jobtitle_prv.Text = strprv[11];
lbl_website_prv.Text = strprv[12];
lbl_offstreet_prv.Text = strprv[13];
lbl_offcity_prv.Text = strprv[14];
lbl_offstate_prv.Text = strprv[15];
lbl_offcount_prv.Text = strprv[16];
lbl_offzip_prv.Text = strprv[17];
lbl_perstreet_prv.Text = strprv[18];
lbl_percity_prv.Text = strprv[19];
lbl_perstate_prv.Text = strprv[20];
lbl_percount_prv.Text = strprv[21];
lbl_perzip_prv.Text = strprv[22];


}
protected void btnsave_Click(object sender, EventArgs e)
{

EntityRegistration EntReg = new EntityRegistration();


EntReg.Title = strprv[0];


EntReg.FirstName = strprv[1];
EntReg.MiddleName = strprv[2];
EntReg.LastName = strprv[3];
EntReg.JobTitle = strprv[11];
EntReg.Company = strprv[4];
EntReg.Website = strprv[12];
EntReg.OfficePhone = Convert.ToInt64(strprv[5]);
EntReg.Workphone = Convert.ToInt64(strprv[6]);
EntReg.Mobile = Convert.ToInt64(strprv[7]);
EntReg.Fax = Convert.ToInt64(strprv[8]);
EntReg.OfficeEmail = strprv[9];
EntReg.PersonalEmail = strprv[10];

EntReg.OfficeStreet = strprv[13];
EntReg.OfficeCity = strprv[14];
EntReg.OfficeState = strprv[15];
EntReg.OfficeCountry = strprv[16];
EntReg.OfficeZIP = Convert.ToInt64(strprv[17]);

EntReg.PerStreet = strprv[18];
EntReg.PerCity = strprv[19];
EntReg.PerState = strprv[20];
EntReg.PerCountry = strprv[21];
EntReg.PerZIP = Convert.ToInt64(strprv[22]);


BAO.BAOAddContact baoadd = new BAO.BAOAddContact();

baoadd.ADDDetails(EntReg);
}

protected void btnEdit_Click(object sender, EventArgs e)
{


Response.Redirect("AddContact.aspx?FirName=" + strprv[1] + "LastName=" +strprv[2]);



}
}




my problem is if user clicks "edit" button then it should redirec to "registration page" with all the values retained that entered previously but im loosing all the values




i tried 'query string' in so mane ways but no result...




please help me with code and explanation





very thanks in advance




Responses

Posted by: Vuyiswamb on: 9/28/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Day

I suggest you use the Wizard control.You have a lot of Controls and you want to depend on a View state and i see you are doing some sort of the wizard , but you are trying to accomplish this in page level. i suggest you use a Wizard Control.

Thank you for posting at dotnetfunda

Vuyiswa Maseko


Thank you for posting at Dotnetfunda
[Administrator]

Shalini4duck, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response