• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 313
  • Last Modified:

Add Client side button to HTML table

I have an html string that is inserted into my aspx page.  The html is generated dynamically.  I attempted to add a client side button to this dynamically generated html but when I open the page it crashes internet explorer.

I only have access to the html inside the <Table></Table> and I attempted to add the button as so...

<INPUT class='btnUpdate' style='Z-INDEX: 115; LEFT: 77px; POSITION: absolute; TOP: 457px' onclick='UpdateVV();' type='button'>

Prior to this tag is the <Table> tag and 4 hidden text boxes.

How can I make this button work?
0
billy21
Asked:
billy21
  • 3
  • 2
1 Solution
 
billy21Author Commented:
So the HTML looks like this...
<Table>
    <asp:textbox id='SupplierId' value:HM*SupplierId style='DISPLAY: none; Z-INDEX: 102; LEFT: 636px; POSITION: absolute; TOP: 9px' runat='server' Width='1px' Height='330px'></asp:textbox>
     <asp:textbox id='SPId' style='DISPLAY: none; value:HM*SPId; Z-INDEX: 102; LEFT: 636px; POSITION: absolute; TOP: 9px' runat='server' Width='1px' Height='330px'></asp:textbox>
     <asp:textbox id='VariationReason' style='DISPLAY: none; Z-INDEX: 102; LEFT: 636px; POSITION: absolute; TOP: 9px' runat='server' Width='1px' Height='330px'></asp:textbox>
     <asp:textbox id='VariationNote' style='DISPLAY: none; Z-INDEX: 102; LEFT: 636px; POSITION: absolute; TOP: 9px' runat='server' Width='1px' Height='330px'></asp:textbox>
     <INPUT class='btnUpdate' style='Z-INDEX: 115; LEFT: 77px; POSITION: absolute; TOP: 457px' onclick='UpdateVV();' type='button'>
     <TR>...
0
 
shovavnikCommented:
You should always put controls inside table cells and not in the table itself.

This is especially true of serverside controls, as you never know how they'll render.

Either take all the <asp:textbox> controls out of the table or put them in a
<tr><td>{Your code here}</td></tr>
block.

If you want to make sure the boxes and the button are always on the same row, put them in their own table:
<table>
<tr>
<td><asp:textbox #1></td>
<td><asp:textbox #1></td>
<td><asp:textbox #3></td>
<td><input type="button"></td>
</tr>
</table>


Btw, what exactly do you mean by dynamically generated html?  (There are several possible meanings.)
1. Do you generate the html code *with* the <asp:textbox> controls?  (With xslt for example?)
2. Do you type the html code exactly as you've specified here in an .aspx file (not in codebehind)?
3. Is this code inside a repeating object, like a DataRepeater or some other data bound control?

0
 
billy21Author Commented:
Yes i'm using the html inside a repeater control bound to a datatable object.
0
 
billy21Author Commented:
Thanks shovavnik.  That did the trick!
0
 
shovavnikCommented:
Glad to be of service.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now