Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: C# Error Message For AdRotar


Message #1 by "Mark Phillips" <margia5@h...> on Mon, 7 May 2001 18:09:47
Hi,



I'm working thru the examples in the WROX Preview of ASP+.

I coverted the code for the AdRotar to C# and am getting a 

message I don't understand.  Can anyone help?  The info is listed

below:



Compiler Error Message: 

CS0118: 'System.Web.UI.WebControls.AdCreatedEventArgs.AdProperties' 

denotes a 'property' where a 'method' was expected



Source Error:



 



Line 4:  	void Ad_Created( Object Sender, AdCreatedEventArgs e )

Line 5:  	{

Line 6:  	    if (e.AdProperties("Caption") != "" )

Line 7:  		Caption.Text = e.AdProperties("Caption");

Line 8:         }



Thanks,

Mark

 

Message #2 by "Mark Phillips" <margia5@h...> on Tue, 8 May 2001 07:01:52
I found my error. In C# the AdProperties are held in a collection array.

So the value of the add properties must be addressed with the square 

brackets that are used with C# arrays.  



The solution is:



Line 4:  	void Ad_Created( Object Sender, AdCreatedEventArgs e )

> Line 5:  	{

> Line 6:  	    if (e.AdProperties["Caption"] != "" )

> Line 7:  		Caption.Text = e.AdProperties["Caption"];

> Line 8:         }



Mark







> Hi,

> 

> I'm working thru the examples in the WROX Preview of ASP+.

> I coverted the code for the AdRotar to C# and am getting a 

> message I don't understand.  Can anyone help?  The info is listed

> below:

> 

> Compiler Error Message: 

> CS0118: 'System.Web.UI.WebControls.AdCreatedEventArgs.AdProperties' 

> denotes a 'property' where a 'method' was expected

> 

> Source Error:

> 

>  

> 

> Line 4:  	void Ad_Created( Object Sender, AdCreatedEventArgs e )

> Line 5:  	{

> Line 6:  	    if (e.AdProperties("Caption") != "" )

> Line 7:  		Caption.Text = e.AdProperties("Caption");

> Line 8:         }

> 

> Thanks,

> Mark

>  


  Return to Index