having an issue with iis5 when I move code from iis6

G

Guest

Ok, I have the below function in my web app.

public void advalue_set_tbs_m (DirectoryEntry ad_user, string field, TextBox
tb)

{ //adds value to AD if value is > 0, if not, sets it to null

if (tb.Text.Length > 0)
{
ad_user.Properties[field].Clear();
ad_user.Properties[field].Add(tb.Text);
}
else
{
ad_user.Properties[field].Clear();
}
}

It works fine on my IIS 6 web server. I upgraded my IIS5 server to ASP.Net,
then moved the app over.

I am now getting the below error

System.InvalidOperationException: Operation is not valid due to the current
state of the object

on this line

ad_user.Properties[field].Add(tb.Text);

anyone have any idea whats going on ??

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,042
Latest member
icassiem

Latest Threads

Top