locked
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)

    {

    }

    </script>

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

    <div id="body">

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

    <div class="fullwidth">

    <h2>

    Useful Documents - Select a Category</h2>

    <p>

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

    DataSourceID="SqlDataSource1" OnSelectedIndexChanged="DataList1_SelectedIndexChanged1">

    <ItemTemplate>

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

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

    <br />

    </ItemTemplate>

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

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

    <SelectParameters>

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

    </SelectParameters>

    </asp:SqlDataSource>

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

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

    <Columns>

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

    <EditItemTemplate>

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

    </EditItemTemplate>

    <ItemTemplate>

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

    </ItemTemplate>

    </asp:TemplateField>

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

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

    </Columns>

    </asp:GridView>

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

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

    <SelectParameters>

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

    </SelectParameters>

    </asp:SqlDataSource>

    <br />

    &nbsp;</p>

    </div>

    <div class=fullwidth>

    The club's links.

    </div>

    </div>

    </asp:Content>

     

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

     

    Thanks.

    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