本文整理汇总了C#中System.Web.UI.WebControls.DataListCommandEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataListCommandEventArgs类的具体用法?C# DataListCommandEventArgs怎么用?C# DataListCommandEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataListCommandEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了DataListCommandEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DlCommandItem
public void DlCommandItem(object server, DataListCommandEventArgs e)
{
if (e.CommandName == "StudentDetailInfo")
{
Response.Redirect(String.Format("~/InstructorSite/frmViewStudentGrade.aspx?sid={0}", ((Label)e.Item.FindControl("lblStudentID")).Text));
}
}
开发者ID:haripradhan,项目名称:LMS,代码行数:7,代码来源:frmViewGradeByInstructor.aspx.cs
示例2: DataListEmpleados_ItemCommand
protected void DataListEmpleados_ItemCommand(object source, DataListCommandEventArgs e) {
if(e.CommandName == "verDetalles") {
string empleadoID = e.CommandArgument.ToString();
int indice = e.Item.ItemIndex;
DataListItem itemSeleccionado = DataListEmpleados.Items[indice];
Literal l1 = itemSeleccionado.FindControl("Literal1") as Literal;
l1.Visible = true;
SqlConnection conexion = new SqlConnection(cadenaConexion);
SqlCommand consultaTelefono = new SqlCommand ("SELECT TelfMobil FROM Empleados WHERE EmpleadoID = @EmpleadoID", conexion);
consultaTelefono.Parameters.Add("@EmpleadoID", SqlDbType.Int);
consultaTelefono.Parameters["@EmpleadoID"].Value = empleadoID;
try {
conexion.Open();
SqlDataReader reader = consultaTelefono.ExecuteReader();
if(reader.Read()) {
l1.Text += "<strong>" + reader["TelfMobil"] + "</strong>";
}
reader.Close();
}
catch (SqlException ex) {
Response.Write("Ha ocurrido un error en la consulta: " + ex.Message);
}
finally {
conexion.Close();
}
}
}
开发者ID:Myugen,项目名称:ProyectosASP.NET,代码行数:27,代码来源:Empleados.aspx.cs
示例3: DataList1_ItemCommand
public void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName.Equals("call"))
{
DataListItem item = (DataListItem)(((Button)(e.CommandSource)).NamingContainer);
text = ((TextBox)item.FindControl("TextBox1")).Text;
Response.Write(text+"text1");
}
UploadAttribute.WebService1 S1 = new UploadAttribute.WebService1();
S1.Credentials = System.Net.CredentialCache.DefaultCredentials;
String a;
a = S1.deleteTable(text);
string imgurl = Server.MapPath("~/storage/"+text + "");
System.IO.File.Delete(imgurl);
if (a.Equals("Bought"))
{
Response.Write("Delete Successful");
Response.Write(text);
}
else
Response.Write("Delete UnSuccessful");
}
开发者ID:umkc1,项目名称:increment4,代码行数:29,代码来源:WebForm2.aspx.cs
示例4: DataList1_ItemCommand
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "btnDel")
{
sb.delSpeak((int)e.CommandArgument);
}
}
开发者ID:heroims,项目名称:studyCommunity,代码行数:7,代码来源:manage_soundSpeak.aspx.cs
示例5: DataList1_ItemCommand
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
if(e.CommandName.ToString()=="Cmdedit")
{
DataList1.EditItemIndex = e.Item.ItemIndex;
FillData();
}
else if(e.CommandName.ToString()=="CmdCancel")
{
DataList1.EditItemIndex = -1;
FillData();
}
else if(e.CommandName.ToString()=="CmdUpadate")
{
Label leno = (Label)e.Item.FindControl("lblempno");
string empno =leno.Text;
Response.Write(empno);
TextBox t1 = (TextBox)e.Item.FindControl("txtempname");
string ename = t1.Text;
TextBox t2 = (TextBox)e.Item.FindControl("txtsalary");
Double salary =Double.Parse( t2.Text);
con.Open();
string query="update emp set Empname='"+ename+"',salary='"+salary+"' where empno='"+empno+"'";
SqlCommand cmd = new SqlCommand(query, con);
cmd.ExecuteNonQuery();
con.Close();
DataList1.EditItemIndex = -1;
FillData();
}
}
开发者ID:ananth039,项目名称:Anantha-Kumar-.net-Practice-programs,代码行数:31,代码来源:datalist+control+example.aspx.cs
示例6: DataList1_UpdateCommand
protected void DataList1_UpdateCommand(object source, DataListCommandEventArgs e)
{
//if (base.level == ((int)Util.Enum.UserSysLevel.Experience).ToString() || base.isOverTime)
//{
// Alert(this, "体验版用户不能具备此功能!");
// return;
//}
int id = 0;
try
{
id = Convert.ToInt32(DataList1.DataKeys[e.Item.ItemIndex]);
}
catch (Exception ex)
{
Alert(this, "ID格式错误"+ex.Message);
return;
}
string context = ((TextBox)e.Item.FindControl("txtContext")).Text.Trim();
if (context.Length == 0)
{
Alert(this, "请填写好评再保存");
return;
}
autoTraderateAction.UpdateContext(id,context);
DataList1.EditItemIndex = -1;
BindDatalist();
}
开发者ID:feidu,项目名称:TBAPP,代码行数:27,代码来源:AutoTraderate.aspx.cs
示例7: StudentData_UpdateCommand
protected void StudentData_UpdateCommand(object source, DataListCommandEventArgs e)
{
if (Page.IsValid)
try
{
StudentDataSource.UpdateParameters["StuId"].DefaultValue = HttpContext.Current.User.Identity.Name;
// Build update parametter from controls
StudentDataSource.UpdateParameters["Address"].DefaultValue = ((TextBox)e.Item.FindControl("txtAddress")).Text;
StudentDataSource.UpdateParameters["Phone"].DefaultValue = ((TextBox)e.Item.FindControl("txtPhone")).Text;
StudentDataSource.UpdateParameters["Email"].DefaultValue = ((TextBox)e.Item.FindControl("txtEmail")).Text;
StudentDataSource.UpdateParameters["Account"].DefaultValue = ((TextBox)e.Item.FindControl("txtAccount")).Text;
StudentDataSource.Update();
// Rebind to control
StudentData.EditItemIndex = -1;
StudentData.DataBind();
if (!string.IsNullOrEmpty(Settings["Email"] as string))
this.CompareAndSendInfo(e.Item);
}
catch (Exception ex)
{
// Notice error to the user
((Label)e.Item.FindControl("StudentFailureText")).Text = ex.Message;
}
}
开发者ID:hoaian89,项目名称:DAA,代码行数:26,代码来源:StudentCV.ascx.cs
示例8: DatalistDVD_ItemCommand
protected void DatalistDVD_ItemCommand(object source, DataListCommandEventArgs e)
{
if(e.CommandName == "DVDEditOpen")
{
DatalistDVD.EditItemIndex = e.Item.ItemIndex;
bindDatalist();
}
else if(e.CommandName == "DVDEditSave")
{
int DVDID = Convert.ToInt32(e.CommandArgument);
TextBox TextBoxTitle = (TextBox)e.Item.FindControl("TextBoxTitle");
string newTitle = TextBoxTitle.Text;
TextBox TextBoxArtist = (TextBox)e.Item.FindControl("TextBoxArtist");
string newArtist = TextBoxArtist.Text;
TextBox TextBoxRating = (TextBox)e.Item.FindControl("TextBoxRating");
string newRating = TextBoxRating.Text;
TextBox TextBoxPrice = (TextBox)e.Item.FindControl("TextBoxPrice");
string newPrice = TextBoxPrice.Text;
sqlUpdateItem(DVDID, newTitle, newArtist, newRating, newPrice);
DatalistDVD.EditItemIndex = -1;
bindDatalist();
}
else if(e.CommandName == "DVDEditCancel")
{
DatalistDVD.EditItemIndex = -1;
bindDatalist();
}
}
开发者ID:jeffersoneagley,项目名称:PROG117,代码行数:29,代码来源:EditDVDList.aspx.cs
示例9: dlistUrunler_ItemCommand
protected void dlistUrunler_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "detay")
{
Response.Redirect("Details.aspx?id=" + Convert.ToInt32(e.CommandArgument));
}
else if (e.CommandName == "sepet")
{ // 13.10 ******************
dlistUrunler.EditItemIndex = e.Item.ItemIndex;
if (Session["sepet"] == null)
{
Session["sepet"] = spt.YeniSepet();
}
DataTable dt = (DataTable)Session["sepet"];
DataRow dr;
dr = dt.NewRow();
dr["UrunID"] = Convert.ToInt32(dlistUrunler.SelectedValue);
Label Adi = (Label)e.Item.FindControl("lblUrunAdi");
dr["urunAd"] = Adi.Text;
TextBox Adet = (TextBox)e.Item.FindControl("txtAdet");
dr["Adet"] = Convert.ToInt32(Adet.Text);
Label Fiyat = (Label)e.Item.FindControl("lblUrunFiyat");
dr["fiyat"] = Convert.ToDecimal(Fiyat.Text);
dr["tutar"] = Convert.ToInt32(Adet.Text) * Convert.ToDecimal(Fiyat.Text);
dt.Rows.Add(dr);
Session["sepet"] = dt;
Response.Redirect("Sepet.aspx");
}
}
开发者ID:arslanaybars,项目名称:CSharp-Workspace,代码行数:30,代码来源:Details.aspx.cs
示例10: repCategories_ItemCommand
//private void repCategories_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
protected void repCategories_ItemCommand(object source, DataListCommandEventArgs e)
{
try
{
if(e.CommandName == "Select")
{
ViewState["CatId"] = e.CommandArgument;
pnlEnterIssue.Visible = true;
pnlSelectCategory.Visible = false;
pnlViewIssues.Visible = false;
tbNotes.Text = "";
}
}
catch(Exception ex)
{
_functions.Log(ex, HttpContext.Current.User.Identity.Name, SourcePageName);
Session["lastpage"] = CurrentPage;
Session["error"] = ex.Message;
Session["error_report"] = ex.ToString();
Response.Redirect("error.aspx", false);
}
finally
{
}
}
开发者ID:bigWebApps,项目名称:Fleet,代码行数:26,代码来源:ok_addIssues.aspx.cs
示例11: dl_music_ItemCommand
protected void dl_music_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "SongInfo")
{
Response.Redirect("MusicView.aspx");
}
}
开发者ID:Sherazzie,项目名称:MusicTherapyProject,代码行数:7,代码来源:FilterSongsByAlbum.aspx.cs
示例12: DataListUsers_UpdateCommand
protected void DataListUsers_UpdateCommand(object source, DataListCommandEventArgs e)
{
SqlDataSourceUsers.UpdateParameters["userID"].DefaultValue = DataListUsers.DataKeys[e.Item.ItemIndex].ToString();
SqlDataSourceUsers.UpdateParameters["blokada"].DefaultValue = e.CommandArgument.ToString();
SqlDataSourceUsers.Update();
}
开发者ID:taksun,项目名称:ASP,代码行数:7,代码来源:Users.aspx.cs
示例13: DataListProducts_ItemCommand
public void DataListProducts_ItemCommand(object source, DataListCommandEventArgs e)
{
/*
var list = (List<Tuple<string, int>>)(Session["cartList"]);
foreach (var i in list)
{
if (i.Item1 == e.CommandName)
{
list.Add(new Tuple<string, int>(e.CommandName, 1));
break;
}
}
Session["cartList"] = list;
foreach (var x in prods)
{
if (e.CommandName == x.Prodcd)
{
x.Qty++;
x.Total = x.Qty * x.Price;
DataListCartItems.DataSource = prods;
DataListCartItems.DataBind();
break;
}
}
* */
}
开发者ID:gmeehan,项目名称:QuickStart,代码行数:28,代码来源:CartItems.aspx.cs
示例14: DataList1_ItemCommand
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "cate")
{
Response.Redirect("~/Tour.aspx?cateid=" + e.CommandArgument + "&Country=" + Request.QueryString["country"]);
}
}
开发者ID:thangcyber92,项目名称:halongbaycruises,代码行数:7,代码来源:ucTourTry.ascx.cs
示例15: dlstTs_ItemCommand
protected void dlstTs_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "sepet")
{
dlstTs.SelectedIndex = e.Item.ItemIndex;
if (Session["sepet"] == null)
{
Session["sepet"] = spt.YeniSepet();
}
DataTable dt = (DataTable)Session["sepet"];
DataRow dr;
dr = dt.NewRow();
dr["urunId"] = Convert.ToInt32(dlstTs.SelectedValue);
Label UrunAdi = (Label)e.Item.FindControl("lblTs");
dr["urunadi"] = UrunAdi.Text;
Label Fiyat = (Label)e.Item.FindControl("lblFiyat");
dr["birimfiyat"] = Convert.ToDecimal(Fiyat.Text);
TextBox Adet = (TextBox)e.Item.FindControl("txtAdet");
dr["adet"] = Convert.ToInt32(Adet.Text);
dr["tutar"] = Convert.ToInt32(Adet.Text) * Convert.ToDecimal(Fiyat.Text);
dt.Rows.Add(dr);
Session["sepet"] = dt;
Response.Redirect("Sepet.aspx");
}
else
if (e.CommandName == "detay")
{
Response.Redirect("Detay.aspx?ID=" + Convert.ToInt32(e.CommandArgument));
}
}
开发者ID:AlptugYaman,项目名称:TSHIT,代码行数:31,代码来源:Erkek.aspx.cs
示例16: Booking_DeleteCommand
protected void Booking_DeleteCommand(object source, DataListCommandEventArgs e)
{
int bookingid;
bookingid = Convert.ToInt32(e.CommandArgument);
SqlConnection con = new SqlConnection(strconn);
con.Open();
SqlCommand cmd = new SqlCommand("Delete from schedule where id = '" + bookingid + "'", con);
SqlCommand cmd2 = new SqlCommand("UPDATE carOwner SET MyPoints = MyPoints+200 where carOwner.ownerID = (Select schedule.OwnerID from schedule where id = '" + bookingid + "')", con);
int res2 = cmd2.ExecuteNonQuery();
int res = cmd.ExecuteNonQuery();
if (res > 0 && res2 > 0)
{
Label5.Visible = true;
Label5.Text = "Your booking has been cancelled and you have been refunded back with 200 points";
con.Close();
}
else
{
Label5.Visible = true;
Label5.Text = "Error in booking cancelling try again later";
con.Close();
}
displayBooking();
}
开发者ID:Daveolumbe,项目名称:WASHD,代码行数:28,代码来源:cancel.aspx.cs
示例17: dtEquipment_ItemCommand
protected void dtEquipment_ItemCommand(object source, DataListCommandEventArgs e)
{
int id = int.Parse(e.CommandArgument.ToString());
string cmd = e.CommandName;
if (cmd == "AddToCart")
{
Label lbl = (Label)e.Item.FindControl("lblMsg");
lbl.Visible = false;
TextBox txt = (TextBox)e.Item.FindControl("txtDLQty");
if (int.Parse(txt.Text) >= 0)
{
Inventory s = new Inventory(id, int.Parse(txt.Text), ddlInvClient.SelectedIndex);
Session["tmp_eqID"] = s.EquipmentID;
Session["tmp_Qty"] = s.Quantity;
Session["tmp_cID"] = s.ClientID;
pnlInvInput.Visible = true;
}
else
{
lbl.Visible = true;
lbl.Text = "must be greater than 0";
}
}
}
开发者ID:coderjokis,项目名称:ServiceApp,代码行数:26,代码来源:Cart.aspx.cs
示例18: employeesDataList_ItemCommand
protected void employeesDataList_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "MoreDetailsPlease")
{
Literal myLiteral;
myLiteral = (Literal)e.Item.FindControl("extraDetailsLiteral");
myLiteral.Text = "Employee ID: <strong>" + e.CommandArgument +
"</strong><br />";
}
else if (e.CommandName == "EditItem")
{
employeesDataList.EditItemIndex = e.Item.ItemIndex;
BindList();
}
else if (e.CommandName == "CancelEditing")
{
employeesDataList.EditItemIndex = -1;
BindList();
}
else if (e.CommandName == "UpdateItem")
{
int employeeId = Convert.ToInt32(e.CommandArgument);
TextBox nameTextBox = (TextBox)e.Item.FindControl("nameTextBox");
string newName = nameTextBox.Text;
TextBox usernameTextBox = (TextBox)e.Item.FindControl("usernameTextBox");
string newUsername = usernameTextBox.Text;
UpdateItem(employeeId, newName, newUsername);
employeesDataList.EditItemIndex = -1;
BindList();
}
}
开发者ID:jeffersoneagley,项目名称:PROG117,代码行数:31,代码来源:EmployeeDirectory2.aspx.cs
示例19: SelectCourseItemCommand
protected void SelectCourseItemCommand(object sender, DataListCommandEventArgs e)
{
if (e.CommandName == "courseName" || e.CommandName== "ViewCourse")
{
string courseId = ((Label)e.Item.FindControl("lblCourseID")).Text;
string instructorName = ((Label)e.Item.FindControl("lblInstructorName")).Text;
string courseName = ((LinkButton)e.Item.FindControl("lbCourseName")).Text;
if (Session["CourseID"] != null)
{
Session.Remove("CourseID");
}
if (Session["CourseName"] != null)
{
Session.Remove("CourseName");
}
if (Session["InstructorName"] != null)
{
Session.Remove("InstructorName");
}
Session["CourseID"] = courseId;
Session["InstructorName"] = instructorName;
Session["CourseName"] = courseName;
Response.Redirect(String.Format("~/Presentation/formHome.aspx?cid={0}", courseId));
}
}
开发者ID:haripradhan,项目名称:LMS,代码行数:26,代码来源:FormMyCourse.aspx.cs
示例20: DataList1_ItemCommand1
protected void DataList1_ItemCommand1(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "sale")
{
catid = Convert.ToInt32(e.CommandArgument);
Response.Redirect("DetailedAds.aspx?allad=" + catid);
}
if (e.CommandName == "sale1")
{
catid = Convert.ToInt32(e.CommandArgument);
Response.Redirect("Allads.aspx?address=" + catid);
}
if (e.CommandName == "sale2")
{
catid = Convert.ToInt32(e.CommandArgument);
Response.Redirect("Allads.aspx?city=" + catid);
}
if (e.CommandName == "sale3")
{
catid = Convert.ToInt32(e.CommandArgument);
Response.Redirect("Allads.aspx?cat1=" + catid);
}
if (e.CommandName == "sale4")
{
catid = Convert.ToInt32(e.CommandArgument);
Response.Redirect("Allads.aspx?subcat1=" + catid);
}
}
开发者ID:aceindus123,项目名称:New,代码行数:32,代码来源:Allads.aspx.cs
注:本文中的System.Web.UI.WebControls.DataListCommandEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论