Click here to Skip to main content
15,914,419 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Chat Pin
_Maxxx_17-Mar-09 19:18
professional_Maxxx_17-Mar-09 19:18 
QuestionProblem With enternet exporer 6.0 Pin
ais0716-Mar-09 18:05
ais0716-Mar-09 18:05 
AnswerRe: Problem With enternet exporer 6.0 Pin
Christian Graus16-Mar-09 18:18
protectorChristian Graus16-Mar-09 18:18 
GeneralRe: Problem With enternet exporer 6.0 Pin
ais0716-Mar-09 18:23
ais0716-Mar-09 18:23 
GeneralRe: Problem With enternet exporer 6.0 Pin
Christian Graus16-Mar-09 18:35
protectorChristian Graus16-Mar-09 18:35 
GeneralRe: Problem With enternet exporer 6.0 Pin
ais0716-Mar-09 18:37
ais0716-Mar-09 18:37 
GeneralRe: Problem With enternet exporer 6.0 Pin
Christian Graus16-Mar-09 19:03
protectorChristian Graus16-Mar-09 19:03 
QuestionDeleting is not supported by ObjectDataSource 'allUsersDataSource' unless the DeleteMethod is specified Pin
JimBob SquarePants16-Mar-09 16:20
JimBob SquarePants16-Mar-09 16:20 
Dear fellows


I've been fiddling about with some code I inherited that I hoped would allow me to delete users from my database.

The users are actually part of the asnet users scheme not just a simple record table.

I'm getting the error message stated in the title of my query.

The funny thing is, is that it seems to be deleting the user but also returning me the error essage.

can anyone tell me what is going wrong?

I've been googling but not had much luck.

Thanks in advance.

Here's what I'm doing..............

The markup:

<asp:gridview id="gvUsers" allowpaging="true" runat="server" autogeneratecolumns="False" xmlns:asp="#unknown">
            DataSourceID="allUsersDataSource" EmptyDataText="There are no matching users in the system."
            PageSize="5" BorderStyle="Solid" BorderColor="#6AA6CC">
            <footerstyle cssclass="GridFooter"></footerstyle>
            <rowstyle cssclass="GridItem"></rowstyle>
            <alternatingrowstyle cssclass="GridAltItem"></alternatingrowstyle>
            <pagerstyle cssclass="GridFooter" /><headerstyle cssclass="GridHeader"></headerstyle>
            <columns>
                <asp:templatefield headertext="Active" itemstyle-width="40" itemstyle-horizontalalign="Center">
                    <itemtemplate>
                        <asp:checkbox runat="server" id="chkActive" oncheckedchanged="EnabledChanged" autopostback="true">
                            Checked='<%#DataBinder.Eval(Container.DataItem, "IsApproved")%>' Value='<%#DataBinder.Eval(Container.DataItem, "UserName")%>' />
                    </asp:checkbox></itemtemplate>
                </asp:templatefield>
                <asp:templatefield runat="server" headertext="User Name" itemstyle-width="160">
                    <itemtemplate>
                        <a href="Admin_UsersEdit.aspx?username=<%#Eval("UserName")%>">
                            <%#DataBinder.Eval(Container.DataItem, "UserName")%></a>
                    </itemtemplate>
                    <itemstyle width="160px"></itemstyle>
                </asp:templatefield>
                <asp:templatefield headertext="Email" itemstyle-width="180" itemstyle-horizontalalign="Left">
                    <itemtemplate>
                        <asp:hyperlink id="EmailLink" runat="server" navigateurl="<%# Eval("Email", "mailto:{0}") %>">
                            Text='<%# Eval("Email") %>'></asp:hyperlink>
                    </itemtemplate>
                    <itemstyle horizontalalign="Left" width="180px"></itemstyle>
                </asp:templatefield>
                <asp:boundfield datafield="CreationDate" headertext="Created On" readonly="True">
                    SortExpression="CreationDate" ItemStyle-HorizontalAlign="Center">
                    <itemstyle horizontalalign="Center"></itemstyle>
                </asp:boundfield>
                <asp:boundfield datafield="LastLoginDate" headertext="Last Login" sortexpression="LastLoginDate">
                    ItemStyle-HorizontalAlign="Center">
                    <itemstyle horizontalalign="Center"></itemstyle>
                </asp:boundfield>
                <asp:templatefield runat="server" itemstyle-horizontalalign="Center">
                    <itemtemplate>
                        <asp:linkbutton runat="server" id="linkButton2" text="Delete" commandname="delete">
                            CommandArgument='<%#DataBinder.Eval(Container.DataItem, "UserName")%>' ForeColor="black"
                            OnCommand="LinkButtonClick" />
                    </asp:linkbutton></itemtemplate>
                    <itemstyle horizontalalign="Center"></itemstyle>
                </asp:templatefield>
            </columns>
            <emptydatarowstyle font-italic="True" />
        </asp:gridview>

