I want to use the C# Scripting language on ASP.net. And I also want to manipulate my html page by using document.write, and I can't find the option in C#. I also edit my code straight to the html code and not on the .aspx.cs file. So is there any same function of document.write to the c#?
Take a look at this: http://msdn.microsoft.com/en-in/library/ms178135(v=vs.100).aspx
It talks about embedded code blocks which can execute during the render phase of the page.
From the above url:
<%@ Page Language="C#" %>
<html>
<body>
<form id="form1" runat="server">
<% for(int i = 0; i < 6; i++) %>
<% { Response.Write("<br>" + i.ToString()); }%>
</form>
</body>
</html>
try this
<%@ Page Title="Sample" Language="C#" %>
<%
var str = "hi!";
Response.Write(str);
Response.Write("hi");
%>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With