how to change FormView programmatically

R

Random

In the ASP.NET 2.0 beta, the FormView control has the ItemTemplate and
InsertItemTemplate areas (and others). All the documentation I've found
says the way to toggle between the views is to use a control with the
appropriate CommandName. But, I want to decide this when the page loads,
based on the selection made in a DropDownList on a previous page (basically
selecting between a read-only view of an item, an item edit, or a new item).
How can I set the FormView to display the appropriate Template then?
 
B

Brazuka

Use the method called "changeMode"

ex: fvCustomers.ChangeMode(FormViewMode.Insert)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top