textbox values arent showing up?
am 25.01.2008 13:47:50 von Andy B
I have this code:
protected void EditEventsWizard_NextButtonClick(object sender,
WizardNavigationEventArgs e) {
//get the values from the DetailsView
TextBox StartTime = (TextBox)EditEventForm.Rows[1].Cells[1].Controls[0];
TextBox EndTime = (TextBox)EditEventForm.Rows[2].Cells[1].Controls[0];
TextBox Location = (TextBox)EditEventForm.Rows[3].Cells[1].Controls[0];
TextBox Address = (TextBox)EditEventForm.Rows[4].Cells[1].Controls[0];
TextBox Admission = (TextBox)EditEventForm.Rows[5].Cells[1].Controls[0];
TextBox Description = (TextBox)EditEventForm.Rows[6].Cells[1].Controls[0];
TextBox Name = (TextBox)EditEventForm.Rows[7].Cells[1].Controls[0];
//show them in the confirm step
ConfirmEndTimeLabel.Text =
Convert.ToDateTime(EndTime.Text).ToString("h:mmtt");
ConfirmStartTimeLabel.Text =
Convert.ToDateTime(StartTime.Text).ToString("dddd, MMMM d yyyy h:mmtt");
ConfirmAdmissionLabel.Text = Admission.Text;
ConfirmDiscriptionLabel.Text = Description.Text;
ConfirmLocationAddressLabel.Text = Address.Text;
ConfirmLocationNameLabel.Text = Location.Text;
ConfirmNameLabel.Text = Name.Text;
}
For some reason the labels arent showing the textbox values. UIt worked on
all my other pages. Any idea why?
Re: textbox values arent showing up?
am 25.01.2008 18:37:48 von Jignesh Desai
Could be problem somewhere else. check page_load event to ensure you have
if( !Page.Ispostback) condition written.
Regards
JIGNESH
"Andy B" wrote in message
news:uBmG0B1XIHA.5984@TK2MSFTNGP06.phx.gbl...
> I have this code:
> protected void EditEventsWizard_NextButtonClick(object sender,
> WizardNavigationEventArgs e) {
>
> //get the values from the DetailsView
>
> TextBox StartTime = (TextBox)EditEventForm.Rows[1].Cells[1].Controls[0];
>
> TextBox EndTime = (TextBox)EditEventForm.Rows[2].Cells[1].Controls[0];
>
> TextBox Location = (TextBox)EditEventForm.Rows[3].Cells[1].Controls[0];
>
> TextBox Address = (TextBox)EditEventForm.Rows[4].Cells[1].Controls[0];
>
> TextBox Admission = (TextBox)EditEventForm.Rows[5].Cells[1].Controls[0];
>
> TextBox Description = (TextBox)EditEventForm.Rows[6].Cells[1].Controls[0];
>
> TextBox Name = (TextBox)EditEventForm.Rows[7].Cells[1].Controls[0];
>
>
> //show them in the confirm step
>
> ConfirmEndTimeLabel.Text =
> Convert.ToDateTime(EndTime.Text).ToString("h:mmtt");
>
> ConfirmStartTimeLabel.Text =
> Convert.ToDateTime(StartTime.Text).ToString("dddd, MMMM d yyyy h:mmtt");
>
> ConfirmAdmissionLabel.Text = Admission.Text;
>
> ConfirmDiscriptionLabel.Text = Description.Text;
>
> ConfirmLocationAddressLabel.Text = Address.Text;
>
> ConfirmLocationNameLabel.Text = Location.Text;
>
> ConfirmNameLabel.Text = Name.Text;
>
> }
>
> For some reason the labels arent showing the textbox values. UIt worked on
> all my other pages. Any idea why?
>
>
>
>
>
>