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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:05:59+00:00 2026-06-14T20:05:59+00:00

In my Visual web part I’m using relative url like following and it’s working

  • 0

In my Visual web part I’m using relative url like following and it’s working fine . But I assume it will not work when I deploy my project in different site structure on another server. So my question is how to make links,urls dynamic which will work in all the scenarios.

../../something.aspx 

Please note I have some JQuery files included in <script> tag I can’t only rely on building dynamic url using code.

  • 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-14T20:06:00+00:00Added an answer on June 14, 2026 at 8:06 pm

    Rishi,

    Are you using a document library to store the page? If so, you could use SPDocumentLibrary.DefaultViewURL. If you’re trying to navigate to a different web, then you can get a web’s URL from SPWeb.Url.

    Best,
    -Tony

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

Sidebar

Related Questions

I have a web app that runs fine in Visual web developer. But when
I created a new Visual Web Part in VS 2010 (using Sharepoint Server 2010),
I am creating a custom view in a SharePoint visual Web Part using ASP.NET
I am using sharepoint 2010 and developing a visual web part. I had javascript
I am working on sharepoint 2010. I have created a simple visual web part
I have built a custom web part using Visual Studio. Is it possible to
I have a visual web part (a simple form) with RequiredFieldValidators. But a problem
I have a web part in visual studio. The web part will contain 3
I have a visual web-part for sharepoint with code below, but code of click-handler
I have created a Hello World web part. When I pressed F5 in Visual

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.