Adding control at runtime and change the cursor style on mouse over
-
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
-
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
-
If you don't show your code, noone can tell you what's wrong with it. --- b { font-weight: normal; }
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; }
-
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; }
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; }