473,396 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Delete from Datagrid without Viewstate?

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
Nov 19 '05 #1
0 1237

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Derek | last post by:
I have an aspx page where I use a reversebind and templates to edit the entire datagrid at one time. I added a textbox and button to change the parameter criteria and then rerun the databind2...
4
by: Stephen | last post by:
I have got an event below to remove items from an arraylist and then to rebind the arraylist to the datagrid subsequently deleting the appropriate row. My problem is that my code makes sense and I...
2
by: Stephen | last post by:
I am trying to delete a row in a datagrid on the onclick of a asp:ButtonColumn. The datagrid is created from the items in an arraylist so what im trying to do is remove the item from the array and...
1
by: Stephen | last post by:
I have an event below to remove items from an arraylist and then to rebind the arraylist to the datagrid subsequently deleting the appropriate row. My problem is that my code makes sense and I...
0
by: Jonah Olsson | last post by:
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%"
3
by: Phi | last post by:
Hi, I hope somebody could help me with this problem. I would like to make a form to add and delete records from my ms access database. I've found most of the codes from the internet and...
0
by: Sue | last post by:
I'm missing something very simple here, and I need an answer fairly quick if possible. I'm behind on this project now because of this... Code examples below question... I have a datagrid (DG)...
5
by: Jeff User | last post by:
Hello ..NET 1.1, VS 2003, C# & asp.net I have tried to follow msdn instructions and samples but I can not get an event to fire for this button on the datagrid. There has to be something obvious...
4
by: kpg | last post by:
Hola, I have a datagrid with button columns. I bind the data on page load, and the table is read only, so I don't need the datagrid viewstate enabled. When I turn it off however, I no longer...
0
by: rn5a | last post by:
All the rows in a DataGrid are accompanied by a CheckBox. When a user checks the rows & clicks a Button, the checked rows get deleted. For e.g. assume that the DataGrid displays 10 rows. A user...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.