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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:29:03+00:00 2026-06-04T00:29:03+00:00

So I have this FormView which should only have 1 record for editing: <asp:FormView

  • 0

So I have this FormView which should only have 1 record for editing:

    <asp:FormView ID="fmv_accountDetail" runat="server" DataKeyNames="UserID"
        DataSourceID="sds_accountDetail" DefaultMode="Edit" 
        emptydatatext="No employees found." 
        onitemcommand="fmv_accountDetail_ItemCommand"  >
        <EditItemTemplate>
            <asp:Label ID="lbl_UserID" runat="server" Text='<%# Eval("UserID") %>'  Visible="false"></asp:Label>
            <asp:Label ID="lbl_CustomerName" runat="server" Text='<%# Eval("customerName") %>'  Visible="false"></asp:Label>
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
        </EditItemTemplate>

    </asp:FormView>

How do I get the lbl_CustomerName in C#? I would like to populate other labels with this value on the page.

Here is what I have been trying, but it say null error exception:

(fmv_accountDetail.FindControl("lbl_CustomerName") as Label).Text;
  • 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-04T00:29:04+00:00Added an answer on June 4, 2026 at 12:29 am

    Found the problem, and it was really easy too:

    (fmv_accountDetail.Row.FindControl("lbl_CustomerName") as Label).Text;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: <asp:FormView ID=PhotoFormView runat=server DataKeyNames=PhotoID DataSourceID=PhotoDataSource> <EmptyDataTemplate> No photo here.
I have am using an asp:FormView control with elements such as: <asp:TextBox id=FirstName runat=server
Greetings! I have a DropDownList within a FormView which are bound to XmlDataSources: <asp:FormView
In my asp page I have a FormView which is used to display and
I have this membership site setup on my local machine using the ASP.NET membership
I have this DependencyProperty which holds an entity with a property that is a
I've got this textBox which triggers off an ajax request using jQuery: <asp:TextBox ID=postcodeTextBox
I have an SqlDataSource attached to a FormView which is used for inserting/updating, which
I have a flip animation which goes like this: Picker *picker = [[Picker alloc]
I have a standard button which should call a method but it just refuses

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.