Hi
this code gives System.StackOverflow.Exception at the bold line. Can anyone explain me how come?
Thanks
V
using System;
namespace test
{
public partial class WebForm1 : System.Web.UI.Page
{
public Test ts = new Test();
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = "ok";
}
}
public class Test : WebForm1
{
string x;
}
}
aspx file:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="test.WebForm1" %>
....
Sachin SinghPosted Jan 1, 2023, 7:54 AM
Absolutely correct you are, it is indeed an infinite loop.
Valerie MeunierPosted Dec 31, 2022, 2:49 PM
I think i found the reason and that is the inheritance public class Test : WebForm1 which causes a infinite loop.