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

What are the new features implemented in ASP.NET?

611


Explain the difference between server.transfer and response.redirect? Why would I choose one over the other?

552


What is mta?

635


What is advantage of code behind coding in ASP.NET?

566


Is it possible for me to change my aspx file extension to some other name?

593






Mention few asp.net validators.

583


What are the parts of an http response?

515


Explain how is a property designated as read-only?

561


How can u deifne the benefits and limitation of using Viewstate for state management?

718


Explain the difference between codebehind="mycode.aspx.cs" and src="mycode.aspx.cs"?

547


Define view state.

560


Let's say I have an existing application written using vb6 and this application utilizes windows 2000 com+ transaction services. How would you approach migrating this application to.net?

510


What are session cookies?

553


how to retrieve property settings from xml .config file.

555


Explain how can we inherit a static member?

538