my code behind:

Public Sub LinkButtonClick(ByVal sender As Object, ByVal e As CommandEventArgs)
        If e.CommandName.Equals("delete") Then
            Dim userName As String = DirectCast(e.CommandArgument, String)
          
            Membership.DeleteUser(userName)
           
            Response.Redirect("admin_users.aspx", False)
        End If
    End Sub


JimBob SquarePants
*******************************************************************
"He took everything personally, including our royalties!"
David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager
*******************************************************************

QuestionFreeTextBox control Pin
dptalt16-Mar-09 10:15
dptalt16-Mar-09 10:15 
AnswerRe: FreeTextBox control Pin
Christian Graus16-Mar-09 10:27
protectorChristian Graus16-Mar-09 10:27 
AnswerRe: FreeTextBox control Pin
Yusuf16-Mar-09 10:29
Yusuf16-Mar-09 10:29 
QuestionConversion of html page to aspx page Pin
immu516-Mar-09 9:58
immu516-Mar-09 9:58 
AnswerRe: Conversion of html page to aspx page Pin
Christian Graus16-Mar-09 10:26
protectorChristian Graus16-Mar-09 10:26 
GeneralRe: Conversion of html page to aspx page Pin
immu516-Mar-09 10:45
immu516-Mar-09 10:45 
GeneralRe: Conversion of html page to aspx page Pin
Christian Graus16-Mar-09 12:34
protectorChristian Graus16-Mar-09 12:34 
GeneralRe: Conversion of html page to aspx page Pin
immu517-Mar-09 4:28
immu517-Mar-09 4:28 
AnswerREGEX Pin
David Mujica16-Mar-09 10:26
David Mujica16-Mar-09 10:26 
GeneralRe: REGEX Pin
immu516-Mar-09 10:44
immu516-Mar-09 10:44 
Question[Message Deleted] Pin
Richard Leighton16-Mar-09 5:10
Richard Leighton16-Mar-09 5:10 
AnswerRe: Frustrating! Datagrid - Get the information! Pin
led mike16-Mar-09 5:31
led mike16-Mar-09 5:31 
GeneralRe: Frustrating! Datagrid - Get the information! Pin
Richard Leighton16-Mar-09 7:09
Richard Leighton16-Mar-09 7:09 
GeneralRe: Frustrating! Datagrid - Get the information! Pin
led mike16-Mar-09 7:47
led mike16-Mar-09 7:47 
RantRe: Frustrating! Datagrid - Get the information! Pin
Richard Leighton16-Mar-09 7:49
Richard Leighton16-Mar-09 7:49 
GeneralRe: Frustrating! Datagrid - Get the information! Pin
led mike16-Mar-09 7:55
led mike16-Mar-09 7:55 
Question"ASP" Sending Email Doesn't deliver.. Pin
D.Manivelan16-Mar-09 5:05
D.Manivelan16-Mar-09 5:05 

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.