Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access DropDownList inside a FormView's header template

Posted on 2007-11-20
4
Medium Priority
?
808 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
3 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline

824 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