Showing posts with label type. Show all posts
Showing posts with label type. Show all posts

Wednesday, March 28, 2012

System.InvalidCastException: Specified cast is not valid.

i'm retrieving data with Repeater from Sql Database. i have color colums in the table.. such as color1, color2, color3, color4 and columns type Nvarchar.

i implemented below the function to get team colors instead of characters in the table cells

---- function -----

string Team_Colours(string color)
{
switch (color)
{
case "WHITE" :
color = "#FFFFFF";
break;

case "BLACK" :
color = "#000000";
break;

case "RED" :
color = "#FF0000";
break;
case "" : // i think problem is here

color = "";
break;
}

return color;
}

-----------

if all color colums are not null, everything okay.. but, i'm getting below the error if any color colums is null..

------error-----

Exception Details: System.InvalidCastException: Specified cast is not valid.

Line 159: <td bgcolor="<%# Team_Colors((string) DataBinder.Eval(Container.DataItem, "color4")) %>"
------------
how can i solve this problem ?

thanks..If it's Null at times, try Switch(color.ToString())
Or add the .ToString to where the color is actually being read from the database.

Hope this helps, but may need to see more code...

Zath
i tried that Switch(color.ToString()) but same eror :(
it's ok, thanks Zath..

<%# Team_Colors(DataBinder.Eval(Container.DataItem, "color1").ToString()) %>
<%# Team_Colors(DataBinder.Eval(Container.DataItem, "color2").ToString()) %>
<%# Team_Colors(DataBinder.Eval(Container.DataItem, "color3").ToString()) %>
<%# Team_Colors(DataBinder.Eval(Container.DataItem, "color4").ToString()) %>
I just tried your function and it works ok for me.
Are there any other colors in the database not accounted for?

Have you tried setting a break point in your code to help debug?

Maybe a little more code might help.

Zath

Monday, March 26, 2012

System.Net HttpWebRequest - post a form

(Type your message here)
From: senthil t
There is a third party website that we use=2E Whenever someone=
unsubscribes from our website, some one has to go to that third=
party website, enter the unsubscribed user info and submit the=
form=2E We are doing this manually=2E What I would like is, whenever=
any user unsubscribes from our website, auto post the third=
party website form with all the user information from my =2Enet=
code=2E This is the code I have right now=2E But this is not=
working=2E
HttpWebRequest webRequest =3D (HttpWebRequest) WebRequest=2ECreate=
(URL);
webRequest=2EKeepAlive =3D false;
webRequest=2ETimeout =3D 100000;
webRequest=2EMethod =3D "POST";
webRequest=2EContentType =3D "application/x-www-form-urlencoded";
byte[] requestBytes =3D (new=
System=2EText=2EASCIIEncoding())=2EGetBy
tes (PostData);
webRequest=2EContentLength =3D requestBytes=2ELength;
Stream requestStream =3D webRequest=2EGetRequestStream();
requestStream=2EWrite (requestBytes, 0, requestBytes=2ELength);
requestStream=2EClose();
webResponse =3D (HttpWebResponse) webRequest=2EGetResponse();
sr =3D new StreamReader (webResponse=2EGetResponseStream(),=
System=2EText=2EEncoding=2EASCII);
response =3D sr=2EReadToEnd ();
With =2Easpx page, it was not doing anything until I added the=
viewstate info to the postdata=2E But is throwing an error at this=
line=2E
webResponse =3D (HttpWebResponse) webRequest=2EGetResponse();
Internal Server Error=2ESystem=2ENet=2EHttpWebResponse at=
System=2ENet=2EHttpWebRequest=2ECheckFin
alStatus() at=
System=2ENet=2EHttpWebRequest=2EEndGetRe
sponse(IAsyncResult=
asyncResult) at System=2ENet=2EHttpWebRequest=2EGetRespo
nse()
Can any one tell me what is wrong with what I am doing?
Posted by a user from =2ENET 247 (http://www=2Edotnet247=2Ecom/)
<Id>0ZTNUiUrPECOfo+INVokdg=3D=3D</Id>Hi senthil:
What I've done in the past is use a tool like Fiddler [1] to compare
what my program is POSTing to the server versus what happens when I
use a browser.
http://www.fiddlertool.com/fiddler/
Scott
http://www.OdeToCode.com/blogs/scott/
On Sun, 15 May 2005 05:03:55 -0700, senthil t via .NET 247
<anonymous@.dotnet247.com> wrote:

>(Type your message here)
>--
>From: senthil t
>There is a third party website that we use. Whenever someone unsubscribes from our
website, some one has to go to that third party website, enter the unsubscribed user
info and submit the form. We are doing this manually. What I would like is, wheneve
r a
ny user unsubscribes from our website, auto post the third party website form with all the
user information from my .net code. This is the code I have right now. But this is not work
ing.
> HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create (URL);
> webRequest.KeepAlive = false;
> webRequest.Timeout = 100000;
> webRequest.Method = "POST";
> webRequest.ContentType = "application/x-www-form-urlencoded";
> byte[] requestBytes = (new System.Text.ASCIIEncoding()).GetBytes (PostDa
ta);
> webRequest.ContentLength = requestBytes.Length;
> Stream requestStream = webRequest.GetRequestStream();
> requestStream.Write (requestBytes, 0, requestBytes.Length);
> requestStream.Close();
> webResponse = (HttpWebResponse) webRequest.GetResponse();
> sr = new StreamReader (webResponse.GetResponseStream(), System.Text.Enco
ding.ASCII);
> response = sr.ReadToEnd ();
>With .aspx page, it was not doing anything until I added the viewstate info
to the postdata. But is throwing an error at this line.
>webResponse = (HttpWebResponse) webRequest.GetResponse();
>Internal Server Error.System.Net.HttpWebResponse at System.Net.HttpWebReque
st.CheckFinalStatus() at System.Net.HttpWebRequest.EndGetResponse(IAsyncResu
lt asyncResult) at System.Net.HttpWebRequest.GetResponse()
>Can any one tell me what is wrong with what I am doing?
>--
>Posted by a user from .NET 247 (http://www.dotnet247.com/)
><Id>0ZTNUiUrPECOfo+INVokdg==</Id>

Saturday, March 24, 2012

System.Net.Sockets.SocketException when using the HttpWebRequest.GetResponse

Hello i keep gettign this error when i use this code

Error:
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in system.dll

Additional information: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full

Code:

Dim HTTP_request As HttpWebRequest
Dim HTTP_response As HttpWebResponse

HTTP_request = HttpWebRequest.Create("http://www.google.com/images/logo.gif")

HTTP_response = HTTP_request.GetResponse

the erorr happens every time on the "HTTP_response = HTTP_request.GetResponse" line

pls helpanyone pls?
The code works fine for me. Is there a chance you are behind a firewall that is blocking the outgoing call?

Thanks,

AspDotNetGuy
i dont think i block any calls at all, all i have is xp firewall on but when disable that i still get the same error.

now this happens not in all computers, in some just work fine

what kinda trafic should i be looking on this?
Very Odd. I am sure someone has run into this, can someone help? I havne't done much HTML Scraping, so I haven't experienced this before.

What version of .NET your running, maybe something changed in 1.1? No idea just a thought.
Yes is 1.1, I have even reinstalled the framework but nothing. Maybe is something machine related where or like you said some block port. i have to see more of this but man this is driving me crazy.

btw thanks for trying to help i really hope some can give moe some light on this
in case some1 has the same error i got this response in another forum and fixed my problem

This may solve your problem. I had a similar error message but got it when
trying to work with a web service.

First check article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;815209 ; and use the
enum.exe and info to check and/or change your protocol bindings.

If changing your network protocols doesn't work (didn't help me) then get
the hotfix from:
http://support.microsoft.com/default.aspx?scid=kb;en-us;826757

You need to call MS and refer to this article. They may not charge you
anything and will send you the hotfix in a password protected e-mail. The
reason it is not publically available is b/c it is still being regression
tested. I was told it will be a part of the .Net 1.1 service pack which I was
also told should be available this month.

System.Nullable 2.0 Framework

The 2.0 Framework has a new type called System.Nullable. This allows
something to Not exist, basically you can pass 'Nothing' to a method whose
parameters as System.Nullable.
Im looking at table adapters ; you know those clever little things which
allow you to contrsuct methods for manipulating data use this. So a method
might be declared someting like this.
Private Sub myMethod(ByVal myYear As System.Nullable(Of Integer), ByVal
myw As System.Nullable(Of Integer))
End Sub
My question is. How to I translate this into a practical method call for a
value which may or may not exits. Lets say we have two text boxes.
yearTextBox and wTextBox.
How to I assign an integer value or nothing depending on if the box is
emtpy, because you cant assign nothing to an integer. I dont want multiple
call lines to the one method, just one.
Goofy
GoofyGot it
Dim year As System.Nullable(Of Single)
Dim w As System.Nullable(Of Integer)
"Goofy" <me@.mine.com> wrote in message
news:%23X%23OA%23DJHHA.320@.TK2MSFTNGP06.phx.gbl...
> The 2.0 Framework has a new type called System.Nullable. This allows
> something to Not exist, basically you can pass 'Nothing' to a method whose
> parameters as System.Nullable.
> Im looking at table adapters ; you know those clever little things which
> allow you to contrsuct methods for manipulating data use this. So a method
> might be declared someting like this.
> Private Sub myMethod(ByVal myYear As System.Nullable(Of Integer), ByVal
> myw As System.Nullable(Of Integer))
> End Sub
> My question is. How to I translate this into a practical method call for a
> value which may or may not exits. Lets say we have two text boxes.
> yearTextBox and wTextBox.
> How to I assign an integer value or nothing depending on if the box is
> emtpy, because you cant assign nothing to an integer. I dont want multiple
> call lines to the one method, just one.
> --
> Goofy
>
> --
> Goofy
>
"Goofy" <me@.mine.com> wrote in message
news:uMXc8jEJHHA.3872@.TK2MSFTNGP06.phx.gbl...

> Got it
> Dim year As System.Nullable(Of Single)
> Dim w As System.Nullable(Of Integer)
Not sure about VB.NET, but in C# v2 you can do this simply by appending a
question mark to the datatype e.g.
Int32 intYear = 0; // not nullable
Int32? intYear = null; // nullable
Didnt know that, but then I dont code in C# normally. This nullable facility
is really usefull in some situations I find.
"Mark Rae" <mark@.markNOSPAMrae.com> wrote in message
news:utmozHFJHHA.536@.TK2MSFTNGP02.phx.gbl...
> "Goofy" <me@.mine.com> wrote in message
> news:uMXc8jEJHHA.3872@.TK2MSFTNGP06.phx.gbl...
>
> Not sure about VB.NET, but in C# v2 you can do this simply by appending a
> question mark to the datatype e.g.
> Int32 intYear = 0; // not nullable
> Int32? intYear = null; // nullable
>
"Goofy" <me@.mine.com> wrote in message
news:%23r$GlYOJHHA.3264@.TK2MSFTNGP02.phx.gbl...

> Didnt know that, but then I dont code in C# normally.
Conversely, I never go anywhere near VB.NET... :-)

> This nullable facility is really usefull in some situations I find.
I couldn't agree more! One of the most important enhancements in v2, along
with generics.

System.Nullable 2.0 Framework

The 2.0 Framework has a new type called System.Nullable. This allows
something to Not exist, basically you can pass 'Nothing' to a method whose
parameters as System.Nullable.

Im looking at table adapters ; you know those clever little things which
allow you to contrsuct methods for manipulating data use this. So a method
might be declared someting like this.

Private Sub myMethod(ByVal myYear As System.Nullable(Of Integer), ByVal
myweek As System.Nullable(Of Integer))

End Sub

My question is. How to I translate this into a practical method call for a
value which may or may not exits. Lets say we have two text boxes.
yearTextBox and weekTextBox.

How to I assign an integer value or nothing depending on if the box is
emtpy, because you cant assign nothing to an integer. I dont want multiple
call lines to the one method, just one.

--
Goofy

--
GoofyGot it

Dim year As System.Nullable(Of Single)

Dim week As System.Nullable(Of Integer)

"Goofy" <me@.mine.comwrote in message
news:%23X%23OA%23DJHHA.320@.TK2MSFTNGP06.phx.gbl...

Quote:

Originally Posted by

The 2.0 Framework has a new type called System.Nullable. This allows
something to Not exist, basically you can pass 'Nothing' to a method whose
parameters as System.Nullable.
>
Im looking at table adapters ; you know those clever little things which
allow you to contrsuct methods for manipulating data use this. So a method
might be declared someting like this.
>
Private Sub myMethod(ByVal myYear As System.Nullable(Of Integer), ByVal
myweek As System.Nullable(Of Integer))
>
End Sub
>
My question is. How to I translate this into a practical method call for a
value which may or may not exits. Lets say we have two text boxes.
yearTextBox and weekTextBox.
>
How to I assign an integer value or nothing depending on if the box is
emtpy, because you cant assign nothing to an integer. I dont want multiple
call lines to the one method, just one.
>
--
Goofy
>
>
>
--
Goofy
>


"Goofy" <me@.mine.comwrote in message
news:uMXc8jEJHHA.3872@.TK2MSFTNGP06.phx.gbl...

Quote:

Originally Posted by

Got it
>
Dim year As System.Nullable(Of Single)
>
Dim week As System.Nullable(Of Integer)


Not sure about VB.NET, but in C# v2 you can do this simply by appending a
question mark to the datatype e.g.

Int32 intYear = 0; // not nullable
Int32? intYear = null; // nullable
Didnt know that, but then I dont code in C# normally. This nullable facility
is really usefull in some situations I find.

"Mark Rae" <mark@.markNOSPAMrae.comwrote in message
news:utmozHFJHHA.536@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

"Goofy" <me@.mine.comwrote in message
news:uMXc8jEJHHA.3872@.TK2MSFTNGP06.phx.gbl...
>

Quote:

Originally Posted by

>Got it
>>
>Dim year As System.Nullable(Of Single)
>>
>Dim week As System.Nullable(Of Integer)


>
Not sure about VB.NET, but in C# v2 you can do this simply by appending a
question mark to the datatype e.g.
>
Int32 intYear = 0; // not nullable
Int32? intYear = null; // nullable
>


"Goofy" <me@.mine.comwrote in message
news:%23r$GlYOJHHA.3264@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Didnt know that, but then I dont code in C# normally.


Conversely, I never go anywhere near VB.NET... :-)

