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. Adding control at runtime and change the cursor style on mouse over

Adding control at runtime and change the cursor style on mouse over

Scheduled Pinned Locked Moved ASP.NET
csharphelpasp-nettutorial
4 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
    psmukil
    wrote on last edited by
    #1

    How to add a textbox control at runtime in a Panel and how to add a onmouseover event for the textboxes to change the cursor style. I have added the control, but controls are added on the same location i think. So its showing a single control. Wherein in a windows application we can specify the location. Im using ASP.Net 2.0 and C# as code behind. Plese help me to solve this problem. Thanks in advance. Its a urgent requirement. Help me out. Regards Mukilan.P.S

    G 1 Reply Last reply
    0
    • P psmukil

      How to add a textbox control at runtime in a Panel and how to add a onmouseover event for the textboxes to change the cursor style. I have added the control, but controls are added on the same location i think. So its showing a single control. Wherein in a windows application we can specify the location. Im using ASP.Net 2.0 and C# as code behind. Plese help me to solve this problem. Thanks in advance. Its a urgent requirement. Help me out. Regards Mukilan.P.S

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      If you don't show your code, noone can tell you what's wrong with it. --- b { font-weight: normal; }

      P 1 Reply Last reply
      0
      • G Guffa

        If you don't show your code, noone can tell you what's wrong with it. --- b { font-weight: normal; }

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

        In the button click im adding a text box control. But text box is added only once. whenever button click event occurs, one more textbox should be added in the html table which is already present. I made that html tabel to run at server and rows and columns. By default, i have a text box in the table. But the new text box should be added above the control which already pressent protected void btnAdd_Click(object sender, EventArgs e) { //this.createControls(); HtmlTableRow htrow = new HtmlTableRow(); HtmlTableCell htcell = new HtmlTableCell(); TextBox txtName = new TextBox(); txtName.ID = "txtName"; txtName.Visible = true; txtName.Width = 150; txtName.Text = "Check"; txtName.BorderWidth = 0; txtName.Attributes.Add("onmouseover", "alert('hi');"); htcell.Controls.Add(txtName); htrow.Cells.Add(htcell); ItemRow.Controls.Add(htcell); ListTable.Visible = true; htcell.Visible = true; //htrow.Visible = true; }

        G 1 Reply Last reply
        0
        • P psmukil

          In the button click im adding a text box control. But text box is added only once. whenever button click event occurs, one more textbox should be added in the html table which is already present. I made that html tabel to run at server and rows and columns. By default, i have a text box in the table. But the new text box should be added above the control which already pressent protected void btnAdd_Click(object sender, EventArgs e) { //this.createControls(); HtmlTableRow htrow = new HtmlTableRow(); HtmlTableCell htcell = new HtmlTableCell(); TextBox txtName = new TextBox(); txtName.ID = "txtName"; txtName.Visible = true; txtName.Width = 150; txtName.Text = "Check"; txtName.BorderWidth = 0; txtName.Attributes.Add("onmouseover", "alert('hi');"); htcell.Controls.Add(txtName); htrow.Cells.Add(htcell); ItemRow.Controls.Add(htcell); ListTable.Visible = true; htcell.Visible = true; //htrow.Visible = true; }

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          When you add controls dynamically to a page you have to add them each time the page reloads, as the page is recreated from scratch every time. That means that you have to keep track of all the textboxes that you added, and add them in every postback. --- b { font-weight: normal; }

          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