Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: semicolon expected and OnItemCommand problem


Message #1 by "Carl Chouinard" <carl@w...> on Fri, 17 Aug 2001 15:16:30 -0400
Hi all, 



I have two little problems. I always get compiler error telling me to

put semicolon after my if statement



If(expression)

{

	..

}



Well the compiler tells me to put a semicolon after the ")" which

doesn't make sense! 



Another problem, I have a DataGrid Web Control in whit I've put a 



<asp:DataGrid 

...

OnItemCommand="labelInfo"

/>



And in my .cs file (CodeBehind) I have declare the following function 



protected void labelInfo(object sender, DataGridCommandEventArgs e)

{

	..

}



When compiling I don't get any error relating to that, but when running

the page I have the following error



CS0117: 'ASP.WebForm1_aspx' does not contain a definition for

'labelInfo'



But it's there! I have another event handler from a button onclick event

in my .cs who works perfectly.



Any help would be appreciated, I have VS.NET beta 2 with SP 2 installed.





Carl

	



Message #2 by "Chris Scott" <chris@e...> on Mon, 20 Aug 2001 09:27:17 -0700
Hi Carl,



I think 'If' should be 'if' (all lower case).

Is runat=server in the datagrid tag?

Is the datagrid defined in the code behind class (e.g. protected

System.Web.UI.WebControls.DataGrid myDataGrid) ?



HTH



Chris



----- Original Message -----

From: "Carl Chouinard" <carl@w...>

To: "ASP+" <aspx@p...>

Sent: Friday, August 17, 2001 12:16 PM

Subject: [aspx] semicolon expected and OnItemCommand problem





> Hi all,

>

> I have two little problems. I always get compiler error telling me to

> put semicolon after my if statement

>

> If(expression)

> {

> ..

> }

>

> Well the compiler tells me to put a semicolon after the ")" which

> doesn't make sense!

>

> Another problem, I have a DataGrid Web Control in whit I've put a

>

> <asp:DataGrid

> ...

> OnItemCommand="labelInfo"

> />

>

> And in my .cs file (CodeBehind) I have declare the following function

>

> protected void labelInfo(object sender, DataGridCommandEventArgs e)

> {

> ..

> }

>

> When compiling I don't get any error relating to that, but when running

> the page I have the following error

>

> CS0117: 'ASP.WebForm1_aspx' does not contain a definition for

> 'labelInfo'

>

> But it's there! I have another event handler from a button onclick event

> in my .cs who works perfectly.

>

> Any help would be appreciated, I have VS.NET beta 2 with SP 2 installed.

>

>

> Carl

>

>


  Return to Index