[求助]下拉列表有错误!!
各位前辈:请问本公司的网站上的注册信息中有一个“关于行业”的下拉列表,点击时没有选项,而出现的是[Method error 500] ,但是别的下拉列表就没有问题。请前辈快点想想办法,本人新手,急急急 还是这个问题,刚才我看了Dreamweaver属性中的我们公司的下拉列表的属性是“下拉列表”,而一般我们插入的是“列表/菜单”这是什么原因 应该是用了ajax控件的cascadingdropdown控件,
出现这个错误的话你检查检查你的webserver页面是不是在处理函数之前有[System.Web.Script.Services.ScriptService]
对了还有就是在aspx页面引用的时候处理方法名没有写错…… 谢谢啊啊 不好意思啊我还得问问,还是这个问题你说的webserver页面我没在我这找到啊,你看看这是那个下拉列表的代码:
<td>
<asp:DropDownList ID="DropDownList1" runat="server" Width="100px" CssClass="buttonstyle244">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server" Width="100px" CssClass="buttonstyle244">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList3" runat="server" Width="100px" CssClass="buttonstyle244">
</asp:DropDownList>
<cc1:CascadingDropDown ID="CascadingDropDown1" runat="server" Category="industry1"
LoadingText="正在加载..." PromptText="请选择" ServiceMethod="GetIndustryDropDownContents"
TargetControlID="DropDownList1" ServicePath="admin/WebService.asmx">
</cc1:CascadingDropDown>
<cc1:CascadingDropDown ID="CascadingDropDown2" runat="server" Category="industry2"
LoadingText="正在加载..." ParentControlID="DropDownList1" PromptText="请选择" ServiceMethod="GetIndustryDropDownContents"
ServicePath="admin/WebService.asmx" TargetControlID="DropDownList2">
</cc1:CascadingDropDown>
<cc1:CascadingDropDown ID="CascadingDropDown3" runat="server" Category="industry3"
LoadingText="正在加载..." ParentControlID="DropDownList2" PromptText="请选择" ServiceMethod="GetIndustryDropDownContents"
TargetControlID="DropDownList3" ServicePath="admin/WebService.asmx">
</cc1:CascadingDropDown>
</td>
请帮忙看看啊 看来没有错就是用到了CascadingDropDown……
admin/WebService.asmx,把这样页面的代码也贴出来看看 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="publishvcinfo.aspx.cs" Inherits="Capital.Web.publishvcinfo" %>
<%@ Register Src="Controls/userleftmenu.ascx" TagName="userleftmenu" TagPrefix="uc3" %>
<%@ Register Src="Controls/bottom.ascx" TagName="bottom" TagPrefix="uc5" %>
<%@ Register Src="Controls/searchbar.ascx" TagName="searchbar" TagPrefix="uc2" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="Controls/navlogin.ascx" TagName="navlogin" TagPrefix="uc1" %>
<!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 media="all" href="css/formstyle.css" type="text/css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="admin/js/formcheck.js"></script>
</head>
<body>
<form id="form1" runat="server">
<uc1:navlogin ID="Navlogin1" runat="server"></uc1:navlogin>
<uc2:searchbar ID="Searchbar1" runat="server"></uc2:searchbar>
<br />
<div style="width: 760px; height: 800px; margin-right: auto; margin-left: auto;">
<div style="float: left; display: block; overflow: visible;">
<uc3:userleftmenu ID="Userleftmenu1" runat="server" MemberType="机构投资者"></uc3:userleftmenu>
</div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div style="text-align:left; display:block;margin-left:20px;float:left;">
<table class="uptable" cellspacing="0" border="0" style="width: 585px">
<tr>
<td align="right" class="uptable-title" style="width: 125px">
<span style="font-size: 11pt; color: #ff0000">* </span>
标题</td>
<td>
<asp:TextBox ID="title" runat="server" Width="398px" CssClass="buttonstyle244"></asp:TextBox></td>
<td class="uptable-notice">
</td>
</tr>
<tr>
<td align="right" class="uptable-title bottomborder" style="width: 125px">
投资意向概述</td>
<td class="bottomborder">
<asp:TextBox ID="summary" runat="server" Height="160px" TextMode="MultiLine" Width="398px" CssClass="buttonstyle244"></asp:TextBox></td>
<td class="uptable-notice">
</td>
</tr>
<tr>
<td class="uptable-title" style="width: 125px" align="right">
<span style="font-size: 11pt; color: #ff0000"> </span>投资项目所在行业</td>
<td>
<table id="div2" cellspacing="0" cellpadding="3" width="100%" border="0">
<tr>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" Width="100px" CssClass="buttonstyle244">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server" Width="100px" CssClass="buttonstyle244">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList3" runat="server" Width="100px" CssClass="buttonstyle244">
</asp:DropDownList>
<cc1:CascadingDropDown ID="CascadingDropDown1" runat="server" Category="industry1"
LoadingText="正在加载..." PromptText="请选择" ServiceMethod="GetIndustryDropDownContents"
TargetControlID="DropDownList1" ServicePath="admin/WebService.asmx">
</cc1:CascadingDropDown>
<cc1:CascadingDropDown ID="CascadingDropDown2" runat="server" Category="industry2"
LoadingText="正在加载..." ParentControlID="DropDownList1" PromptText="请选择" ServiceMethod="GetIndustryDropDownContents"
ServicePath="admin/WebService.asmx" TargetControlID="DropDownList2">
</cc1:CascadingDropDown>
<cc1:CascadingDropDown ID="CascadingDropDown3" runat="server" Category="industry3"
LoadingText="正在加载..." ParentControlID="DropDownList2" PromptText="请选择" ServiceMethod="GetIndustryDropDownContents"
TargetControlID="DropDownList3" ServicePath="admin/WebService.asmx">
</cc1:CascadingDropDown>
</td>
</tr>
</table>
</td>
<td>
</td>
</tr>
<tr>
<td class="uptable-title bottomborder" style="width: 125px" align="right">
投资项目所在地区</td>
<td class="bottomborder">
<table id="TABLE1" cellspacing="0" cellpadding="3" width="100%" border="0">
<tr>
<td>
<asp:DropDownList ID="country" runat="server">
</asp:DropDownList><br />
<asp:DropDownList ID="DropDownList5" runat="server" Width="100px" CssClass="buttonstyle244">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList6" runat="server" Width="100px" CssClass="buttonstyle244">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList7" runat="server" Width="100px" CssClass="buttonstyle244">
</asp:DropDownList>
<cc1:CascadingDropDown ID="CascadingDropDown4" runat="server" Category="province"
LoadingText="正在加载..." PromptText="请选择" ServiceMethod="GetDropDownContents" TargetControlID="DropDownList5"
ServicePath="admin/WebService.asmx">
</cc1:CascadingDropDown>
<cc1:CascadingDropDown ID="CascadingDropDown5" runat="server" Category="city" LoadingText="正在加载..."
ParentControlID="DropDownList5" PromptText="请选择" ServiceMethod="GetDropDownContents"
ServicePath="admin/WebService.asmx" TargetControlID="DropDownList6">
</cc1:CascadingDropDown>
<cc1:CascadingDropDown ID="CascadingDropDown6" runat="server" Category="county" LoadingText="正在加载..."
ParentControlID="DropDownList6" PromptText="请选择" ServiceMethod="GetDropDownContents"
TargetControlID="DropDownList7" ServicePath="admin/WebService.asmx">
</cc1:CascadingDropDown>
</td>
</tr>
</table>
</td>
<td class="uptable-notice">
</td>
</tr>
<tr>
<td align="right" class="uptable-title" style="width: 125px">
投资周期</td>
<td>
<asp:RadioButtonList ID="timespan" runat="server" RepeatDirection="Horizontal">
<asp:ListItem>3年以内</asp:ListItem>
<asp:ListItem>3-5年</asp:ListItem>
<asp:ListItem>5年以上</asp:ListItem>
</asp:RadioButtonList></td>
<td class="uptable-notice">
</td>
</tr>
<tr>
<td align="right" class="uptable-title" style="width: 125px">
<span style="font-size: 11pt; color: #ff0000">* </span>投资额度</td>
<td>
<asp:RadioButtonList ID="capitaloffer" runat="server" RepeatDirection="Horizontal">
<asp:ListItem>50--500</asp:ListItem>
<asp:ListItem>500-8,000</asp:ListItem>
<asp:ListItem>8,000 -20,000</asp:ListItem>
<asp:ListItem>20,000以上</asp:ListItem>
</asp:RadioButtonList>(单位:万元人民币)</td>
<td class="uptable-notice">
</td>
</tr>
<tr>
<td class="uptable-title" style="width: 125px" align="right">
<span style="font-size: 11pt; color: #ff0000">* </span>
投资项目要求</td>
<td>
<asp:RadioButtonList ID="partnerdemmand" runat="server" RepeatDirection="Horizontal">
<asp:ListItem>个人创业项目</asp:ListItem>
<asp:ListItem>初创期项目</asp:ListItem>
<asp:ListItem>发展期项目</asp:ListItem>
<asp:ListItem>扩张期项目</asp:ListItem>
<asp:ListItem>成熟期项目</asp:ListItem>
</asp:RadioButtonList></td>
<td class="uptable-notice">
</td>
</tr>
<tr>
<td class="uptable-title" style="width: 125px; height: 24px;" align="right">
投资方式</td>
<td style="height: 18px">
<asp:RadioButtonList ID="financingtype" runat="server" RepeatDirection="Horizontal">
<asp:ListItem>债权融资</asp:ListItem>
<asp:ListItem>股权投资</asp:ListItem>
<asp:ListItem>夹层投资</asp:ListItem>
</asp:RadioButtonList></td>
<td class="uptable-notice" style="height: 24px">
</td>
</tr>
<tr>
<td align="right" class="rightborder bottomborder" style="width: 125px">
上传相关介绍文件</td>
<td class="bottomborder">
<asp:FileUpload ID="FileUpload2" runat="server" Width="328px" CssClass="" /><br />
(允许的格式:.txt
.doc .ppt .xls)</td>
<td class="uptable-notice" style="height: 26px">
</td>
</tr>
<tr>
<td align="right" class="uptable-title" style="width: 125px; height: 24px">
</td>
<td style="height: 18px">
<input type="submit" value="确 认 添 加" class="" name="submit" runat="server" id="Submit1"
onserverclick="Submit1_ServerClick"></td>
<td class="uptable-notice" style="height: 24px">
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
这是页面所有代码 你刚说的admin/WebService.asmx这个页面我这没找到啊 我们公司是买的人家的虚拟主机的 不是、你打开admin/WebService.asmx页面然后双击到admin/WebService.asmx.cs页面,将它的代码贴出来看看…… 我找不到你说的admin/WebService.asmx这个页面 using System;
using System.Web;
using System.Collections.Specialized;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml;
/// <summary>
/// WebService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService {
public WebService ()
{
}
private static XmlDocument xmlDoc;
private static XmlDocument industryXmlDoc;
private static object objectLock = new object();
public static XmlDocument Document
{
get
{
lock (objectLock)
{
if (xmlDoc == null)
{
xmlDoc = new XmlDocument();
xmlDoc.Load(HttpContext.Current.Server.MapPath("~/region.xml"));
}
}
return xmlDoc;
}
}
public static XmlDocument IndustryDocument
{
get
{
lock (objectLock)
{
if (industryXmlDoc == null)
{
industryXmlDoc = new XmlDocument();
industryXmlDoc.Load(HttpContext.Current.Server.MapPath("~/industry.xml"));
}
}
return industryXmlDoc;
}
}
public static string[] Hierarchy
{
get { return new string[] { "province", "city" }; }
}
public static string[] IndustryHierarchy
{
get { return new string[] { "industry1", "industry2" }; }
}
[WebMethod]
public AjaxControlToolkit.CascadingDropDownNameValue[] GetDropDownContents(string knownCategoryValues, string category)
{
StringDictionary knownCategoryValuesDictionary = AjaxControlToolkit.CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
return AjaxControlToolkit.CascadingDropDown.QuerySimpleCascadingDropDownDocument(Document, Hierarchy, knownCategoryValuesDictionary, category);
}
[WebMethod]
public AjaxControlToolkit.CascadingDropDownNameValue[] GetIndustryDropDownContents(string knownCategoryValues, string category)
{
StringDictionary knownCategoryValuesDictionary = AjaxControlToolkit.CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
return AjaxControlToolkit.CascadingDropDown.QuerySimpleCascadingDropDownDocument(IndustryDocument, IndustryHierarchy, knownCategoryValuesDictionary, category);
}
}
找到了在我们公司最早备份的文件中 你看看有错误吗 还有就是.cs的文件都在原来的备份中是不是都要复制过来呢 其他的我不知道该不该复制,但是我给你说的那个文件你要是要解决的话你必须复制过去……
并且路径也要设置正确……
页:
[1]
