I have one ASP.NET Page. It's for display customer information. Now I want this page to handle the f

Discussion in 'ASP .Net' started by Benny Ng, Jan 4, 2007.

  1. Benny Ng

    Benny Ng Guest

    Dear All,
    Now I met one problem in the development of my one application.

    I have one ASP.NET page. It's for disply the information of customer.
    But now I have one new requirement. It's to combine the "Edit" and "Display"
    funtions into this page.
    (It means if user want to edit the customer information, this page would
    provided editing page to the user;
    If the user want to display the customer information, this page would
    providev the display function to the user.)

    Actually in before I had 100% implemented these functions into one page.

    My method is when the page is at "Display" status. Then first to hided
    all editing elements of this page.(Set the property "Visible" to "false" for
    each elements). And then shows all Labels controls with the corresponding
    values. And vice versa.

    But the disadvantages of this method is I Must to write many codes to
    hide the editing fields and shows Label fields and vice versa.

    Now I have one idea about that. It's to write a function to loop all
    editing elements and let them invisible. After that shows the corresponding
    values at the same space.

    It means:
    Status "Edit": <td><asp:textbox id=a1
    text="testing"></asp:textbox></td>
    Status "Display: <td>testing</td>

    After that I needn't to write so much source codes to handle those
    elements. One function enough for my purpose.

    I used the following code to loop all elements of that page.But for the
    next stage I still haven't no any ideas.

    Any suggestion are appreciated for me. Thank you very much.

    foreach (Control i in Page.FindControl("frmEdit").Controls)
    {
    //Response.Write(i.ID + "---" + i.GetType().FullName);

    }

    Best Regards,

    Benny Ng
     
    Benny Ng, Jan 4, 2007
    #1
    1. Advertisements

  2. Benny Ng

    bruce barker Guest

    Re: I have one ASP.NET Page. It's for display customer information.Now I want this page to handle the function "Edit" and "Display", Is it possible?

    i'd write a new control that had a edit property. it would then render
    an input or text depending on the edit setting.

    -- bruce (sqlwork.com)


    Benny Ng wrote:
    > Dear All,
    > Now I met one problem in the development of my one application.
    >
    > I have one ASP.NET page. It's for disply the information of customer.
    > But now I have one new requirement. It's to combine the "Edit" and "Display"
    > funtions into this page.
    > (It means if user want to edit the customer information, this page would
    > provided editing page to the user;
    > If the user want to display the customer information, this page would
    > providev the display function to the user.)
    >
    > Actually in before I had 100% implemented these functions into one page.
    >
    > My method is when the page is at "Display" status. Then first to hided
    > all editing elements of this page.(Set the property "Visible" to "false" for
    > each elements). And then shows all Labels controls with the corresponding
    > values. And vice versa.
    >
    > But the disadvantages of this method is I Must to write many codes to
    > hide the editing fields and shows Label fields and vice versa.
    >
    > Now I have one idea about that. It's to write a function to loop all
    > editing elements and let them invisible. After that shows the corresponding
    > values at the same space.
    >
    > It means:
    > Status "Edit": <td><asp:textbox id=a1
    > text="testing"></asp:textbox></td>
    > Status "Display: <td>testing</td>
    >
    > After that I needn't to write so much source codes to handle those
    > elements. One function enough for my purpose.
    >
    > I used the following code to loop all elements of that page.But for the
    > next stage I still haven't no any ideas.
    >
    > Any suggestion are appreciated for me. Thank you very much.
    >
    > foreach (Control i in Page.FindControl("frmEdit").Controls)
    > {
    > //Response.Write(i.ID + "---" + i.GetType().FullName);
    >
    > }
    >
    > Best Regards,
    >
    > Benny Ng
    >
    >
     
    bruce barker, Jan 4, 2007
    #2
    1. Advertisements

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. z. f.
    Replies:
    0
    Views:
    854
    z. f.
    Feb 3, 2005
  2. Kunle Odutola
    Replies:
    4
    Views:
    1,524
    Kunle Odutola
    Feb 13, 2006
  3. UJ
    Replies:
    1
    Views:
    401
  4. Tony Andreas
    Replies:
    3
    Views:
    423
  5. Tony Andreas
    Replies:
    2
    Views:
    342
  6. Tony Andreas
    Replies:
    2
    Views:
    403
  7. Alexander
    Replies:
    20
    Views:
    1,398
    BGB / cr88192
    Sep 11, 2010
  8. Annie
    Replies:
    1
    Views:
    418
    Phillip Williams
    Nov 2, 2005
Loading...