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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:26:47+00:00 2026-06-08T11:26:47+00:00

I would like to give a different url in Facebook share button rather than

  • 0

I would like to give a different url in Facebook share button rather than current page url.

I’ve tried to change url in asp.net behind side but I wasn’t success.

I would be gratefulif anyone can help about this.

Some codes that I used, you can see bellow.

this is front side script

<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript">
</script>
<script type="text/javascript">
function fbs_click() {
u = location.href;
t = document.title;
window.open('http://www.facebook.com/share.php?u=' + encodeURIComponent(u) +
'&t=' + encodeURIComponent(t), 'share', 'toolbar=0,status=0,width=626,height=436');
return false;
}
</script>

this is share button

<a name="fb_share" runat="server" id="aFbShare" type="button" class="sharelink">Paylaş</a>

this is what I did on behind side

string wishListUrl = SEOHelper.GetWishlistUrl(NopContext.Current.User.CustomerGuid);
aFbShare.Attributes.Add("onclick", "fbs_click()");
aFbShare.Attributes.Add("target", "_blank");
aFbShare.HRef = "http://www.facebook.com/share.php?u=" + wishListUrl;
  • 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-08T11:26:49+00:00Added an answer on June 8, 2026 at 11:26 am

    The issue you are having is this. The user clicks your button:

    <script type="text/javascript">
    function fbs_click() {
       u = location.href;
       t = document.title;  
       window.open('http://www.facebook.com/share.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'share', 'toolbar=0,status=0,width=626,height=436');
       return false;
    }
    </script>
    

    In this function, u is the current URL, t is the current title. You open up a new window to facebook, then return false. This means your link is never actually followed because the false tells the browser the click should not be handled any further. What you should be doing is modify the code-behind:

    string desiredTitle = "My Wishlist";
    string wishListUrl = SEOHelper.GetWishlistUrl(NopContext.Current.User.CustomerGuid);
    aFbShare.Attributes.Add("onclick", "fbs_click('" + wishListUrl + "', '" + desiredTitle + "')");
    

    And modify the client script to:

    <script type="text/javascript">
    function fbs_click(url, title) {
       window.open('http://www.facebook.com/share.php?u=' + encodeURIComponent(url) + '&t=' + encodeURIComponent(title), 'share', 'toolbar=0,status=0,width=626,height=436');
       return false;
    }
    </script>
    

    If you need to maintain your current title, just remove the title variable from the onclick call, and the function signature, and pull the title from the document as you were doing before.

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

Sidebar

Related Questions

I would like to give multiple polygons a different pop up window with data
I would like to give the user a file browser from within a webpage.
We would like to give our customers access to report bugs and to look
I would like to give points to my users who submit articles based on
I would like to give text shadow for my text using css3. Can anyone
I would like to give the user the ability to insert custom elements in
I am making a Firefox extension and would like to give my users more
For the python program I am writing I would like to give the opportunity
I have never done any Windows coding and I would like to give it
I have a script. I would like to give this script a quiet mode

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.