Solved

Web Form: How Do You Create a Web Form Containing a FormView and Two Sub Forms

Posted on 2011-09-30
4
163 Views
Last Modified: 2012-05-12
I have a web form in which I have a TABLE structure containing a FormView which displays a single row from a table. I have it coded such that I can switch between ItemTemplate (for viewing the data) and EditItemTemplate (for updating the data). This is working.

I also have on the same web page a separate TABLE structure into which I need to place something like a Repeater for displaying multiple rows of data. I chose the Repeater because I want to control the format of the data being displayed. Instead of displaying the row fields as columns, I want to display the fields one under the other with a separator between data rows. The Repeater seems to provide this capability, but, unlike the FormView, the Repeater only has the ItemTemplate. I need to be able to switch the view so that I can update the data.

How do you switch between View (readonly) and Edit within a Repeater? If it is possible, can you give a brief example or point me to a website that explains it?
0
Comment
Question by:Donna Kainer
  • 3
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 36903777
Are you looking for the capabilities of the DetailsView?
0
 

Accepted Solution

by:
Donna Kainer earned 0 total points
ID: 36919431
I found, in a Google search, a way to do most of what I need done (Edit and Delete) without the DetailsView. See http://sureshsharmaaspdotnet.wordpress.com/2008/05/12/edit-update-delete-in-repeater-in-aspnet/ for more information.

Using the above link I figured out how to get the Repeater to display the data from the database table with an Edit and Delete button on each row of data. However, there was no description of how to Add a record. I don't know how to get the Repeater to give me a blank row on request (I.E. I click an ADD button) so that I can type the data into the form and then add it to the database table.

Does anyone know how to do this?
0
 

Author Comment

by:Donna Kainer
ID: 36924765
My last comment should be a new question entry. I have created that entry. This can be closed.
0
 

Author Closing Comment

by:Donna Kainer
ID: 36947368
No one provided a better solution than the one I found via internet searches.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question