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 7181781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:37:46+00:00 2026-05-28T17:37:46+00:00

Currently i’m working on my final year project. In a webpage which loads data

  • 0

Currently i’m working on my final year project.
In a webpage which loads data in gridview, each row has on button which will popup a window and ask for error to write inside **textbox** and submit that error on server.
On the serverside i require two values, first one is the primary key of that row and the error that is written inside **textbox**. It is easy to get primary key value but i’m unable to get value in side the textbox.
I’m attaching the code of .aspx file:

<asp:GridView ID="gvPODetails" runat="server" DataSourceID="Inspection_SqlDataSource"
            EnableModelValidation="True" AllowSorting="True" AutoGenerateColumns="False"
            BackColor="#CCCCCC" BorderColor="Black" BorderStyle="Solid" BorderWidth="3px" CellPadding="4" ForeColor="Black" CellSpacing="2">
            <Columns>
                <asp:BoundField DataField="ProductCode" HeaderText="ProductCode" SortExpression="ProductCode" />
                <asp:BoundField DataField="MaterialCode" HeaderText="MaterialCode" SortExpression="MaterialCode" />
                <asp:TemplateField>
                    <ItemStyle BorderStyle="None" BorderColor="Transparent" BorderWidth="0px" />
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkbtnOk" OnClick="Ok_Click" CommandArgument='<%# Eval("Identity")%>'
                            runat="server" Text="Ok"></asp:LinkButton>
                        <asp:LinkButton ID="lnkbtnReject" runat="server" Text="Reject"></asp:LinkButton>                        
                        <asp:Panel ID="popUp_Data" runat="server" CssClass="modelPopup" Style="display: none;">
                            <table style="padding: 10px 10px 10px 10px; width: 100%;">
                                <tr>
                                    <td>
                                    </td>
                                    <td align="right">
                                        <input id="close_popup" type="image" src="../Images/closebox.gif" />
                                    </td>
                                </tr>
                                <tr valign="top">
                                    <td align="right">
                                        <asp:Label ID="lblError" Text="Error" runat="server" CssClass="fontStyle"></asp:Label>
                                    </td>
                                    <td align="left">
                                        <asp:TextBox ID="txtError" runat="server" CssClass="ta"
                                            TextMode="MultiLine"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td align="left">
                                        <asp:Button ID="btnSubmit" runat="server" CssClass="sbmt" Text="Reject Item" OnClick="Reject_Click"
                                            CommandArgument='<%# Eval("Identity")%>' />
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>                               
                        <asp:ModalPopupExtender ID="popUp_Data_ModalPopupExtender" runat="server" DynamicServicePath=""
                            Enabled="True" BackgroundCssClass="modelBackground" PopupControlID="popUp_Data"
                            TargetControlID="lnkbtnReject" CancelControlID="close_popup">
                        </asp:ModalPopupExtender>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <asp:Label runat="server" ID="lblNoDataFound" Text="No Machine Found."></asp:Label>
            </EmptyDataTemplate>
        </asp:GridView>


What i want is the data inside textbox with id txtError.

  • 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-28T17:37:47+00:00Added an answer on May 28, 2026 at 5:37 pm

    Since it is a repeating item, you cannot access it directly using its id. You can use FindControl instead as follows:

    var textBoxAux = gridView.Rows[index].FindControl("txtError") as TextBox;
    

    You need to find the index of the row in the event you are handling.

    EDIT: finding the index…

    Pass the DataItemIndex in the CommandArgument ( instead of the identity ) if applicable.

    CommandArgument='<%# Container.DataItemIndex %>'
    

    Ref: ASP.NET GridView RowIndex As CommandArgument

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

Sidebar

Related Questions

Currently I have a web service, which loads up any plugins located within its
Currently, working with RC0 Denali, having some issues I am attempting to review data
Currently working on database part of android project. The main aim of the project
Currently i m working on a project where there are users with four roles
Currently we have a project with a standard subversion repository layout of: ./trunk ./branches
Currently I'm doing some unit tests which are executed from bash. Unit tests are
Currently I know of only two ways to cache data (I use PHP but
Currently I have a date in my clients data table and it is stored
Currently, my MVC 3 app has a dependency on a static class that is
Currently local storage for javascript is limited to cookies, which makes robust client side

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.