/// 初始化时下拉列表框选中相应的值
/// </summary>
/// <param name="obj"></param>
/// <param name="id"></param>
public void Selected(DropDownList obj, string id)
{
int count = obj.Items.Count;
if (count > 0)
{
for (int i = 0; i < count; i++)
{键
if (obj.Items[i].Value == id) obj.Items[i].text 值
{
obj.SelectedIndex = i;
BinderviceCategory();
break;
}
}
}
}
function LoadCity()
{
var selCity = $("#<%=ddlCity.ClientID %>");
$.ajax({
type: "post",
dataType: "json",
url: "/b2c/handlers/Financial/GetCity.ashx",
success: function(msg)
{
if (msg.result == "ok")
{
if (msg.cityData.length > 0)
{
for (var i = 0; i < msg.cityData.length; i++)
{
$("#<%=ddlCity.ClientID %>").append ("<option value='" + msg.cityData[i].cityID+ "'>" + msg.cityData[i].city+ "</option>");
}
$("#<%=ddlCity.ClientID %>").val("310100");
$("#<%=ddlCity.ClientID %>").children().attr("style","width:72px");
}
}
},
error: function(msg) {
alert ("请求异常");
}
});