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

How is a session stored and maintained in asp.net?

598


Mention the namespace that is used to include .net data provider for sql server in .net code?

561


1.can we add connection string in global.asax?????????? 2.what are the default files included when we create new web application????

18923


What is the difference between the asp and asp.net?

549


Explain how is the asp.net mvc architecture different from others? : asp.net mvc

569






What is csrf attack in asp.net?

571


Hi All, Im an MCA holder with 3+ years of experience in asp.net. Now i want to move to some good government job. I have no idea about different categories of exams held & which one can be applicable for my education background. I have done B.A with MCA. Please help me out with your valuable suggestions. I would be very grateful. Thanks Anuj

2901


How will you load dynamic assembly?

620


What is x xss protection?

627


What is the server of asp.net?

568


What do you mean by query string?

584


What are the media types of http requests and response?

570


What is the use of worker process in asp.net?

588


Explain the difference between debug.write and trace.write?

588


What is the parent class of all web server control?

593