Need help on setting up a query page using MenuItem, GridView, AcessDataSource components

Hi,

I'm a college student with an homework assignment to do. I'm developing an website where there is a menu with several items. Each item is configured with an unique ID "idsubcat":


<asp:MenuItem NavigateUrl="Consulta.aspx idsubcat=1" Text="Espumantes" Value="Vinhos"></asp:MenuItem>
 

The AcessDataSource object should receive that info and display the desired data on a GridView object: 


<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/inspektordb.mdb"

SelectCommand="SELECT [foto], [marca], [ds_produto], [preco] FROM [produto] WHERE ([cd_sub_categoria] = ) ORDER BY [preco] DESC">

<SelectParameters>

<asp:SessionParameter DefaultValue="" Name="cd_sub_categoria" SessionField="idsubcat"

Type="String" />

</SelectParameters>

</asp:AccessDataSource>


 


It doesn't work. It just shows a blank area where the GridView should appear when I run it. Testing the connection with a given DefaultValue works, though. 

I have a vague knowledge that MenuItem should pass "MenuItem.SelectedValue" to SessionParameter but I don't know how to do it because I'm using a MasterPage component therefore I'm unable to use MenuItem directly when setting up SQL query parameters.  I even tried that but it didn't work either.

I thank you all in advance for any help.




Answer this question

Need help on setting up a query page using MenuItem, GridView, AcessDataSource components

  • StanScott

    Hi,

    Questions specific to ASP.Net should be posted on forums.asp.net. You'll have a greater chance of getting an answer there.




    cheers,

    Paul June A. Domag


  • Need help on setting up a query page using MenuItem, GridView, AcessDataSource components