Details view with autogenerate equal false

Posted on 2007-07-24
Last Modified: 2007-07-24
I am trying to use a non auto generated insert button in a details view and it isn't working
I have posted both my objectdatasource and the detailsview insert template. The page refeshes but nothing is added to the db. Any suggestions? Everything was working until I didn't auto generate the insert button.
'object data source
    <asp:ObjectDataSource ID="ods1" runat="server" SelectMethod="getDS" DeleteMethod="Delete" InsertMethod="Add" UpdateMethod="SaveGrid"
'details view insert
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Add"  ValidationGroup="InsertGroup" Text="Insert"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
Question by:NickMalloy
    1 Comment
    LVL 16

    Accepted Solution

    You need to make CommandName="Add" into CommandName="Insert" if you want to use the default processing of the detailsview insert. Otherwise, you'll have to process the commandname of "Add" and do the insert logic manually.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on could not pull conte…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now