Re: Convert.FromBase64String() and ViewState

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
> 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).

“ABCDEF” isn’t serialized as either UTF-8 or UTF-16, but as Base64
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
.



Relevant Pages

  • Re: Line widths in postings, usenet vs. bulletin boards (forums)
    ... of options of the text editor used in this forum. ... Each user, however, reads, posts, and edits using specific software ... Usenet peering servers may have some limit, but you might never hit it. ... other than 512 characters for protocol command lines. ...
    (comp.sys.hp48)
  • Re: Unicode question
    ... the right forum would be ... text for characters from these langauges and assume right-to-left ... alignment under certain conditions. ... scripts" - while the alignment is RTL, ...
    (borland.public.delphi.non-technical)
  • Re: Forms Forum for Forms Problem
    ... > posting to the wrong Forum, so, my question is, whch is the best Forum to ... > formatted as numeric, 10 characters, number format "0". ... > form and store it as a template. ...
    (microsoft.public.word.docmanagement)
  • Re: Ravi Shankar Chowdhury
    ... opposed to far-away characters) being assumed, ... father, but about *your* music. ... perhaps the former *is* too much to ask on this forum. ... you find indecorous or insufficiently respectful of Panditji? ...
    (rec.music.indian.classical)
  • php-fusion 4.x vuln
    ... ('binary' encoding is not supported, ... TheGreatOne2176, Reapercore ... I have a found an error in php-fusion 4.x where you can view any thread on the forum. ...
    (Bugtraq)