473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

passing Guid values from C# object to ASP classic?

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
2 3190
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: BigDadyWeaver | last post by:
I am using the following code in asp to define a unique and unpredictable record ID in Access. <% 'GENERATE UNIQUE ID Function genguid() Dim Guid guid =...
0
by: jason | last post by:
I have the following code in a C# class library method: // GUID VERSION Guid gUserID = new Guid(sUserID); Guid gAuthorityID = new Guid(AuthorityID); oCommand.Parameters.Append(...
3
by: Mark | last post by:
Hi From what I understand, you can pass arrays from classic ASP to .NET using interop, but you have to change the type of the.NET parameter to object. This seems to be because classic ASP passes...
5
by: rcolby | last post by:
Evening, Wondering if someone can point me in the right direction, on how I would compare a system.guid with a system.byte. system.guid (pulled from sql server table with a data type of...
3
by: Wayne Wengert | last post by:
Using VSNET2005. I want to insert some rows into a table. Each row has 2 columns, "memberid" which is a GUID and "Interests" which is a varchar. I created a SQLDataSource with the values to insert...
4
by: simon | last post by:
hi, I would like to separate my javascript completely from my xhtml. in the end there should be only <script type="text/javascript" src="javalib.js"></script> in the head-tag to my javascript....
5
by: stjulian | last post by:
IN IIS 6.0, classic .asp I have been creating new GUID's through this block of code set typ = server.createobject("Scriptlet.TypeLib") guid = TRIM(MID(cstr(typ.GUID),2,36))...
4
by: Marc | last post by:
Hi, I don't get it I cannot get this to work, can somebody give me a hint Table1 contains a field Id which is a GUID as primary key and DATA a string, I want to insert a new row but it does not...
0
skeptics
by: skeptics | last post by:
Trying to pass a SafeArray that i get form Request.BinaryRead Method in classic asp to a c# com interop component. In this thread i found a solution to pass and cast a normal asp safearray in to a c#...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.