Quote:

Originally Posted by

This nullable facility is really usefull in some situations I find.


I couldn't agree more! One of the most important enhancements in v2, along
with generics.

Tuesday, March 13, 2012

System.Runtime.InteropServices.COMException: Word could not fire t

You need to post the code you are using plus the full error message. I
received this type of error while trying to use query AD using
DirectoryServices and the authentication/impersonation settings in my
web.config were set to a system account that didn't have rights.
"Microsoft NEws" wrote:

> i am getting this error when creating a new document using asp.net
> your thoughts
>
>i solved it
i just added ASPNET user to Microsoft Word Document DCOM
properties/security using dcomcfg.exe
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

System.StackOverflowException

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 PropertyHello
Change
Title = pStrTitle
to
pStrTitle = Value

Best regards,
Sherif

"Simon Harris" <too-much-spam@.makes-you-fat.com> wrote in message
news:u1VhjPBVFHA.3432@.TK2MSFTNGP10.phx.gbl...
> 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
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
"Simon Harris" <too-much-spam@.makes-you-fat.com> wrote in message
news:u1VhjPBVFHA.3432@.TK2MSFTNGP10.phx.gbl...
> 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
Never mind - Realised my properties were in a right old mess :)

"Simon Harris" <too-much-spam@.makes-you-fat.com> wrote in message
news:u1VhjPBVFHA.3432@.TK2MSFTNGP10.phx.gbl...
> 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

