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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:55:49+00:00 2026-06-16T05:55:49+00:00

I have a gridview. its data source is a datatable that is loaded from

  • 0

I have a gridview. its data source is a datatable that is loaded from the database. In this gridview, i have a template column.

<asp:TemplateField HeaderText="Product Type" SortExpression="ProductID">
                                        <ItemStyle CssClass="MP-table-tb-display-item" />
                                        <ItemTemplate>
                                            <div class="MP-table-tb-display-main">
                                                <asp:LinkButton ID="lnkview" CommandArgument='<%# Eval("ProductID") %>' CommandName="Viewproduct"
                                                    runat="server" CausesValidation="False" OnClick="lnkview_Click"><h4>
                                        <%# Eval("Name") %>
                                    </h4>
                                                </asp:LinkButton>
                                            </div>
                                            <br />
                                            <div class="MP-table-tb-display">
                                                <p>
                                                    <span>KEY</span><%# Eval("[product_type_key]") %></p>
                                                <br />

                                                <a target="_blank" href='<%# Eval("SourceURL") %>'>Source</a>
                                            </div>
                                        </ItemTemplate>
                                    </asp:TemplateField>

In this I want Source hyperlink only show when data available into <%# Eval("SourceURL") %>. If I am not able to get the SourceURL value into RowDatabound Event . Please Guide me.

I plan for this too but this is not working properly.

<a target="_blank" href=' <%= Eval("SourceURL")!=null ? Eval("SourceURL") : "style='display: none'" %> />'>  Source</a>
  • 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-16T05:55:50+00:00Added an answer on June 16, 2026 at 5:55 am

    use this instead

    <asp:hyperlink  Target="_blank"  NavigateUrl='<%# Eval("SourceURL") %>' Visible = '<%# Eval("SourceURL") == null ? false : true %>' >
    

    Similarly you could use the <a> tag to control its visiblity. The if condition would go in Style attribue and not in href attribute. Something like this

    Style=display:Eval('some_val') == null ? none : block
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a gridview. its data source is a datatable that is loaded from
I have a gridview that gets its data from a webservice. This comes into
i have an gridview that retrieves the data via a datatable like this: protected
I have a gridview and its data source comes from linq to sql statements:
I have a gridview that i want to fill with data from my linq
I created a GridView in code with a DataTable as its data source which
I have a Gridview which has its datasource set to a DataTable. This has
I have a gridview that shows an image as part of one of its
I have a datalist that contains a gridview inside its itemtemplate. on the item-data_bound
I'm creating a dynamic GridView from a DataTable that is returned from a stored

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.