Welcome aboard! We are happy you are here and wish you good net-raft!
<% @Page Language="C#" %>
<script runat="server">
private void test1(object sender, EventArgs e)
{
string s = "Hello world!";
s = s.ToLower();
int count_l = 0;
string char_l = "l";  // display the number of character l
foreach (char c in s)
{
if (char_l.Contains(c))
count_l++;
}
string char1 = count_l.ToString();
changed_text.InnerHtml = char1;
}
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<input runat="server" id="button1" type="submit" value="Click" OnServerClick="test1"/>
<hr />
<h3> Results: </h3>
<span runat="server" id="changed_text" />
</form>
</body>
</html> 
The most helpful C# solutions