About The Author
Michael Flynn is a Senior Developer at Unicon, a consulting company that focuses on enterprise deployments of open source software. He specializes in web technologies that include C# .NET, SQL, XML, AJAX, jQuery, Flash, and also skills in Photoshop and Illustrator. He was been involved in web development since 1998, and earned a Bachelors and Masters degree in Computer Engineering and Computer Science from the Univerisity of Louisville and holds an MSCT certificate in Web Applications.
Calendar
<<  May 2013  >>
SMTWTFS
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

Open Link From IFrame Into New Window with JQuery

I recently had to open links in an IFrame in a new window.  The problem before was files ilke PDFs and images were opening up in the IFrame with no scrolling.  I wanted a clean, quick solution with JQuery so below is what I came up with. 

$(document).ready(function() {
        $('a').click(function() {
        window.open($(this).attr('href'), 'File', 'fullscreen=yes', 'resizable,scrollbars'); return false;
    });
});

Posted on 9/13/2008 8:03:00 PM by cblaze22

Permalink | Comments (12) | Post RSSRSS comment feed |

Categories: Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | Development Tips | jQuery | jQuery | Development Tips | Development Tips | jQuery | jQuery | jQuery | jQuery | Development Tips | Development Tips | jQuery | jQuery | jQuery | jQuery | jQuery | jQuery | jQuery | jQuery | jQuery | jQuery | jQuery | jQuery | jQuery | jQuery | jQuery | jQuery | jQuery | jQuery | Tips | Tips | jQuery | jQuery | jQuery | jQuery | jQuery | jQuery | Tips | Tips | Tips | Tips | Tips | Tips | jQuery | jQuery | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips | Tips

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Currently rated 2.0 by 12 people

  • Currently 2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Universal Root/Base Url

I have tried many ways to get the root/base url of a website.  A static approach to this is to store it in the web.config appsettings section and calling it in code.

<appSettings>
        <add key="RootUrl" value="http://www.mydotnetworld.com"/>
</appSettings>

string rootUrl = ConfigurationManager.AppSettings["RootUrl"];

This isnt convenient when you are working locally and the port number might change.  Another way is to call a method to get the base/root of the website.  I have seen numerous ways to do this and most of them had flaws.  I created my own that I use in every project and hasnt failed me yet.  It works in any development environment.

public static string RootUrl
{
    get
    {
        HttpContext context = HttpContext.Current;
        string executionPath = context.Request.ApplicationPath;
        return string.Format("{0}://{1}{2}", context.Request.Url.Scheme,
                                                                context.Request.Url.Authority,
                                                                executionPath.Length == 1 ? string.Empty : executionPath);
    }
}

I place this function inside a utility class and call it wherever the base/url is needed.  It also comes in handy within javascript.

var rooUrl = <%= Utility.RootUrl %>;

Posted on 8/16/2008 2:14:00 AM by cblaze22

Permalink | Comments (1) | Post RSSRSS comment feed |

Categories: ASP.NET | Development Tips

Tags:

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5