I use a process in which I first only load the first three "generations" of the treeview. Then in the BeforeExpand event, I populate that node's grandchildren. Therefore, any time the user sees a node, it always shows its expand icon (the [+]) if it has children.
The problem I have is that the page I receive comes back with encoding that doesn't show up correctly in a text box. For example a single quote ’ comes back as & # 8 2 1 7 ; (without the spaces). I think that this would be correctly displayed in a HTML viewer, but how do I get it to display correctly in a text box?
Putting an encoding in the constructor for the StreamReader seems to make no difference.
using System.Text;<br />
using System.Net;<br />
WebClient request = new WebClient();<br />
string PageText = Encoding.Default.GetString(request.DownloadData(Page));<br />
// You can change Encoding.Default to Encoding.UTF8 if needed<br />
What language is your web page/web server? You may try to change Encoding.Unicode to other encoding like UTF8, and Encoding.ASCII to UTF8 if you're still getting wrong results. I'm using the default encoding to read web pages in english/portuguese, and the results are ok for me.
I have a standard C# Class-library Project and want it to behave like the SQl-Connection User Control. Means you can drag it from the toolbox on a form and it docks underneath the forms designer.
Does anybody know how to achieve this?
I am pretty new to C# and the .NET fromework for that matter. I have recently began working on a Binary Tree class and would like to be able to store any type a user wants to store (i.e. Object). I would like to hide the implementation of this class from the user, however I am having trouble discerning what type the data is that is being stored in this class. I would like to be able to do some sort of "dyanmic cast" on the data and call the appropriate CompareTo() method. I would like to not have to always test on the type of the data and then cast the data to that specific type.