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:MenuItemNavigateUrl="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:AccessDataSourceID="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:SessionParameterDefaultValue=""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.

[4011 byte] By [WendelSouza] at [2008-1-26]
# 1
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

PaulDomag at 2007-9-8 > top of Msdn Tech,Visual Studio Express Editions,Visual C# 2005 Express Edition...