473,394 Members | 1,567 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,394 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 2114
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....
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.