Click here to Skip to main content
15,914,289 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionAssigning stored proc param values in GridView's SelectCommand Pin
Christopher Duncan29-Jan-09 2:13
Christopher Duncan29-Jan-09 2:13 
AnswerRe: Assigning stored proc param values in GridView's SelectCommand Pin
ToddHileHoffer29-Jan-09 2:43
ToddHileHoffer29-Jan-09 2:43 
GeneralRe: Assigning stored proc param values in GridView's SelectCommand Pin
Christopher Duncan29-Jan-09 3:03
Christopher Duncan29-Jan-09 3:03 
Question[newbie] controls not aligned within <table></table> Pin
jon-8029-Jan-09 1:13
professionaljon-8029-Jan-09 1:13 
AnswerRe: [newbie] controls not aligned within Pin
ToddHileHoffer29-Jan-09 2:46
ToddHileHoffer29-Jan-09 2:46 
GeneralRe: [newbie] controls not aligned within Pin
jon-8029-Jan-09 3:05
professionaljon-8029-Jan-09 3:05 
Questionhow to fetch values from stock market in asp.net application Pin
rak_kan29-Jan-09 1:12
rak_kan29-Jan-09 1:12 
AnswerRe: how to fetch values from stock market in asp.net application Pin
mr_muskurahat29-Jan-09 2:05
mr_muskurahat29-Jan-09 2:05 
AnswerRe: how to fetch values from stock market in asp.net application Pin
johnsontroye29-Jan-09 9:57
johnsontroye29-Jan-09 9:57 
QuestionFile download Pin
Radhakrishnan G.29-Jan-09 0:50
Radhakrishnan G.29-Jan-09 0:50 
AnswerRe: File download Pin
Guffa29-Jan-09 6:01
Guffa29-Jan-09 6:01 
AnswerRe: File download Pin
Rutvik Dave29-Jan-09 6:52
professionalRutvik Dave29-Jan-09 6:52 
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 

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.