473,569 Members | 2,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:textbo x 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.FindContro l("frmEdit").Co ntrols)
{
//Response.Write( i.ID + "---" + i.GetType().Ful lName);

}

Best Regards,

Benny Ng
Jan 4 '07 #1
1 2276
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:textbo x 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.FindContro l("frmEdit").Co ntrols)
{
//Response.Write( i.ID + "---" + i.GetType().Ful lName);

}

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
8581
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, might as well move to PHP (for a variety of reasons - not trying to reopen the PHP -vs- CFM thing again :). Anyway, so I'm looking at this...
6
1713
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 have a form (which I use smarty templating to display, and smartyvalidator to validate). The php page basically is driven by the action variable...
0
1852
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 2003, although I'm not sure what is actually causing the problem. I can't summarize the issue, so please read on to find out more. I've created a...
13
3968
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 button "Unexpected Error":3251 operation is not supported for this type of object.The demo cd has two databases, one is called inventory and the other...
2
2108
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 Edit, Delte, or Update functionality in my GridView. I just need to display the data thats all. I am using ASP.NET 2.0 and VS 2005. some one could...
1
3863
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 and a FormView on the same page, where the GridView is visible at page load, and the FormView is set to Edit mode by default, but is hidden on the...
17
11694
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 the user to add/change/delete any data, apparently as a result of adding a GROUP BY clause to a View used indirectly as the form's Record Source. I...
0
8294
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 records there is an error "Incorrect syntax near '-'. Must declare the scalar variable "@UserName". I worked out in design view,code is automatically...
5
2619
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 $string = @$_GET ; $trimmed = trim($string); //trim whitespace from the stored variable // rows to return
0
7697
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
5512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.