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

  • SEARCH
  • Home
  • 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 3498612
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:30:40+00:00 2026-05-18T12:30:40+00:00

I am working on a application where i am using rowupdating event of the

  • 0

I am working on a application where i am using rowupdating event of the gridview. I am using templatefield in my columns so i am not able to get the new values from the textboxws that i am having in the gridview. How can i get the new values from the textboxes. Following is my code in rowupdating:

protected void gviewTemplate_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
    gviewTemplate.EditIndex = -1;
    string rowNum = ViewState["ID"].ToString();
    Label lbl2 = (Label)gviewTemplate.Rows[e.RowIndex].FindControl("lblTemplateName");
    Label lbl1 = (Label)gviewTemplate.Rows[e.RowIndex].FindControl("lblUploaded");

    TextBox txtTempName = (TextBox)gviewTemplate.Rows[e.RowIndex].FindControl("txtTemplateName");
    TextBox txtHeading = (TextBox)gviewTemplate.Rows[e.RowIndex].FindControl("txtHeading");
    TextBox txtCoupon = (TextBox)gviewTemplate.Rows[e.RowIndex].FindControl("txtCouponText");
    TextBox txtBrand = (TextBox)gviewTemplate.Rows[e.RowIndex].FindControl("txtBrandName");
    TextBox txtSearchText = (TextBox)gviewTemplate.Rows[e.RowIndex].FindControl("txtSearch");
    TextBox txtDiscount = (TextBox)gviewTemplate.Rows[e.RowIndex].FindControl("txtDiscount");
    TextBox txtStartDt = (TextBox)gviewTemplate.Rows[e.RowIndex].FindControl("txtStartDt");
} 

i want to get the new values form these textboxes but it is always giving me old values. and yes, e.Newvalues is not giving me anything. It is always empty. This is small extract from my gridview design:

<asp:GridView runat="server" AutoGenerateColumns="False"  
                        ID="gviewTemplate" onrowdatabound="gviewTemplate_RowDataBound" DataKeyNames="F1"
                        onrowcommand="gviewTemplate_RowCommand" 
                        onrowediting="gviewTemplate_RowEditing" 
                        onrowcancelingedit="gviewTemplate_RowCancelingEdit" 
                        onrowupdating="gviewTemplate_RowUpdating" 
                        onrowdeleting="gviewTemplate_RowDeleting" 
                        onrowupdated="gviewTemplate_RowUpdated">
                        <Columns>
                            <asp:TemplateField HeaderText="Uploaded Image">
                            <EditItemTemplate>
                                <asp:LinkButton Text="Reload" runat="server" OnClick="lbtnReloadImage_Click" CommandName="reload" ID="lbtnReloadImage"></asp:LinkButton>
                            </EditItemTemplate>
                                <ItemTemplate>
                                    <table id="Table2" runat="server" width="100%" cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td>
                                                <asp:Label Runat="server" Text='<%# Eval("Uploaded") %>' ID="lblUploaded"></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Template Name">
                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Center" />
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtTemplateName" Width="60" Runat="server" Text='<%# Eval("F1") %>'></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" Runat="server" 
                                    ErrorMessage="You must provide a Product Name." ControlToValidate="txtTemplateName">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <table id="Table3" runat="server" width="100%" cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblTemplateName" runat="server" Text='<%# Eval("F1") %>'></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Heading">
                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Center" />
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtHeading" Runat="server" Width="60" Text='<%# Eval("F2") %>'></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" Runat="server" 
                                    ErrorMessage="You must provide a Product Name." ControlToValidate="txtHeading">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <table id="Table4" runat="server" width="100%" cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblHeading" runat="server" Text='<%# Eval("F2") %>'></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Coupon Text">
                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Center" />
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtCouponText" Runat="server" Width="80" Text='<%# Bind("F3") %>'></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" Runat="server" 
                                    ErrorMessage="You must provide a Product Name." ControlToValidate="txtCouponText">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <table id="Table5" runat="server" width="100%" cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td>
                                                <asp:Label Runat="server" Text='<%# Bind("F3") %>' ID="lblCouponText"></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </asp:TemplateField>

Can anyone please tell me how to get the new values from these textboxes?

  • 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-05-18T12:30:41+00:00Added an answer on May 18, 2026 at 12:30 pm

    Don’t Rebind the GridView, just Bind it if the page is not postback

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

Sidebar

Related Questions

Hi im working on iphone application using monotouch im trying to get list of
I am working on windows application using c#. I have a from say X,
I have a working application using python and zeromq and I would like to
I'm working on an application using MEF (specifically, MEF 2 Preview 5 ), and
I am working on window application using c# . i want to show my
I am working a java application using H2 Database in embedded mode. My Application
I am working on an application using Spring 3 and Hibernate 3.5 with Java
I'm currently working on web application using VB in ASP.NET. Right now I have
Greetings, I'm working in windows application using C#. I have typed-dataset called packetsDBDataSet and
I am working on big application build using ASP.NET which was started 1.5 years

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.