--
I am using the free version of SPAMfighter for private users.
It has removed 2175 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!
...but thanks for the replies (I posted my reply before yours appeared)

System.StackOverflowException


Server Error in '/' Application.
------------------------

Exception of type 'System.StackOverflowException' was thrown.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.StackOverflowException: Exception of type 'System.StackOverflowException' was thrown.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[StackOverflowException: Exception of type 'System.StackOverflowException' was thrown.]

I was poking around with some of the controls in ASP.NET 2.0, and suddenly got this message. I have tried everything I can think of, but it just won't go away! Please help!

Thomas ><>Can you be more specific? For example can you post some code or tell us when this happen, what you did that will cause this exception to be thrown etc? This kind of exception will often be thrown when the stack is full, probably when there is loop that will do something with the stack and never. For example like a recursive method that will never end.

<%@. Master Debug="true" %>
<!DOCTYPE HTML SYSTEM>
<html xmlns="http://www.w3.org/1999/xhtml"
<!-- Begin Head. -->
<head>
<title>A Random Design</title>
<meta http-equiv="Content-Type" content="text/html" />
<link type="text/css" rel="stylesheet" href="http://links.10026.com/?link=/ard.css" />
</head>
<!-- End Head. --
<body class="bodycolor02">
<form id="mainform" runat="server"
<div align="center">
<table width="98%">
<tr>
<td colspan="3">
<!-- Begin Header. -->
<table id="header" class="header01" align="center" width="100%" height="100">
<tr>
<td class="backcolor02">><> A Random Design </td>
</tr>
</table>
<!-- End Header. -->
</td>
</tr>
<tr>
<td id="left" align="left" valign="top" width="200">
<!-- Begin Controls. -->
<table id="controls" class="nav01" width="200">
<tr>
<td class="backcolor02" colspan="3" align="center">Navigation</td>
<td class="backcolor02" colspan="5" align="center">Paragraph</td>
</tr>
<tr>
<td class="backcolor02" align="center" valign="bottom"><span class="nav01">A</span></td>
<td class="backcolor02" align="center" valign="bottom"><span class="nav02">A</span></td>
<td class="backcolor02" align="center" valign="bottom"><span class="nav03">A</span></td>
<td class="backcolor02" align="center" valign="bottom"><span class="text01">A</span></td>
<td class="backcolor02" align="center" valign="bottom"><span class="text02">A</span></td>
<td class="backcolor02" align="center" valign="bottom"><span class="text03">A</span></td>
<td class="backcolor02" align="center" valign="bottom"><span class="text04">A</span></td>
<td class="backcolor02" align="center" valign="bottom"><span class="text05">A</span></td>
</tr>
</table>
<!-- End Controls. -->
<!-- Begin Summary. -->
<table id="summary" class="nav01" width="200" height="25">
<tr>
<td class="backcolor02"><span align="center">Latest Updates:</span>
<p>The conversion to ASP.NET 2.0 was a success!<br />
It's a colourful world!<br />
Note the tweaked layout...</p>
</td>
</tr>
</table>
<!-- End Summary. -->
<!-- Begin Menu. -->
<table id="menu" class="nav01" width="200">
<tr>
<td class="backcolor02" valign="top">
<asp:SiteMapDataSource Runat="Server" ID="sitemap" />
<asp:TreeView Runat="Server" ShowExpandCollapse="true" DataSourceID="sitemap">
<DataBindings>
<asp:TreeNodeBinding PopulateOnDemand="true" NavigateUrlField="url" TextField="title" />
</DataBindings>
</asp:TreeView>
</td>
</tr>
</table>
<!-- End Menu. -->
</td>
<td id="center" class="backcolor00" width="100%" align="center" valign="top">
<!-- Begin NavLinks. -->
<table id="navlinks1" class="nav01" align="center" width="100%">
<tr>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled"><asp:HyperLink Runat="Server" NavigateUrl="~/">Home</asp:HyperLink></span></td>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled"><asp:HyperLink Runat="Server" NavigateUrl="javascript:history.back(1)">Back</asp:HyperLink></span></td>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled"><a href="http://links.10026.com/?link=../">Up</asp:HyperLink></span></td>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled"><asp:HyperLink Runat="Server" NavigateUrl="javascript:history.forward(1)">Forward</asp:HyperLink></span></td>
</tr>
<tr>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled">First</span></td>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled">Previous</span></td>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled">Next</span></td>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled">Last</span></td>
</tr>
</table>
<!-- End NavLinks. -->
<!-- Begin BreadCrumbs. -->
<table id="breadcrumbs" class="nav01" align="center" width="100%">
<tr>
<td class="backcolor00">You are here: <asp:SiteMapPath ID="SiteMapPath1" Runat="Server" PathDirection="RootToCurrent" PathSeparator=":-:" CurrentNodeStyle-Font-Italic="true" />
</td>
</tr>
</table>
<!-- End BreadCrumbs. -->
<!-- Begin BodyHead. -->
<table class="header02" align="center" width="100%">
<tr>
<td class="backcolor02">
<asp:ContentPlaceHolder id="bodyhead" runat="server" />
</td>
</tr>
</table>
<!-- End BodyHead. -->
<!-- Begin BodyText. -->
<asp:Panel Runat="Server" ScrollBars="Auto" Width="100%" Height="500">
<table class="text02" align="center" width="100%">
<tr>
<td class="backcolor02" valign="top">
<asp:ContentPlaceHolder id="bodytext" runat="server" />
</td>
</tr>
</table>
</asp:Panel>
<!-- End BodyText. -->
<!-- Begin PageCounter. -->
<table class="nav01" align="center" width="100%">
<tr>
<td class="backcolor00" valign="top">
This page has been viewed <!-- Page Counter --> times.
</td>
</tr>
</table>
<!-- End PageCounter. -->
<!-- Begin NavLinks. -->
<table id="navlinks2" class="nav01" align="center" width="100%">
<tr>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled"><asp:HyperLink Runat="Server" NavigateUrl="~/">Home</asp:HyperLink></span></td>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled"><asp:HyperLink Runat="Server" NavigateUrl="javascript:history.back(1)">Back</asp:HyperLink></span></td>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled"><a href="http://links.10026.com/?link=../">Up</asp:HyperLink></span></td>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled"><asp:HyperLink Runat="Server" NavigateUrl="javascript:history.forward(1)">Forward</asp:HyperLink></span></td>
</tr>
<tr>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled">First</span></td>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled">Previous</span></td>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled">Next</span></td>
<td class="backcolor00" style="text-align: center"><span class="linkdisabled">Last</span></td>
</tr>
</table>
<!-- End NavLinks. -->
</td>
<td id="right" align="center" valign="top" width="200">
<!-- Begin AdsTable. -->
<table valign="top" width="100%">
<tr>
<td class="backcolor00">
<!-- Begin AdsTable. -->
<table valign="top" width="100%">
<tr>
<td class="backcolor00">
<asp:ContentPlaceHolder runat="server" ID="adstable">
<asp:AdRotator Runat="server" ID="AdRotator" AdvertisementFile="~/images/adrotate.xml" />
</asp:ContentPlaceHolder>
</td>
</tr>
</table>
<!-- End AdsTable. -->
</td>
</tr>
</table>
<!-- End AdsTable. --></td>
</tr>
<tr>
<td colspan="3">
<!-- Begin Footer. -->
<table id="footer" class="nav01" align="center" width="100%">
<tr>
<td class="backcolor02" width="100%">
<p style="text-align: center">Copyright © 2002-2004 Thomas Ingram ><> All Rights Reserved.</p>
</td>
</tr>
</table>
<!-- End Footer. -->
</td>
</tr>
</table>
</div
</form>
</body
</html>

