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

  • Home
  • SEARCH
  • 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 7874773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:52:07+00:00 2026-06-03T02:52:07+00:00

I have a DataTable and it is passing a value though a DataNavigateUrlField .

  • 0

I have a DataTable and it is passing a value though a DataNavigateUrlField.

In code what do I type to get that value, e.g.:

MessageNum = DataNavigateUrlField[MessageNumber];

Here i have DataNavigateUrlFields="MessageNumber", What in my C# Code can i do to get the value of MessageNumber?? Please i need help.

<asp:HyperLinkField
    HeaderText="Subject"
    DataNavigateUrlFields="MessageNumber" 
    DataNavigateUrlFormatString="~/ViewMailContent.aspx?MessageNumber={0}"
    DataTextField="Subject" />

The DataTable is set as a GridView.DataSource, and then sent to a page, the user selects a hyperlink and then the page navigates, i need the message number selected.

I noticed The Value is showing on the top of my Screen in the Url and its the correct value, but how do i get the value, and is it possible to get the value before the Page navigates? else The page will have to load twice i think.

I started web about a week ago so not give me extreme web lingo.

  • 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-03T02:52:08+00:00Added an answer on June 3, 2026 at 2:52 am

    You have (at least) two options:

    1. If you need the value in the destination page (the page that you navigate to by clicking the url in the grid) you’ll just write

      Example (in code behind):

      Request.QueryString("MessageNumber")
      
    2. If you need the value in the page that has the grid you’ll rewrite the url to point to a javascript function, which in turn may redirect to the destination page.

      <asp:HyperLinkField
          HeaderText="Subject"
          DataNavigateUrlFields="MessageNumber" 
          DataNavigateUrlFormatString="javascript:myFunction({0})"
          DataTextField="Subject" />
      

      The function (should be in a javascript block in source page):

      function myFunction(id)
      { 
          alert("Now you are leaving this page");
          document.location = "ViewMailContent.aspx?MessageNumber=" + id;
      }
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataTable object. Every column is of type string. Using LINQ, how
I have a DataTable that I manually created and loaded with data using C#.
I have a wingrid that is bound to a datatable. I create a new
I have a stored proc that I am passing two parameters into. One parameter
I have a DataTable, say pdt, in my code. I just want to select
----> I have datatable which is passing to another page in session variable. ---->
I have a DataTable which has the following structure. StartDate (Type DateTime) EndDate (Type
I have a datatable that has a date column, but I am stumped as
I have dictionary that gives me back a method according to the value passed
I have C# application that fills a GridView with data from a DataTable object,

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.