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 is the most appropriate lifetime for a database connection/orm context in an asp.net mvc application? : Asp.Net MVC

622


What is asp.net used for?

690


Explain how can we inherit a static member?

611


What is difference between or and orelse?

634


What is redirecting behavior?

621






List the events in page life cycle.

635


What is the difference between response.redirect and server.transfer?

617


Diff between web user control and web custom control?

604


Which protocol is used to call a web service?

663


What is asp.net mvc? : asp.net mvc

646


What do you mean by role-based security?

645


What is the difference between mechine.config and web.config?

841


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

611


How do I open an ashx file in windows 7?

661


Describe session handling in a webfarm?

648