Need HELP with forms .aspx

Discussion in 'ASP.NET 2.0' started by danielr, May 1, 2007.

  1. 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:





    Code:
    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:





    Code:
    [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.GetDataSource() +1819389
       System.Web.UI.WebControls.DataBoundControl.ConnectToDataSourceView() +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,
     
  2. 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
     
  3. 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:





    Code:
    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:





    Code:
    [HttpException (0x80004005): Control 'DetailsViewSpo' of type 'DetailsView' must be placed inside a form tag with runat=server.]
       System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +1999935
       System.Web.UI.WebControls.DetailsView.Render(HtmlTextWriter writer, Boolean renderPanel) +37
       System.Web.UI.WebControls.DetailsView.Render(HtmlTextWriter writer) +30
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter 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(HtmlTextWriter writer, ICollection children) +130
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
       System.Web.UI.Page.Render(HtmlTextWriter writer) +26
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter 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
    
     
  4. 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
     

Share This Page