Sunday, December 5, 2010

How to show/hide iframe in ssl/non-ssl pages in asp.net

Last week I was working on a task where we had to disable the facebook like box on a ssl pages because of security issues with the controls which are not coming from within our website. We are including the widget within our master page, that means that it will be part of all the child pages, doesn't matter if they are ssl or non-ssl. After some testing, here is how I resolved the problem, and have the widget enabled on non-ssl pages, and have the widget disabled on ssl pages.

Here is the iframe received from Facebook:


<iframe src="http://www.facebook.com/plugins/likebox.php?href=www.facebook.com%2Fwebsite&width=180&colorscheme=dark&connections=6&stream=true&header=false&height=605" style="border: medium none; overflow: hidden; width: 177px; height: 605px;" allowtransparency="true" frameborder="0" scrolling="no"></iframe>

Now what I am doing is I am checking the connection with:

                      <% if (Request.IsSecureConnection.Equals(false))


If the page is non-ssl display the iframe, and if the page is ssl don't display the iframe and disable ir from rendering.
Here is the complete source code:


<div>

                      <% if (Request.IsSecureConnection.Equals(false))

                           { %>

                           <br /><br />

            <iframe src="http://www.facebook.com/plugins/likebox.php?href=www.facebook.com%2FyourWebsite&width=180&colorscheme=dark&connections=6&stream=true&header=false&height=605" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:177px; height:605px;" allowTransparency="true"></iframe>                      

                       <br />

                         <a style="float:left;" href="http://twitter.com/YourWebsite" target="_blank" style="float: right"><img src="images/twitter_Web.jpg" title="Follow me on Twitter" width="162 height="69" /></a><br />

                    

                        <% } %>

                     </div>



Thanks for reading and comments always appreciated.

Follow me on twitter: http://www.twitter.com/AngelArnaudov

Thursday, November 25, 2010

Beginning Microsoft Sql Server 2008 Programming book by Wrox

I finally finished reading this book, it took me a while though, almost 2 months with all my travel around, but at the end I must conclude that it is a great book, I can recommend to everyone who wants to learn more about sql server and how to program more efficiently with sql language. The book covers all from very basic stuff to some intermediate level. There is one more part of this book, which I hope to read in near future and is the advanced programming in sql server 2008.

Thursday, November 11, 2010

Pubcon Las Vegas 2010

My first post will be about the conference which I attended in the last 4 days. Pubcon conference in Las Vegas, Nevada.
This post is written while I am waiting for my flight to Jacksonville, FL via Dallas, TX.
One of the biggest Internet Marketing seminars, PubCon is certainly the place to be if you want to learn the latest trends in the Search Engine Optimization field, the social media, affiliates and much more.
After the last spring conference in Dallas, TX, this would be my second time to visit the conference, and I don't regret at all.
The key note this tear was all mostly around the social media, how to leverage the followers/fans and convert them easily.
The prediction will be one of the main things in the future, search engines will be suggesting, predicting things which you are interested to do instead of just displaying results which are static or obscure.
The connections you have from your social circles and their opinion about the things you are searching will play more important rule in the search results.
Bing is keeping to raise but we will need to see if it will be able to keep up with Google and what more they will show. For now, there was a stat displayed at one of the panels that the people who tend to visit sites through Bing are 11% more likely to buy stuff then the people who are doing that through Google.
What about Google? Google is using more and more social media data and it uses that to display more updated search results. Their tools are getting more and more advanced, and most of all they are free.
Facebook Ads are becoming more interesting as well, mostly because there are many different criterias under which the ad can be set, and that includes demographic filtering, interests, hobbies, etc.
Well, Got to go now, I will make sure to give better summary of the conference once I will land in FL and get some decent sleep.
Thanks for reading!