Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Inline C#: Mark with Attribute

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fao, Sean - 16 Oct 2007 03:53 GMT
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,

Signature

Sean

Rory Becker - 16 Oct 2007 08:11 GMT
> 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
[quoted text clipped - 3 lines]
> 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?

--
Rory
bruce barker - 16 Oct 2007 16:49 GMT
just like code behind.

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

-- bruce (sqlwork.com)

> 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
[quoted text clipped - 4 lines]
>
> Thank you in advance,

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.