When a dropdownlist has been added by some records and it
has been binded why it is not executing i'm facing this
error pls help me ?

if (is!pageposback)

{
arraylist books = new arraylist;
books.add ("gone with the wind");
books.add ("rahulsriramprakash");
books.add ("vishal");
dropdowndisplay.datasource=books;
dropdowndisplay.databind();
}

The error is :

1) The dropdowndisplay does not exist.

Answer Posted / tarun

instead of arrayList use HashTable

and create one bindingsourse

BindingSource bs=new BindingSource();

HashTable hs=new HashTable();
hs.Add("Value","Key");

bs.dataSource=hs;

dropdowndisplya.datasource=bs;
dropdowndisplay.databind();

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we have multiple web config files for an asp.net application?

539


What is custom attribute? How to create?

545


Explain program to call the js function when the change is being made in the dropdown list made in asp.net mvc? : asp.net mvc

534


Any disadvantages in Dataset and in reflection ?

2829


What are demand-paging and pre-paging?

586






Where you store Connection string in "Web.Config" file in ASP.NET?

588


How to use push notification?

606


How do you store a value in viewstate and retrieve them?

572


Differentiate globalization and localization.

594


What is http post and http get?

548


What does mvc represent in asp.net? : asp.net mvc

528


What is Partial PostBack in ASP.NET?

608


Which adapter should you use, if you want to get the data from an access database?

544


What is the use of placeholder control?

554


What are early binding and late binding.

568