Click here to Skip to main content
15,885,842 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionAbout search from start Date to End Date Pin
sanjay3029-Jan-09 0:47
sanjay3029-Jan-09 0:47 
AnswerRe: About search from start Date to End Date Pin
Aman Bhullar29-Jan-09 0:57
Aman Bhullar29-Jan-09 0:57 
QuestionCan anybody help me pleaseeeeee Pin
AnuMaria29-Jan-09 0:31
AnuMaria29-Jan-09 0:31 
AnswerRe: Can anybody help me pleaseeeeee Pin
Paddy Boyd29-Jan-09 2:48
Paddy Boyd29-Jan-09 2:48 
QuestionTextEditor Pin
sajjadlashari29-Jan-09 0:18
sajjadlashari29-Jan-09 0:18 
AnswerRe: TextEditor Pin
Tad McClellan29-Jan-09 11:06
professionalTad McClellan29-Jan-09 11:06 
AnswerRe: TextEditor Pin
samira_sm13-Nov-09 7:16
samira_sm13-Nov-09 7:16 
QuestionDropdownlist is getting null refernce eventhough there is a proper reference Pin
meeram39529-Jan-09 0:14
meeram39529-Jan-09 0:14 
Thank you for answering to all my previous queries. All were very helpful. Now I'm facing another issue.

In my form I'm dynamically generating two dropdownlist controls. One is for country and other is for state. I can able to fire the SelectedIndexchanged event of Country dropdown and getting the id of Selected Index.

However, while selecting the control from Repeater control, eventhough FindControl Method is getting reference, the correponding dropdownlist is getting the null reference. Any idea what's happening?

Following is the code:
DropDownList CountryDropDownList = sender as DropDownList;
         string controlName = string.Empty;

         string ChkDropDown = CountryDropDownList.ID;

        if (ChkDropDown.Contains("Country"))
        {
            int CountryId = Convert.ToInt32(CountryDropDownList.SelectedValue);
            dt1 = Codtls.GetStatesList(CountryId);
foreach (UserField userField in _userFields)
            {
               
                if (userField.Name.Contains("State"))
                {
                    string vaulueControlName = String.Concat("UserFieldValue", userField.Id);
                    controlName = String.Concat("UserField", userField.Id + "_" + userField.Name.ToString().Trim());
                    Control valueControl = UserFieldRepeater.FindControl(controlName);
              // Till this, it is working fine and valueControl is having the id and name of the control. But when I tried to assign to a  dropdownlist, it is coming out as null.     
                  
                    DropDownList StateList = valueControl as DropDownList;
                    StateList.DataSource = dt1;
                    StateList.DataTextField = "_Statename";
                    StateList.DataValueField = "_StateId";
                    StateList.DataBind();
                }


I tried to put the line, DropDownList StateList = (DropDownList)valueControl; then it is giving me the error ' Cannot cast repeater item to a dropdownlist'. Anybody can provide any help please?
Thanks in advance.

Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

QuestionHow to get Textbox value from dynamic generated onClick EventHandler Pin
Karan_TN28-Jan-09 23:09
Karan_TN28-Jan-09 23:09 
AnswerRe: How to get Textbox value from dynamic generated onClick EventHandler Pin
Tad McClellan29-Jan-09 17:22
professionalTad McClellan29-Jan-09 17:22 
Questionincrement the texbox value on mouse down[modified] Pin
yathika sekar28-Jan-09 23:03
yathika sekar28-Jan-09 23:03 
AnswerRe: increment the texbox value on mouse dow Pin
Tad McClellan29-Jan-09 17:24
professionalTad McClellan29-Jan-09 17:24 
Questionhow to convert awebsite from two tier archtecture to three tier archtecture Pin
anujbanka178428-Jan-09 23:02
anujbanka178428-Jan-09 23:02 
AnswerRe: how to convert awebsite from two tier archtecture to three tier archtecture Pin
SeMartens28-Jan-09 23:09
SeMartens28-Jan-09 23:09 
GeneralRe: how to convert awebsite from two tier archtecture to three tier archtecture Pin
anujbanka178428-Jan-09 23:22
anujbanka178428-Jan-09 23:22 
GeneralRe: how to convert awebsite from two tier archtecture to three tier archtecture Pin
SeMartens28-Jan-09 23:24
SeMartens28-Jan-09 23:24 
GeneralRe: how to convert awebsite from two tier archtecture to three tier archtecture Pin
anujbanka178428-Jan-09 23:27
anujbanka178428-Jan-09 23:27 
AnswerRe: how to convert awebsite from two tier archtecture to three tier archtecture Pin
Paddy Boyd29-Jan-09 2:48
Paddy Boyd29-Jan-09 2:48 
QuestionHow to refresh the Datagrid(WPF DataGrid) for every 5 minutes in WPF Browser application Pin
reach2narahari@gmail.com28-Jan-09 22:13
reach2narahari@gmail.com28-Jan-09 22:13 
Question[newbie] Retrieving values Pin
jon-8028-Jan-09 22:05
professionaljon-8028-Jan-09 22:05 
AnswerRe: [newbie] Retrieving values Pin
SeMartens28-Jan-09 22:09
SeMartens28-Jan-09 22:09 
GeneralRe: [newbie] Retrieving values Pin
jon-8028-Jan-09 22:38
professionaljon-8028-Jan-09 22:38 
GeneralRe: [newbie] Retrieving values Pin
SeMartens28-Jan-09 23:05
SeMartens28-Jan-09 23:05 
GeneralRe: [newbie] Retrieving values Pin
jon-8028-Jan-09 23:59
professionaljon-8028-Jan-09 23:59 
QuestionTooltip Possitioning problems Pin
Docarctiss28-Jan-09 21:54
Docarctiss28-Jan-09 21:54 

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.