in Education by
Greetings! I have a DropDownList within a FormView which are bound to XmlDataSources:

<%# XPath("SomeNode")%>

' /> In the page's codebehind, I have the following OnLoad() method as well as the method for when the select index of the dropdownlist changes: protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!IsPostBack) { string xml = GetMyXml(0); // default value MyXmlDataSource.Data = xml; MyDdlDataSource.Data = xml; } } protected void MyDdl_SelectedIndexChanged(object sender, EventArgs e) { DropDownList l_MyDdl = FindControl("MyDdl") as DropDownList; int myVal; if (l_MyDdl != null) if (!Int32.TryParse(l_MyDdl.SelectedItem.Value, out myVal)) myVal = 0; string xml = GetMyXml(myVal); MyXmlDataSource.Data = xml; MyDdlDataSource.Data = xml; } When a different value is selected from the dropdown list and SelectedIndexChanged is invoked, I am unable to get the value of the dropdown list (FindControl always returns null) in order to use it to re-bind the datasources. How can I get this value? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Because your dropdownlist is contained within another control it may be that you need a recursive findcontrol. http://weblogs.asp.net/palermo4/archive/2007/04/13/recursive-findcontrol-t.aspx

Related questions

0 votes
    Greetings! I have a DropDownList within a FormView which are bound to XmlDataSources: In the page's ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    So the problem is i don't get get a value from textbox field on GridView RowUpdating event. Here ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    I have a fileupload option in my project. It inclueds a query which returns a dataset. It works fine ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    I have an XML document which basically looks like this: SomeSeller 2535 Now I'm trying to parse the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    I want to make a button Go To Cart visible after adding a product into cart. But when page gets ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    I have been developing a webpage which uses n number of dropdownlists which are binding dynamically inside a ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    I have created an empty web application project in visual studio 2010 and have addd the following model ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I have created an empty web application project in visual studio 2010 and have addd the following model ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I have a master page with a form element and the defaultbutton attribute set to a server-side ImageButton. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 16, 2022 in Education by JackTerrance
0 votes
    I have a Login control placed inside LoginView control contained within a PANEL. I want to set login button ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    I am developing solution where there are three webapi projcets. Each of them is secured with JWT tokens ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    All How can I download a file so the user sees that it is downloading (like with a stream?) I ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    I'm working on a DNN skin using Christoc's DNN templates and when I create a normal ASP.NET ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I have two submit buttons and a few textboxes on my page. When I enter details in the textbox and hit ... model.FirsttName) @Html.TextBoxFor(model => model.LastName) Get History...
asked May 22, 2022 in Education by JackTerrance
0 votes
    Description: I have a solution in Visual Studio which has multiple projects as application layers. Business Logic ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
...