codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  show hide problem in dynamic table creation  rsanuj at 05:24 on Monday, May 05, 2008
 

Hi Friends,
I have problem to show hide contents in a table which is generated at run time.

Here i am giving code which is used with asp.net(vb.net):
Dim strMs As String
Try
oDataAccess = New DataAccessClass
oDR = oDataAccess.ExecuteProcedure("spGetAdvisoryBoardDetailsNew") ', oSQLparam)
If oDR.HasRows Then
While oDR.Read()
Dim intCount As Integer
Dim i As Int16
Dim td As HtmlTableCell
Dim tr As HtmlTableRow

Dim strHtml As String
Dim strHtml1 As String
intCount = oDR.FieldCount
For i = 0 To intCount

strHtml = "<tr><td><table><tr><td><IMG src='images/"
strHtml = strHtml & oDR("ImageName")
strHtml = strHtml & "'> </td>"
strHtml = strHtml & "<td valign='top' width='700px'>" & oDR("AdvisoryDetails") & "</td>"
strHtml = strHtml & "<td align='Right' width='400px' vAlign='baseline'><font name='verdana' size=1>"
strHtml = strHtml & "<A id='LM' onclick='showcontent('content'); return true;' href='javascript:showcontent('content','LM')'>Learn More"
strHtml = strHtml & "</font></td>"
strHtml = strHtml & "</tr></table></td></tr>"
strHtml = strHtml & "<tr><td><div id='content'><table><tr><td></td><td>" & oDR("AdvisoryContents")
strHtml = strHtml & "<font style='LEFT: 668px; FONT-FAMILY: Verdana; POSITION: absolute' size='1'><A onclick='hidecontent('content'); return true;' href='javascript:hidecontent('content')'>Hide</A></font>"
strHtml = strHtml & "<br></td></tr></table></div></td></tr>"
Next
tr = New HtmlTableRow
td = New HtmlTableCell
td.InnerHtml = strHtml '& strContents
tr.Cells.Add(td)
tblDynamic.Rows.Add(tr)
End While
End If
Catch sqlex As SqlException
Throw sqlex
Catch ex As Exception
Throw ex
Finally
If Not IsNothing(oDataAccess) Then
oDataAccess = Nothing
End If
If Not IsNothing(oDR) Then
oDR.Close()
End If
End Try

----------
and its java script code:
function showcontent(d)
{
if(d.length < 1) { return; }
document.getElementById(d).style.display = "block";
document.getElementById("LM").style.display="none";
document.getElementById("Content").style.display = "none";
}
function hidecontent(d)
{
if(d.length < 1)
{ return; }
document.getElementById(d).style.display = "none";
document.getElementById("LM").style.display="block";
}

please help to solve the problem








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Re: Perl Script - File Handling.
•  Open a file from website
•  Re: to open 5 terminals from one and also execute different commands on each terminal
•  read a selected multiple line, those should match some of the values read in the files..
•  Help me please
•  Empty the contents of a file.
•  Month Start, End dates
•  show hide problem in dynamic table creation
•  Re: ASP Sendmail has huge delay - ANYONE??


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008