Yes I understand.
 
Here's what I have:
 
Dim titleprefix as string
titleprefix = CheckNulls(Rdr("Title")).ToString()
titleddl.SelectedIndex = 
titleddl.Items.IndexOf(titleddl.Items.FindByText(titleprefix))

response.write(titleprefix) 
 
Now I know I am getting the titleprefix from the database, but it is not 
getting selected in the DDL.
 
Thanks.


Ali Husain <[EMAIL PROTECTED]> wrote:
Anna,



That's everyone's point.



If you have a ddl with titles, and one of them is not "MD" then its not
going to work.



dropWhatever.Items.FindByValue("MD").Selected=true



If there is no "MD" in dropWhatever it will throw an error

Also check one more thing. Make sure AutoPostback = True on the first
ddl. 



Hope that helps,



Ali



________________________________

From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Anna Leon
Sent: Friday, November 04, 2005 2:20 PM
To: [email protected]
Subject: Re: [AspNetAnyQuestionIsOk] DDL



Well I just have a DDL with titles (Mr/Mrs/Miss/Ms).  Whatever I put, I
get that error..

Peter Brunone <[EMAIL PROTECTED]> wrote:My guess is that you don't
have an item of value "MD" in your list.

On 11/4/05, Anna Leon <[EMAIL PROTECTED]> wrote:
>
> When I use this:
>
> dropWhatever.Items.FindByValue("MD").Selected=true
>
> I get an error: "Object reference not set to an instance of an
object."
>
> Please advise. Thanks.
>
>
> [EMAIL PROTECTED] wrote:
> http://www.learnasp.com/freebook/learn/dropdownlistcoremethods.aspx
> shows you exact syntax.
>
> On 10/30/05, sas0riza <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > I need to populate/fill a DDL with the selecteditem from database.
> >
> > e.g. My DDL = MR/MRS/MISS/MS
> >
> > The selecteditem from the database is MISS, the DDL should select
MISS
> > (which is the third item), but instead, MISS replaces the first item
of
> > the DDL. So, it would look like MISS/MRS/MISS/MS.
>


[Non-text portions of this message have been removed]



---------------------------------
YAHOO! GROUPS LINKS 


    Visit your group "AspNetAnyQuestionIsOk" on the web.
  
    To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
  
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



---------------------------------




            
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.  

[Non-text portions of this message have been removed]




________________________________

YAHOO! GROUPS LINKS 



*      Visit your group "AspNetAnyQuestionIsOk
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
        
*      To unsubscribe from this group, send an email to:
      [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]
cribe> 
        
*      Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> . 



________________________________



[Non-text portions of this message have been removed]



---------------------------------
YAHOO! GROUPS LINKS 


    Visit your group "AspNetAnyQuestionIsOk" on the web.
  
    To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
  
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


---------------------------------



                
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to