471,599 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,599 software developers and data experts.

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?

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
Jan 4 '07 #1
1 2187
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

Jan 4 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Greg Bryant | last post: by
6 posts views Thread by DJ Majestik | last post: by
5 posts views Thread by th1982 | last post: by
2 posts views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.