Re: Convert.FromBase64String() and ViewState
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Wed, 01 Apr 2009 16:07:57 -0700
On Wed, 01 Apr 2009 15:13:48 -0700, <frankswildyearstom@xxxxxxxxx> wrote:
[...]
Not really – I realize out of ten Asp.Net related threads I may post
here, only one will get answered,
That's a pretty poor signal-to-noise ratio, and strongly suggests you're misusing the forum.
but at least that one question will
get answered completely, since sometimes it takes four or more replies
for me to finally understand the subject at hand. Here people helping
tend to “persist”, while on other forums that is not the case most of
the time.
I appreciate that you find people in this forum more helpful than the more appropriate one. And it's great that in spite of those people having to go outside their areas of expertise, you're still able to get useful answers. But, you should continue to be mindful that you are in fact in the wrong forum for these questions.
If you simply insist on continuing to use a non-ASP.NET forum for ASP.NET questions, you would likely be able to get answers more quickly if you would accommodate that fact, by presenting the questions in a less domain-specific way. That is, abstract out the aspects of the question that don't really pertain to ASP.NET, and come up with a way to ask the question that is more generally understandable.
There's no requirement that you do that, of course. But I think you'll find you get better answer, and faster answers, if you do some legwork yourself up-front.
[...]> Q2 - Since String represents a set of Unicode characters, I assume“ABCDEF” isn’t serialized as either UTF-8 or UTF-16, but as Base64
> that in the above example when “ABCDEF” is deserialized from the
> viewstate, each character in “ABCDEF” string is represented with two
> elements of a ‘stringBytes’ array?
That all depends on how the data is serialized in the first place. If the
string "ABCDEF" is serialized as UTF-16, then yes...you get two bytes for
each character in the deserialized output. If it's serialized as UTF-8,
then that particular string will get you only one byte for each character
(but could have two or more bytes for other characters).
encoding.
No, that's not correct. Base64 encodes _bytes_, not characters. If your data is characters to start with, then they MUST be converted to some byte representation via some encoding, such as UTF-16, UTF-8, etc.
Likewise, at the other end, if you want characters back, you have to know what that character encoding was, and use it to convert the bytes you've gotten back from the Base64 representation into the original characters.
Given the context, it's certainly possible that this encoding is being done on your behalf. But then, I'm surprised ASP.NET wouldn't have a way to also unpack the data on your behalf as well. In either case, it's important to understand what these various encodings can and cannot do. And Base64 doesn't encode characters.
> Q3 - Is forms data, thus TextBox1.Text also saved in viewstate – I’m
> asking this cos I don’t see a point in saving tha data since form will
> save it automatically on postbacks.Are fields that are saved by
> postback form automatically not included in viewstate
You keep mentioning this "viewstate". If this is a standard part of
ASP.NET, then this illustrates why you should post your question in a more
appropriate forum. If it's not, then you should be more specific about what "viewstate" is and how it gets initialized and used.
ViewState is Asp.Net specific
Then as I said, you should be more specific about what it is and how it gets initialized and used. This is part of abstracting out the domain-specific elements, so that your question is understandable by people not familiar with ASP.NET.
The fact is, as long as you're going to post your question in a forum not specific to ASP.NET, you need to do your best to present the question in a way that isn't dependent on knowledge about ASP.NET.
Pete
.
- References:
- Convert.FromBase64String() and ViewState
- From: frankswildyearstom
- Re: Convert.FromBase64String() and ViewState
- From: Peter Duniho
- Re: Convert.FromBase64String() and ViewState
- From: frankswildyearstom
- Convert.FromBase64String() and ViewState
- Prev by Date: Re: Controling ShowDialog()
- Next by Date: Re: Controling ShowDialog()
- Previous by thread: Re: Convert.FromBase64String() and ViewState
- Next by thread: Re: Convert.FromBase64String() and ViewState
- Index(es):
Relevant Pages
|