ASP.NET - Write File content to a rich text box

Asked By Hema Moss
06-Sep-10 02:17 AM
Hi All,

    I have a requirement to read the file content and write it to a Rich textbox.

    I have tried converting byte[] to String by all Encodings(for ex: ASCII, UTF7,UTF8) but couldn't accomplish the task.

   Can anyone guide me with this issue...?
 
  Peter Bromberg replied to Hema Moss
06-Sep-10 06:08 PM
Generally a RichTextBox control has two properties, RTF and Text.

RTF expects correctly formatted Rich Text which includes all the special RTF markup codes.
The Text property expects plain text without formatting codes.

If you are reading from a text file and it does not include RTF markup, then you have no choice but to assign your "stuff" to the Text property.
Create New Account
help
during building Asp.net 1.1 application show error i Friends, when i build asp.net 1.1 web application show the following error on output window. Rebuild All started: Project Pre-build validation for project 'Finalodc_24July' completed - -- -- - > - -- -- - Rebuild All started: Project: Finalodc_24July, Configuration: Release - -- -- - > > Building file 'C: \ Inetpub \ wwwroot \ OverDCounter \ Finalodc_24July \ Release \ Finalodc_24July.msi'. . . > ERROR: Unable to build folder named 'images ERROR: Unable to build folder named 'common' > ERROR: Unable to build folder named 'common' > Packaging file 'account.aspx.cs'. . . > Packaging file 'toolbar.start.gif'. . . > Packaging file 'box_bg_top1.gif'. . . > Packaging file 'fck_docprops.html'. . . > Packaging file 'update_icn.gif'. . . > Packaging file 'radajax.dll'. . . > Packaging
search-Full / / New Property if (RadioButtonList1.SelectedIndex = = 1 && DropDownList3_category.SelectedItem.Text = = "All" && DropDownList1_categorytype.SelectedItem.Text = = "All" && DropDownList_state.SelectedItem.Text = = "All" && DropDownList_city.SelectedItem.Text = = "All" && CheckBoxList1.SelectedIndex = = -1) { cmd = new SqlCommand ( "select a.img, a.prop_name, b.state_name, c ownership_id = d.prop_ownership and prop_type = 'New Property'" , con); } else if (RadioButtonList1.SelectedIndex = = 1 && DropDownList3_category.SelectedItem.Text = = "All" && DropDownList1_categorytype.SelectedItem.Text = = "All" && DropDownList_state.SelectedItem.Text = = "All" && DropDownList_city.SelectedItem.Text = = "All" && CheckBoxList1.Items[0].Selected = = true && CheckBoxList1.Items[1].Selected = = false && CheckBoxList1.Items[2].Selected
search / / Any if (RadioButtonList1.SelectedIndex = = 0 && DropDownList3_category.SelectedItem.Text = = "All" && DropDownList1_categorytype.SelectedItem.Text = = "All" && DropDownList_state.SelectedItem.Text = = "All" && DropDownList_city.SelectedItem.Text = = "All" && CheckBoxList1.SelectedIndex = = -1) { cmd = new SqlCommand ( "select a.img, a.prop_name, b.state_name, c d.prop_name and e.ownership_id = d.prop_ownership" , con); } else if (RadioButtonList1.SelectedIndex = = 0 && DropDownList3_category.SelectedItem.Text = = "All" && DropDownList1_categorytype.SelectedItem.Text = = "All" && DropDownList_state.SelectedItem.Text = = "All" && DropDownList_city.SelectedItem.Text = = "All" && CheckBoxList1.Items[0].Selected = = true && CheckBoxList1.Items[1].Selected = = false && CheckBoxList1.Items[2].Selected
Net hi friends Any one send frequently asked Important questions in C# .Net, ADO .Net, Asp .Net and Sql Server. . . . . . . . tx in Advance. . . . . . Hi, Find this. . (B)What is an IL? (B implementation to Remoting Client? (A) What are LeaseTime, SponsorshipTime, RenewonCallTime and LeaseManagerPollTime? (A) Which config file has all the supported channels / protocol? (A) How can you specify remoting parameters using Config the different phase / steps of acquiring a proxy object in Web service? (B) What is file extension of Web services? (B) Which attribute is used in order that the method can dependencies in cache and types of dependencies? (A)Can you show a simple code showing file dependency in cache? (A) What is Cache Callback in Cache? (A) What is scavenging? (B) What are different types of caching using cache object of ASP.NET? (B) How can you cache different version of same page using ASP.NET cache object? (A) How will implement Page Fragment Caching? (B) Can you compare ASP
in Sql server as var_name int How do you separate business logic while creating an ASP.NET application? There are two level of asp.net debugging 1. Page level debugging For this we have to edit the page level debugging debugging in the application level for this Edit the following trace value in web.config file Enable trace enabled = true. If there is a calendar control to be included in each The control itself will take care of the date display How can you deploy an asp.net application ? You can deploy an ASP.NET Web application using any one of the following three deployment options. a) Deployment using