D
Davíð Þórisson
I don't get it... so simple code but it's bringing an error which goes away
if I skip that <script Src="initialize.cs"> part...
("CS0038: Cannot access a nonstatic member of outer type
'System.Web.UI.Page' via nested type 'default_aspx.Initialize'")
PS it's running .Net 2.0 which explains the "ClassName" attribute in Page
directive
===default.aspx====
<%@ Page CompileWith="default.aspx.cs" ClassName="default_aspx" %>
<script Src="initialize.cs" runat="server"/>
<html>
<body>
<asp:Literal ID="LitBody" runat="server"/>
<asp:Literal ID="LitBody2" runat="server"/>
</body>
</html>
===initialize.cs===
public class Initialize
{
void Page_Load(object sender, System.EventArgs e)
{
LitBody2.Text = "Texti 2";
}
}
if I skip that <script Src="initialize.cs"> part...
("CS0038: Cannot access a nonstatic member of outer type
'System.Web.UI.Page' via nested type 'default_aspx.Initialize'")
PS it's running .Net 2.0 which explains the "ClassName" attribute in Page
directive
===default.aspx====
<%@ Page CompileWith="default.aspx.cs" ClassName="default_aspx" %>
<script Src="initialize.cs" runat="server"/>
<html>
<body>
<asp:Literal ID="LitBody" runat="server"/>
<asp:Literal ID="LitBody2" runat="server"/>
</body>
</html>
===initialize.cs===
public class Initialize
{
void Page_Load(object sender, System.EventArgs e)
{
LitBody2.Text = "Texti 2";
}
}