请教下,这段代码是设置城市的,是个下拉的选择,我想找出设置这些城市的文件,并把城市换掉,要怎么做??
怎样找?这个是在数据库中设置的,还是代码中设置的??请高手指点。<tr>
<td width="80" align="right" bgcolor="#FAFAFA">
城 市:</td>
<td bgcolor="#FFFFFF" align="left">
<asp:DropDownList ID="ddCity1" runat="server"> </asp:DropDownList>
<asp:DropDownList ID="ddCity2" runat="server" Width="100px"> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddCity1"
ErrorMessage="区域不能为空," SetFocusOnError="True" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ddCity2"
ErrorMessage="地段不能为空!" SetFocusOnError="True" Display="Dynamic"></asp:RequiredFieldValidator></td>
</tr>
怎样找?这个是在数据库中设置的,还是代码中设置的??请高手指点。<tr>
<td width="80" align="right" bgcolor="#FAFAFA">
城 市:</td>
<td bgcolor="#FFFFFF" align="left">
<asp:DropDownList ID="ddCity1" runat="server"> </asp:DropDownList>
<asp:DropDownList ID="ddCity2" runat="server" Width="100px"> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddCity1"
ErrorMessage="区域不能为空," SetFocusOnError="True" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ddCity2"
ErrorMessage="地段不能为空!" SetFocusOnError="True" Display="Dynamic"></asp:RequiredFieldValidator></td>
</tr>
解决方案 »
- 无法将类型为“Microsoft.Office.Interop.Word.ApplicationCla
- c# 画图函数 mycontroll是什么
- DataRow[] 绑定datagrid 问题?
- 两个问题,不难,新人就是这样
- 怎样把Crystal Report下生成的PDF文件,转换成EXCEL格式的文件!~~???
- 有谁能提供一个用的公路施工管理系统,针对工程实体
- Dictionary<string,Func<string>>获取Func<string>函数的返回值
- .NET程序运行时内存飙升
- c# 组开发
- 通过反射动态SHOW出的窗体 怎么传递参数
- c#下调用DILPHI的动态库出错(在线等)
- RichTextBox的Find方法,在现实中如何使用?
<%@ page language="C#" autoeventwireup="true" enableeventvalidation="false" inherits="SystemManage_Company_EditCompany, WebSite" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>商家修改</title>
<link type="text/css" rel="stylesheet" href="../images/default.Css">
<script type="text/javascript" src="/Js/AjaxBase.js"></script>
<script type="text/javascript" src="/Js/Comm.js"></script>
<script type="text/javascript" src="/Js/valid.js"></script>
<script type="text/javascript" src="/ajaxpro/Web9eat.Ajax.All_Model,Ajax.ashx"></script>
<script type="text/javascript" src="/Js/upLoadimg.js" ></script>
<script type="text/javascript" src="/Inc/Calendar/WdatePicker.js"></script> </head>
<body>
<form id="form1" runat="server">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#F6F6F6">
<tr>
<td height="30" align="left" bgcolor="#F6F6F6" >
<asp:Label ID="labOptionTitle" runat="server" Text="Label"></asp:Label></td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="#FFFFFF">
<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#F6F6F6">
<tr>
<td width="80" align="right" bgcolor="#FAFAFA" style="width: 80px">
企业名称: </td>
<td bgcolor="#FFFFFF" align="left">
<asp:TextBox ID="txtC_name" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="Dynamic"
ErrorMessage="公司名称不能空!" SetFocusOnError="True" ControlToValidate="txtC_name"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td width="80" align="right" bgcolor="#FAFAFA">
城 市:</td>
<td bgcolor="#FFFFFF" align="left">
<asp:DropDownList ID="ddCity1" runat="server"> </asp:DropDownList>
<asp:DropDownList ID="ddCity2" runat="server" Width="100px"> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddCity1"
ErrorMessage="区域不能为空," SetFocusOnError="True" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="ddCity2"
ErrorMessage="地段不能为空!" SetFocusOnError="True" Display="Dynamic"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td width="80" align="right" bgcolor="#FAFAFA">
地 址: </td>
<td bgcolor="#FFFFFF" align="left">
<asp:TextBox ID="txtC_add" runat="server" Width="229px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtC_add"
ErrorMessage="地址不能为空!" SetFocusOnError="True"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td width="80" align="right" bgcolor="#FAFAFA">
电 话: </td>
<td bgcolor="#FFFFFF" align="left">
<asp:TextBox ID="txt_tel" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td width="80" align="right" bgcolor="#FAFAFA">
交通线路:</td>
<td bgcolor="#FFFFFF" align="left">
<asp:TextBox ID="txtC_bus" runat="server" Height="42px" TextMode="MultiLine" Width="268px"></asp:TextBox></td>
</tr>
<tr>
<td width="80" align="right" bgcolor="#FAFAFA">
经营类型:</td>
<td bgcolor="#FFFFFF" align="left">
<asp:DropDownList ID="ddCx_model" runat="server"> </asp:DropDownList>
<asp:DropDownList ID="ddC_model" runat="server" Width="100px"> </asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="ddCx_model"
Display="Dynamic" ErrorMessage="经营类型不能为空!" SetFocusOnError="True"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td width="80" align="right" bgcolor="#FAFAFA">
经营特色:</td>
<td bgcolor="#FFFFFF" align="left">
<asp:TextBox ID="txtC_ts" runat="server" Columns="30"></asp:TextBox> </td>
</tr>
<tr>
<td width="80" align="right" bgcolor="#FAFAFA">
就餐人数:</td>
<td bgcolor="#FFFFFF" align="left">
<asp:TextBox ID="txtC_mans" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td width="80" align="right" bgcolor="#FAFAFA">
人均消费:</td>
<td bgcolor="#FFFFFF" align="left">
<asp:DropDownList ID="ddC_money" runat="server">
<asp:ListItem Value="">选择人均消费</asp:ListItem>
<asp:ListItem Value="50元以下">50元以下</asp:ListItem>
<asp:ListItem Value="50-100元">50-100元</asp:ListItem>
<asp:ListItem Value="100-150元">100-150元</asp:ListItem>
<asp:ListItem Value="150-200元">150-200元</asp:ListItem>
<asp:ListItem Value="200元以上">200元以上</asp:ListItem>
</asp:DropDownList></td>
</tr>
....
</table>
</form>
</body>
</html>
1.systemmanage_company_editcompany.csusing ASP;
using System;
using System.Collections.Generic;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using Web9eat.BLL;
using Web9eat.Model;
using Web9eat.WebBase;public class SystemManage_Company_EditCompany : Page, IRequiresSessionState
{
private int _Id = 0;
protected string _referrerUrl = "CompanyList.aspx";
private All_Model bAll_Model = new All_Model();
private C_About bC_About = new C_About();
private Web9eat.BLL.Dns bDns = new Web9eat.BLL.Dns();
protected Button btnOption;
private User bUser = new User();
protected CheckBoxList ChkC_huanjin;
protected CheckBox chkC_isdc;
protected CheckBox chkC_isShow360;
protected CheckBox chkC_isvote;
protected CheckBox chkC_order;
protected CheckBox chkC_order_vip;
protected CheckBox chkC_vip;
protected DropDownList ddC_model;
protected DropDownList ddC_money;
protected DropDownList ddCity1;
protected DropDownList ddCity2;
protected DropDownList ddCx_model;
protected HtmlForm form1;
protected Image ImgShow;
protected Image ImgShow1;
protected Label ImgSize;
.... protected void btnOption_Click(object sender, EventArgs e)
{
....
if (base.Request.Form["ddCity1"].ToString() != "")
{
mC_AboutInfo.c_city = All_Model.GetModelText(Convert.ToInt32(base.Request.Form["ddCity1"].ToString()));
}
if (base.Request.Form["ddCity2"].ToString() != "")
{
mC_AboutInfo.c_city_1 = All_Model.GetModelText(Convert.ToInt32(base.Request.Form["ddCity2"].ToString()));
....
....
private void PageOnload()
{
IList<All_ModelInfo> All_ModelInfos = null;
All_ModelInfos = this.bAll_Model.All_ModelInfoList_byType("city");
this.ddCity1.Items.Clear();
this.ddCity1.Items.Add(new ListItem("区域", ""));
foreach (All_ModelInfo mAll_ModelInfo in All_ModelInfos)
{
this.ddCity1.Items.Add(new ListItem(mAll_ModelInfo.model, mAll_ModelInfo.id.ToString()));
}
this.ddCity1.Attributes.Add("onchange", "All_Model_OnChange(this,'" + this.ddCity2.ClientID + "')");
this.ddCity2.Items.Clear();
this.ddCity2.Items.Add(new ListItem("区域", ""));
All_ModelInfos = this.bAll_Model.All_ModelInfoList_byType("jylx");
this.ddCx_model.Items.Clear();
....
-----------------------------------------------------------------------------------------
2.usermanage_company_editcompany.csusing ASP;
using System;
using System.Collections.Generic;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using Web9eat.BLL;
using Web9eat.Model;
using Web9eat.WebBase;public class UserManage_Company_EditCompany : Page, IRequiresSessionState
{
private int _cId = 0;
private string _userId = UserCookie.GetUserId();
private All_Model bAll_Model = new All_Model();
private C_About bC_About = new C_About();
protected Button btnModify;
protected CheckBoxList ChkC_huanjin;
protected string companyId = "";
protected DropDownList ddC_model;
protected DropDownList ddC_money;
protected DropDownList ddCity1;
protected DropDownList ddCity2;
protected DropDownList ddCx_model;
.....
protected void btnGoback_Click(object sender, EventArgs e)
{
base.Response.Redirect((string) this.ViewState["UrlReferrer"]);
} protected void btnModify_Click(object sender, EventArgs e)
{
.....
if (mC_AboutInfo != null)
{
mC_AboutInfo.c_add = this.txtC_add.Text;
mC_AboutInfo.c_bus = this.txtC_bus.Text;
mC_AboutInfo.c_closetime = this.txtC_closetime.Text;
mC_AboutInfo.c_mans = this.txtC_mans.Text;
mC_AboutInfo.c_memo = this.txtC_memo.Text;
mC_AboutInfo.c_name = this.txtC_name.Text;
mC_AboutInfo.c_tingchewei = this.txtC_tingchewei.Text;
mC_AboutInfo.c_url = this.txtC_url.Text;
mC_AboutInfo.c_tel = this.txt_tel.Text;
mC_AboutInfo.c_ts = this.txtC_ts.Text;
if (base.Request.Form["ctl00$ContentPlaceHolder$ddCity1"].ToString() != "")
{
mC_AboutInfo.c_city = All_Model.GetModelText(Convert.ToInt32(base.Request.Form["ctl00$ContentPlaceHolder$ddCity1"].ToString()));
}
if (base.Request.Form["ctl00$ContentPlaceHolder$ddCity2"].ToString() != "")
{
mC_AboutInfo.c_city_1 = All_Model.GetModelText(Convert.ToInt32(base.Request.Form["ctl00$ContentPlaceHolder$ddCity2"].ToString()));
}
.....
private void PageOnload()
{
IList<All_ModelInfo> All_ModelInfos = null;
All_ModelInfos = this.bAll_Model.All_ModelInfoList_byType("city");
this.ddCity1.Items.Clear();
this.ddCity1.Items.Add(new ListItem("区域", ""));
foreach (All_ModelInfo mAll_ModelInfo in All_ModelInfos)
{
this.ddCity1.Items.Add(new ListItem(mAll_ModelInfo.model, mAll_ModelInfo.id.ToString()));
}
this.ddCity1.Attributes.Add("onchange", "All_Model_OnChange(this,'" + this.ddCity2.ClientID + "')");
this.ddCity2.Items.Clear();
this.ddCity2.Items.Add(new ListItem("区域", ""));
All_ModelInfos = this.bAll_Model.All_ModelInfoList_byType("jylx");
this.ddCx_model.Items.Clear();
this.ddCx_model.Items.Add(new ListItem("选择", ""));
foreach (All_ModelInfo mAll_ModelInfo in All_ModelInfos)
{
this.ddCx_model.Items.Add(new ListItem(mAll_ModelInfo.model, mAll_ModelInfo.id.ToString()));
}
this.ddCx_model.Attributes.Add("onchange", "All_Model_OnChange(this,'" + this.ddC_model.ClientID + "')");
this.ddC_model.Items.Clear();
this.ddC_model.Items.Add(new ListItem("全部", ""));
string[] arrXfhj = new string[] { "商务宴请", "情侣约会", "朋友聚餐", "休闲社交", "家庭聚餐", "随便吃吃" };
for (int i = 0; i < arrXfhj.Length; i++)
{
this.ChkC_huanjin.Items.Add(new ListItem(arrXfhj[i], arrXfhj[i]));
}
}
.....
估计是你连数据库读数据的时候没有读到数据,最好跟一下这个方法看看