Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Finding if an value exists in a DD list

Reply
Thread Tools

Finding if an value exists in a DD list

 
 
Stu
Guest
Posts: n/a
 
      05-20-2004
Hi,

I have a web form that uses simple binding to bind properties to the
controls on the page. However, if I try and bind a value to a dd list using:

SelectedValue="<%# MyProperty %>"

If the value doesn't exist it throws and error: Object reference not set to
an instance of an object.
Is there any way to test if a value exists in a DD list (preferably without
looping through each item individually)?

Thanks in advance,

Stu


 
Reply With Quote
 
 
 
 
Elliot M. Rodriguez, MCSD
Guest
Posts: n/a
 
      05-20-2004
Stu:

You shoudl wrap the binding code in a try catch block.


"Stu" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I have a web form that uses simple binding to bind properties to the
> controls on the page. However, if I try and bind a value to a dd list

using:
>
> SelectedValue="<%# MyProperty %>"
>
> If the value doesn't exist it throws and error: Object reference not set

to
> an instance of an object.
> Is there any way to test if a value exists in a DD list (preferably

without
> looping through each item individually)?
>
> Thanks in advance,
>
> Stu
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check if a directory exists? folder.exists() does not work! Ulf Meinhardt Java 8 08-28-2009 12:26 PM
Dropdown List - Check if value exists in list prior to selection =?Utf-8?B?QnJlbmRlbiBCaXhsZXI=?= ASP .Net 5 03-20-2007 11:05 PM
Finding out if a folder exists christopher_board@yahoo.co.uk Java 2 02-05-2007 06:07 PM
finding if file exists or not in apache webdav server and if exists what is the mime type of it.... Totan Java 0 04-17-2006 05:13 AM
Finding if a certain form elements exists... Stu ASP .Net 4 08-19-2003 01:10 PM



Advertisments