473,386 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 2266
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Greg Bryant | last post by:
I'm doing some work for a company that has an auction site running in coldfusion. They're not real happy with it, and it needs a major overhaul, so I'm looking at redoing it, and while I'm at it,...
6
by: DJ Majestik | last post by:
OK, I am devising a php page that will handle a form submission, and wanted to know if anyone has already setup such an idea, or if you had links to point to good tutorials on this. Basically I...
0
by: Dave | last post by:
Hi everyone, (I already posted this to the VS.NET IDE news group without any responses, so I'm attempting one more time in this group) The issue I'm having is occuring in the IDE of VS.NET...
13
by: royaltiger | last post by:
I am trying to copy the inventory database in Building Access Applications by John L Viescas but when i try to run the database i get an error in the orders form when i click on the allocate...
2
by: Learner | last post by:
Hello, I have a GridView control on my webform. I can see the data in my GridView control but I don't see any option to hide or delete the Edit column in the control. I don't have to have any...
1
by: scartin | last post by:
I'm fairly new to working with ASP web controls, and am running into what seems to be a ridiculous problem that I'm hoping will be a breeze for an experienced ASP developer. I have a GridView...
17
by: radio1 | last post by:
Configuration: Access 2002 and SQL Server 2000 using a .ADP Project. I would VERY MUCH appreciate anyone's input into this problem I'm having. I have a form in Access that does not permit...
0
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new...
5
by: th1982 | last post by:
HI All I have a search page' s result which view 3results/per page,but my "next" link to view next page is not working. Here is my code : <?php // Get the search variable from URL ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.