Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
530
Full page postback issue, instead of AJAX
posted

I have created a page with a WebImageButton within a WebDataGrid.  When the button is pushed, it does a full page postback instead of just the grid.  I add the OnItemCommand="grdClasses_ItemCommand" code to my markup and it causes the page to abend.  What am I doing wrong?  I will attach some of my code behind and the grid markup.  Thanks.

Code Behind...

Dim adapter As New SqlClient.SqlDataAdapter(sql.ToString, cn)

 

 

 

Dim ds As DataSet = New DataSet("Classes")

adapter.Fill(ds)

 

 

 

If ds.Tables(0).Rows.Count > 0 Then

 

 

 

With grdClasses

.DataSource = ds

.DataMember =

 

""

.DataBind()

 

 

 

 

End With

 

 

 

End If

Mark Up...

 

 

<ig:WebDataGrid ID="grdClasses" runat="server" AutoGenerateColumns="False"

 

 

EnableDataViewState="True" Height="350px" Width="769px" OnItemCommand="grdClasses_ItemCommand">

 

 

<Columns>

 

 

<ig:BoundDataField DataFieldName="id" Hidden="True" Key="id">

 

 

<Header Text="BoundColumn_0" />

 

 

</ig:BoundDataField>

 

 

<ig:BoundDataField DataFieldName="classdate" Key="classdate">

 

 

<Header Text="Class Date" />

 

 

</ig:BoundDataField>

 

 

<ig:BoundDataField DataFieldName="cost" Key="cost" DataFormatString="{0:C}">

 

 

<Header Text="Cost" />

 

 

</ig:BoundDataField>

 

 

<ig:TemplateDataField Key="register">

 

 

<ItemTemplate>

 

 

<igtxt:WebImageButton ID="cmdClass" runat="server" Text="Register">

 

 

</igtxt:WebImageButton>

 

 

</ItemTemplate>

 

 

<Header Text="Register" />

 

 

</ig:TemplateDataField>

 

 

</Columns>

 

 

</ig:WebDataGrid>

Parents
No Data
Reply Children
No Data