Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7902279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:27:06+00:00 2026-06-03T09:27:06+00:00

I have an asp.net webpage that contain a gridview with edit, select and delete

  • 0

I have an asp.net webpage that contain a gridview with edit, select and delete enabled, and a detailview for inserting new record. Each control is placed inside a asp.net ajax extension control-updatepanel. And the two controls are bonded to the same datasource which is LinqDataSource.

After new record was inserted nothing display in the gridview until user refresh the page.
Did I miss something? Can anyone help?

<asp:ScriptManager ID="ScriptManager1" runat="server" />
<fieldset>

<asp:UpdatePanel ID="UpdatePanel2" runat="server">       
    <ContentTemplate>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="TermLinqDataSource" AllowPaging="True" AllowSorting="True" 
        DataKeyNames="TermID">
        <Columns>
            <asp:CommandField 
                ShowSelectButton="True" />
            <asp:BoundField DataField="RowIndex" HeaderText="RowIndex" 
                InsertVisible="False" SortExpression="RowIndex" Visible="False" />
            <asp:BoundField DataField="TermID" HeaderText="Term" ReadOnly="True" 
                SortExpression="TermID" />
            <asp:BoundField DataField="StartDate" HeaderText="Start Date" 
                SortExpression="StartDate" DataFormatString="{0:d}" />
            <asp:BoundField DataField="EndDate" HeaderText="End Date" 
                SortExpression="EndDate" DataFormatString="{0:d}" />               
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />  
        </Columns>                        
    </asp:GridView>
    </ContentTemplate>
    </asp:UpdatePanel>

    <br />
    <h4>Add New Term:</h4>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <asp:DetailsView ID="addNewTerm" runat="server" 
            AutoGenerateRows="False" DataKeyNames="TermID" 
            DataSourceID="TermLinqDataSource" DefaultMode="Insert">
            <FieldHeaderStyle Font-Bold="true" />
            <Fields>
                <asp:BoundField DataField="TermID" HeaderText="Term:" SortExpression="TermID" 
                    ReadOnly="True" />
                <asp:BoundField DataField="StartDate" HeaderText="Start Date:" 
                    SortExpression="StartDate" />
                <asp:BoundField DataField="EndDate" HeaderText="End Date:" 
                    SortExpression="EndDate" />
                <asp:CommandField ShowInsertButton="True" />
            </Fields>
        </asp:DetailsView>
    </ContentTemplate>
    </asp:UpdatePanel>
    <asp:LinqDataSource ID="TermLinqDataSource" runat="server" 
        ContextTypeName="CETMSClient.RegistraDCsDataContext" EnableDelete="True" 
        EnableInsert="True" EnableUpdate="True" TableName="Terms" 
        OrderBy="RowIndex desc" >
    </asp:LinqDataSource>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T09:27:07+00:00Added an answer on June 3, 2026 at 9:27 am

    I think you need to bind gridview again after insertion.
    Visit msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.detailsview.iteminserted.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario: You have an ASP.Net webpage that should display the next image in a
I have an ASP.NET webpage running under IIS that uses a common assembly that
I have an ASP.NET 2.0 (C#) webpage with a link that pulls a blob
I have an asp.net webpage that only contains a textbox and a button. The
I have an ASP.NET 4 webpage that contains an update panel which just allows
We have an asp.net webpage that uses viewstate. During a lengthy operation (that takes
I have an ASP.NET webpage that is rendering many (~3000) <input type=text> textboxes on
i have a asp.net mvc webpage that queries a SQL server database for contact
Hello StackOverflow, I have an ASP.NET/C# webpage that calls functions from a managed .dll
I have a simple asp.net web page that contain a table with about 5

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.