By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,773 Members | 1,778 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,773 IT Pros & Developers. It's quick & easy.

passing Guid values from C# object to ASP classic?

P: n/a
Hello everyone,

I have a C# object library which encapsulates data. Data is keyed by
way of Guid values, which are stored in the objects as read-only Guid
properties.

However, we have a Classic ASP application that has to read these Guid
values, and sometimes pass them back into the the object libraries (for
LoadByID type functions).

The library itself works through COM Interop just fine, but how do you
recommend I pass the Guid value back and forth? Can the ASP Classic
instantiate a COM object that will hold a .NET Guid?

One thing I've tried is using the .ToString method to get it out to the
ASP app, but if the ASP passes a string back into the object library,
how do I assign the value of the Guid from a string? I haven't seen any
methods to suggest that is possible.

Thanks for any help,

Jason

Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jason,

The constructor of the Guid structure takes a string (in a specified
format) which can initialize the Guid with the value.

Passing a string here is the better solution (although I don't like it),
since ASP isn't going to be able to access the structures in .NET (it is all
late bound, and I don't believe you can access structures in late bound
environments).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"jason" <ia****@yahoo.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Hello everyone,

I have a C# object library which encapsulates data. Data is keyed by
way of Guid values, which are stored in the objects as read-only Guid
properties.

However, we have a Classic ASP application that has to read these Guid
values, and sometimes pass them back into the the object libraries (for
LoadByID type functions).

The library itself works through COM Interop just fine, but how do you
recommend I pass the Guid value back and forth? Can the ASP Classic
instantiate a COM object that will hold a .NET Guid?

One thing I've tried is using the .ToString method to get it out to the
ASP app, but if the ASP passes a string back into the object library,
how do I assign the value of the Guid from a string? I haven't seen any
methods to suggest that is possible.

Thanks for any help,

Jason

Nov 17 '05 #2

P: n/a
indeed, i just noticed the string constructor of the Guid. thanks so
much for responding!

this is going to be such a pain in the ass. i can't wait until the ASP
Classic goes away. i'm going to have to make special ASP Classic
versions of all the Guid properties now, that get and set to and from
strings. wee, fun :)

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.