473,216 Members | 1,937 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,216 software developers and data experts.

How to create a multi-dimensioned array in conventional ASP Javascript so that C# interop function can read it?

I am trying to create multi-dimensioned arrays in conventional ASP pages and
pass these arrays as arguments to functions that are in a C# interop
assembly. ASP complains because it doesn't recognize that the created array
is the same as the declared interface argument.

The C# function is expecting to receive a 2 dimensioned array and is
declared like this:
public object[] InteropFunc( string s1, object[] arValues );

What should the ASP side look like in order to call into the C# interop
function?
--
Richard Lewis Haggard
www.Haggard-And-Associates.com
Aug 3 '06 #1
5 2107
Richard,

And how are you expecting to pass that array to ASP.NET? The only way
you can do this is to set form values which will be passed on a post.

To that end, you can create a hidden field in your form which you set to
a string which you can then parse on the server side to recreate your array.

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

"Richard Lewis Haggard" <HaggardAtWorldDotStdDotComwrote in message
news:OA**************@TK2MSFTNGP02.phx.gbl...
>I am trying to create multi-dimensioned arrays in conventional ASP pages
and pass these arrays as arguments to functions that are in a C# interop
assembly. ASP complains because it doesn't recognize that the created array
is the same as the declared interface argument.

The C# function is expecting to receive a 2 dimensioned array and is
declared like this:
public object[] InteropFunc( string s1, object[] arValues );

What should the ASP side look like in order to call into the C# interop
function?
--
Richard Lewis Haggard
www.Haggard-And-Associates.com

Aug 4 '06 #2
Easiest way will be change your asp to asp.net I think.

chanmm

"Richard Lewis Haggard" <HaggardAtWorldDotStdDotComwrote in message
news:OA**************@TK2MSFTNGP02.phx.gbl...
>I am trying to create multi-dimensioned arrays in conventional ASP pages
and pass these arrays as arguments to functions that are in a C# interop
assembly. ASP complains because it doesn't recognize that the created array
is the same as the declared interface argument.

The C# function is expecting to receive a 2 dimensioned array and is
declared like this:
public object[] InteropFunc( string s1, object[] arValues );

What should the ASP side look like in order to call into the C# interop
function?
--
Richard Lewis Haggard
www.Haggard-And-Associates.com

Aug 4 '06 #3
Thank you for your response. However, you've addressed a question that was
not asked. There's not the slightest bit of trouble returning an array from
the C# interop assembly to the ASP page. After all, from the ASP point of
view, the C# assembly is a COM server. That's the point of the interop
assembly. In any case, that was not my question. My question was going the
other way. How does one format up an array from an ASP page, using either
Javascript or VBScript or a combination of the two, such that the C# interop
can receive the array argument as type object[].

--
Richard Lewis Haggard
www.Haggard-And-Associates.com
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:u5**************@TK2MSFTNGP02.phx.gbl...
Richard,

And how are you expecting to pass that array to ASP.NET? The only way
you can do this is to set form values which will be passed on a post.

To that end, you can create a hidden field in your form which you set
to a string which you can then parse on the server side to recreate your
array.

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

"Richard Lewis Haggard" <HaggardAtWorldDotStdDotComwrote in message
news:OA**************@TK2MSFTNGP02.phx.gbl...
>>I am trying to create multi-dimensioned arrays in conventional ASP pages
and pass these arrays as arguments to functions that are in a C# interop
assembly. ASP complains because it doesn't recognize that the created
array is the same as the declared interface argument.

The C# function is expecting to receive a 2 dimensioned array and is
declared like this:
public object[] InteropFunc( string s1, object[] arValues );

What should the ASP side look like in order to call into the C# interop
function?
--
Richard Lewis Haggard
www.Haggard-And-Associates.com


Aug 4 '06 #4
Thank you for your response. While that is on the schedule for sometime next
year, I need to solve this problem now or they will bring in another
consultant who can. If you have some useful ideas on how an ASP page can
format up an array, using either Javascript or VBScript or a combination of
the two, such that the C# interop can receive the array argument as type
object[] then I'd be the high grateful recipient of such wisdom.
--
Richard Lewis Haggard
www.Haggard-And-Associates.com
"chanmm" <ch*****@hotmail.comwrote in message
news:ex**************@TK2MSFTNGP04.phx.gbl...
Easiest way will be change your asp to asp.net I think.

chanmm

