Also, "does not work" isn't very descriptive. Is there an error, or does
nothing happen at all?
On 10/22/07, Charles Carroll < 911%40learnasp.com">911
learnasp.com> wrote:
>
> Can we see the event name and the all the code for the page i.e.
>
> protected void Page_Load(...)
> {
> ... code ...
> }
>
> The code for the buttons and other events could help. Perhaps the
> Page_Load() event is misspelled or has incorrect parameter or does not
> fire. The easiest way to find if events fire is Trace.Write basically
> turning on trace=true and placing a check on the value of i will help
> may give us more info on what is happening i.e.
>
> protected void Page_Load(...)
> {
> for(int i=1985;i<=2010;i++)
> {
> Trace.Write("i=",i.ToString());
> ddlyear.items.add(i);
> }
> }
>
> On 10/22/07, Anil Srivastava < anilsri_05%40yahoo.com">anilsri_05
yahoo.com<anilsri_05%40yahoo.com>>
> wrote:
> >
> > Hi All
> > I have a dropdown list. id=ddlyear
> > I have set autopostback=true
> > I want to populate it in c#
> > i use following code on page load
> > for(int i=1985;i<=2010;i++)
> > ddlyear.items.add(i);
> >
> > but this does not work.
> > Could anyone help me out.
>
[Non-text portions of this message have been removed]
.