Skip to content

Instantly share code, notes, and snippets.

View yaplex's full-sized avatar

Alex Shapovalov yaplex

View GitHub Profile
<asp:GridView ID="GridView1" runat="server" CssClass="dataGrid"
DataSourceID="SqlDataSource1" AllowPaging="True" AutoGenerateColumns="false"
OnRowDeleting="grid_onRowDeleting" OnRowUpdating="GridView1_OnRowUpdating"
AutoGenerateEditButton="true" AutoGenerateDeleteButton="true"
PageSize="20" GridLines="None" Width="99%">
<AlternatingRowStyle CssClass="odd" />
<Columns>
<asp:TemplateField HeaderText="App Id">
<ItemTemplate>
protected void GridView1_OnRowUpdating(object sender, GridViewUpdateEventArgs e)
{
// if APP_ID in the grid bind with Eval method, it will be exception below
// But if you use Bind instead of Eval it will be ok.
rowToUpdate = e.NewValues["APP_ID"];
}
(function($) {
// your plug-in code here
})(jQuery);
(function($) {
$.log =
{
log: function(message) {
//if('console' in window && 'log' in window.console)
if (typeof window.console != 'undefined' && typeof window.console.log != 'undefined') {
console.log(message);
}
else {
// do nothing
<asp:UpdatePanel runat="server" ID="calendarUpdatePanel">
<ContentTemplate>
<uc1:Calendar ID="Calendar1" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
protected void Page_Load(object sender, EventArgs e)
{
Calendar1.SelectionChanged += CalendarSelectionChanged;
}
private void CalendarSelectionChanged(object sender, EventArgs e)
{
DateTime selectedDate = ((Calendar) sender).SelectedDate;
string url = "HistoryRates.aspx?date="
+ HttpUtility.UrlEncode(selectedDate.ToShortDateString());
@yaplex
yaplex / jscode.js
Last active December 25, 2022 22:39
function openWindow(url)
{
var w = window.open(url, '', 'width=1000,height=600,toolbar=0,status=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1');
w.focus();
}
dynamic messagePost = new ExpandoObject(); messagePost.picture = "https://yaplex.com/media/default/logos/yaplex.png";
messagePost.link = "https://yaplex.com/"; messagePost.name = "[name] Facebook name..."; // "{*actor*} " + "posted news...";
//<---{*actor*} is the user (i.e.: Alex) messagePost.caption = "[caption] Facebook caption"; messagePost.description =
"[description] Facebook description..."; messagePost.message = "[message] Facebook message..."; string acccessToken = "xxxx5120330xxxx|4xxxxx0c0f95bd3f62dxxxxx.1-10000xx4x73xxxx|2xx5xxx0566xxxx|z2xxxx37dxxxxsdDS23s_Sah34a";
FacebookClient appp = new FacebookClient(acccessToken); try { var postId = appp.Post("24351740xxxxxx" + "/feed", messagePost);
} catch (FacebookOAuthException ex) { //handle oauth exception } catch (FacebookApiException ex) { //handle facebook exception
}
public class ProductDAL
{
public virtual List<Product> GetProducts()
{
// connect to DB and get products
return new List<Product>();
}
}
public class ProductBL
{
private readonly ProductDAL dal;
public ProductBL(ProductDAL dal)
{
this.dal = dal;
}
public List<Product> GetProducts()