|
Dear All,
I have a problem while doing ASP.NET development. I have a page that is used to display customer information. But this page I think it has both display and editing functions.
My previous approach was to hide all edited controls (visible = false one by one) when this page is in the "displayed" state, and then assign and display the label controls one by one. There are many lines of code to do these things on each page. (If the page is large)
I have an idea now, I want to write a function, and then scan all the controls on the page directly, then hide them, and then show their contents in their original position, I can now scan all the controls on the page , But don't know how to proceed to the next step. (For example: it is to hide the TextBox control, and then display the displayed content at the position of the TextBox, and vice versa)
foreach (Control i in Page.FindControl ("frmEdit"). Controls)
{
//Response.Write(i.ID + "---" + i.GetType (). FullName);
}
I don't know what I'm saying clearly. Please give instructions.
Anyway, the main purpose is to be lazy, a page to achieve two functions. :)
Best Regards,
Benny Ng |
|