Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Add Client side button to HTML table

Posted on 2004-08-15
5
284 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

860 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