2013年3月18日 星期一
2013年3月14日 星期四
登入區塊內按下Enter,則觸發登入按鈕
//登入區塊內按下Enter,則觸發登入按鈕
$(".Aclass").keypress(function(e) {
if (e.which == 13) {
$("#Btn").click();
//return false;
}
});
$("input").keypress(function (evt) {
//Deterime where our character code is coming from within the event
var charCode = evt.charCode || evt.keyCode;
if (charCode == 13) {
//Enter key's keycode
return false;
}
});
將物件、字串由A傳到B[物件導向]
[[[[[Controller]]]]]
[HttpGet]
public ActionResult A(string Hi, string How)
{
Session["Hi"] = Hi;
Session["How"] = How;
//return RedirectToAction("B");
return RedirectToAction("B", "Controller", new { Hi = Hi, How = How });
}
[HttpGet]
public ActionResult B(string Hi, string How)
{
FormResult Outer= new FormResult();
Outer.Hi = Hi== null ? (string)Session["Hi"] : Hi;
return View();
}
[[[[[View]]]]]
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<ANZ.Models.FormResult >" %>
<%= Html.HiddenFor(model => model.Hi)%>
[HttpGet]
public ActionResult A(string Hi, string How)
{
Session["Hi"] = Hi;
Session["How"] = How;
//return RedirectToAction("B");
return RedirectToAction("B", "Controller", new { Hi = Hi, How = How });
}
[HttpGet]
public ActionResult B(string Hi, string How)
{
FormResult Outer= new FormResult();
Outer.Hi = Hi== null ? (string)Session["Hi"] : Hi;
return View();
}
[[[[[View]]]]]
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<ANZ.Models.FormResult >" %>
<%= Html.HiddenFor(model => model.Hi)%>
2013年3月12日 星期二
iframe learning
<iframe id="ifameOne" src="Controller/Action"></ifram
<iframe id="ifameOne" src="../User/LogOn"></iframe>
<iframe id="ifameOne" src="../User/LogOn"></iframe>
public ActionResult Pdf()
{
return File(@"d:\test.pdf", "application/pdf");
}
<iframe src="<%= Url.Action("Pdf", "SomeController") %>"></iframe>
<script type="text/javascript">
var ImportInfo = function() {
var info = $('td.active').html();
// call controller action which parses the given string,
//checks for existence in database, and adds new row if needed
$.ajax({
url: '/controller/action',
data: { paramName: info }
})
}
$("#Import").click(ImportInfo);
</script>
<script type="text/javascript"> var ImportInfo = function() { var info = $$('td.active')[0].innerHTML; // call controller action which parses the given string: new Ajax.Request('/controller/action',{ method: 'post' parameters: { paramName: info } }) } $("#Import").click(ImportInfo); </script>
Require SSL
function redirectSSL() {
var loc = location.href.split(':');
if (loc[0] == 'http') {
location.href = 'https:' + loc[1];
}
}
2013年3月4日 星期一
電腦各種符號英文唸法
& Ampersand (And 符號)
* Asterisk (星號)
@ At sign, at (At 符號,At)
\ Backslash (反斜線)
[ Open bracket (左中括弧)
^ Caret (插入號)
] Close bracket (右中括弧)
( Open parenthesis (左括弧)
) Close parenthesis (右括弧)
: Colon (冒號)
, Comma (逗號)
$ Dollar sign (錢符號)
-- Double dash (雙破折號)
... Ellipsis (省略符號)
' Single quote (單引號)
" Quote (雙引號)
= Equals (等號)
+ Plus, plus sign (加,加號)
! Exclamation point (驚歎號)
> Greater than (大於)
< Less than (小於)
# Pound sign (井字號)
? Question mark (問號)
. Period, dot (句號,點)
; Semicolon (分號)
- Hyphen (連字號)
— Dash (破折號)
_ Underscore (底線)
| Vertical bar (垂直線)
{ Open brace (左大括弧)
} Close brace (右大括弧)
% Percent, percent sign (百分比,百分比符號)
/ Slash (斜線)
// Double slash (雙斜線)
~ Tilde (取代符號,毛毛蟲)
* Asterisk (星號)
@ At sign, at (At 符號,At)
\ Backslash (反斜線)
[ Open bracket (左中括弧)
^ Caret (插入號)
] Close bracket (右中括弧)
( Open parenthesis (左括弧)
) Close parenthesis (右括弧)
: Colon (冒號)
, Comma (逗號)
$ Dollar sign (錢符號)
-- Double dash (雙破折號)
... Ellipsis (省略符號)
' Single quote (單引號)
" Quote (雙引號)
= Equals (等號)
+ Plus, plus sign (加,加號)
! Exclamation point (驚歎號)
> Greater than (大於)
< Less than (小於)
# Pound sign (井字號)
? Question mark (問號)
. Period, dot (句號,點)
; Semicolon (分號)
- Hyphen (連字號)
— Dash (破折號)
_ Underscore (底線)
| Vertical bar (垂直線)
{ Open brace (左大括弧)
} Close brace (右大括弧)
% Percent, percent sign (百分比,百分比符號)
/ Slash (斜線)
// Double slash (雙斜線)
~ Tilde (取代符號,毛毛蟲)
訂閱:
文章 (Atom)