Solved

Newbie Q: Dynamic content inside tables

Posted on 2001-07-03
6
227 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

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

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

759 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

17 Experts available now in Live!

Get 1:1 Help Now