【发布时间】:2015-05-29 01:14:55
【问题描述】:
我需要使用Response.Redirect() 重定向到带有查询字符串值的页面,因为我无法设置此值。
我有一个包含ImageButton 和Label 的转发器,标签的文本是从数据库中检索的,我需要响应带有 URL"ShowCourse.aspx?coursename=value" 的页面,其中 value 是标签的值。
中继器代码:
<asp:Repeater ID="CoursesListRepeater" runat="server" DataSourceID="FetchCourse">
<ItemTemplate>
<table>
<tr>
<td>
<asp:ImageButton ID="CourseImage" runat="server" Height="90" Width="90" ImageUrl='<%# Eval("CourseImage")%>' CssClass="imageButtons" OnClick="CourseImage_Click" />
</td>
<td>
<asp:Label runat="server" ID="CourseNameLabel"><a href='<%#String.Format("AboutCourse.aspx?coursename={0}",Eval("CourseName")) %>' style="font-family: 'Buxton Sketch'; font-size: 40px;"><%#Eval("CourseName") %></a></asp:Label>
<br />
<asp:Label ID="CategoryLabel" runat="server" Font-Size="22px" ForeColor="Gray" Text='<%#Eval("CourseCategory") %>' />
<br />
<asp:Label ID="DescriptionLabel" Font-Size="13px" runat="server" Text='<%#Eval("CourseDescription") %>' ForeColor="DarkRed" />
</td>
</tr>
<hr style="margin-top: 30px; border-radius: 5px;" />
</table>
</ItemTemplate>
</asp:Repeater>
【问题讨论】: