Thursday, March 29, 2012
Separating application logic and content from its presentation
I am about to develop a simple Content Management system – main purpose
would be posting articles. I am trying to find some ideas/ sample
architecture showing how to separate application logic and content from its
presentation. I would like to use some kind of predefined templates (only
developer can cerate new templates); each template would be composed of
certain controls and in would have some specific layout. The default.aspx
would be created dynamically based on the template specified.
I checked out DotNetNuke and Community Starter Kit
(http://asp.net/Default.aspx?tabindex=8&tabid=47). They are very good, but
too complex for my need.
Any hints would be greatly appreciated,
GregJust create the different modules (news, links, events, etc) and make sure t
o
use styles for all the different visual items. Then its really just a matter
of using different CSS files. You only have to specify which CSS to use then
.
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
"Greg" wrote:
> Hi,
> I am about to develop a simple Content Management system – main purpose
> would be posting articles. I am trying to find some ideas/ sample
> architecture showing how to separate application logic and content from it
s
> presentation. I would like to use some kind of predefined templates (only
> developer can cerate new templates); each template would be composed of
> certain controls and in would have some specific layout. The default.aspx
> would be created dynamically based on the template specified.
>
> I checked out DotNetNuke and Community Starter Kit
> (http://asp.net/Default.aspx?tabindex=8&tabid=47). They are very good, but
> too complex for my need.
> Any hints would be greatly appreciated,
> Greg
>
Separating application logic and content from its presentation
I am about to develop a simple Content Management system – main purpose
would be posting articles. I am trying to find some ideas/ sample
architecture showing how to separate application logic and content from its
presentation. I would like to use some kind of predefined templates (only
developer can cerate new templates); each template would be composed of
certain controls and in would have some specific layout. The default.aspx
would be created dynamically based on the template specified.
I checked out DotNetNuke and Community Starter Kit
(http://asp.net/Default.aspx?tabindex=8&tabid=47). They are very good, but
too complex for my need.
Any hints would be greatly appreciated,
GregJust create the different modules (news, links, events, etc) and make sure to
use styles for all the different visual items. Then its really just a matter
of using different CSS files. You only have to specify which CSS to use then.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
"Greg" wrote:
> Hi,
> I am about to develop a simple Content Management system – main purpose
> would be posting articles. I am trying to find some ideas/ sample
> architecture showing how to separate application logic and content from its
> presentation. I would like to use some kind of predefined templates (only
> developer can cerate new templates); each template would be composed of
> certain controls and in would have some specific layout. The default.aspx
> would be created dynamically based on the template specified.
>
> I checked out DotNetNuke and Community Starter Kit
> (http://asp.net/Default.aspx?tabindex=8&tabid=47). They are very good, but
> too complex for my need.
> Any hints would be greatly appreciated,
> Greg
Thursday, March 22, 2012
Serializng objects for SQL State management
I am trying to migrate my site from In-proc state management to out-of-proc
SQL state management.
I am having problems with the serialization of my classes.
I have added the [Serializable] attribute to the classes, which works, but
some of the classes' objects (XmlDocument is one example), are causing
errors:
"[SerializationException: The type System.Xml.XmlDocument in Assembly
System.Xml, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 is not marked as serializable.]"
Is there a quick way around this? Perhaps creating a derived class from
XmlDocument that is marked as serializable, or is there another attribute or
solution that I am missing?
Thanks for your help,
- gskIf a class isn't serializable, than any classes that derive from it wouldn't
be serializable.
What you could do, though is expose a property for your XmlDocument but have
the document itself strored as a string within the provate variable, so in
your get/set you instantiate an XmlDocument, load it with the string and
then return it to the user.
The problem, though, would be that the string would be passed by value, so
if a process just got the document and modified it, that procedd would have
to re-set the property for the private variable to get the changes.
Another option...
DataSets are serializable, so if your document id structured in a way that
loading it into a dataset wouldn be too strange, that might be a good way of
handling it
"GSK" <gsk@.NiOcSaP.nAeMt> wrote in message
news:uhZriNoOEHA.3300@.TK2MSFTNGP09.phx.gbl...
> Hello all,
> I am trying to migrate my site from In-proc state management to
out-of-proc
> SQL state management.
> I am having problems with the serialization of my classes.
> I have added the [Serializable] attribute to the classes, which works, but
> some of the classes' objects (XmlDocument is one example), are causing
> errors:
> "[SerializationException: The type System.Xml.XmlDocument in Assembly
> System.Xml, Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089 is not marked as serializable.]"
> Is there a quick way around this? Perhaps creating a derived class from
> XmlDocument that is marked as serializable, or is there another attribute
or
> solution that I am missing?
> Thanks for your help,
> - gsk
Serializng objects for SQL State management
containing the XML.
That should Serialize fine.
Hth,
Phil Winstanley
Microsoft ASP.NET MVPThanks guys,
As I already had a method for returning the OuterXml of the XmlDocument,
saving that value in session, then subsequently re-creating my object using
the string as an input parameter has done the trick.
Thanks for the advice!
- gsk.
"Phil Winstanley [Microsoft MVP]" <phil@.winstanley.name> wrote in message
news:c85a58$obm@.odah37.prod.google.com...
> Or another option is to just output the XML Document as a string
> containing the XML.
> That should Serialize fine.
> Hth,
> Phil Winstanley
> Microsoft ASP.NET MVP
Serializng objects for SQL State management
I am trying to migrate my site from In-proc state management to out-of-proc
SQL state management.
I am having problems with the serialization of my classes.
I have added the [Serializable] attribute to the classes, which works, b
ut
some of the classes' objects (XmlDocument is one example), are causing
errors:
"[SerializationException: The type System.Xml.XmlDocument in Assembly
System.Xml, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 is not marked as serializable.]"
Is there a quick way around this? Perhaps creating a derived class from
XmlDocument that is marked as serializable, or is there another attribute or
solution that I am missing?
Thanks for your help,
- gskIf a class isn't serializable, than any classes that derive from it wouldn't
be serializable.
What you could do, though is expose a property for your XmlDocument but have
the document itself strored as a string within the provate variable, so in
your get/set you instantiate an XmlDocument, load it with the string and
then return it to the user.
The problem, though, would be that the string would be passed by value, so
if a process just got the document and modified it, that procedd would have
to re-set the property for the private variable to get the changes.
Another option...
DataSets are serializable, so if your document id structured in a way that
loading it into a dataset wouldn be too strange, that might be a good way of
handling it
"GSK" <gsk@.NiOcSaP.nAeMt> wrote in message
news:uhZriNoOEHA.3300@.TK2MSFTNGP09.phx.gbl...
> Hello all,
> I am trying to migrate my site from In-proc state management to
out-of-proc
> SQL state management.
> I am having problems with the serialization of my classes.
> I have added the [Serializable] attribute to the classes, which works,
but
> some of the classes' objects (XmlDocument is one example), are causing
> errors:
> "[SerializationException: The type System.Xml.XmlDocument in Assembly
> System.Xml, Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089 is not marked as serializable.]"
> Is there a quick way around this? Perhaps creating a derived class from
> XmlDocument that is marked as serializable, or is there another attribute
or
> solution that I am missing?
> Thanks for your help,
> - gsk
>
Or another option is to just output the XML Document as a string
containing the XML.
That should Serialize fine.
Hth,
Phil Winstanley
Microsoft ASP.NET MVP
Thanks guys,
As I already had a method for returning the OuterXml of the XmlDocument,
saving that value in session, then subsequently re-creating my object using
the string as an input parameter has done the trick.
Thanks for the advice!
- gsk.
"Phil Winstanley [Microsoft MVP]" <phil@.winstanley.name> wrote in messag
e
news:c85a58$obm@.odah37.prod.google.com...
> Or another option is to just output the XML Document as a string
> containing the XML.
> That should Serialize fine.
> Hth,
> Phil Winstanley
> Microsoft ASP.NET MVP
>
Serious Exception
Hi,
I have a web application build in version .Net 1.1 & its successfully deployed to the server & running also.
But through my exception management library; I get following exception regularly in my inbox:
APPLICATION ERROR: Error Details:
Time of Error:10/19/2006 8:13:47 PM
Please suggest me so that I can resolve this exception. If am not wrong this occurs 'coz of ViewState Curroption. But I dont have any idea to resolve it.
Thank you
i assumetxtQuantity is a textbox.
you can get away with that error by setting validateRequest attribute of the Page directive to false:
<%@. Page validateRequest="false" %>
check this for more details..
http://www.asp.net/faq/RequestValidation.aspx
HI,
Thanks for your grt reply.
I have already added Compare validator which accepts values greaterthanequal 1 even though I am getting this error. I am not getting know what will be the possible reason for this error.
Thank you
ASP.NET has a built-in function that checks whatever is input into a form for possible injection attacks (HTML, SQL, JavaScript, etc.) If anything looks funny, it will throw this exception.
While@. Page validateRequest="false" will work, you lose the built-in protection on the whole page. Not a good security practice.
It would be better in this case is to use Validation controls to prevent the page from even posting unless valid data is entered. For example, set it up so that txtQuantity only allows digits.
What value did you input in the TextBox when you get this error?
Thanks
Hello,
The textbox has one default value as 1. And this error comes when any user using the site. I dont know about what value does he enter.............
Thanks