Datalist添加链接项的简便方法

By bboncn

天下午让老师把我做的毕业设计看了下,理所当然地被老师夸奖了一番。说做的不错,可能答辩的时候老师们

都不会相信之类的话。听了高兴了好一阵子。

在网上招聘模块,我之前只实现了通过datalist控件显示数据库表中数据的功能。老师看后又给我加了个“应聘该职位 ”的功能,让浏览者可以通过该功能把自己应聘的详细信息提交给网站管理员,以便从中选择性地对应聘者进行筛选。实现的基本思想也就是当用户点击“应聘该职位”时跳转至“填写个人信息”的提交页。在该过程中应将应聘职位的职位名页调用到该页显示。具体实现代码如下: 

<asp:DataList ID=”DataList1″ runat=”server” DataSourceID=”SqlDataSourceGetHR” CaptionAlign=”Top” Width=”480px” RepeatDirection=”Horizontal” Height=”266px” RepeatColumns=”1″>
                                          <ItemTemplate>
                                              <span class=”STYLE4″><b>招聘职位:</b>
                                              <b>
                                              <asp:Label ID=”JobLabel” runat=”server” Text=’<%# Eval(“Job”) %>’></asp:Label>
                                              <br />
                                              </b>
                                              招聘人数:
                                              <asp:Label ID=”PersonLabel” runat=”server” Text=’<%# Eval(“Person”) %>’></asp:Label>
                                              <br />
                                              性别要求:
                                              <asp:Label ID=”SexLabel” runat=”server” Text=’<%# Eval(“Sex”) %>’></asp:Label>
                                              <br />
                                              年龄要求:
                                              <asp:Label ID=”AgeLabel” runat=”server” Text=’<%# Eval(“Age”) %>’></asp:Label>
                                              <br />
                                              发布日期:
                                              <asp:Label ID=”CtimeLabel” runat=”server” Text=’<%# Eval(“Ptime”) %>’></asp:Label>
                                              <br />
                                              截至日期:
                                              <asp:Label ID=”PtimeLabel” runat=”server” Text=’<%# Eval(“Ctime”) %>’></asp:Label>
                                              <br />
                                              备注信息:
                                              <asp:Label ID=”RemarkLabel” runat=”server” Text=’<%# Eval(“Remark”) %>’></asp:Label>
                                              <br />
                                              <asp:HyperLink ID=”HyperLink1″ runat=”server” NavigateUrl=’<%# Eval(“Job”, ”Jober.aspx?Job={0}”) %>’><b>应聘该职位</b></asp:HyperLink>                                              </span><br />
                                              <br />
                                        </ItemTemplate>
                                          <SelectedItemStyle Font-Bold=”False” Font-Italic=”False” Font-Overline=”False” Font-Strikeout=”False”
                                              Font-Underline=”False” />
                                          <HeaderStyle Font-Bold=”False” Font-Italic=”False” Font-Overline=”False” Font-Strikeout=”False”
                                              Font-Underline=”False” />
                                      </asp:DataList><asp:SqlDataSource ID=”SqlDataSourceGetHR” runat=”server” ConnectionString=”<%$ ConnectionStrings:ConnectionStringGetHR %>”
                                          SelectCommand=”Select [Job], [Person], [Sex], [Age], [Remark], [Ptime], [Ctime] FROM [Hr]“>
                                      </asp:SqlDataSource>                         

Leave a Reply