Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÔÚASP.NETÖзÃÎÊDataGridÖÐËùÓпؼþµÄÖµ

<%@ Page Language="C#" %>
<%@ import Namespace="System.Collections" %>
<script runat="server">
void Page_Load(Object sender, EventArgs e) {
if(!Page.IsPostBack){
ArrayList data = new ArrayList();
data.Add(new Person("Tom",33,true));
data.Add(new Person("Jhon",39,false));
data.Add(new Person("Mark",20,false));
data.Add(new Person("Linda",27,true));
MyDataGrid.DataSource = data;
MyDataGrid.DataBind();
}
}
void GetValues_Click(Object sender, EventArgs e) {
String Result = "";
foreach(DataGridItem dataGridItem in MyDataGrid.Items){
//Get name from cell[0]
String Name = dataGridItem.Cells[0].Text;
//Get text from textbox in cell[1]
String Age = ((TextBox)dataGridItem.FindControl("AgeField")).Text;
//Get Checked property of Checkbox control
bool IsGraduate = ((CheckBox)dataGridItem.FindControl("IsGraduateField")).Checked;
// get Values from Checkboxlist
String Skills = "";
foreach(ListItem item in ((CheckBoxList)dataGridItem.FindControl("CheckBoxList1")).Items){
if (item.Selected){
Skills += item.Value + ",";
}
}
Skills = Skills.TrimEnd(',');
//Get RadioButtonList Selected text
String Experience = ((RadioButtonList)dataGridItem.FindControl("RadioButtonList1")).SelectedItem.Text;
//Get DropDownList Selected text
String Degree = ((DropDownList)dataGridItem.FindControl("DropDownList1")).SelectedItem.Text;
// Build String to show result.
Result += Name;
Result += " [Age -" + Age + "] ";
if (IsGraduate){
Result += "Is Graduate , ";
}else{
Result += "Is not Graduate , ";
}
Result += "Has Skills[" + Skills + "] , ";
Result += "Has " + Experience + " Experience , And " ;
Result += "Has " + Degree + " Degree." ;
Result += "<br>";
}
ResultField.Text = Result;
}
class Person{
String _Name;
int _Age;
bool _IsGraduate;
public Person(String name,int age, bool isGraduate){
_Name = name;
_Age = age;
_IsGraduate = isGraduate;
}
public String Name{
get{return _Name;}
}
public int Age{
get{return _Age;}


Ïà¹ØÎĵµ£º

Asp.netÖеÄAJAX¿Ø¼þ


Accordion¿Ø¼þʱµÄ³£ÓÃÊôÐÔ±êÇ©
ÊôÐÔ±êÇ©Ãû Ãè¡¡¡¡Êö
SelectedIndex ¸Ã¿Ø¼þ³õ´Î¼ÓÔØʱչ¿ªµÄAccordionPaneÃæ°åµÄË÷ÒýÖµ
HeaderCssClass ¸ÃAccordionÖаüº¬µÄËùÓÐAccordionPaneÃæ°åµÄ±êÌâÇøÓòËùÓ¦ÓõÄCSS Class
ContentCssClass ¸ÃAccordionÖаüº¬µÄËùÓÐAccordionPaneÃæ°åµÄÄÚÈÝÇøÓòËùÓ¦ÓõÄCSS Class
AutoSize Ô ......

Asp.Net ButtonµÄUseSubmitBehaviorÊôÐÔ

ÔÚijҳÃæÉÏÓÐÈçÏÂÐÅÏ¢£¬
Html£¬
<asp:Button ID="btn" runat="server" Text="Click me" OnClick="ButtonClicked" />
<script language="javascript">
function javascriptMethod() {
alert(1);
}

</script>
C#£¬
protected void ButtonClic ......

Javascript ÔÚASP.net ĸ°åҳϷÃÎÊ ¿Ø¼þID£º

Javascript ÔÚASP.net ĸ°åҳϷÃÎÊ ¿Ø¼þID£º
¶ÔÓÚ html control : Ö±½Ó·ÃÎÊID
document.getElementById("hfRespondID");
¶ÔÓÚ Web control :
document.getElementById("<%= this.hfRespondID.ClientID %>") [×¢Òâ´óСд
]     
     &nb ......

asp.net µ¼³öExcel

public bool SaveExcel(GridView paramGridView)
{
if (paramGridView.Rows.Count == 0)
{
return false;
}
//´´½¨Excel¶ÔÏó
Microsoft.Office.Interop.Excel.Application myExcel = new Microsoft.Office.Interop.Excel.Appl ......

ÓÃasp.net»¹Ô­Óë»Ö¸´sqlserverÊý¾Ý¿â

  
ÉÏ´Î×öÁ˸öÏîÄ¿£¬Éæ¼°µ½Êý¾Ý¿âµÄ»¹Ô­ºÍ»Ö¸´£¬µ½ÍøÉÏÕÒÁËһϣ¬ÊÇÀûÓÃSQLDMOʵÏֵģ¬Ö»ÒªÌí¼ÓSQLDMOÒýÓþͺÃÁË£¬È»ºóÀûÓÃϱߵÄÀàµÄ·½·¨¾Í¿ÉÒÔʵÏÖÁË¡£
ÎÒ°ÑÔ­×÷ÕßµÄÀàÀ©³äÁËһϣ¬¿ÉÒÔ×Ô¶¯Ê¶±ðweb.configÀï µÄÊý¾Ý¿âÁ¬½Ó×Ö·û´®£¬¿ÉÒÔͨ¹ý±äÁ¿ÉèÖû¹Ô­»Ö¸´µÄÐÅÏ¢¡£
ÐèҪעÒâµÄʱ»¹Ô­£¬»¹Ô­µÄʱºòÎÊÌ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