[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.mobile

Newbie - can't get the hang of SelectionList

Ian A

5/12/2002 6:39:00 PM

I have a form with a selectionlist control and a command button

The selectionlist is bound to a SQL query which returns a list of dates and
formatted dates ( eg. 05/12/2002, Sun 12 May ) I have set the datatextfield
and datavaluefield to the query field names and I can show either of those
in the control fine.

I have code attached to the 'SelectedIndexChanged' event and this is
triggered when I click the command button. I can't seem to read back the
chosen item in the dropdown list that is shown on the page.

My code ans = selectionlist1.selection.value reports
'System.NullReferenceException: Object reference not set to an instance of
an object.'

What am I overlooking?

Thanks
Ian


1 Answer

Ian A

5/13/2002 10:15:00 AM

0

solved it, forgot to put 'if not ispostback then/endif round my pageload
code.
Ian
"Ian A" <ian@addinsell.co.uk> wrote in message
news:upF7fOd#BHA.2524@tkmsftngp05...
> I have a form with a selectionlist control and a command button
>
> The selectionlist is bound to a SQL query which returns a list of dates
and
> formatted dates ( eg. 05/12/2002, Sun 12 May ) I have set the
datatextfield
> and datavaluefield to the query field names and I can show either of
those
> in the control fine.
>
> I have code attached to the 'SelectedIndexChanged' event and this is
> triggered when I click the command button. I can't seem to read back the
> chosen item in the dropdown list that is shown on the page.
>
> My code ans = selectionlist1.selection.value reports
> 'System.NullReferenceException: Object reference not set to an instance of
> an object.'
>
> What am I overlooking?
>
> Thanks
> Ian
>
>