textbox values arent showing up?

Discussion in 'ASP .Net' started by Andy B, Jan 25, 2008.

  1. Andy B

    Andy B Guest

    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?
    Andy B, Jan 25, 2008
    #1
    1. Advertising

  2. Andy B

    Jignesh Guest

    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:...
    > 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?
    >
    >
    >
    >
    >
    >
    Jignesh, Jan 25, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Greg Smith

    Showing currency in a textbox

    Greg Smith, May 25, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    436
  2. Ray Booysen
    Replies:
    2
    Views:
    643
    Ray Booysen
    Mar 28, 2006
  3. Replies:
    2
    Views:
    1,924
    Ian Shef
    Apr 20, 2005
  4. Replies:
    5
    Views:
    673
  5. Coolgg
    Replies:
    9
    Views:
    167
    Coolgg
    Jan 24, 2013
Loading...

Share This Page