Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Access DropDownList inside a FormView's header template

Posted on 2007-11-20
4
801 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

839 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