That is the source for the Master page. I am certain the problem is not with the Content pages. Also I am using an XML file that has the menu info in it. I am sure the problem is not there either, since the menu worked at one point. Thank you.

Thomas ><>
Has anyone else seen this error? How is it fixed?
If you could send me your code and the XML file, I could check if I will have the same problem. My e-mail is fnormen@.<no spam>hotmail.com

System.StackOverflowException

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 PropertyHello
Change
Title = pStrTitle
to
pStrTitle = Value
Best regards,
Sherif
"Simon Harris" <too-much-spam@.makes-you-fat.com> wrote in message
news:u1VhjPBVFHA.3432@.TK2MSFTNGP10.phx.gbl...
> 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
>
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
"Simon Harris" <too-much-spam@.makes-you-fat.com> wrote in message
news:u1VhjPBVFHA.3432@.TK2MSFTNGP10.phx.gbl...
> 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
>
Never mind - Realised my properties were in a right old mess :)
"Simon Harris" <too-much-spam@.makes-you-fat.com> wrote in message
news:u1VhjPBVFHA.3432@.TK2MSFTNGP10.phx.gbl...
> 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
>
I am using the free version of SPAMfighter for private users.
It has removed 2175 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!
...but thanks for the replies (I posted my reply before yours appeared)

System.StackOverflowException: Exception of type System.StackOverf

