一般來說,如果在GridView要顯示三位一撇,只要設定就可以達到
參考:http://paladinprogram.blogspot.com/2008/07/gridview.html
或者在程式中,可以用 string.Format("{0:#,##0}",數值) 就可以達成(一定要轉成數值喔)
若希望在SQL所產生的資料就有三位一撇的效果,可以參考
http://blog.blueshop.com.tw/soway/archive/2008/01/08/53987.aspx
2008年11月19日 星期三
2008年11月18日 星期二
建立WebService
基礎建立(單獨)
http://blog.blueshop.com.tw/swtnwr/archive/2007/05/18/50933.aspx
加入於專案中
1、加入新項目→Web服務→自訂Function
2、加入Web參考→使用此方案的Web服務→確定
回傳DataSet
http://www.c-sharpcorner.com/UploadFile/fbesterwitch/ReturningDataSetFromWebServices11252005004535AM/ReturningDataSetFromWebServices.aspx
回傳XML
http://bytes.com/forum/thread376574.html
http://blog.blueshop.com.tw/swtnwr/archive/2007/05/18/50933.aspx
加入於專案中
1、加入新項目→Web服務→自訂Function
2、加入Web參考→使用此方案的Web服務→確定
回傳DataSet
http://www.c-sharpcorner.com/UploadFile/fbesterwitch/ReturningDataSetFromWebServices11252005004535AM/ReturningDataSetFromWebServices.aspx
回傳XML
http://bytes.com/forum/thread376574.html
2008年10月22日 星期三
2008年10月9日 星期四
2008年10月2日 星期四
在cs中,導到別頁時,以另開新頁的方式開啟
直接導到別頁的方式:Response.Redirect("網址");
以另開新頁的導頁方式:
public static void OpenWindowToNewPage(Page page, string destUrl)
{
//開一新視窗
string scriptString = string.Format("< language="'JavaScript'">window.open(\"{0}\",'NewPage');<", destUrl);
以另開新頁的導頁方式:
public static void OpenWindowToNewPage(Page page, string destUrl)
{
//開一新視窗
string scriptString = string.Format("< language="'JavaScript'">window.open(\"{0}\",'NewPage');<", destUrl);
scriptString += "/";
scriptString += "script >";
Type cstype = page.GetType();
if (!page.ClientScript.IsStartupScriptRegistered("Startup"))
{
page.ClientScript.RegisterStartupScript(cstype, "Startup", scriptString);
}
}
使用方式: OpenWindowToNewPage(this.Page, "網址");
Type cstype = page.GetType();
if (!page.ClientScript.IsStartupScriptRegistered("Startup"))
{
page.ClientScript.RegisterStartupScript(cstype, "Startup", scriptString);
}
}
使用方式: OpenWindowToNewPage(this.Page, "網址");
感謝Darren提供
在cs中直接呼叫javascript,不用在click事件
aspx
function Open()
{
var question="";
var question = confirm("Message?")
if (question)
{
window.open("http://","","width=600,height=400,toolbar=0,status=0,menubar=0,resize=0");
//開啟視窗
//window.open("http://");整個視窗
}
}
cs
string script = "< language="'javascript'">Open()< /script>";
ClientScript.RegisterStartupScript(this.GetType(), "n1", script);
立即取得CheckBoxList目前勾選的選項
一般都是用foreach來取得勾選了哪些選項,但如有筆數限定時,要馬上告知user已超出可勾選的筆數,此方式就不適用了!
可改用:
SelectedIndexChanged事件
string args = Request["__EVENTTARGET"];
char[] delimiterChars = { '$' };
string[] words = args.Split(delimiterChars);
int ix = Convert.ToInt16(words[words.Length - 1]);
foreach (ListItem item in CheckBoxList.Items)
{
if (item.Selected)
{
if (!判斷目前所勾選的筆數)
CheckBoxList.Items[ix].Selected = false;
}
}
參考網址:http://phone.idv.tw/cs2/forums/thread/510.aspx
可改用:
SelectedIndexChanged事件
string args = Request["__EVENTTARGET"];
char[] delimiterChars = { '$' };
string[] words = args.Split(delimiterChars);
int ix = Convert.ToInt16(words[words.Length - 1]);
foreach (ListItem item in CheckBoxList.Items)
{
if (item.Selected)
{
if (!判斷目前所勾選的筆數)
CheckBoxList.Items[ix].Selected = false;
}
}
參考網址:http://phone.idv.tw/cs2/forums/thread/510.aspx
感謝協助我的人^^
訂閱:
文章 (Atom)