Witam
Chcialbym zrozumiec ASP .net gdyz chce przejsc z Classic ASP
Zrobilem strone do forum aby wyswietlała liste tematow tylko teraz chcialbym po kliknieciu na dany temat przekazac idtematu aby go wyswietlic.
Jak to mozna zrobic? Bo chyba tu querystring sie nie da...
<%@ Page Language="VB" debug="true" %>
<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "MySql.Data.MySqlClient" %>
<script language="VB" runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
Dim myConnection As MySqlConnection
Dim myDataAdapter As MySqlDataAdapter
Dim myDataSet As DataSet
Dim strSQL As String
Dim iRecordCount As Integer
myConnection = New MySqlConnection("server=localhost; user id=root; password=tajne2; database=forum; pooling=false;")
strSQL = "select * from temat "
strSQL = strSQL & " inner join uzytkownik on temat.iduzytkownik=uzytkownik.iduzytkownik "
strSQL = strSQL & " inner join kategoria on temat.idkategoria=kategoria.idkategoria "
strSQL = strSQL & " order by temat.datatemat desc "
myDataAdapter = New MySqlDataAdapter(strSQL, myConnection)
myDataSet = New Dataset()
myDataAdapter.Fill(myDataSet, "mytable")
MySQLDataGrid.DataSource = myDataSet
MySQLDataGrid.DataBind()
End Sub
</script>
<html>
<head>
<title>FORUM DYSKUSYJNE ( WERSJA: ASP .NET )</title>
</head>
<body>
<center>
<table width=35% align="center" style="border-top:solid 1px;border-bottom:solid 1px;border-left:solid 1px;border-right:solid 1px;">
<tr>
<td colspan=2 align=center bgcolor="#4747D8" style="color:white"><b>LOGOWANIE</b></td>
</tr>
<tr>
<td>
<form id="Form1" runat="server">
<b>Login:</b> <asp:TextBox ID="login" runat="server" />
</td>
<td>
<b>Hasło:</b> <asp:TextBox ID="password" TextMode="Password" runat="server" /> <br>
</td>
</tr>
<tr>
<td colspan=2 >
<center><asp:Button ID="btWyslij" runat="server" text="Zaloguj" /></center>
</td>
<tr>
<td colspan=2>
<center><a href="default.aspx?operacja=rejestracja">Rejestracja</a></td></center>
</tr>
</table><br>
<asp:GridView id="MySQLDataGrid" runat="server" AutoGenerateColumns="False"
BackColor="#E6E6FA" AlternatingRowStyle-BackColor="#F0F0F0"
BorderStyle="Ridge" BorderWidth="1px" CellPadding="1" CellSpacing="1"
HeaderStyle-BackColor="#4747D8" HeaderStyle-Font-Bold="True" HeaderStyle-ForeColor="#E7E7FF"
DataKeyNames="iduzytkownik" GridLines="None">
<Columns>
<asp:BoundField DataField="datatemat" HeaderText="Data"
SortExpression="datatemat" ItemStyle-Font-Size="Medium" ItemStyle-Width="20%" />
<asp:HyperLinkField DataTextField="temat" NavigateUrl="post.aspx?idtemat="
HeaderText="Temat" SortExpression="temat" ItemStyle-Font-Size="Medium" ItemStyle-Width="70%" />
<asp:BoundField DataField="nick"
HeaderText="Użytkownik" SortExpression="nick" ItemStyle-Font-Size="Medium" ItemStyle-Width="15%" />
<asp:BoundField DataField="kategorianazwa"
HeaderText="Kategoria" SortExpression="kategorianazwa" ItemStyle-Font-Size="Medium" ItemStyle-Width="10%" />
</Columns>
</asp:GridView>
</form>
</center>
</body>
</html>
Z gory dziekuje za pomoc