Error:-
System.StackOverflowException: Exception of type
System.StackOverflowException was thrown.
When is this thrown..
Any ideasthis should happen when you have a cicling method which is never finishig.
It should happen to have a property like this

private int a ;
public int A{
get{ return A;} instead of A put a
set{ A = value;} instead of A put a
}

this is the most usuall content in which you get the error.

"Patrick.O.Ige" wrote:

> Error:-
> System.StackOverflowException: Exception of type
> System.StackOverflowException was thrown.
> When is this thrown..
> Any ideas
Thx mate.
I get it when i work with VS.NET!
But works with asp.net
Do u know why?:)

"Psycho" wrote:

> this should happen when you have a cicling method which is never finishig.
> It should happen to have a property like this
> when i work with VS.NET
> private int a ;
> public int A{
> get{ return A;} instead of A put a
> set{ A = value;} instead of A put a
> }
> this is the most usuall content in which you get the error.
> "Patrick.O.Ige" wrote:
> > Error:-
> > System.StackOverflowException: Exception of type
> > System.StackOverflowException was thrown.
> > When is this thrown..
> > Any ideas
it is throw when you make an infinite recurvise method.

http://msdn.microsoft.com/library/d...nclasstopic.asp

"Patrick.O.Ige" wrote:

> Thx mate.
> I get it when i work with VS.NET!
> But works with asp.net
> Do u know why?:)
>
> "Psycho" wrote:
> > this should happen when you have a cicling method which is never finishig.
> > It should happen to have a property like this
> > when i work with VS.NET
> > private int a ;
> > public int A{
> > get{ return A;} instead of A put a
> > set{ A = value;} instead of A put a
> > }
> > this is the most usuall content in which you get the error.
> > "Patrick.O.Ige" wrote:
> > > Error:-
> > > System.StackOverflowException: Exception of type
> > > System.StackOverflowException was thrown.
> > > When is this thrown..
> > > Any ideas

