Method 1:
var web = new HtmlWeb();
var doc = web.Load(sourceUrl);
Method 2:
var uri = new Uri(sourceUrl);
var request = (HttpWebRequest)WebRequest.Create(uri);
request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
var response = (HttpWebResponse)request.GetResponse();
var doc = new HtmlDocument();
var stream = response.GetResponseStream();
doc.Load(stream, Encoding.UTF8);
Method 3:
using (var wc = new WebClient()){
html = wc.DownloadString(sourceUrl);
}
var doc = new HtmlDocument();
doc.LoadHtml(html);
Friday, April 17, 2015
Tuesday, April 7, 2015
Friday, March 27, 2015
Sunday, March 8, 2015
Friday, March 6, 2015
Tuesday, February 17, 2015
Monday, February 16, 2015
Case-insensitive and Accent-insensitive String Comparison in Linq to SQL
ALTER TABLE Stories ALTER COLUMN Name [nvarchar](max) COLLATE SQL_Latin1_General_CP1_CI_AI
Tuesday, February 3, 2015
Friday, January 30, 2015
Wednesday, January 28, 2015
AngularJS Directives
ng-app
ng-controller
ng-model
ng-click
ng-submit
ng-repeat
ng-view
ng-show
ng-hide
ng-controller
ng-model
ng-click
ng-submit
ng-repeat
ng-view
ng-show
ng-hide
Tuesday, January 27, 2015
Wednesday, January 21, 2015
Sublime Text Emmet (ex-Zen Coding)
table snippet:
table>tr*2>td*3+tab
generated text:
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
table>tr*2>td*3+tab
generated text:
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
Tuesday, January 6, 2015
Elmah Security Settings
<elmah>
<security allowRemoteAccess="1"/>
</elmah>
<add key="elmah.mvc.requiresAuthentication" value="true" />
<add key="elmah.mvc.allowedRoles" value="Admin" />
<security allowRemoteAccess="1"/>
</elmah>
<add key="elmah.mvc.requiresAuthentication" value="true" />
<add key="elmah.mvc.allowedRoles" value="Admin" />
Saturday, December 20, 2014
jQuery UI Autocomplete Changes in 1.10
Legacy 1.9 Code:
$("#searchBox").data("uiAutocomplete")._renderItem = function (ul, item) {
return renderAutoCompleteItems(ul, item);
};
renderAutoCompleteItems = function(ul, item) {
return $("<li />")
.data("item.autocomplete", item)
.append("<a><img style='width:50px; height:50px;' src='" + item.icon + "' /> " + item.label + "</a>")
.appendTo(ul);
};
Updated 1.10 Code:
$("#searchBox").data("ui-autocomplete")._renderItem = function (ul, item) {
return renderAutoCompleteItems(ul, item);
};
renderAutoCompleteItems = function(ul, item) {
return $("<li />")
.data("ui-autocomplete-item", item)
.append("<a><img style='width:50px; height:50px;' src='" + item.icon + "' /> " + item.label + "</a>")
.appendTo(ul);
};
$("#searchBox").data("
return renderAutoCompleteItems(ul, item);
};
renderAutoCompleteItems = function(ul, item) {
return $("<li />")
.data("
.append("<a><img style='width:50px; height:50px;' src='" + item.icon + "' /> " + item.label + "</a>")
.appendTo(ul);
};
Updated 1.10 Code:
$("#searchBox").data("ui-autocomplete")._renderItem = function (ul, item) {
return renderAutoCompleteItems(ul, item);
};
renderAutoCompleteItems = function(ul, item) {
return $("<li />")
.data("ui-autocomplete-item", item)
.append("<a><img style='width:50px; height:50px;' src='" + item.icon + "' /> " + item.label + "</a>")
.appendTo(ul);
};
Subscribe to:
Posts (Atom)

