Inline C#: Mark with Attribute

F

Fao, Sean

I have to do inline C# (please don't ask why!) and I need to decorate
one of the classes with the [Serializable] attribute. Normally I would
just add this to the top of my class, but how do I do this inline?

I've done so quick searches and haven't come up with anything (kind of a
hard thing to search for).

Thank you in advance,
 
R

Rory Becker

I have to do inline C# (please don't ask why!) and I need to decorate
one of the classes with the [Serializable] attribute. Normally I
would just add this to the top of my class, but how do I do this
inline?

I've done so quick searches and haven't come up with anything (kind of
a hard thing to search for).

Not sure... I think I would mark the codebehind class which the runtime generated
page class inherits from.

(see me using my new found knowledge Juan :) )

This would only work for Attributes which are inheritable (erm... attribute
themselves to the descendents of the class they mark)

Does this help?
 
B

bruce barker

just like code behind.

<script runat=server>
[Serializabe]
public myClass
{
}
</script>

-- bruce (sqlwork.com)
 

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
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top