Click here to Skip to main content
16,006,845 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: ASP.Net Message Box Pin
ritu432118-Apr-07 19:29
ritu432118-Apr-07 19:29 
GeneralRe: ASP.Net Message Box Pin
J Liang19-Apr-07 16:20
J Liang19-Apr-07 16:20 
QuestionCan we use ASP files in ASP.Net Solution Pin
Rahithi18-Apr-07 17:25
Rahithi18-Apr-07 17:25 
AnswerRe: Can we use ASP files in ASP.Net Solution Pin
Elizma18-Apr-07 18:05
Elizma18-Apr-07 18:05 
QuestionAccessing a List<object[]> from a repeater control Pin
eggie518-Apr-07 12:07
eggie518-Apr-07 12:07 
QuestionHow to get Server control to access parent container's controls collection? Pin
Dominic Pettifer18-Apr-07 12:04
Dominic Pettifer18-Apr-07 12:04 
AnswerRe: How to get Server control to access parent container's controls collection? Pin
koleraba18-Apr-07 15:41
koleraba18-Apr-07 15:41 
QuestionGrid view delete Pin
hahii18-Apr-07 11:04
hahii18-Apr-07 11:04 
I have the followning code in my HTML part. But when I click on Deletw link it deleted the record from gridview as well as from Datasource but it give me following error page


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: Updating is not supported by ObjectDataSource 'ObjectDataSource1' unless the deleteMethod is specified.




Here Is the code

<asp:gridview id="gdAddUser" runat="server" allowsorting="True" autogeneratecolumns="False"
="" datakeynames="UserId" datasourceid="ObjectDataSource1" onrowcommand="gdAddUser_RowCommand" onrowdatabound="gdAddUser_RowDataBound" onrowdeleting="gdAddUser_RowDeleting" width="390px" onselectedindexchanged="gdAddUser_SelectedIndexChanged" autogenerateeditbutton="True">
<columns>
<asp:boundfield datafield="AppName" headertext="Application">
<asp:boundfield datafield="AppRight" headertext="Permissions">
<asp:templatefield headertext="Select">
<itemtemplate>
<asp:linkbutton id="LinkButton1" runat="server"
="" commandargument="<%# Eval("UserId") %>" commandname="Delete">
Delete



protected void gdAddUser_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton l = (LinkButton)e.Row.FindControl("LinkButton1");
l.Attributes.Add("onclick", "javascript:return " +
"confirm('Are you sure you want to delete this record " +
DataBinder.Eval(e.Row.DataItem, "UserId") + "')");
}

}
protected void gdAddUser_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Delete")
{
// get the categoryID of the clicked row
int AppId = Convert.ToInt32(e.CommandArgument);
// Delete the record
DeleteRecordByID(AppId);
// Implement this on your own Smile | :)
}

}
//protected void gdAddUser_RowDeleted(object sender, GridViewDeletedEventArgs e)

//}
protected void gdAddUser_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int AppId = (int)gdAddUser.DataKeys[e.RowIndex].Value;
DeleteRecordByID(AppId);//implement yourself


}
QuestionASP.NET and K2.NET 2003 Problem [modified] Pin
Elizma18-Apr-07 8:49
Elizma18-Apr-07 8:49 
QuestionWeb server control(textbox) events Pin
hbk_leo18-Apr-07 8:00
hbk_leo18-Apr-07 8:00 
AnswerRe: Web server control(textbox) events Pin
kubben18-Apr-07 8:19
kubben18-Apr-07 8:19 
AnswerRe: Web server control(textbox) events Pin
_mubashir18-Apr-07 8:19
_mubashir18-Apr-07 8:19 
AnswerRe: Web server control(textbox) events Pin
Not Active18-Apr-07 8:22
mentorNot Active18-Apr-07 8:22 
QuestionASP.NET Deploying Pin
hariram2818-Apr-07 7:29
hariram2818-Apr-07 7:29 
AnswerRe: ASP.NET Deploying Pin
kubben18-Apr-07 8:18
kubben18-Apr-07 8:18 
GeneralRe: ASP.NET Deploying Pin
hariram2819-Apr-07 0:29
hariram2819-Apr-07 0:29 
GeneralRe: ASP.NET Deploying Pin
kubben19-Apr-07 1:44
kubben19-Apr-07 1:44 
GeneralRe: ASP.NET Deploying Pin
hariram2819-Apr-07 7:34
hariram2819-Apr-07 7:34 
GeneralRe: ASP.NET Deploying Pin
kubben19-Apr-07 7:46
kubben19-Apr-07 7:46 
GeneralRe: ASP.NET Deploying Pin
hariram2819-Apr-07 22:25
hariram2819-Apr-07 22:25 
GeneralRe: ASP.NET Deploying Pin
kubben20-Apr-07 2:02
kubben20-Apr-07 2:02 
QuestionHow can I display or hide columns for Gridview in ASP.NET 2.0? Pin
radshaykho18-Apr-07 5:58
radshaykho18-Apr-07 5:58 
AnswerRe: How can I display or hide columns for Gridview in ASP.NET 2.0? Pin
enjoycrack18-Apr-07 7:07
enjoycrack18-Apr-07 7:07 
GeneralRe: How can I display or hide columns for Gridview in ASP.NET 2.0? Pin
radshaykho18-Apr-07 7:25
radshaykho18-Apr-07 7:25 
QuestionHow to Reply? Pin
ArunkumarSundaravelu18-Apr-07 5:57
ArunkumarSundaravelu18-Apr-07 5:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.