Solved

Add Client side button to HTML table

Posted on 2004-08-15
5
302 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
[X]
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
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

689 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