I'm having an issue with the Docs.aspx RRS feed

  • Question

  • User1964923810 posted
    Hello, I'm trying to do the Extended Introduction to the Club Website. Which is adding in a file section, however I've ran into a problem that I cannot figure out. I keep getting this error whenever I try to goto the Docs.aspx page:

    Line 30: DataSourceID="SqlDataSource1" OnSelectedIndexChanged="DataList1_SelectedIndexChanged1">
    Line 31: <ItemTemplate>
    Line 32: <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# <%# Eval("CategoryID", @"Docs.aspx?categoryid={0}") %> %>'
    Line 33: Text='<%# Eval("CategoryName") %>'></asp:HyperLink><br /> Line 34: <br />


    And here is the entire code of the Docs.aspx:


    <%@ Page Language="C#" MasterPageFile="~/Default.master" Title="Clubsite Links" %>

    <%@ Register TagPrefix="Club" TagName="LoginBanner" Src="LoginBanner.ascx" %>

    <script runat="server">

    protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e)



    protected void DataList1_SelectedIndexChanged(object sender, EventArgs e)



    protected void DataList1_SelectedIndexChanged1(object sender, EventArgs e)




    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <div id="body">

    <club:loginbanner id="LoginBanner1" runat="server" />

    <div class="fullwidth">


    Useful Documents - Select a Category</h2>


    &nbsp;&nbsp;<asp:DataList ID="DataList1" runat="server" DataKeyField="CategoryID"

    DataSourceID="SqlDataSource1" OnSelectedIndexChanged="DataList1_SelectedIndexChanged1">


    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# <%# Eval("CategoryID", @"Docs.aspx?categoryid={0}") %> %>'

    Text='<%# Eval("CategoryName") %>'></asp:HyperLink><br />

    <br />


    </asp:DataList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ClubSiteDB %>"

    SelectCommand="SELECT * FROM [DocumentCategories] WHERE ([IsPublic] = @IsPublic) ORDER BY [CategoryName]">


    <asp:Parameter DefaultValue="true" Name="IsPublic" Type="Boolean" />



    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"

    AutoGenerateColumns="False" DataKeyNames="DocumentID" DataSourceID="SqlDataSource2">


    <asp:TemplateField HeaderText="DocumentName" SortExpression="DocumentName">


    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("DocumentName") %>'></asp:TextBox>



    <asp:HyperLink ID="HyperLink2" runat="server" Text='<%# <%# Eval("DocumentName", @"~\Files\{0}") %> %>'></asp:HyperLink>



    <asp:BoundField DataField="DateInput" HeaderText="DateInput" SortExpression="DateInput" />

    <asp:BoundField DataField="Comments" HeaderText="Comments" SortExpression="Comments" />



    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ClubSiteDB %>"

    SelectCommand="SELECT * FROM [Documents] WHERE ([DocumentCategory] = @DocumentCategory) ORDER BY [DateInput] DESC">


    <asp:QueryStringParameter Name="DocumentCategory" QueryStringField="categoryid" Type="Int32" />



    <br />



    <div class=fullwidth>

    The club's links.





    If anyone could help out, it would be much appreciated. I'm very new at this.



    Tuesday, January 31, 2006 5:38 AM

All replies

  • User-798333769 posted
    Hi, I am working with this project as well. I am new to this too. Within NavigateURL I took out the extra <%# surrounding the Eval segment,  the page loads fine. Did you try that? My problem is I can't get the Admin.aspx page to load docs into DB. I can manually type it into the table and it the shows on page however, but the controls on the page wont load it into DB. Is there source code anywhere from the creator?


    Thursday, February 2, 2006 12:16 AM