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. Access asp control from c#

Access asp control from c#

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasehelptutorial
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.
  • P Offline
    P Offline
    Paulraj G
    wrote on last edited by
    #1

    Hi... I have two DIV controls in my main.aspx page. 1st DIV's ID is COMPONENT and another one is COLOR. in main.aspx.cs, I have code to retrieve some datas from database.

    foreach (DataRow drRow in dtResult.Rows)
    {

                Loginname = drRow\["name"\].ToString();
                password = drRow\["password"\].ToString();
               
                Response.Write(Loginname  + "-" + password);
             }
    

    It is printing the values in mian window.but i want to print the value of Loginname & password into the DIV - COMPONENT. How to do this... Any help will be appriciated... Thanks...

    G.Paulraj

    R 1 Reply Last reply
    0
    • P Paulraj G

      Hi... I have two DIV controls in my main.aspx page. 1st DIV's ID is COMPONENT and another one is COLOR. in main.aspx.cs, I have code to retrieve some datas from database.

      foreach (DataRow drRow in dtResult.Rows)
      {

                  Loginname = drRow\["name"\].ToString();
                  password = drRow\["password"\].ToString();
                 
                  Response.Write(Loginname  + "-" + password);
               }
      

      It is printing the values in mian window.but i want to print the value of Loginname & password into the DIV - COMPONENT. How to do this... Any help will be appriciated... Thanks...

      G.Paulraj

      R Offline
      R Offline
      rakeshs312
      wrote on last edited by
      #2

      use labels in that div and write it there

      P 1 Reply Last reply
      0
      • R rakeshs312

        use labels in that div and write it there

        P Offline
        P Offline
        Paulraj G
        wrote on last edited by
        #3

        yes... That is one method. But here i don't know how much rows are there. So i have to include many labels... thats why i am asking to print with out labels...

        G.Paulraj

        R 1 Reply Last reply
        0
        • P Paulraj G

          yes... That is one method. But here i don't know how much rows are there. So i have to include many labels... thats why i am asking to print with out labels...

          G.Paulraj

          R Offline
          R Offline
          rakeshs312
          wrote on last edited by
          #4

          or use a multiline textbox and write like TextBox1.Text+= Loginname + "-" + password + "\r\n" ;

          P 1 Reply Last reply
          0
          • R rakeshs312

            or use a multiline textbox and write like TextBox1.Text+= Loginname + "-" + password + "\r\n" ;

            P Offline
            P Offline
            Paulraj G
            wrote on last edited by
            #5

            Yes... Its working.... But i need to give links to each login name. for ex, paul - www.paul.com raj - www.raj.com rakesh - www.rakesh.com Thats why i am asking to print in DIV. Thanks...

            G.Paulraj

            R 1 Reply Last reply
            0
            • P Paulraj G

              Yes... Its working.... But i need to give links to each login name. for ex, paul - www.paul.com raj - www.raj.com rakesh - www.rakesh.com Thats why i am asking to print in DIV. Thanks...

              G.Paulraj

              R Offline
              R Offline
              rakeshs312
              wrote on last edited by
              #6

              foreach (DataRow drRow in dtResult.Rows) { Loginname = drRow["name"].ToString(); password = drRow["password"].ToString(); disp.InnerHtml += Loginname + "-" + password; disp.InnerHtml+=("
              "); }

              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