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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:36:09+00:00 2026-06-04T05:36:09+00:00

Can any one tell me if I can use a ASP Control instead of

  • 0

Can any one tell me if I can use a ASP Control instead of Field Renderer to display the field.Please see below illustration.
Note:I need to do it in the Item Databound Event of Repeater.

I have a template with Field as External Link .Eg :Contact US .One way to display that link in the page is using field renderer as below.

ContactUS.aspx:

<asp:Repeater ID="rptContactUS" runat="server" OnItemDataBound="Menu_OnItemDataBound">
        <ItemTemplate>
           <item><sc:FieldRenderer ID="frContactUS" runat="server"/></item>                                           
       </ItemTemplate>    
 </asp:Repeater>

ContactUS.aspx.cs:

protected void Menu_OnItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        Field item = (Field)e.Item.DataItem;
        if (item != null)
        {
            FieldRenderer frContactUS= (FieldRenderer)e.Item.FindControl("frContactUS");
            if (frContactUS!= null)
            {
                frContactUS.FieldName = item.Name;
            }
        }    
    }

The above code works fine.My Question is Whether I can use a Asp control instead of FieldRenderer and assign the link value from the Field Item to asp href property of the link in item databound event of repeater.If yes,Please tell me how?

Thanks,
Suhas

  • 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-04T05:36:10+00:00Added an answer on June 4, 2026 at 5:36 am

    Yes you can. From what I see in your example you are binding Field to the Menu.
    You could also bind a List of Items to your menu. You can then retrieve the item’s fields in the repeater like this:

    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Item dataItem = (Item)e.Item.DataItem;
                        System.Web.UI.WebControls.HyperLink hl = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("hl");
    
                        if (hl != null)
                        {
                        Sitecore.Data.Fields.LinkField url = dataItem.Fields["linkfield"];
    
                        if (url != null)
                        {
                            hlMerk.NavigateUrl = url.Url;
                            hlMerk.Target = url.Target;
                            // more properties are available check sitecore documentation
                        }                       
                    }
               }
    

    }

    From here you will have the url field (obviously you should give the correct field name instead of url.
    The LinkField has several properties as described in the general Sitecore documentation that can be found @ http://sdn.sitecore.net.

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

Sidebar

Related Questions

Can any one tell me how to use Silverlight to play audio from local
Can anyone please tell me is there any special requirement to use either EXTERN
Can any one tell me how to solve the following scenario in Asp.net application.
How can i use Rupee Symbol in Silverlight can any one tell how to
Hi can any one tell the steps to use the YAJL to parse the
Can anyone please tell me when should I use MessageContracts and when should I
Can any one tell me if its possible to create a stored procedure in
Can any one tell me how can i replace the slideup function with fadeout('slow')
Can any one tell how to disable focus to a browser. Hi i am
Can any one tell me how to create the rounded button (Circular Button) in

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.