Hashtable items = getMenuItems(sender, e);
dao.buildLogandDropDownView(items);
raft_IDList.DataSource = dao.getRaftIDView();
raft_IDList.DataTextField = "RaftID";
raft_IDList.DataValueField = "RaftID";
raft_IDList.DataBind();
raft_IDList.Items.Insert(0, new ListItem("",""));
Logger lg = new Logger();
IEnumerator en = items.Values.GetEnumerator();
while(en.MoveNext()){
lg.writeLog("C://", "LOGS.txt","Value: " + en.Current.ToString());
lg.writeLog("C://", "LOGS.txt","Value2: " + (String)items["jobid"]);
lg.writeLog("C://", "LOGS.txt","Value3: " +
raft_IDList.Items.FindByValue((String)items["jobid"]).Value);
}
my logger outputs
Value: ICC1
Value2: ICC1
And blows up on the Value 3 with this Error:
reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.
Now the raft_IDList displays the ICC1 in its list so why can't I find it to
make it selected?
Travis D. Falls |Consultant, Raft.Net IT | 860.547.4070 |
[EMAIL PROTECTED]
-----Original Message-----
From: Dean Fiala [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 28, 2004 4:38 PM
To: [EMAIL PROTECTED]
Subject: Re: [AspNetAnyQuestionIsOk] DropDown List Control selected
The problem is there is no item with a key value of "jobid".
so this
items["jobid"]
returns no value
you need to put in the actual jobid value as the key to get your
selection out of the hashtable
string jobid = "13"
items[jobid]
HTH
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
Yahoo! Groups Links
This communication, including attachments, is for the exclusive use of
addressee and may contain proprietary, confidential or privileged
information. If you are not the intended recipient, any use, copying,
disclosure, dissemination or distribution is strictly prohibited. If
you are not the intended recipient, please notify the sender
immediately by return email and delete this communication and destroy all copies.
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/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/