我有一个网格视图,用于在 asp.net 网站中显示文章列表。当用户单击每篇文章(网格视图行)的“显示文章”链接时,如果用户通过身份验证,我希望加载文章文件:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
EnableModelValidation="True" GridLines="None" Width="100%">
<Columns >
<asp:TemplateField>
<ItemTemplate>
<table style="width:100%;border-color:Gray; border-style:solid; border-width:2px; padding:0;">
<tr style="background-color:White; width:100%;">
<td rowspan="2" style="height:70px;width:10%" ><img alt="" src="Images/Article.jpg" width="70px" height="70px"></td>
<td><table width="100%"><tr>
<td width="50%"><asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl='<%# Eval("ArticlePath","ArticlesList.aspx?Code={0}") %>'>
<p style="font-family:B Titr; font-size:13px;"><%#Eval("ArticleTitle")%></p></asp:HyperLink> </td>
<td style="color:Gray; width:30%">article group:<span> <%#Eval("Title")%></span></td>
<td style="text-align:left; width:20%" ><p><%# SDKClass.GetFarsiDate(Eval("ArticleAddedDate", "{0:D}"), true)%></td>
</tr>
<tr >
<td colspan="2"><p style="font-family:B Zar; font-size:14px;"><%#Eval("ArticleAbstract")%></p> </td>
<td style=" text-align:left; font-size:10" > <asp:HyperLink ID="HyperLink2" runat="server" Text="show article"
NavigateUrl='<%# Eval("ArticlePath","ArticlesList.aspx?Code={0}") %>'>
</asp:HyperLink>
</td></tr>
</table>
</td>
</table>
<hr style="color:Orange">
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
在页面加载中:
if (Request.QueryString["Code"] != null)
{
Response.Redirect(Request.QueryString["Code"]);
}
如何检查页面加载中选择的每一行以重定向到其文件?