System.StackOverflowException

S

Simon Harris

Hi All,

When I set the property of title in my class (Shown below) I get a
"Exception of type System.StackOverflowException was thrown." error message.

I'm guessing I got some sort of horrible loop going on, where did I go
wrong?

Thanks,
Simon.

Private pTitleAs String

Public Property Title() As String
Get
Return pStrTitle
End Get
Set(ByVal Value As String)
Title = pStrTitle
End Set
End Property
 
A

Alvin Bruney [MVP - ASP.NET]

you're setting the title of the string with pstrTitle, but the set action
itself calls the property again recursively. The solution provided by sherif
will fix the problem, i just thought you wanted to know the why.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
 
W

Web Team @ Borough of Poole

....but thanks for the replies (I posted my reply before yours appeared)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top