Click here to Skip to main content
15,912,665 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# class that makes program read SqlConnection string from xml file Pin
Wayne Gaylard18-Nov-11 19:51
professionalWayne Gaylard18-Nov-11 19:51 
GeneralRe: C# class that makes program read SqlConnection string from xml file Pin
Framework .l.18-Nov-11 19:55
Framework .l.18-Nov-11 19:55 
GeneralRe: C# class that makes program read SqlConnection string from xml file Pin
Wayne Gaylard18-Nov-11 20:00
professionalWayne Gaylard18-Nov-11 20:00 
AnswerRe: C# class that makes program read SqlConnection string from xml file Pin
OriginalGriff18-Nov-11 20:38
mveOriginalGriff18-Nov-11 20:38 
GeneralRe: C# class that makes program read SqlConnection string from xml file Pin
Wayne Gaylard18-Nov-11 20:57
professionalWayne Gaylard18-Nov-11 20:57 
GeneralRe: C# class that makes program read SqlConnection string from xml file Pin
OriginalGriff18-Nov-11 21:36
mveOriginalGriff18-Nov-11 21:36 
GeneralRe: C# class that makes program read SqlConnection string from xml file Pin
Wayne Gaylard18-Nov-11 21:44
professionalWayne Gaylard18-Nov-11 21:44 
QuestionAccessing a dynamically created drop down list Pin
Jon Myers18-Nov-11 9:21
Jon Myers18-Nov-11 9:21 
I have the following method in a class library that creates a dropdown menu populated using linq to sql.

C#
public DropDownList GetCategoryList()
        {
            ArticleDataDataContext dc = new ArticleDataDataContext();

            DataBuddy db = new DataBuddy(dc.getAllCategories());

            List<string> result = db.EnumerateISingleResultAsString();

            DropDownList d = new DropDownList();

            d.ID = "ddCatList";
            d.ViewStateMode = ViewStateMode.Enabled;

            foreach (string item in result)
            {
                d.Items.Add(new ListItem(item, item, true));
            }

            return d;
        }


This works fine but I cannot figure out how to access the control on postback.

I have tried the following in a button click event handler but it doesn't work.

C#
DropDownList dd = (DropDownList)this.FindControl("ddCatList");

AnswerRe: Accessing a dynamically created drop down list Pin
Dan Mos19-Nov-11 8:05
Dan Mos19-Nov-11 8:05 
GeneralRe: Accessing a dynamically created drop down list Pin
Jon Myers19-Nov-11 10:21
Jon Myers19-Nov-11 10:21 
GeneralRe: Accessing a dynamically created drop down list Pin
Dan Mos19-Nov-11 10:31
Dan Mos19-Nov-11 10:31 
QuestionShutdown and Logoff System Events and Windows Services Pin
adrianojorge18-Nov-11 8:34
adrianojorge18-Nov-11 8:34 
QuestionRe: Shutdown and Logoff System Events and Windows Services Pin
Mark Salsbery18-Nov-11 10:08
Mark Salsbery18-Nov-11 10:08 
AnswerRe: Shutdown and Logoff System Events and Windows Services Pin
adrianojorge18-Nov-11 21:30
adrianojorge18-Nov-11 21:30 
GeneralRe: Shutdown and Logoff System Events and Windows Services Pin
Mark Salsbery19-Nov-11 6:21
Mark Salsbery19-Nov-11 6:21 
GeneralRe: Shutdown and Logoff System Events and Windows Services Pin
adrianojorge20-Nov-11 4:41
adrianojorge20-Nov-11 4:41 
AnswerRe: Shutdown and Logoff System Events and Windows Services Pin
SilimSayo19-Nov-11 11:22
SilimSayo19-Nov-11 11:22 
GeneralRe: Shutdown and Logoff System Events and Windows Services Pin
adrianojorge20-Nov-11 4:43
adrianojorge20-Nov-11 4:43 
AnswerMessage Removed Pin
21-Nov-11 23:46
ganeshbdas21-Nov-11 23:46 
GeneralRe: Shutdown and Logoff System Events and Windows Services Pin
adrianojorge21-Nov-11 23:51
adrianojorge21-Nov-11 23:51 
Questionchallange .net datepicker problem Pin
suma.mca.4u18-Nov-11 3:40
suma.mca.4u18-Nov-11 3:40 
AnswerRe: challange .net datepicker problem Pin
Not Active18-Nov-11 5:46
mentorNot Active18-Nov-11 5:46 
GeneralRe: challange .net datepicker problem Pin
Pete O'Hanlon18-Nov-11 8:30
mvePete O'Hanlon18-Nov-11 8:30 
GeneralMessage Removed Pin
18-Nov-11 9:22
professionalN_tro_P18-Nov-11 9:22 
GeneralRe: challange .net datepicker problem Pin
Pete O'Hanlon18-Nov-11 9:30
mvePete O'Hanlon18-Nov-11 9:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.