Script does not work when i remove language="C#" and add type="text/C#" in its tag. What is the difference between both of them.
Another Question is why can't i access html Controls while writing code in aspx.cs file, what is the difference between both styles of writing C#
and how can i access html controls so easily if i am writing code in aspx.cs file , like in the following event function and what is the object for source in its parameters
<head runat="server">
<title></title>
<script language="C#" runat="server">
void Submit_bttn1(object Source,EventArgs e)
{
SpanMsg.InnerHtml= "your Suggestions are "+Textarea1.Value;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<p>
Page 2
</p>
<div>
<textarea id="Textarea1" cols="15" rows="5" runat="server"></textarea>
<input type="submit" value="Submit" runat="server" onserverclick="Submit_bttn1" />
<span id="SpanMsg" runat="server"></span>
</div>
<p> </p>
<p>
<asp:Button ID="Button1" runat="server" Text="Button" />
</p>
</form>
</body>
</html>
There must be some pros and cons of writing C# code in both styles so what would be the scenerio for writing C# code in html page . Thanks
Update Panelas well perhaps this can help you