S
Sky Sigal
I guess my question is:
"Even if all the docs talk about making CompositeControls that serialize their multiple Style
objects into the ViewState object -- is there any reason that you can think of? Or can I safely get
rid of it?"
Let me explain:
It just sort of struck me 10 minutes ago that it might be time for me to requestion/confirm
something that I have been taking for granted -- but maybe I shouldn't..?
The question is: Why are we ViewStating/Serializing/Sending Style objects and round tripping them to
the client ? I know that sounds like a dumb question ...and frankly
I wouldn't care that much for the lost bandwidth for most of my controls -- but the one I am working
on currently has 5 or 6 views -- each with 5 or 6 Styles that could be used.
Serializing that whole thing is ...potentially huge.
And for what gain?
Consider a simple control
<CC:SomeControl style='border:solid 1px red;color:BLUE;font-family:Verdana;' Text=""/>
Assuming that somwhere on th page a button is clicked that we then decide to set the control's text
color to RED....Well...according to the net documentation I have I would be serializing the whole
Style--and sending it to the client just to track that.
Whereas
Render(){
if (ViewState["Clicked"]!=null){
MyControl.ForeColor=Color.Red;
}
}
would have done the same thing without sending all that weight to the client.
What's your opinion?
"Even if all the docs talk about making CompositeControls that serialize their multiple Style
objects into the ViewState object -- is there any reason that you can think of? Or can I safely get
rid of it?"
Let me explain:
It just sort of struck me 10 minutes ago that it might be time for me to requestion/confirm
something that I have been taking for granted -- but maybe I shouldn't..?
The question is: Why are we ViewStating/Serializing/Sending Style objects and round tripping them to
the client ? I know that sounds like a dumb question ...and frankly
I wouldn't care that much for the lost bandwidth for most of my controls -- but the one I am working
on currently has 5 or 6 views -- each with 5 or 6 Styles that could be used.
Serializing that whole thing is ...potentially huge.
And for what gain?
Consider a simple control
<CC:SomeControl style='border:solid 1px red;color:BLUE;font-family:Verdana;' Text=""/>
Assuming that somwhere on th page a button is clicked that we then decide to set the control's text
color to RED....Well...according to the net documentation I have I would be serializing the whole
Style--and sending it to the client just to track that.
Whereas
Render(){
if (ViewState["Clicked"]!=null){
MyControl.ForeColor=Color.Red;
}
}
would have done the same thing without sending all that weight to the client.
What's your opinion?