Click here to Skip to main content
15,918,742 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.

XML
<%@ 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>
Posted
Updated 6-Nov-10 2:36am
v2

1 solution

have you bind that datasource ??
what is the exact error??
check that[^]
 
Share this answer
 
Comments
Strider1987 6-Nov-10 23:39pm    
Yes i bind my data-source, and there r no errors at this moment. now what i want to do is after click on relevant click that should display some data next to it.
Tamer Hatoum 7-Nov-10 8:41am    
sorry for being late to reply,,, you can check that article it will help you ...
http://www.codeproject.com/KB/webforms/dgrowselect.aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900