Islam
Islam

Reputation: 1727

sharing my page URL on twitter via twitter share button

I have a problem using twitter share button on my asp.net page.The problem is that when I click on the share button i want it to share the URL of my page which the share button exists for example "http://localhost:1349/Pages/Share/ShareRedeemtion.aspx?UID=2&GiftID=1&MID=2 via@QhatAPP" but for some reason which i can't figure the button only share the title of the page, I'm confused is there is a problem with twitter share button to share URLs which contains a query string? and if do exists a problem is there any way enables me to share my URL on twitter via twitter share button?

Upvotes: 1

Views: 2194

Answers (1)

Doozer Blake
Doozer Blake

Reputation: 7797

You appear to have 2 problems:

  1. You need to encode the URL you are passing in because, yes, it has a querystring on it. Check out URLEncode if you need to.
  2. It also doesn't appear to work with non-publicly accessible Urls (your localhost in the sample). It may be doing some sort of callback to check that the Url is accessible or checking for Spam.

A sample that works with a querystring.

https://twitter.com/share?url=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F8190644%2Fsharing-my-page-url-on-twitter-via-twitter-share-button%3Ftemp%3D1&text=Test+Link

For more information and properties for the button, check https://dev.twitter.com/docs/tweet-button

Upvotes: 3

Related Questions