System.Text.StringBuilder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using some code off the web that requires a string builder in a script
within a web page.

In order to get the script to work I need to include the relevant library in
the references section in the project.

However, if I include the System library, the application does not work. In
the help files the string builder class is meant to be in system.text but it
aint!!

What library should I include so that string builder is available

Thanks in advance
 
Cor et al,

It's actually my problem. Hp started this thread for me.

What I want to do is use the methodology provided in the following tutorial:
http://www.charon.co.uk/content.aspx?CategoryID=28&ArticleID=53 in order to
render compliant XHTML.

I've compiled the Components class, and added the ?serverside? script to my
webpage aspx file in Visual Studio. However, when I run Build I get the
following:

Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'StringWriter'
could not be found (are you missing a using directive or an assembly
reference?)

Source Error:

Line 17: {
Line 18: StringBuilder stringBuilder = new StringBuilder();
Line 19: StringWriter stringWriter = new StringWriter(stringBuilder);
Line 20: HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
Line 21: base.Render(htmlWriter);


Source File: http://localhost/EmployeeInfo2/EmployeeForm.aspx Line: 19

Thanks for your help,
Cormy
 
Cormy,

Can you add this in top of your page
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.IO" %>

I took the next error as well the rest you may do yourself.

I hope this helps?

Cor
 
Back
Top