System.StackOverflowException: Exception of type System.StackOverf

Error:-
System.StackOverflowException: Exception of type
System.StackOverflowException was thrown.
When is this thrown..
Any ideasthis should happen when you have a cicling method which is never finishig.
It should happen to have a property like this
private int a ;
public int A{
get{ return A;} instead of A put a
set{ A = value;} instead of A put a
}
this is the most usuall content in which you get the error.
"Patrick.O.Ige" wrote:

> Error:-
> System.StackOverflowException: Exception of type
> System.StackOverflowException was thrown.
> When is this thrown..
> Any ideas

System.StackOverflowException: Exception of type System.StackO

Thx mate.
I get it when i work with VS.NET!
But works with asp.net
Do u know why?:)
"Psycho" wrote:
> this should happen when you have a cicling method which is never finishig.
> It should happen to have a property like this
> when i work with VS.NET
> private int a ;
> public int A{
> get{ return A;} instead of A put a
> set{ A = value;} instead of A put a
> }
> this is the most usuall content in which you get the error.
> "Patrick.O.Ige" wrote:
>it is throw when you make an infinite recurvise method.
http://msdn.microsoft.com/library/d...nclasstopic.asp
"Patrick.O.Ige" wrote:
> Thx mate.
> I get it when i work with VS.NET!
> But works with asp.net
> Do u know why?:)
>
> "Psycho" wrote:
>