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. Web Development
  3. ASP.NET
  4. placeholder position

placeholder position

Scheduled Pinned Locked Moved ASP.NET
csharpsysadmintutorialquestion
4 Posts 4 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.
  • C Offline
    C Offline
    C Coudou
    wrote on last edited by
    #1

    hi mates, how to alternate the position of placeholder? here's what i did.but i want the result alternating. client side:aspxfile

    <table>
    <tr>
    <td>
    <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
    </td>
    </tr>
    <tr>
    <td>
    <asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder>
    </td>
    </tr>
    </table>

    server side: page_load

    For i As Integer = 1 To 3
    Dim dLabel As New Label
    Dim dText As New TextBox
    dLabel.ID = "lblid" & i.ToString()
    dLabel.Text = "label" & i.ToString()
    dLabel.Width = 10

    dText.ID = "txtid" & i.ToString()
    dText.Text = "text" & i.ToString()
    dText.Width = 10
    
     PlaceHolder1.Controls.Add(dLabel)
     PlaceHolder2.Controls.Add(dText)
    

    Next

    RESULT: label1 label2 label3 text1 text2 text3 I WANT THE RESULT LIKE THIS: label1 text1 label2 text2 label3 text3

    C# コードMicrosoft End User 2000-2008 「「「「「「「「「「「「「「「「「「「「「「「「「「「「 The best things in life are free 」」」」」」」」」」」」」」」」」」」」」」」」」」」」

    B P N 3 Replies Last reply
    0
    • C C Coudou

      hi mates, how to alternate the position of placeholder? here's what i did.but i want the result alternating. client side:aspxfile

      <table>
      <tr>
      <td>
      <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
      </td>
      </tr>
      <tr>
      <td>
      <asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder>
      </td>
      </tr>
      </table>

      server side: page_load

      For i As Integer = 1 To 3
      Dim dLabel As New Label
      Dim dText As New TextBox
      dLabel.ID = "lblid" & i.ToString()
      dLabel.Text = "label" & i.ToString()
      dLabel.Width = 10

      dText.ID = "txtid" & i.ToString()
      dText.Text = "text" & i.ToString()
      dText.Width = 10
      
       PlaceHolder1.Controls.Add(dLabel)
       PlaceHolder2.Controls.Add(dText)
      

      Next

      RESULT: label1 label2 label3 text1 text2 text3 I WANT THE RESULT LIKE THIS: label1 text1 label2 text2 label3 text3

      C# コードMicrosoft End User 2000-2008 「「「「「「「「「「「「「「「「「「「「「「「「「「「「 The best things in life are free 」」」」」」」」」」」」」」」」」」」」」」」」」」」」

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      Add this line of code PlaceHolder1.Controls.Add(new LiteralControl(" ")) before you add control label, same do for PlaceHolder2


      I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.cacttus.com

      1 Reply Last reply
      0
      • C C Coudou

        hi mates, how to alternate the position of placeholder? here's what i did.but i want the result alternating. client side:aspxfile

        <table>
        <tr>
        <td>
        <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
        </td>
        </tr>
        <tr>
        <td>
        <asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder>
        </td>
        </tr>
        </table>

        server side: page_load

        For i As Integer = 1 To 3
        Dim dLabel As New Label
        Dim dText As New TextBox
        dLabel.ID = "lblid" & i.ToString()
        dLabel.Text = "label" & i.ToString()
        dLabel.Width = 10

        dText.ID = "txtid" & i.ToString()
        dText.Text = "text" & i.ToString()
        dText.Width = 10
        
         PlaceHolder1.Controls.Add(dLabel)
         PlaceHolder2.Controls.Add(dText)
        

        Next

        RESULT: label1 label2 label3 text1 text2 text3 I WANT THE RESULT LIKE THIS: label1 text1 label2 text2 label3 text3

        C# コードMicrosoft End User 2000-2008 「「「「「「「「「「「「「「「「「「「「「「「「「「「「 The best things in life are free 」」」」」」」」」」」」」」」」」」」」」」」」」」」」

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

        @BlueBoy Good One..

        1 Reply Last reply
        0
        • C C Coudou

          hi mates, how to alternate the position of placeholder? here's what i did.but i want the result alternating. client side:aspxfile

          <table>
          <tr>
          <td>
          <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
          </td>
          </tr>
          <tr>
          <td>
          <asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder>
          </td>
          </tr>
          </table>

          server side: page_load

          For i As Integer = 1 To 3
          Dim dLabel As New Label
          Dim dText As New TextBox
          dLabel.ID = "lblid" & i.ToString()
          dLabel.Text = "label" & i.ToString()
          dLabel.Width = 10

          dText.ID = "txtid" & i.ToString()
          dText.Text = "text" & i.ToString()
          dText.Width = 10
          
           PlaceHolder1.Controls.Add(dLabel)
           PlaceHolder2.Controls.Add(dText)
          

          Next

          RESULT: label1 label2 label3 text1 text2 text3 I WANT THE RESULT LIKE THIS: label1 text1 label2 text2 label3 text3

          C# コードMicrosoft End User 2000-2008 「「「「「「「「「「「「「「「「「「「「「「「「「「「「 The best things in life are free 」」」」」」」」」」」」」」」」」」」」」」」」」」」」

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          To get the desired results you don't need to use a table. In fact, modern web design doesn't use table layouts. You could use a Repeater control and bind to it. The markup for the repeater could be constructed to format the lines and items in whatever configuration you would like. There is no need to use PlaceHolders.


          I know the language. I've read a book. - _Madmatt

          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