Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trimming blanks from a Parameter
Message
From
23/06/2010 14:38:08
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01470305
Message ID:
01470339
Views:
38
>>>>
>>>>thanks, but no, clientType is never null.
>>>
>>>Assuming clientType isn't null, something else in that code is failing (probably because of a null).
>>
>>Thanks again (and Mike too).
>>
>>In the meantime I had changed the code to this:
>>
>>
        private void SetClientTypeDisplay(string clientType)
>>        {
>>            this.pnlCompany.Visible = (clientType.Trim() == "Company");
>>
>>
>>and that works, so I guess I'll never work out what the problem was (unless I get a chance to put it back to the original and step through it).
>
>Whatever the problem was I'm afraid that change in code won't fix it - it will still be waiting to bite you....
>If the error occurred in the snippet you posted then either clientType or pnlCompany was null when it raised the exception....

Yes, I agree. I was surprised the change worked as it is essentially the same thing as the original code. But, neither of those should ever be null as I check before calling this code, so...
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Reply
Map
View

Click here to load this message in the networking platform