?
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
Medium Priority
?
499 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 41

Accepted Solution

by:
guru_sami earned 2000 total points
ID: 40217554
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

801 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