Thank you very much!
Where should I insert this line in my code? (Sorry for this question, i'm
not yet proficient enough in ASP.NET)
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:Ricambi_2Con nectionString %>"
SelectCommand=" SELECT [IDProdotto], [Codice], [Prodotto_I], [Nome_Pdf] FROM
[Prodotti]">
</asp:SqlDataSour ce>
<asp:GridView ID="GridView1" runat="server" AutoGenerateCol umns="False"
CellPadding="4" DataKeyNames="I DProdotto" DataSourceID="S qlDataSource1"
Font-Names="Verdana" Font-Size="X-Small" ForeColor="#333 333"
GridLines="None ">
<FooterStyle BackColor="#5D7 B9D" Font-Bold="True" ForeColor="Whit e" />
<RowStyle BackColor="#F7F 6F3" ForeColor="#333 333" />
<Columns>
<asp:BoundFie ld DataField="IDPr odotto" HeaderText="IDP rodotto"
InsertVisible=" False" ReadOnly="True" SortExpression= "IDProdotto " />
<asp:BoundFie ld DataField="Codi ce" HeaderText="Cod ice"
SortExpression= "Codice" />
<asp:HyperLinkF ield DataNavigateUrl Fields="Codice"
DataNavigateUrl FormatString="d efpost.aspx?id= {0}"
DataTextField=" Codice" NavigateUrl="de fpost.aspx" />
<asp:BoundFie ld DataField="Codi ce" />
<asp:BoundFie ld DataField="Prod otto_I" HeaderText="Pro dotto_I"
SortExpression= "Prodotto_I " />
<asp:BoundFie ld DataField="Nome _Pdf" HeaderText="Nom e_Pdf"
SortExpression= "Nome_Pdf" />
</Columns>
<PagerStyle BackColor="#284 775" ForeColor="Whit e" HorizontalAlign ="Center"
/>
<SelectedRowSty le BackColor="#E2D ED6" Font-Bold="True" ForeColor="#333 333"
/>
<HeaderStyle BackColor="#5D7 B9D" Font-Bold="True" ForeColor="Whit e" />
<EditRowStyle BackColor="#999 999" />
<AlternatingRow Style BackColor="Whit e" ForeColor="#284 775" />
</asp:GridView>
"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgha scritto nel
messaggio news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
You can get it in the code as Request.QuerySt ring["id"].
If you are using SqlDataSource control, you can get away without writting
any code if you use a QueryStringPara meter:
<asp:querystrin gparameter name="id" type="String" querystringfiel d="id" />
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Zaur Bahramov" <zb********@msn .comwrote in message
news:e5******** ******@TK2MSFTN GP03.phx.gbl...
>Hi!
I'm developing a web application where the first page shows table from
SQL Server and has some hyperlinks in one collumn. The collumn has
productID so when clicked the page is passed as defpost.aspx?id ={0}
When user clicks on a hyperlink it is redirected to defpost.aspx page
where basing on the value of ID the data grid needs to display another
table after querying a SQL Server passing the parameter (which is equal
to "id").
The first part is clear and is ready, I'm having a difficulty creating a
defpost.aspx page. How do I grab the ID and pass it to sql query on
defpost.aspx ?
Thank you!
Zaur