This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model UmbracoLogin.MemberLoginModel | |
@if (User.Identity.IsAuthenticated) | |
{ | |
<p>Logged in: @User.Identity.Name</p> | |
<p>@Html.ActionLink("Log out", "MemberLogout", "MemberLoginSurface")</p> | |
} | |
else | |
{ | |
using (Html.BeginUmbracoForm("MemberLogin", "MemberLoginSurface")) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('iframe').each(function() { | |
var source = $(this).attr('src'); | |
var wmode = "wmode=opaque"; | |
if (source.indexOf('?') != -1) { | |
$(this).attr('src', source + '&' + wmode); | |
} else { | |
$(this).attr('src', source + '?' + wmode); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void Application_Error(object sender, EventArgs e) | |
{ | |
//Application.Lock(); | |
//Application["LastException"] = Server.GetLastError(); | |
var serverError = Server.GetLastError() as HttpException; | |
if (serverError != null) | |
{ | |
int errorCode = serverError.GetHttpCode(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyHandler : IHttpHandler | |
{ | |
private const string CONSTSOMEPARAM = "SomeParam"; | |
public MyHandler(){} | |
public void ProcessRequest(HttpContext context) | |
{ | |
// Don't allow this response to be cached by the browser. | |
// Note, you MIGHT want to allow it to be cached, depending on what you're doing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <summary> | |
/// An abstract base Http Handler for all your | |
/// <see cref="IHttpHandler"/> needs. | |
/// </summary> | |
/// <remarks> | |
/// <p> | |
/// For the most part, classes that inherit from this | |
/// class do not need to override <see cref="ProcessRequest"/>. | |
/// Instead implement the abstract methods and | |
/// properties and put the main business logic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string GetAltTextFromImage(string path) | |
{ | |
string result = string.Empty; | |
if (!string.IsNullOrEmpty(path)) | |
{ | |
// Get start position for image name from path | |
int first = path.LastIndexOf("/") + 1; | |
// Get last position for image name from path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var linkRewriter = function(old_domain, new_domain) { | |
$('a[href*="' + old_domain + '"]').each(function() { | |
if ($(this).attr('href') == old_domain ) { | |
$(this).attr('href', $(this).attr('href').replace(old_domain, new_domain)); | |
} | |
}); | |
}; | |
linkRewriter('www.olddomain.com', 'www.newdomain.com'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* IE 6 */ | |
* html .yourclass { } | |
/* IE 7 */ | |
*+html .yourclass{ } | |
/* IE 7 and modern browsers */ | |
html>body .yourclass { } | |
/* Modern browsers (not IE 7) */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Input parameter is the UNIX timestamp | |
of the starting date. | |
The second parameter is optional - | |
It's value is the ending date, | |
also UNIX timestamp. If this | |
parameter is not given, the | |
default date is current date. | |
*/ | |
function duration($start,$end=null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Renders the partial view to string. | |
/// </summary> | |
/// <param name="context">The context.</param> | |
/// <param name="partialViewName">Partial name of the view.</param> | |
/// <param name="viewData">The view data.</param> | |
/// <param name="tempData">The temp data.</param> | |
/// <returns></returns> | |
public static string RenderPartialViewToString(ControllerContext context, string partialViewName, ViewDataDictionary viewData, TempDataDictionary tempData) | |
{ |
OlderNewer