Answer the question
In order to leave comments, you need to log in
How to add reference to System.Configuration?
I decided to start my acquaintance with c#, but there was a problem.
I take the standard code from the manual.
try
{
var appSettings = ConfigurationManager.AppSettings;
if (appSettings.Count == 0)
{
Console.WriteLine("AppSettings is empty.");
}
else
{
foreach (var key in appSettings.AllKeys)
{
Console.WriteLine("Key: {0} Value: {1}", key, appSettings[key]);
}
}
}
catch (ConfigurationErrorsException)
{
Console.WriteLine("Error reading app settings");
}
Answer the question
In order to leave comments, you need to log in
var pic = document.getElementById("pic")
Returns undefined and the rest of the code doesn't make sense.
Learn to use the developer console.
Move the script to the end of the file.
In this case:
<!DOCTYPE html>
<html>
<head>
<meta lang="ru">
<script>
function lol(){
alert("AD");
}
</script>
</head>
<body>
<title>Program</title>
<img src="ship.png" id="pic" onclick="lol()">
<body>
</html>
Install Resharper, it will pick up the path and add a reference to the assembly, and at the same time get a great piece for development.
PS why don't you use search?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question