Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6077851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:46:01+00:00 2026-05-23T10:46:01+00:00

i am moving an application into asp.net with c#, which has some javascript in

  • 0

i am moving an application into asp.net with c#, which has some javascript in it already.

i have the following javascript function:

function toggle(id) {
    var tog = document.getElementById(id);
    if (tog == null) { return; }
    var bExpand = tog.style.display == '';
    tog.style.display = (bExpand ? 'none' : '');
}

and i am calling it <a href="javascript:void(0);" onclick="toggle('programinfo');" class="nobold">[-]</a>

as you can see, the only thing it does is toggle the display property from none to blank, making the id ‘programinfo’ show or not show accordingly.

coming from coldfusion it worked perfectly, i just had a div named programinfo and it would display or not display the contents of the div each time the link was clicked. now however, it doesn’t do anything. if i add an alert on the value tog.style.display it does either show a blank value, or the value none, so i know it is getting the value, however it is no longer flipping the value.

i have tried it on both divs and tables, nothing. then i even tried adding a style="display:none;" attribute to the table by default to get it to disappear, but even that still doesn’t work.

my only guess at this point is that it’s something with asp, but i can’t find it anywhere so i’m not sure. does anyone have any ideas? thanks.

edit – by request the html output to the browser:

<table width="100%" border="0" class="dgbc" cellspacing="0" cellpadding="5">
    <tr>
        <td colspan="12" class="section_header" style="background-repeat:no-repeat;background-image:url(images/tms_side1.jpg);margin:0;background-position:right;">
            <span style="float: right;"><a href="javascript:void(0);" onclick="toggle('programinfo');" class="nobold">[-]</a></span>
            PROGRAM INFO
        </td>
    </tr>
    <tr>
        <td valign="top">
            <table width="100%">
                <div id="programinfo" style="display:none;">
                    blah blah blah
                </div>
            </table>
        </td>
    </tr>
</table>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:46:02+00:00Added an answer on May 23, 2026 at 10:46 am

    I Think I problem you are facing is invalid use for HTML tags.

                <table width="100%">
                    <tr>
                        <td>
                            <div id="programinfo" style="display: none;">
                                blah blah blah
                            </div>
                        </td>
                    </tr>
                </table>
    

    Place the Div tag inside the td and tr. You will get the problem resolved. This problem persists in IE6 and IE7. Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to molularize my ASP.NET MVC application by moving each Area into their
I'm working on my first ASP.NET MVC 3 application with utilizes some JavaScript and
I'm in the process of moving a large classic ASP application to ASP.NET MVC
I am moving an old ASP.net (C#) application from plain SQL queries to LINQ
I am a ten-year veteran of ASP.NET and C# development and I'm moving into
I have an aspx page in a ASP.NET 2.0 application using several ObjectDataSources. They
So, being an early adopter, I have developed an application based on SQLCE4, ASP.Net
We have a web based (ASP.NET MVC) application that uses SQL Server 2008 for
I'd like to start moving our application business layers into a collection of REST
When moving my .Net Compact Framework application to the SD-card of a Windows CE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.