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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:00:29+00:00 2026-06-06T06:00:29+00:00

Using ASP.net and c# using visual studio 2010 Hi all, I hope some one

  • 0

Using ASP.net and c#
using visual studio 2010

Hi all, I hope some one can help me. Basically I have a page that has a grid view that has a link button in one of the columns. What I’m trying to do is; user clicks the link and the PDF file it refers to is loaded in a new page using the site.master. Below is the code I currently have.

Starting page

SelectCommand="SELECT * FROM [Guides] WHERE (([Display] = ?) AND ([Media_Document] = ?))">

<SelectParameters>
    <asp:QueryStringParameter DefaultValue="true" Name="Display" 
    QueryStringField="checkbox" Type="Boolean" />
    <asp:QueryStringParameter DefaultValue="Document" Name="Media_Document" 
    QueryStringField="Media_Document" Type="String" />
</SelectParameters>

</asp:AccessDataSource>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server">
</asp:ObjectDataSource>


<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" 
DataKeyNames="ID"  CssClass="mGrid"  RowStyle-CssClass="pgr"  AlternatingRowStyle-CssClass="alt"
DataSourceID="AccessDataSource1" Width="225px" style="text-align:left" 
GridLines="None" >

<AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>

<Columns>
    <asp:BoundField DataField="Guide" HeaderText="Guide" SortExpression="Guide" />
    <asp:HyperLinkField DataNavigateUrlFields="File_location" 
    DataNavigateUrlFormatString="Guides.aspx?File_location={0}" 
    Target="content" Text="Link" />
</Columns>

<RowStyle CssClass="pgr"></RowStyle>

</asp:GridView> 
</div>

This code generates the link correctly which is Guides.aspx?File_location=blahblahblah.pdf

Destination page

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <object width="800" height="800" data="File_Location"></object>
</asp:Content>     

This dose not work because the variable File_location is not recognized which makes sense. I could get the location using c# in the code behind but how do I then display that in the page?

Any Ideas?

Code Behind

public partial class Guides : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        string Location = Request.QueryString.ToString();

        File_location(Location);

    }


    public void File_location(string location)
    {

        string File_Location = location.Substring(location.IndexOf('=') + 1);
    }
}
  • 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-06T06:00:30+00:00Added an answer on June 6, 2026 at 6:00 am

    One way would be to have a public property on the code behind page called File_Location and then you would refer to it like this:

    <object width="800" height="800" data="<%=File_Location%>"></object>
    

    Set the value in Page_load.

    create a property in the code-behind like this:

    public string File_location()
    {
        get
        {
            string location = Request.QueryString;
            return = location.Substring(location.IndexOf('=') + 1);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a asp.net website with c# code behind and using visual studio 2010.
Using asp.net 3.5 Gridview control, visual studio 2008. I have played with all the
Can I develop asp.net 3.5/2.0 projects using Visual Studio 2010? Or I will be
First of all, I'm using Visual Studio 2010 (Visual C#) and ASP.NET. I'm working
I'm using ASP.net MVC C# in Visual Studio Web Dev. I have a couple
We develop asp.net webforms using visual studio 2008. For multilingual support, we translate all
I am using visual studio 2008 coding asp.net.vb I have 20 images on my
I am using Visual Studio to compile and run my ASP.NET website. Now, one
I am using visual studio 2008, asp.net.vb I have various functions; 1 that calculates
Assume that: An ASP.NET MVC3 Page (using visual studio debug server) calls a WCF

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.