public string GetTwitterShareURL(string sProductID, string sProductName, string sProductLogo, string sProductDescitpion, string AppID) { string sADID = QSVars["ADID"].ToString(); string suser_id = QSVars["user_id"].ToString(); string sUDiD = QSVars["UDID"].ToString(); string sArticleTitle = "Check out this App!"; string _sAppPathLink = ofbBiz.GetAppPagePath(AppID); string sArticleSource = "http://www.testsonetreach.com";//sAppPathLink; string app_id = QSVars["app_id"].ToString(); string customLogoLocation = ofbBiz.GetCustomLogo(sProductID); string logoLocation = "https://www.testsonetreach.com/Images/sonet_watermark.png"; string _sNotifierDID = new AppNotifier().GetNewDIDWithPrefix(); if (!_sAppPathLink.EndsWith("?")) _sAppPathLink += "&"; //Build NotifierDID & pass it to link _sAppPathLink += "NDID=" + _sNotifierDID + "&NTYP=TWEET"; //Auth User to get Twitter Details Twitter otittwr = new Twitter(); string AuthTwitter = otittwr.GetTwitterAuthURL(sADID, app_id, sProductID); StringBuilder oSBTweetButton = new StringBuilder(); oSBTweetButton.Append("<a class=\"TW_Share\" href=\"#\" onclick=\"javascript:" + "METHOD" + sProductID + "Twitter(); return false;\" ></a>" + Environment.NewLine); oSBTweetButton.Append("<script type=\"text/javascript\">" + Environment.NewLine); oSBTweetButton.Append("function " + "METHOD" + sProductID + "Twitter() {" + Environment.NewLine); oSBTweetButton.Append("window.open('" + AuthTwitter + "', 'mywindow', 'height=470,width=660,menubar=0,toolbar=0,statusbar=0,scrollbars=0,resizable=0,fullscreen=no');" + Environment.NewLine); oSBTweetButton.Append("} </script>" + Environment.NewLine); return oSBTweetButton.ToString(); }
protected void btnTweet_Click(object sender, EventArgs e) { string ADID = SessionData.Product.AppConfigDID; string app_id = SessionData.Config.AppID; string PDID = SessionData.Product.DID; //Auth User to get Twitter Details Twitter otittwr = new Twitter(); string AuthTwitter = otittwr.GetTwitterAuthURL(ADID, app_id, PDID); ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(760/2);var Mtop = (screen.height/2)-(700/2);window.open( '" + AuthTwitter + "', null, 'height=700,width=760,status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no,top=\'+Mtop+\', left=\'+Mleft+\'' );", true); //Response.Redirect(otittwr.GetTwitterAuthURL()); }