I have this code in my default page Which fetches last ten records from database.
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="Jobstbl">
<ItemTemplate>
<div class="job_detail_row">
<h1><a href="#"><%# Eval("Titel")%></a></h1>
<p><%# left(Eval("Description"),100) %> <a href="#"> Read more</a><br /><span class="posted_by">Psted by: <%# Eval("Employer")%>: <%# Eval("Date")%></span> Country: <%# Eval("City")%> </p>
</div>
</ItemTemplate>
</asp:Repeater>
<asp:SqlDataSource ID="Jobstbl" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT TOP 10 * FROM [Jobs] ORDER BY ID DESC"></asp:SqlDataSource>
Now i want to do is. One a user click on
<h1><a href="#"><%# Eval("Titel")%></a></h1> Automaticly go to new page with this url Jobs.aspx?ID=(Numaric 1,2, etc) can anybody guide me what i have to do ?
Resumepod
Member
56 Points
97 Posts
Create dynamic page.
Dec 16, 2012 05:27 PM|LINK
I have this code in my default page Which fetches last ten records from database.
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="Jobstbl"> <ItemTemplate> <div class="job_detail_row"> <h1><a href="#"><%# Eval("Titel")%></a></h1> <p><%# left(Eval("Description"),100) %> <a href="#"> Read more</a><br /><span class="posted_by">Psted by: <%# Eval("Employer")%>: <%# Eval("Date")%></span> Country: <%# Eval("City")%> </p> </div> </ItemTemplate> </asp:Repeater> <asp:SqlDataSource ID="Jobstbl" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT TOP 10 * FROM [Jobs] ORDER BY ID DESC"></asp:SqlDataSource>Now i want to do is. One a user click on
<h1><a href="#"><%# Eval("Titel")%></a></h1> Automaticly go to new page with this url Jobs.aspx?ID=(Numaric 1,2, etc) can anybody guide me what i have to do ?RameshRajend...
Star
7983 Points
2099 Posts
Re: Create dynamic page.
Dec 16, 2012 06:42 PM|LINK
http://stackoverflow.com/questions/8822297/create-query-string-in-anchor-tag
http://stackoverflow.com/questions/7963569/how-to-pass-querystring-in-anchor-tag
oned_gk
All-Star
31373 Points
6412 Posts
Re: Create dynamic page.
Dec 16, 2012 10:14 PM|LINK
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ID","Jobs.aspx?ID={0}") %>' Text='<%# Eval("Titel") %>'> </asp:HyperLink>Resumepod
Member
56 Points
97 Posts
Re: Create dynamic page.
Dec 17, 2012 12:44 AM|LINK
This Method will send me on next page. Now i have to add a new page? And have to Select record using query string? Am i right?
oned_gk
All-Star
31373 Points
6412 Posts
Re: Create dynamic page.
Dec 17, 2012 12:55 AM|LINK
yes. You need new page called "Jobs.aspx" or maybe "JobsDetail.aspx"
Resumepod
Member
56 Points
97 Posts
Re: Create dynamic page.
Dec 17, 2012 01:24 AM|LINK
One thing more i want to ask. Can i make something like this ? Jobs/Job_ID Instead of jobs.aspx?ID=
oned_gk
All-Star
31373 Points
6412 Posts
Re: Create dynamic page.
Dec 17, 2012 01:31 AM|LINK
You can find some answered threat in this site called "URL Rewrite".