473,399 Members | 3,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

how to change FormView programmatically

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?
Nov 19 '05 #1
1 3101
Use the method called "changeMode"

ex: fvCustomers.ChangeMode(FormViewMode.Insert)
Random wrote:
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?


Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Guenter | last post by:
Hi, I am trying to use the ASP.NET 2.0 FormView as a method to enter data into my business object. At the moment, I am trying to do this without a custom DataSourceView control, but I can't...
3
by: Jurgen Appelo | last post by:
I asked this question earlier, but unfortunately the two replies I got did not solve the problem. Here it is again, but now with the code: After an Update my FormView always loses its viewstate...
8
by: BB | last post by:
Hi, I am using FormView Contol, TextBox (Hidden ) and Submit button whose caption is "View Page" in my aspx page. Here is what I am tryin to do.When page loads I generate dynamic url in text box...
3
by: Jeff | last post by:
hey asp.net 2.0 I want to programmatically populate (with data from the database) a label control in a FormView on a webpage. Is it a good idea to put my logic inside the DataBound event of...
3
by: nicomp | last post by:
Hello, I have a FormView control that has a CheckBoxList in the Item template... I wrote this code to access a CheckBoxList in a FormView template... dim foo as checkboxlist foo = ...
0
by: namewitheldbyrequest | last post by:
Hello, I have a FormView control that has a CheckBoxList in the Item template... I wrote this code to access a CheckBoxList in a FormView template... dim foo as checkboxlist foo = ...
2
by: Nathan Sokalski | last post by:
I am trying to create a FormView controls in which I access and modify the the controls in the PagerTemplate programmatically. However, I continue to recieve the following error: Object...
3
by: J055 | last post by:
Hi I have a PlaceHolder control inside a FormView EditItemTemplate: <asp:PlaceHolder ID="phResponseText" runat="server"> <tr> <td> <asp:Label ID="lblResponseText"...
4
by: dizzy77 | last post by:
Is it possible to select specific row of FormView control by DataKeyName or row ID from code behind programmatically. Assuming that FormView is binded to standard ObjectDataSource control. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.