Solved

Add Client side button to HTML table

Posted on 2004-08-15
5
252 Views
Last Modified: 2006-11-17
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
Comment
Question by:billy21
  • 3
  • 2
5 Comments
 
LVL 6

Author Comment

by:billy21
ID: 11803422
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
 
LVL 8

Accepted Solution

by:
shovavnik earned 500 total points
ID: 11803451
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
 
LVL 6

Author Comment

by:billy21
ID: 11803456
Yes i'm using the html inside a repeater control bound to a datatable object.
0
 
LVL 6

Author Comment

by:billy21
ID: 11803459
Thanks shovavnik.  That did the trick!
0
 
LVL 8

Expert Comment

by:shovavnik
ID: 11803465
Glad to be of service.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now