Solved

Access DropDownList inside a FormView's header template

Posted on 2007-11-20
4
798 Views
Last Modified: 2008-02-07
I have a FormView which I want to put a DropDownList in (named "customerList").  I want to be able to handle the SelectedIndexChanged event of customerList, but VS2005 doesn't recognize that as a valid variable name.  What do I need to do?
0
Comment
Question by:netsmithcentral
4 Comments
 
LVL 8

Expert Comment

by:MrAgile
Comment Utility
Hi,
please post the source code.
0
 
LVL 12

Accepted Solution

by:
netsmithcentral earned 0 total points
Comment Utility
You need to use the FindControl method of the FormView and then do an implicit cast to access it.
<asp:FormView ID="theFormView" ...>

    <ItemTemplate>

        <asp:DropDownList DataSourceID="myDataSource" ID="theDDL" />

.

.

.

    </ItemTemplate>

.

.

.

</asp:FormView>
 
 

Protected Sub useData()

   Dim ddl As DropDownList = theFormView.FindControl("theDDL)

   ddl.SelectedValue...

End Sub

Open in new window

0
 
LVL 1

Expert Comment

by:Vee_Mod
Comment Utility
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
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…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

12 Experts available now in Live!

Get 1:1 Help Now