Possible to pass a struct from asp.net CodeBehind Page into a component method?

I

int

I have a code behind page that uses a struct that's declared inside of it in
order to pass information between the methods that are also defined inside
the code behind page.

However, I want to pass this struct by reference into a separate component's
method.

Is this possible? will I have to define the same struct inside the
components class? I have tried doing it several ways but no success..not
even sure it's possible as the compiler complains as not finding where the
struct is defined, initialized, etc...
 
G

Guest

You will need to define the type in the component or in a namespace that is included in the component class. Then create a property for your component, then where you instantiate it.

I am not sure about being able to send with a reference, unless you find a way to create an object of the component that is accessable after calling it
hth
Reza
 
N

Nicholas Paldino [.NET/C# MVP]

int,

If you want the other components to be able to use the structure, then
you should define it in a separate assembly. Then, reference this assembly
from both assemblies (the ASP.NET page) and the component.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top