Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 967
  • Last Modified:

What is the equivalent of javascript document.getElementById("table1").style.display = "block" in c#

I have a javascript code as followed:
document.getElementById("table1").style.display = "block"

How do I translate into C#?

1 Solution
You'll need to make sure its a server control for to see it. Either use an control or at runat="server" to the existing element.

Then in your C# code you can access it as such:

myControl.Style["display"] = "block";
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Tackle projects and never again get stuck behind a technical roadblock.
Join Now