本文介绍了不包含名称为“SelectedValue”的属性。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞!<%@ Control Language="C#" AutoEventWireup="true" CodeFile="HospitalFinder.ascx.cs" Inherits="HospitalFinder" %><asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <div class="row" dir="rtl"> <div class="col-lg-6"> <div class="form-group"> <label>شهر:</label> <asp:DropDownList ID="DropDownList2UC" runat="server" DataSourceID="SqlDataSource2UC" DataTextField="CityName" DataValueField="CityID" CssClass="form-control" TabIndex="12"> </asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource2UC" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" SelectCommand="SELECT * FROM [Citys] WHERE ([StateID] = @StateID) ORDER BY [CityName]"> <SelectParameters> <asp:ControlParameter ControlID="DropDownList1UC" Name="StateID" PropertyName="SelectedValue" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label>استان:</label> <asp:DropDownList ID="DropDownList1UC" runat="server" DataSourceID="HStateSDSUC" AutoPostBack="True" CssClass="form-control" DataTextField="StateName" DataValueField="StateID" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"></asp:DropDownList> <asp:SqlDataSource ID="HStateSDSUC" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" SelectCommand="SELECT * FROM [States]"></asp:SqlDataSource> </div> </div> </div> <div class="row"> <div class="col-lg-12"> <div class="form-group"> <label>فیلتر:</label> <asp:TextBox ID="TextBox1" runat="server" CssClass="form-control"></asp:TextBox> <br /> <br /> <asp:Button ID="Button1" runat="server" Text="Button" CssClass="btn btn-outline btn-primary btn-lg btn-block" CausesValidation="False" OnClick="Button1_Click" /> </div> </div> </div> <div class="row"> <div class="col-lg-12"> <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" CssClass="table table-striped table-bordered table-hover" AutoGenerateColumns="False" DataKeyNames="HospitalID" DataSourceID="SqlDataSource3UC" Width="90%" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" PageSize="30"> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField DataField="HospitalID" HeaderText="کد مرکز" SortExpression="HospitalID" InsertVisible="False" ReadOnly="True" /> <asp:BoundField DataField="Name" HeaderText="نام مرکز" SortExpression="Name" /> <asp:BoundField DataField="Phone" HeaderText="تلفن" SortExpression="Phone" /> <asp:BoundField DataField="Fax" HeaderText="فکس" SortExpression="Fax" /> <asp:BoundField DataField="Cell" HeaderText="موبایل" SortExpression="Cell" /> <asp:BoundField DataField="Address" HeaderText="آدرس" SortExpression="Address" /> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource3UC" runat="server" ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" SelectCommand="SELECT * FROM [Hospitals] WHERE (([StateID] = @StateID) AND ([CityID] = @CityID) AND (([Name] LIKE '%' + @Name + '%') OR ([Phone] LIKE '%' + @Phone + '%') OR ([Fax] LIKE '%' + @Fax + '%') OR ([Cell] LIKE '%' + @Cell + '%') OR ([Address] LIKE '%' + @Address + '%'))) ORDER BY [Name], [HospitalID]" ConflictDetection="CompareAllValues" DeleteCommand="DELETE FROM [Hospitals] WHERE [HospitalID] = @original_HospitalID" InsertCommand="INSERT INTO [Hospitals] ([Name], [Phone], [Fax], [Cell], [Address]) VALUES (@Name, @Phone, @Fax, @Cell, @Address)" OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE [Hospitals] SET [Name] = @Name, [Phone] = @Phone, [Fax] = @Fax, [Cell] = @Cell, [Address] = @Address WHERE [HospitalID] = @original_HospitalID"> <DeleteParameters> <asp:Parameter Name="original_HospitalID" Type="Int32" /> <asp:Parameter Name="original_Name" Type="String" /> <asp:Parameter Name="original_Phone" Type="String" /> <asp:Parameter Name="original_Fax" Type="String" /> <asp:Parameter Name="original_Cell" Type="String" /> <asp:Parameter Name="original_Address" Type="String" /> </DeleteParameters> <InsertParameters> <asp:Parameter Name="Name" Type="String" /> <asp:Parameter Name="Phone" Type="String" /> <asp:Parameter Name="Fax" Type="String" /> <asp:Parameter Name="Cell" Type="String" /> <asp:Parameter Name="Address" Type="String" /> </InsertParameters> <SelectParameters> <asp:ControlParameter ControlID="HStateSDSUC" Name="StateID" PropertyName="SelectedValue" Type="Int32" /> <asp:ControlParameter ControlID="DropDownList1UC" Name="CityID" PropertyName="SelectedValue" Type="Int32" /> <asp:ControlParameter ControlID="TextBox1" DefaultValue="%" Name="Name" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="TextBox1" DefaultValue="%" Name="Phone" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="TextBox1" DefaultValue="%" Name="Fax" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="TextBox1" DefaultValue="%" Name="Cell" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="TextBox1" DefaultValue="%" Name="Address" PropertyName="Text" Type="String" /> </SelectParameters> <UpdateParameters> <asp:Parameter Name="Name" Type="String" /> <asp:Parameter Name="Phone" Type="String" /> <asp:Parameter Name="Fax" Type="String" /> <asp:Parameter Name="Cell" Type="String" /> <asp:Parameter Name="Address" Type="String" /> <asp:Parameter Name="original_HospitalID" Type="Int32" /> <asp:Parameter Name="original_Name" Type="String" /> <asp:Parameter Name="original_Phone" Type="String" /> <asp:Parameter Name="original_Fax" Type="String" /> <asp:Parameter Name="original_Cell" Type="String" /> <asp:Parameter Name="original_Address" Type="String" /> </UpdateParameters> </asp:SqlDataSource> </div> </div> </ContentTemplate></asp:UpdatePanel> Server Error in ’/’ Application. DataBinding: ’System.Web.UI.WebControls.SqlDataSource’ does not contain a property with the name ’SelectedValue’. 描述:执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。 Exception Details: System.Web.HttpException: DataBinding: ’System.Web.UI.WebControls.SqlDataSource’ does not contain a property with the name ’SelectedValue’. Source Error: An unhandled exception was generated during the execution of the current web request.可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息。 Stack Trace: [HttpException (0x80004005): DataBinding: ’System.Web.UI.WebControls.SqlDataSource’ does not contain a property with the name ’SelectedValue’.] System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +9558913 System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) +104 System.Web.UI.DataBinder.Eval(Object container, String expression) +93 System.Web.UI.WebControls.ControlParameter.Evaluate(HttpContext context, Control control) +203 System.Web.UI.WebControls.Parameter.UpdateValue(HttpContext context, Control control) +50 System.Web.UI.WebControls.ParameterCollection.UpdateValues(HttpContext context, Control control) +101 System.Web.UI.WebControls.SqlDataSource.LoadCompleteEventHandler(Object sender, EventArgs e) +46 System.EventHandler.Invoke(Obje ct sender, EventArgs e) +0 System.Web.UI.Page.OnLoadComplete(EventArgs e) +9668014 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +867 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248 What i have to do????Server Error in '/' Application.DataBinding: 'System.Web.UI.WebControls.SqlDataSource' does not contain a property with the name 'SelectedValue'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: DataBinding: 'System.Web.UI.WebControls.SqlDataSource' does not contain a property with the name 'SelectedValue'.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.Stack Trace:[HttpException (0x80004005): DataBinding: 'System.Web.UI.WebControls.SqlDataSource' does not contain a property with the name 'SelectedValue'.] System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +9558913 System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) +104 System.Web.UI.DataBinder.Eval(Object container, String expression) +93 System.Web.UI.WebControls.ControlParameter.Evaluate(HttpContext context, Control control) +203 System.Web.UI.WebControls.Parameter.UpdateValue(HttpContext context, Control control) +50 System.Web.UI.WebControls.ParameterCollection.UpdateValues(HttpContext context, Control control) +101 System.Web.UI.WebControls.SqlDataSource.LoadCompleteEventHandler(Object sender, EventArgs e) +46 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Page.OnLoadComplete(EventArgs e) +9668014 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +867Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248What i have to do????推荐答案 S erver Error in ’/’ Application. DataBinding: ’System.Web.UI.WebControls.SqlDataSource’ does not contain a property with the name ’SelectedValue’. 描述:执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。 Exception Details: System.Web.HttpException: DataBinding: ’System.Web.UI.WebControls.SqlDataSource’ does not contain a property with the name ’SelectedValue’. Source Error: An unhandled exception was generated during the execution of the current web request.可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息。 Stack Trace: [HttpException (0x80004005): DataBinding: ’System.Web.UI.WebControls.SqlDataSource’ does not contain a property with the name ’SelectedValue’.] System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +9558913 System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) +104 System.Web.UI.DataBinder.Eval(Object container, String expression) +93 System.Web.UI.WebControls.ControlParameter.Evaluate(HttpContext context, Control control) +203 System.Web.UI.WebControls.Parameter.UpdateValue(HttpContext context, Control control) +50 System.Web.UI.WebControls.ParameterCollection.UpdateValues(HttpContext context, Control control) +101 System.Web.UI.WebControls.SqlDataSource.LoadCompleteEventHandler(Object sender, EventArgs e) +46 System.EventHandler.Invoke(Obje ct sender, EventArgs e) +0 System.Web.UI.Page.OnLoadComplete(EventArgs e) +9668014 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +867 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248 What i have to do????Server Error in '/' Application.DataBinding: 'System.Web.UI.WebControls.SqlDataSource' does not contain a property with the name 'SelectedValue'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: DataBinding: 'System.Web.UI.WebControls.SqlDataSource' does not contain a property with the name 'SelectedValue'.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.Stack Trace:[HttpException (0x80004005): DataBinding: 'System.Web.UI.WebControls.SqlDataSource' does not contain a property with the name 'SelectedValue'.] System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +9558913 System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) +104 System.Web.UI.DataBinder.Eval(Object container, String expression) +93 System.Web.UI.WebControls.ControlParameter.Evaluate(HttpContext context, Control control) +203 System.Web.UI.WebControls.Parameter.UpdateValue(HttpContext context, Control control) +50 System.Web.UI.WebControls.ParameterCollection.UpdateValues(HttpContext context, Control control) +101 System.Web.UI.WebControls.SqlDataSource.LoadCompleteEventHandler(Object sender, EventArgs e) +46 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Page.OnLoadComplete(EventArgs e) +9668014 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +867Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248What i have to do???? 这篇关于不包含名称为“SelectedValue”的属性。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-02 10:47