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. Advertising

  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. 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. Tony Andreas
    Replies:
    3
    Views:
    330
  2. Tony Andreas
    Replies:
    2
    Views:
    269
  3. Tony Andreas
    Replies:
    2
    Views:
    330
  4. Robert Wells
    Replies:
    4
    Views:
    704
    Default User
    Jun 24, 2008
  5. Suresh Kumar

    Accessing values of one customer Control from another custom control

    Suresh Kumar, Nov 3, 2003, in forum: ASP .Net Building Controls
    Replies:
    4
    Views:
    202
    Suresh Kumar
    Nov 4, 2003
Loading...

Share This Page