How to display a variable value?

  • Thread starter Thread starter Miguel Dias Moura
  • Start date Start date
M

Miguel Dias Moura

Hello,

I am working in ASP.NET/VB. I have a string created by a script. How can
i display the content of that string when the page is loaded so i can
check its value?

Thanks,
Miguel
 
Hi Miguel,

There are a few different ways to do this. If you are debugging you could
just set a breakpoint in your code and check the value when the breakpoint
is hit. If that isn't an option then you could place a label on the .aspx
page and assign the value of that string to the label. Or you could create
a hidden input type:

<input type="hidden" id="hidTest" name="hidTest" runat="server">

And in your script assign the value of the string to this hidden variable.
Then at the bottom of your .aspx page, maybe just before the </body> tag you
could put this script to show you the value everytime the page loads in a
little alert box:

<script language="javascript">
alert(document.getElementById('hidTest').value);
</script>

One of those ways should work for you. Good luck! Ken.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top