数据列表视图问题 [英] Datalist view problem

查看:61
本文介绍了数据列表视图问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个数据列表,单击链接后应该显示一些数据.

这是我到目前为止所做的
我在那里也创建了超链接.现在,我需要在该链接旁边显示该数据.

I have created a data list that should display some set of data after clicking on the link.

Here is what I have done so far
There i create hyper-links too. Now I need to display that data next to that links.

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 338px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>

        <table style="width:100%;">
            <tr>
                <td class="style1">
                    <asp:DataList ID="DataList1" runat="server" BackColor="White"

                        DataSourceID="AccessDataSource1" Font-Bold="False" Font-Italic="False"

                        Font-Names="Times New Roman" Font-Overline="False" Font-Strikeout="False"

                        Font-Underline="False" ForeColor="Black"

                        onselectedindexchanged="DataList1_SelectedIndexChanged">
                        <ItemTemplate>
                            <asp:linkbutton ID="Linkbutton1" Text='<%# DataBinder.Eval(Container.DataItem, "L_Name") %>' CommandName="Select" style="color:darkred" runat="server"/>
                            <br />
                            <br />
                        </ItemTemplate>
                        <SelectedItemStyle BackColor="#333300" />
                        <HeaderStyle BackColor="Blue" Font-Bold="False" Font-Italic="False"

                            Font-Overline="False" Font-Strikeout="False" Font-Underline="False"

                            ForeColor="Black" />
                    </asp:DataList>
                    <asp:AccessDataSource ID="AccessDataSource1" runat="server"

                        DataFile="~/MLADB.mdb" SelectCommand="SELECT [L_Name] FROM [Lawyer]">
                    </asp:AccessDataSource>
                </td>
                <td>
                <table cellpadding="5" width="100%" style="font: 10pt verdana">
          <tr>
            <td>
              <img alt="Lawyer image" id="LawImage" visible="false" runat="server">
            </td>
            <td valign="top" width="400">
              <div style="font: 12pt Times New Roman;color:black">
                <i><b><span id="L_Name" runat="server"/></b></i><br>
              </div>
              <span id="Residence_ad" runat="server"/>
              <span id="Office_ad" runat="server"/>
              <span id="Residence_tel" runat="server"/>
              <span id="Office_tel" runat="server"/>
              <span id="Mobile_No" runat="server"/>
              <span id="email" runat="server"/>
            </td>
          </tr>
        </table>
                </td>
            </tr>
        </table>

    </div>
    </form>
</body>
</html>

推荐答案

您是否已绑定该数据源? 确切的错误是什么?
检查并确认 [
have you bind that datasource ??
what is the exact error??
check that[^]


这篇关于数据列表视图问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