TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Chevy Mark Sunderland
NA
188
167.3k
Protected void `RowUpdated`, `RowCancelingEdit` and `RowEditing`
Mar 28 2012 11:09 AM
Hi there, I hope your appreciated help.
First of all I must say that I am a newbie when it comes to net language.
This is the GridView: I have problem with the `alerts` of protected void `RowUpdated`, `RowCancelingEdit` and `RowEditing`.
I need for single row is edit or update or cancel print the output `OK` or `KO` in the `lblMessage`.
Now when update the single row I have only output "OK" and If switch the following row for upgrade this output remains fixed printed in the net page...
Can you help me? thank you in advance.
Your help would be very appreciated
protected void GridView1_RowUpdated(Object sender, GridViewUpdatedEventArgs e)
{
if (e.Exception != null)
{
this.lblMessage.Text = e.Exception.Message;
}
else
{
e.ExceptionHandled = true;
this.lblMessage.Text = "OK";
}
}
protected void GridView1_RowCancelingEdit(Object sender, GridViewCancelEditEventArgs e)
{
}
protected void GridView1_RowEditing(Object sender, GridViewEditEventArgs e)
{
}
...
<asp:GridView ID="GridView1" runat="server"
DataSourceID="SqlDataSource1"
DataKeyNames="ID"
AllowSorting="True"
AllowPaging="True"
PageSize="15"
AutoGenerateColumns="false"
CssClass="first"
OnRowUpdated="GridView1_RowUpdated"
OnRowcancelingedit="GridView1_RowCancelingEdit"
OnrowEditing="GridView1_RowEditing">
...
</asp:GridView>
<asp:Label ID="lblMessage" ForeColor="Red" runat="server" />
...
Reply
Answers (
1
)
Define global.asax in ASP.NET.
JavaScript and Ajax not working