PC Review


Reply
Thread Tools Rate Thread

Delete from Datagrid without Viewstate?

 
 
Jonah Olsson
Guest
Posts: n/a
 
      13th Aug 2003
Hi guys,

How can I change the following code to work without using Viewstate?

Thanks
Jonah

** file.aspx **
<asp:datagrid ID="dgEmails" runat="server"
Width="95%"
HorizontalAlign="Center"
GridLines="None"
AutoGenerateColumns="false"
EnableViewState="false">
<alternatingitemstyle BackColor="#FFFFFF"></alternatingitemstyle>
<itemstyle BackColor="#EEEEEE"></itemstyle>
<columns>
<asp:boundcolumn HeaderText="E-mail"
HeaderStyle-CssClass="contentHeader" DataField="email" ItemStyle-Width="180"
/>
<asp:templatecolumn ItemStyle-Width="50"
ItemStyle-HorizontalAlign="right">
<itemtemplate>
<asp:LinkButton id="lnkDelete" CssClass="greyWhiteBox"
runat="server" CommandName="Delete" Text='<%# Localize.GetString("DELETE")
%>' CausesValidation="false" />
</itemtemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>

** file.aspx.vb **
Sub dgEmails_Delete(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs) Handles dgEmails.DeleteCommand

Dim Email As String = e.Item.Cells(0).Text
Dim GroupID As Integer = Request.Params("GroupID")
Dim result As Integer

result = MemberManagement.DeleteEmail(Email, GroupID)

lblMessage.Text = "Record deleted"

BindData()

End Sub


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid Viewstate kpg Microsoft ASP .NET 4 5th Jun 2006 06:05 PM
Datagrid : viewstate =?Utf-8?B?UmVn?= Microsoft ASP .NET 1 10th May 2006 11:05 PM
viewstate on datagrid Dave Bartlett Microsoft ASP .NET 1 9th Jul 2004 04:43 PM
Viewstate on a datagrid Paul Microsoft ASP .NET 1 7th May 2004 03:27 AM
Delete from Datagrid without Viewstate? Jonah Olsson Microsoft ASP .NET 0 13th Aug 2003 08:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:22 PM.