PDA

View Full Version : Need HELP with forms .aspx


danielr
05-01-2007, 07:56 AM
Hey guys I am having trouble getting the forms working.
I am using Expression Web as my editor.
I do not have FP extensions installed.

Below is the error on each of my forms!
************************************************** **************************************


Server Error in '/' Application.


The DataSourceID of 'DetailsViewApp' must be the ID of a control of type IDataSource. A control with ID 'AccessDataSourceApp' could not be found. 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: The DataSourceID of 'DetailsViewApp' must be the ID of a control of type IDataSource. A control with ID 'AccessDataSourceApp' could not be found.

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): The DataSourceID of 'DetailsViewApp' must be the ID of a control of type IDataSource. A control with ID 'AccessDataSourceApp' could not be found.]
System.Web.UI.WebControls.DataBoundControl.GetData Source() +1819389
System.Web.UI.WebControls.DataBoundControl.Connect ToDataSourceView() +34
System.Web.UI.WebControls.DataBoundControl.OnLoad( EventArgs e) +16
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061






Any help you can give would be appreciated.





Thanks,

vvsharma
05-01-2007, 09:33 AM
It seems that you dont have a Datasource control (SqlDataSource or AccessDataSource) with the ID 'AccessDataSourceApp' which you are trying to use with your 'DetailsView' control.

Vikram

DiscountASP.NET
www.DiscountASP.NET (http://www.discountasp.net/)

danielr
05-01-2007, 09:58 AM
Thanks I dont know how I missed that.


That fixed one of my forms but my other 2 forms have this error.



Server Error in '/' Application.


Control 'DetailsViewSpo' of type 'DetailsView' must be placed inside a form tag with runat=server.


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: Control 'DetailsViewSpo' of type 'DetailsView' must be placed inside a form tag with runat=server.

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): Control 'DetailsViewSpo' of type 'DetailsView' must be placed inside a form tag with runat=server.]
System.Web.UI.Page.VerifyRenderingInServerForm(Con trol control) +1999935
System.Web.UI.WebControls.DetailsView.Render(HtmlT extWriter writer, Boolean renderPanel) +37
System.Web.UI.WebControls.DetailsView.Render(HtmlT extWriter writer) +30
System.Web.UI.Control.RenderControlInternal(HtmlTe xtWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Control.RenderChildrenInternal(HtmlT extWriter writer, ICollection children) +130
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +24
System.Web.UI.Page.Render(HtmlTextWriter writer) +26
System.Web.UI.Control.RenderControlInternal(HtmlTe xtWriter writer, ControlAdapter adapter) +25
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1896

vvsharma
05-02-2007, 01:14 AM
All server controls must appear within a <form> tag, and the <form> tag must contain the runat='server' attribute. The runat='server' attribute indicates that the form should be processed on the server. It also indicates that the enclosed controls can be accessed by server scripts

e.g.

<form id='form1' runat='server'>
<div>
<asp:DetailsView ID='DetailsView2' runat='server' Height='50px' Width='125px'>
</asp:DetailsView>

</form>

Vikram

DiscountASP.NET
www.DiscountASP.NET (http://www.discountasp.net/)