enum Colors { None=0, Red = 1, Green = 2, Blue = 4 };
string[] colorStrings = { "0", "2", "8", "blue", "Blue", "Yellow", "Red, Green" };
Colors colorValue = (Colors) Enum.Parse(typeof(Colors), colorString);
enum Colors { None=0, Red = 1, Green = 2, Blue = 4 };
string[] colorStrings = { "0", "2", "8", "blue", "Blue", "Yellow", "Red, Green" };
Colors colorValue = (Colors) Enum.Parse(typeof(Colors), colorString);
void Application_BeginRequest(object sender, EventArgs e)
{
HttpApplication app = sender as HttpApplication;
if(app.Request.Path.IndexOf("FriendlyPage.html") > 0)
{
app.Context.RewritePath("/UnfriendlyPage.aspx?SomeQuery=12345");
}
}
Response.Redirect("http://www.flashwolves.com" + HttpContext.Current.Request.Url.PathAndQuery);
DataSet 廠商專頁ds = DBstatic.廠商專頁ds;
DataRow[] updateRow = 廠商專頁ds.Tables[0].Select("專頁編號 = '" + 專頁編號 + "'");
用途:在codebehind寫txterrmsg.Text = "..."; 就會有即時的alert彈出來! 要放在$(function(){})裡用唷! setInterval(function () { var err = $('#<%=txterrmsg.ClientID%>').val(); if (err != '') { myalert(err); $('#<%=txterrmsg.ClientID%>').val(''); hidenowpop(); } var topoffset = 0; if (detectDevice()) { topoffset = 0; } else topoffset = 60; $('#pop').css('top', topoffset + parseInt($('body').scrollTop()) + 'px'); }, 200);
DateTime 開始時間 = DateTime.ParseExact(終止區間[0], "yyyy/MM/dd", System.Globalization.CultureInfo.InvariantCulture); DateTime 結束時間 = DateTime.ParseExact(終止區間[1], "yyyy/MM/dd", System.Globalization.CultureInfo.InvariantCulture); if (今天.Date < 開始時間.Date || 今天.Date > 結束時間.Date) { Response.Redirect("../expiry/" + Page.RouteData.Values["name"]); }
using System.Text.RegularExpressions; string saveFile = FileUpload1.Value; saveFile = Regex.Replace(saveFile, @"\s+", ""); //清除空白字元
$(document).on('change','.browseimage',function(){
alert('change');// check FormData and ajax ..});
public int 資料重撈時間 = 5; //分鐘 public static DateTime DB資料暫存時間 = new DateTime(); DateTime dt1 = DBstatic.DB資料暫存時間; DateTime dt2 = DateTime.Now; TimeSpan dt3 = dt2.Subtract(dt1); int timeoffset = (int)dt3.TotalMinutes; if (timeoffset > 資料重撈時間) //unicorn { 募款單位ds = DBstatic.募款單位(); }
string[] birthday = ds.Tables[0].Rows[i]["選手生日"].ToString().Split('-');
DateTime today = DateTime.Today; DateTime bday = new DateTime(Convert.ToInt16(birthday[0]), Convert.ToInt16(birthday[1]), Convert.ToInt16(birthday[2])); int age = today.Year - bday.Year; if (bday > today.AddYears(-age)) age--;
<object type="application/x-shockwave-flash" height="378" width="620" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=jackcombat" bgcolor="#000000"><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><param name="allowNetworking" value="all"/><param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf"/><param name="flashvars" value="hostname=www.twitch.tv&channel=jackcombat&auto_play=false"/></object>
http://blogs.microsoft.co.il/tamirs/2009/03/16/pageload-event-fires-twice/
http://stackoverflow.com/questions/2009092/page-loads-twice-in-google-chrome
public partial class MasterPage : MasterBase { int pushid = 0; //照順序排才不會亂掉 AddheadControl(headertype.css, "~/css/master.css", pushid++); AddheadControl(headertype.css, "~/css/btn.css", pushid++); AddheadControl(headertype.js, "~/js/jquery-1.9.1.min.js", pushid++); AddheadControl(headertype.js, "~/myJS/cherryblockV2-min.js", pushid++); AddheadControl(headertype.js, "~/myJS/illya.js", pushid++); AddheadControl(headertype.js, "~/myJS/AjaxHandler.js?140522", pushid++); AddheadControl(headertype.js, "~/myJS/base.js?140929", pushid++); AddheadControl(headertype.js, "~/myJS/msChkboxKai.js", pushid++); AddheadControl(headertype.js, "~/myJS/oebigfire-min.js", pushid++);
DataTable dt = ds.Tables[0]; RP_leftnews.DataSource = dt; RP_leftnews.DataBind(); <asp:Repeater ID="RP_leftnews" runat="server"> <ItemTemplate> <ul class="newList"> <li><a href="<%#Eval("link") %>"><img alt="" src="<%#Eval("pic") %>" /></a></li> <li style="width:73%"> <p class="newsTitle"><a href="<%#Eval("link") %>"><%#Eval("lefttitle") %></a></p> <p class="newsRightdate" style="padding-bottom: 6px;"><%#Eval("date") %></p> <p class="newsContent"><%#Eval("leftcontent") %>....</p> </li> </ul> </ItemTemplate> </asp:Repeater>