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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:34:02+00:00 2026-06-09T00:34:02+00:00

I have a ASP.NET Application and use a ListView . This ListView has a

  • 0

I have a ASP.NET Application and use a ListView. This ListView has a LayoutTemplate,ItemTemplate and a AlternatingItemTemplate. In My LayoutTemplate I have LinkLabels. I want to make a Multilanguage Page and I must access to The Text Property of this Linklabels. But I don’t can access to this Property.

My ASPX (ListView)

<LayoutTemplate>
    <table id="UserTable" runat="server" border="0">
        <tr id="Tr1" style="background-color:#E5E5FE">
            <th runat="server"><asp:LinkButton ID="lnkBenutzer" runat="server" >id_Benutzer</asp:LinkButton></th>
            <th runat="server"><asp:LinkButton ID="lnkemail" runat="server" >id_Email</asp:LinkButton></th>
            <th runat="server"><asp:LinkButton ID="lnkVorname" runat="server" >id_Vorname</asp:LinkButton></th>
            <th runat="server"><asp:LinkButton ID="lnkNachname" runat="server" >id_Nachname</asp:LinkButton></th>
            <th runat="server"><asp:LinkButton ID="lnkTelefon" runat="server" >id_Telefon</asp:LinkButton></th>
        </tr>
        <tr runat="server" id="ItemPlaceholder">
        </tr>
    </table>
</LayoutTemplate>

<ItemTemplate>

    <tr> 

        <td align="left" ><asp:Label ID="Label1" Text='<%# Eval("Benutzername") %>' runat="server" /></td>
        <td align="left"><asp:Label ID="Label2" Text='<%# Eval("eMail") %>' runat="server" /></td>
        <td align="left"><asp:Label ID="Label3" Text='<%# Eval("Vorname") %>' runat="server" /></td>
        <td align="left"><asp:Label ID="Label4" Text='<%# Eval("Nachname") %>' runat="server" /></td>
        <td align="left"><asp:Label ID="Label5" Text='<%# Eval("Telefonnummer") %>' runat="server" /></td>

     <td align="left"><asp:Button ID="Button1" Text="Anzeigen" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>'  runat="server" /></td>

      <td align="left"><asp:Label ID="Label6" Text='<%# Eval("GUID") %>' runat="server" Visible="False" /></td>


    </tr>

</ItemTemplate>

<AlternatingItemTemplate>

    <tr style="background-color:#EFEFEF"> 

        <td align="left" ><asp:Label ID="Label1" Text='<%# Eval("Benutzername") %>' runat="server" /></td>
        <td align="left"><asp:Label ID="Label2" Text='<%# Eval("eMail") %>' runat="server" /></td>
        <td align="left"><asp:Label ID="Label3" Text='<%# Eval("Vorname") %>' runat="server" /></td>
        <td align="left"><asp:Label ID="Label4" Text='<%# Eval("Nachname") %>' runat="server" /></td>
        <td align="left"><asp:Label ID="Label5" Text='<%# Eval("Telefonnummer") %>' runat="server" /></td>

    <td align="left"><asp:Button ID="Button1" Text="Anzeigen" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>'  runat="server" /></td>

        <td align="left"><asp:Label ID="Label6" Text='<%# Eval("GUID") %>' runat="server" Visible="False" /></td>

    </tr>

</AlternatingItemTemplate>

My C# code:

        if (lang == "de")
        {
            string xmlfile= "de_language.xml"; 
                              //GetXMLElement() is my Method
            id_SearchUser.Text = GetXMLElement(xmlfile, "id_SearchUser");
            id_location.Text = GetXMLElement(xmlfile, "id_location");
            Button2.Text = GetXMLElement(xmlfile, "id_Search");

                        //I must access to the text property
            //lnkBenutzer.text = GetXMLElement(xmlfile, "User"); 
        }

My Button:

protected void Button1_Command(object sender, CommandEventArgs e)
        {
            if (e.CommandName == "Select")
            {
                //Der Index der Zeile wird ermitellt
                int index = Convert.ToInt32(e.CommandArgument);

                string xmlfile = Session["language_file"].ToString(); 
               //it doen't works :( 
                ((LinkButton)myListView.FindControl("lnkBenutzer")).Text = GetXMLElement(xmlfile, "id_User");

                //Der Inhalt (GUID[Unsichtbar]) wird aus der zeile mit dem Index herausgezogen und übergeben       

                Label lb = (Label)myListView.Items[index].FindControl("Label6");

                //Der GUID, Benutzer-Nachname und das Werk werden an eine Session übergeben
                Session["UserID"] = lb.Text;
                Session["SearchUser"] = txtBenutzer.Text;
                Session["DropDownValue"] = dropWerk.SelectedValue;

                //Es wird eine neue Webform geöffnet
                Response.Redirect("Benutzer.aspx");

            }

        }
  • 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-09T00:34:04+00:00Added an answer on June 9, 2026 at 12:34 am

    I believe you need to do something like the following:

    In your Benutzer.aspx:

    public void Page_Load() {
        string xmlfile = Session["language_file"].ToString(); 
        LinkButton lnkBenutzer = (LinkButton)myListView.FindControl("lnkBenutzer");
        lnkBenutzer.Text = GetXMLElement(xmlfile, "User"); 
    }
    

    In short what you need to do is “find” the list view control and then find the control inside the list view. This could be shortened to:

    ((LinkButton)myListView.FindControl("lnkBenutzer")).Text = GetXMLElement(xmlfile, "User");
    

    Going further you could extract this to a method wherein you pass in your item name and the new text :

    public void SetText(string controlName, string text)
    {
        ((LinkButton)myListView.FindControl(controlName)).Text = text;
    }
    

    then you could call:

    SetText("lnkBenutzer", GetXMLElement(xmlfile, "User"));
    

    replacing your names and vales as required.

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

Sidebar

Related Questions

I have an ASP.NET Application and use a ListView . This ListView has rows
I have an asp.net web application that use FormsAuthentication. Now, the application has a
I have ASP.NET webFroms application on my local, when i try to use this
I have an asp.net application and I'm using C#. I want to use the
I have an ASP.NET application running on shared hosting and want to use Windows
I have an ASP.Net application which has an area called 'Customers'. This area has
We have a ASP .Net application whereby we use Log4Net to log details within
I use yui datatable in my asp.net application... I have a link button in
I am about to use linqtosql in my first asp.net mvc application. I have
ASP.NET application, VB or C# doesn't matter. I have Listview which databound to Dataset

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.