本文整理汇总了C#中UserService.getCity方法的典型用法代码示例。如果您正苦于以下问题:C# UserService.getCity方法的具体用法?C# UserService.getCity怎么用?C# UserService.getCity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserService
的用法示例。
在下文中一共展示了UserService.getCity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GridView1_RowDataBound
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowState == (DataControlRowState.Edit | DataControlRowState.Alternate) ||
e.Row.RowState == (DataControlRowState.Edit | DataControlRowState.Normal))
{
UserService user = new UserService();
DropDownList ddl = (DropDownList)e.Row.Cells[4].FindControl("DropDownList1");
DataSet dsCities = new DataSet();
dsCities = user.getCity();
ddl.DataSource = dsCities;
ddl.DataTextField = dsCities.Tables[0].Columns[1].ToString();
ddl.DataValueField = dsCities.Tables[0].Columns[0].ToString();
ddl.DataBind();
object cityname = DataBinder.Eval(e.Row.DataItem, "cityId");
ddl.SelectedValue = cityname.ToString();
}
if (e.Row.RowType != DataControlRowType.Header && e.Row.RowType != DataControlRowType.Footer && e.Row.RowType != DataControlRowType.Pager)
{
Button deleteButton = (Button)e.Row.Cells[8].FindControl("Button1");
deleteButton.Attributes["onclick"] = "javascript:return confirm('are you sure you want to delete UserID #" + DataBinder.Eval(e.Row.DataItem, "userID") + "?')";
}
//if (e.Row.RowType == DataControlRowType.Footer)
//{
// Label label1 = (Label)e.Row.Cells[6].FindControl("LabelSum");
// label1.Text=
//}
}