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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:26:06+00:00 2026-05-26T12:26:06+00:00

I have binded a datagridview with the database and I am trying to set

  • 0

I have binded a datagridview with the database and I am trying to set datanavigateurlfields property.I am able to set value when value directly comes from database,but I wanted to concatenate some constant string like “edit_profile.aspx+?uid”+[value from database],now when I try to add “edit_profile.aspx+?uid” this to the url in double quotes it is treating this string as database column,and when I try to put this value is single quote it gave me parser error.

Here is my code:

<Columns>
            <asp:hyperlinkfield datatextfield="heading"
            datanavigateurlfields="heading"          
            headertext="Title"
            target="_blank"

             />

I am trying to concatenate some value with the “heading” in datanavigateurlfields.Please tell me how I can achieve this.

  • 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-26T12:26:06+00:00Added an answer on May 26, 2026 at 12:26 pm

    you can do like this….

          <asp:gridview id="OrdersGridView" 
            datasourceid="OrdersSqlDataSource" 
            autogeneratecolumns="false"
            runat="server">
    
            <columns>
    
              <asp:boundfield datafield="OrderID" 
                headertext="Order ID"/>
              <asp:boundfield datafield="ProductID" 
                headertext="Product ID"/>
              <asp:hyperlinkfield datatextfield="UnitPrice"
                datatextformatstring="{0:c}"
                datanavigateurlfields="ProductID"
                datanavigateurlformatstring="~\details.aspx?ProductID={0}"          
                headertext="Price"
                target="_blank" />
              <asp:boundfield datafield="Quantity" 
                headertext="Quantity"/>
    
            </columns>
    
          </asp:gridview>
    
          <!-- This example uses Microsoft SQL Server and connects -->
          <!-- to the Northwind sample database.                   -->
          <asp:sqldatasource id="OrdersSqlDataSource"  
            selectcommand="SELECT [OrderID], [ProductID], [UnitPrice], [Quantity] FROM [Order Details]"
            connectionstring="server=localhost;database=northwind;integrated security=SSPI"
            runat="server">
          </asp:sqldatasource>
    
        </form>
      </body>
    </html>
    

    would you pls go through this link for more info

    OR

          <body>
        <form id="form1" runat="server">
        <div>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
                SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName], [Address], [City] FROM [Customers]">
            </asp:SqlDataSource>
    
        </div>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="CustomerID"
                DataSourceID="SqlDataSource1" AllowPaging="True" AllowSorting="True">
                <Columns>           
                     <asp:HyperLinkField DataNavigateUrlFields="CustomerID"
                        DataNavigateUrlFormatString="CustomerDetails.aspx?CID={0}"
                         Text="Pass Single Value" />
                       <asp:HyperLinkField DataNavigateUrlFields="CustomerID, CompanyName, ContactName, Address, City"
                        DataNavigateUrlFormatString="CustomerDetails.aspx?CID={0}&CName={1}&ContactName={2}&Addr={3}&City={4}" // here you are defining values 
                          Text="Pass Multiple Values" />
                    <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" ReadOnly="True" SortExpression="CustomerID" />
                    <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName" />
                    <asp:BoundField DataField="ContactName" HeaderText="ContactName" SortExpression="ContactName" />
                    <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
                    <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
                </Columns>
            </asp:GridView>
        </form>
    </body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an automatically binded DataGridView that obtains data and update data directly from
I have to set image on the basis of fields value coming from db.
I have binded a datagridview to a datatable. But the gridview displays an extra
I have two DataTriggers binded to a property (Side) but only one storyboard could
I have gridview binded from database.. I have following code: protected void Page_Load(object sender,
I have a DataGridView binded to this table: [Users] ID Name -- ---- 11
Background I have a custom collection that is binded to the datagridview this.datagridview.DataSource =
I have a class with a int property called X. I binded it to
Here is the problem: I have datagrid binded with data acquired from web service
in asp.net 3.5[vs2008] Gridview i got one issue. i have binded objectdatasource with datagridview,

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.