Solved

Newbie Q: Dynamic content inside tables

Posted on 2001-07-03
6
230 Views
Last Modified: 2012-06-27
I'm just getting started with ASP.  Right now I have a web page that is horribly long.  What I'd like to do is have a Visual Basic object inject content into a <td></td> inside a table based off of button pushes etc.  Can anyone show me a simple example to do this.  Just a single table, a single VB object, and maybe a few lines of ASP to do this?
0
Comment
Question by:tdubroff
  • 3
  • 2
6 Comments
 
LVL 7

Expert Comment

by:John844
ID: 6249791
do you mean something like this where your activex dll returns a string?

<%
dim obj
set obj=server.createobject("projectName.ClassName")

%>

<table>
  <tr>
    <td><%=obj.methodCall %>
  </tr>
</table>

0
 
LVL 7

Expert Comment

by:John844
ID: 6249889
sorry, left off a closing td tag
change
    <td><%=obj.methodCall %>
to
    <td><%=obj.methodCall %></td>
0
 
LVL 5

Accepted Solution

by:
russellshome earned 100 total points
ID: 6252808
Why not try using subroutines & functions.

<%
Function Inject(Stuff)
  Dim injected
  injected = "<td>" & Stuff & "<td>"
End function
%>

<table>
  <tr>
<%
For col = 1 to 5
 Response.Write Inject(col)
Next
%>
  <tr>
</table>

OR do you actually want buttons on the same page to change the content of a &lt;td>?

<table>
     <td><div id="t1">Hi</div></td>
</table>

<form name="test">
<input type="button" value="Hello" onClick="doHello(1)">
<input type="button" value="There" onClick="doHello(2)">
</form>

<script>
     function doHello(i){
          switch(i) {
               case 1:
                    t1.innerText = "Hello"
                    break
               case 2:
                    t1.innerText = "There"
          }
     }
</script>
0
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

 
LVL 2

Author Comment

by:tdubroff
ID: 6252917
I shall try what has been suggested.  It seems that the combination of comments here answer my question.
0
 
LVL 7

Expert Comment

by:John844
ID: 6315488
Do you need more information still.  If not select the comment that assisted you the most.  If you want to split the points between more than one expert, then post a comment in the Community Support area with a link to this question.  They can help you out.

John
0
 
LVL 2

Author Comment

by:tdubroff
ID: 6315526
I went ahead and selected Russelshome as the answer.  He has less points, so John844 shouldn't mind.  Thanks for the help guys!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

821 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