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 ViewResultBase Render(HtmlHelper helper) | |
{ | |
return new PartialViewResult | |
{ | |
ViewName = "AnyPartialViewResult", | |
ViewData = new ViewDataDictionary(helper.ViewData) | |
{ | |
Model = new AnyPartialViewModel() | |
}, | |
TempData = helper.ViewContext.TempData |
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
<style> | |
#file { | |
... | |
opacity: 0.01; | |
} | |
... | |
</style> | |
<div id="file-field-window"> | |
<input type="file"... /> |
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
<style> | |
#file { | |
... | |
right: 0; | |
position: absolute; | |
} | |
#file-field-window { | |
... | |
position:relative; | |
} |
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
<style> | |
... | |
#file-field-window { | |
overflow:hidden; | |
} | |
</style> | |
<div id="file-field-window"> | |
<input type="file" name="file" id="file" value="" /> | |
</div> |
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
<style> | |
#file { | |
height: 300px; | |
font-size: 300px; | |
} | |
</style> |
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
<style> | |
#file { | |
display:none; | |
} | |
</style> |
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
$("#btn-upload").click(function () { | |
$("#file").click(); | |
return false; // must! | |
}); |
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
<script> | |
$(function () { | |
$("#file").change(function () { | |
$(this).closest("form").submit(); | |
}); | |
}); | |
</script> |
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
<form method="post" enctype="multipart/form-data"> | |
<input type="file" name="file" id="file" value="" /> | |
<input type="submit" name="btn-upload" id="btn-upload" | |
value="Upload image..." /> | |
</form> |
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
function setupFixture(f) { | |
var html = Enumerable.from(f.toString().split('\n')) | |
.select("$.trim()") | |
.skipWhile("$.slice(-2) != '/*'") | |
.skip(1) | |
.takeWhile("$.slice(0, 2) != '*/'"); | |
$('#qunit-fixture').html(html.toArray().join('')); | |
} |