Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Text in a Web Application

Text in a Web Application

Scheduled Pinned Locked Moved C#
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    orentuil
    wrote on last edited by
    #1

    Hi. Does anybody know if it is possible to write programatically a text in a web application page with functionnalities like "newline", "tab", "center text",... In fact: organise a text programatically before putting it in a web page. Thanks, Oren :doh:

    P B 4 Replies Last reply
    0
    • O orentuil

      Hi. Does anybody know if it is possible to write programatically a text in a web application page with functionnalities like "newline", "tab", "center text",... In fact: organise a text programatically before putting it in a web page. Thanks, Oren :doh:

      P Offline
      P Offline
      peshawarcoder
      wrote on last edited by
      #2

      You can write text and format it with normal html controls. Then u can add this to one of the block-level element(

      ,

      etc). Example: 1. Type the following script in notepad and save it in wwwroot folder with name such as "Test1.aspx" 2. Open Internet Explorer and the type URL: http://localhost/Test1.aspx

      Sub Page\_Load(sender As Object,e As EventArgs)
      	Dim str As String="<h1><center> Welcome To <b>Web<b/> <i>Appplication</i> </center></h1> in <br /> <h3>ASP.NET</h3>"
      	div1.InnerHtml=str
      End Sub
      
      
      
      
      	A Simple Test  
      

      I dont know wheather may reply solve ur problem. However i just tried.

      P 1 Reply Last reply
      0
      • P peshawarcoder

        You can write text and format it with normal html controls. Then u can add this to one of the block-level element(

        ,

        etc). Example: 1. Type the following script in notepad and save it in wwwroot folder with name such as "Test1.aspx" 2. Open Internet Explorer and the type URL: http://localhost/Test1.aspx

        Sub Page\_Load(sender As Object,e As EventArgs)
        	Dim str As String="<h1><center> Welcome To <b>Web<b/> <i>Appplication</i> </center></h1> in <br /> <h3>ASP.NET</h3>"
        	div1.InnerHtml=str
        End Sub
        
        
        
        
        	A Simple Test  
        

        I dont know wheather may reply solve ur problem. However i just tried.

        P Offline
        P Offline
        peshawarcoder
        wrote on last edited by
        #3

        You can write text and format it with normal html controls. Then u can add this to one of the block-level element(

        ,

        etc). Example: 1. Type the following script in notepad and save it in wwwroot folder with name such as "Test1.aspx" 2. Open Internet Explorer and the type URL: http://localhost/Test1.aspx

        Sub Page\_Load(sender As Object,e As EventArgs)
        	Dim str As String="<pre><h1><center> Welcome To <b>Web<b/> <i>Appplication</i> </center></h1> in <br /> <h3>ASP.NET</h3></pre>"
        	div1.InnerHtml=str
        End Sub
        
        
        
        
        	A Simple Test
        
        1 Reply Last reply
        0
        • O orentuil

          Hi. Does anybody know if it is possible to write programatically a text in a web application page with functionnalities like "newline", "tab", "center text",... In fact: organise a text programatically before putting it in a web page. Thanks, Oren :doh:

          P Offline
          P Offline
          peshawarcoder
          wrote on last edited by
          #4

          You can write text and format it with normal html controls. Then u can add this to one of the block-level element(

          ,

          etc). Example: 1. Type the following script in notepad and save it in wwwroot folder with name such as "Test1.aspx" 2. Open Internet Explorer and the type URL: http://localhost/Test1.aspx

          Sub Page\_Load(sender As Object,e As EventArgs)
          	Dim str As String=<pre>"<h1><center> Welcome To <b>Web<b/> <i>Appplication</i> </center></h1> in <br /> <h3>ASP.NET</h3>"</pre>
          	div1.InnerHtml=str
          End Sub
          
          
          
          
          	A Simple Test
          
          1 Reply Last reply
          0
          • O orentuil

            Hi. Does anybody know if it is possible to write programatically a text in a web application page with functionnalities like "newline", "tab", "center text",... In fact: organise a text programatically before putting it in a web page. Thanks, Oren :doh:

            P Offline
            P Offline
            peshawarcoder
            wrote on last edited by
            #5

            sorry for inconvience. The browser is parsing data section. The contents of str varaible are as under:

            Welcome To Web Appplication

            ===========================================

            ****in

            ASP.NET****

            1 Reply Last reply
            0
            • O orentuil

              Hi. Does anybody know if it is possible to write programatically a text in a web application page with functionnalities like "newline", "tab", "center text",... In fact: organise a text programatically before putting it in a web page. Thanks, Oren :doh:

              B Offline
              B Offline
              BoneSoft
              wrote on last edited by
              #6

              You can use StringBuilder to build text before dumping on a label, literal or straight Response.Write(). Or you can look at HtmlTextWriter which has some specific methods for HTML writing (obviously), though it doesn't facilitate newline or tab. -- modified at 10:47 Friday 28th July, 2006 I take that back, HtmlTextWriter does handle indent and newline.


              Try code model generation tools at BoneSoft.com.

              O 1 Reply Last reply
              0
              • B BoneSoft

                You can use StringBuilder to build text before dumping on a label, literal or straight Response.Write(). Or you can look at HtmlTextWriter which has some specific methods for HTML writing (obviously), though it doesn't facilitate newline or tab. -- modified at 10:47 Friday 28th July, 2006 I take that back, HtmlTextWriter does handle indent and newline.


                Try code model generation tools at BoneSoft.com.

                O Offline
                O Offline
                orentuil
                wrote on last edited by
                #7

                :) Thanks guys, I'll try what you proposed tomorow (on sunday) when I'll be back at my project computer. Here, I don't have Visual. Oren, :-D

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups