formview changeMode

Discussion in 'ASP .Net' started by rodchar, Dec 13, 2007.

  1. rodchar

    rodchar Guest

    hey all,
    i'm doing the following inside a button click event.
    i'm doing a FormView1.ChangeMode(FormViewMode.Insert) and following that i'm
    trying to affect the visibility of a textbox control that is within
    InsertItemTemplate of the formview but it's not working. the textbox remains
    visible.

    can someone please explain what i'm not understanding? here's the simple
    code snippet:

    protected void BtnNew_Click(object sender, EventArgs e)
    {
    FormView1.ChangeMode(FormViewMode.Insert);
    TextBox txt1 = (TextBox)FormView1.FindControl("fldNameTextBox");
    txt1.Visible = false;
    }

    thanks,
    rodchar
     
    rodchar, Dec 13, 2007
    #1
    1. Advertising

  2. rodchar

    rodchar Guest

    please help...

    "rodchar" wrote:

    > hey all,
    > i'm doing the following inside a button click event.
    > i'm doing a FormView1.ChangeMode(FormViewMode.Insert) and following that i'm
    > trying to affect the visibility of a textbox control that is within
    > InsertItemTemplate of the formview but it's not working. the textbox remains
    > visible.
    >
    > can someone please explain what i'm not understanding? here's the simple
    > code snippet:
    >
    > protected void BtnNew_Click(object sender, EventArgs e)
    > {
    > FormView1.ChangeMode(FormViewMode.Insert);
    > TextBox txt1 = (TextBox)FormView1.FindControl("fldNameTextBox");
    > txt1.Visible = false;
    > }
    >
    > thanks,
    > rodchar
     
    rodchar, Dec 17, 2007
    #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. J055
    Replies:
    1
    Views:
    12,085
    Walter Wang [MSFT]
    Aug 10, 2006
  2. Trev

    Formview ChangeMode Problem

    Trev, Feb 8, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    607
  3. J055
    Replies:
    5
    Views:
    750
    Walter Wang [MSFT]
    Aug 20, 2007
  4. R Bandeira
    Replies:
    0
    Views:
    419
    R Bandeira
    Sep 6, 2007
  5. David Thielen

    FormView.ChangeMode(FormViewMode.Edit) not working

    David Thielen, Mar 2, 2007, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    675
    David Thielen
    Mar 4, 2007
Loading...

Share This Page