Solved

Access DropDownList inside a FormView's header template

Posted on 2007-11-20
4
799 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
ID: 20325000
Hi,
please post the source code.
0
 
LVL 12

Accepted Solution

by:
netsmithcentral earned 0 total points
ID: 20525910
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
ID: 20540968
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Allow space in this pattern 2 49
Class object 2 28
Syntax Error 2 47
When should I use a controller? 3 26
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

863 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

18 Experts available now in Live!

Get 1:1 Help Now