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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. server-side ASP:Labels

server-side ASP:Labels

Scheduled Pinned Locked Moved ASP.NET
graphicssysadmindebugging
6 Posts 2 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.
  • G Offline
    G Offline
    gunnar66
    wrote on last edited by
    #1

    Hi When I push a button, I want to view a file in a overflow DIV. This works ok if the .htm file I open do not contain any graphics. If it do contain graphics, the border on my TABLE will dissapear when I open the file. Any idea Here are some code to see what i try to do: <%@ Page Language="VB" Debug="true" %> <%@ import Namespace="System.IO" %> ' Insert page code here Sub Button1_Click(sender As Object, e As EventArgs) Dim dirFile as string = Server.MapPath("test.htm") Dim objStream as StreamReader = File.OpenText(dirfile) Dim strContents as String = objStream.ReadToEnd() objStream.Close() lblFileContents.Text = strContents End Sub

    Some text

    some text

    M 1 Reply Last reply
    0
    • G gunnar66

      Hi When I push a button, I want to view a file in a overflow DIV. This works ok if the .htm file I open do not contain any graphics. If it do contain graphics, the border on my TABLE will dissapear when I open the file. Any idea Here are some code to see what i try to do: <%@ Page Language="VB" Debug="true" %> <%@ import Namespace="System.IO" %> ' Insert page code here Sub Button1_Click(sender As Object, e As EventArgs) Dim dirFile as string = Server.MapPath("test.htm") Dim objStream as StreamReader = File.OpenText(dirfile) Dim strContents as String = objStream.ReadToEnd() objStream.Close() lblFileContents.Text = strContents End Sub

      Some text

      some text

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, What does the html markup in the test.htm look like when it got images?

      G 1 Reply Last reply
      0
      • M minhpc_bk

        Hi there, What does the html markup in the test.htm look like when it got images?

        G Offline
        G Offline
        gunnar66
        wrote on last edited by
        #3

        Hi Test.htm look like this. I have an Excel files with some numbers and a chart that show this numbers. I then save it as a htm file. If I delete the chart and then save it again, the borders in the table looks ok.

        M 1 Reply Last reply
        0
        • G gunnar66

          Hi Test.htm look like this. I have an Excel files with some numbers and a chart that show this numbers. I then save it as a htm file. If I delete the chart and then save it again, the borders in the table looks ok.

          M Offline
          M Offline
          minhpc_bk
          wrote on last edited by
          #4

          Hi there, There are a couple of things that you can try: + Define a style class:

          <style>
          .test{
          border:1px solid #cccccc
          }
          </style>

          Try to replace the border="1" stuff with the class="test" in the table and td elements. + My favourite way is to define 2 style classes for the table and td:

          <style>
          .table {background-color: #ff0000}
          .td {background-color: #ffffff}
          </style>

          Apply these classes to the markup:

          <table style="WIDTH: 980px; HEIGHT: 470px" cellpadding="5" cellspacing="1" class="table">
          <tbody>
          <tr>
          <td valign="top" class="td" >
          ...
          </td>
          <td rowspan="3" class="td" >
          ...
          </td>
          </tr>
          ...
          </tbody>
          </table>

          Replace the border="1" in the td elements with the class="td". You can adjust the border width by changing the cellspacing attribute of the table element. Also, to change the border color you can adjust the background-color value of the table class. + Also, you may consider using the 100% value instead of fixing the width and height of the parent table.

          G 1 Reply Last reply
          0
          • M minhpc_bk

            Hi there, There are a couple of things that you can try: + Define a style class:

            <style>
            .test{
            border:1px solid #cccccc
            }
            </style>

            Try to replace the border="1" stuff with the class="test" in the table and td elements. + My favourite way is to define 2 style classes for the table and td:

            <style>
            .table {background-color: #ff0000}
            .td {background-color: #ffffff}
            </style>

            Apply these classes to the markup:

            <table style="WIDTH: 980px; HEIGHT: 470px" cellpadding="5" cellspacing="1" class="table">
            <tbody>
            <tr>
            <td valign="top" class="td" >
            ...
            </td>
            <td rowspan="3" class="td" >
            ...
            </td>
            </tr>
            ...
            </tbody>
            </table>

            Replace the border="1" in the td elements with the class="td". You can adjust the border width by changing the cellspacing attribute of the table element. Also, to change the border color you can adjust the background-color value of the table class. + Also, you may consider using the 100% value instead of fixing the width and height of the parent table.

            G Offline
            G Offline
            gunnar66
            wrote on last edited by
            #5

            Hi Thank you, that seems like that fix my problem. Well actually there is one more thing, the button also move after i have opened the file. Thanks

            M 1 Reply Last reply
            0
            • G gunnar66

              Hi Thank you, that seems like that fix my problem. Well actually there is one more thing, the button also move after i have opened the file. Thanks

              M Offline
              M Offline
              minhpc_bk
              wrote on last edited by
              #6

              You may consider the table/td size(both width and height), as they all are fixed now, then if the test.html is too large, that can break the table structure. Perhaps, you can use the percentage value to set the height and width properties. Or you may consider using an iframe element to load the test.html.

              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