I'm still new to ASP.NET, but I've worked in classic ASP a bit beforehand.
I worked a tutorial that I found on youtube about how to create a social networking site (not the next Facebook, just something to get me started), but I've run into a problem when trying to use javascript in a link button.
My code looks like this:
<script src="assets/script/Javascript.js" type="text/javascript"></script> - (inside the head tag)
<div id="start" style="display: none;">This is the start menu.</div> - (inside the body tag)
<asp:LinkButton ID="LinkButton1" runat="server" OnClick="javascript:switchVisible('start');javascript:start('start')">Press Start:</asp:LinkButton> - (inside the body tag)
When I try to debug the site, I get an error that looks like this:
Compiler Error Message: CS1012: Too many characters in character literal
I've also tried using the asp:HyperLink and asp: DynamicHyperlink. I saw on other websites where they told someone to replace "onClick" with "onClientClick" and I tried that, but still didn't work. I even tried moving the javascript into the asp file, but still nothing.
What should I do?
I worked a tutorial that I found on youtube about how to create a social networking site (not the next Facebook, just something to get me started), but I've run into a problem when trying to use javascript in a link button.
My code looks like this:
<script src="assets/script/Javascript.js" type="text/javascript"></script> - (inside the head tag)
<div id="start" style="display: none;">This is the start menu.</div> - (inside the body tag)
<asp:LinkButton ID="LinkButton1" runat="server" OnClick="javascript:switchVisible('start');javascript:start('start')">Press Start:</asp:LinkButton> - (inside the body tag)
When I try to debug the site, I get an error that looks like this:
Compiler Error Message: CS1012: Too many characters in character literal
I've also tried using the asp:HyperLink and asp: DynamicHyperlink. I saw on other websites where they told someone to replace "onClick" with "onClientClick" and I tried that, but still didn't work. I even tried moving the javascript into the asp file, but still nothing.
What should I do?