Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > 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?

Reply
Thread Tools

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?

 
 
Benny Ng
Guest
Posts: n/a
 
      01-04-2007
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


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      01-04-2007
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
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to create a link "e-mail this page to a friend" on clicking this link i want to send the URL of that current page to a friend pavi Javascript 0 01-13-2006 12:10 PM
Pagination function for search page returning too many hits to display on one page. Henrik ASP .Net 1 06-02-2005 01:17 PM
Possible to handle web requests without an ASPX page? i.e. have DLL handle request. jdlwright@shaw.ca ASP .Net 2 05-31-2005 05:42 PM
Hi I have one web application and i want to get the number of users who are currently accessing the application. Also I want to get the user details of each user, which is stored in a database. How can I do this? Pls help. Getting No: and anu Java 11 05-12-2005 03:25 PM
Samsung SCD6040 - Anyone have one, used one, or have reviews on one? g wills Digital Photography 0 09-08-2004 08:06 PM



Advertisments