Solved

How do I create and populate an asp:FormView in an Asp.Net application dynamically in the code behind ?

Posted on 2014-07-23
1
458 Views
Last Modified: 2014-07-27
Hi:

I'm working on an ASP.net (VB.Net) application.
We have a page from which we display a ModalPopupExtender(s) tied to a input button click.
We would like to embed an asp:FormView control within the popup div.

Depending on the scenario, the use can edit one of several different record types.
With this in mind, we would like to be able to create and populate the item templates
dynamically in the code behind.

Ideally, we would like the FormView to display it's items in a grid consisting
of multiple rows/columns (<td>label </td><td>Field</td>
The template contents would depend on the current record type.
We won't be editing all the fields in the records, just a subset.

We would like to use the FormView to:
a) view record details
b) update a record
c) create a new record

How do I go about doing this dynamically in the code behind?

Thanks,
JohnB
0
Comment
Question by:jxbma
1 Comment
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
Comment Utility
That's a broad question. do you have anything in place and facing any issues?
Though here's basic steps:
- You can place the FV in modal without any issues.
- In code behind you can bind the FV control like:

FormView1.DataSource = //It is the data e.g. collection of Person objects that holds the data
FormView1.DataBind();
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

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…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now