"Richard Lewis Haggard" <HaggardAtWorldDotStdDotComwrote in message
news:OA**************@TK2MSFTNGP02.phx.gbl...
>>I am trying to create multi-dimensioned arrays in conventional ASP pages
and pass these arrays as arguments to functions that are in a C# interop
assembly. ASP complains because it doesn't recognize that the created
array is the same as the declared interface argument.

The C# function is expecting to receive a 2 dimensioned array and is
declared like this:
public object[] InteropFunc( string s1, object[] arValues );

What should the ASP side look like in order to call into the C# interop
function?
--
Richard Lewis Haggard
www.Haggard-And-Associates.com


Aug 4 '06 #5
You weren't too specific about whether this call was being made on the
client side, or the server side. My assumption was on the client side,
hence my response.

If you are calling this from a server-side ASP.NET page, then you need
to change your interop declaration in such a way so that it matches the
number of dimensions that you are trying to pass ([,] for a two-dimensional
array, [,,] for three, etc, etc).

If this number is variable, then I believe you can declare it as Array,
but I don't know how well interop will handle that declaration.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Richard Lewis Haggard" <HaggardAtWorldDotStdDotComwrote in message
news:Og****************@TK2MSFTNGP05.phx.gbl...
Thank you for your response. However, you've addressed a question that was
not asked. There's not the slightest bit of trouble returning an array
from the C# interop assembly to the ASP page. After all, from the ASP
point of view, the C# assembly is a COM server. That's the point of the
interop assembly. In any case, that was not my question. My question was
going the other way. How does one format up an array from an ASP page,
using either Javascript or VBScript or a combination of the two, such that
the C# interop can receive the array argument as type object[].

--
Richard Lewis Haggard
www.Haggard-And-Associates.com
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote
in message news:u5**************@TK2MSFTNGP02.phx.gbl...
>Richard,

And how are you expecting to pass that array to ASP.NET? The only way
you can do this is to set form values which will be passed on a post.

To that end, you can create a hidden field in your form which you set
to a string which you can then parse on the server side to recreate your
array.

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

"Richard Lewis Haggard" <HaggardAtWorldDotStdDotComwrote in message
news:OA**************@TK2MSFTNGP02.phx.gbl...
>>>I am trying to create multi-dimensioned arrays in conventional ASP pages
and pass these arrays as arguments to functions that are in a C# interop
assembly. ASP complains because it doesn't recognize that the created
array is the same as the declared interface argument.

The C# function is expecting to receive a 2 dimensioned array and is
declared like this:
public object[] InteropFunc( string s1, object[] arValues );

What should the ASP side look like in order to call into the C# interop
function?
--
Richard Lewis Haggard
www.Haggard-And-Associates.com



Aug 5 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Grahammer | last post by:
Is it possible to create a multi element property in VB.Net? Something similar to the "Location" or "Size" property. Each of these has two elements. I'm trying to create an IMAGE property that...
0
by: Eddie | last post by:
In Microsoft Access form, combo box can be binded to the table or query and can be shown as multi column, getting a actual binded column and showing columns. I'm struggling to make a...
2
by: ME | last post by:
I need to know how to create a MULTI page report. All I can seem to create is a report with only one page, even though the datasource it is bound to returns multiple records. I have posted an...
3
by: Bob | last post by:
I need to create a program that is essentially a special fax sender using multi line Dialogic cards. I figure that the best way to do this so that it can be used from any app is to create someting...
2
by: news.sbcglobal.net | last post by:
Here's my problem: I'm developing an ASP.NET 2.0 application that has a user select one or more auto manufacturers from a listbox ("lstMakes"). Once they do this, another listbox ("lstModels")...
2
by: cpressley2 | last post by:
Hi, On a multi-partition instance, can you create a database on a single parition? How??? The db architects want to use one instance for four databases where only one is big enough for a...
2
by: BillE | last post by:
I need to create a multi-line label dynamically. Since labels aren't multi-line, I'm creating a textbox and making it look like a label with the multiline property set to true. I want to...
4
by: Laurence | last post by:
Hi folks, Who knows how to create multi-location/global views? Could you show me some examples? Thanks in advance, Laurence
0
by: Chris Chin | last post by:
I observed from Registry (HKLM:\SYSTEM\CurrentControlSet\Services\<category>\Performance) and Reflector that a multi-instance performance category has IsMultiInstance=1 attribute in the registry. So...
1
by: jimjack145 | last post by:
Hi All, I have one form with two multi select list box. I want to create query when user select value from it and click for result page. However i search on net but not find any code example....
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.