set all check boxes inside page to false - c#

I could have any number of checkboxes in my table.
<input type="checkbox" value='<%#Eval("MapID") %>' class="chk" runat="server"/>...
So how do I set all the checkboxes to false from code behind?
<asp:UpdatePanel runat="server" ID="AccesUpdatePanel" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:ListView ID="lvCurrentMaps" runat="server" >
<LayoutTemplate>
<table cellpadding="0" cellspacing="0" border="0" class="display rndCorner2" id="example" width="100%">
<thead>
<tr id="Tr1" runat="server" class="itemTableHeader">
<td>
<asp:Label runat="server" ID="Label1" Text="Select" />
</td>
<td id="Td1" runat="server">
<asp:Label runat="server" ID="lblMapID" Text="Map ID" />
</td>
</tr>
</thead>
<tbody>
<tr id="itemPlaceholder" runat="server">
</tr>
</tbody>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr id="Tr2" runat="server" class="itemTableData">
<td id="Td6" runat="server" class="chkbox">
<input type="checkbox" value='<%#Eval("MapID") %>' class="chk" runat="server"/>
</td>
<td id="Td1" runat="server" onclick='<%#"doPostBackForView("+Eval("MapID")+")" %>' style="cursor:pointer !important">
<asp:Label runat="server" ID="lblIDMapValue" Text= '<%#Eval("MapID") %>' />
</td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr id="Tr2" runat="server" class="altItemTableData">
<td id="Td6" runat="server" class="chkbox">
<input id="Checkbox" type="checkbox" value='<%#Eval("MapID") %>' class="chk" runat="server"/>
</td>
<td id="Td1" runat="server" onclick='<%#"doPostBackForView("+Eval("MapID")+")" %>' style="cursor:pointer !important">
<asp:Label runat="server" ID="lblIDMapValue" Text= '<%#Eval("MapID") %>' />
</td>
<td id="Td8" runat="server" onclick='<%#"doPostBackForView("+Eval("MapID")+")" %>' style="cursor:pointer !important">
<asp:Label runat="server" ID="lblMapNameValue" Text= '<%#Eval("MapName") %>' />
</td>
<td id="Td9" runat="server" onclick='<%#"doPostBackForView("+Eval("MapID")+")" %>' style="cursor:pointer !important">
<asp:Label runat="server" ID="lblMapDescValue" Text= '<%#Eval("MapDesc") %>' />
</td>
</tr>
</AlternatingItemTemplate>
</asp:ListView>
</ContentTemplate>
</asp:UpdatePanel>
I was trying something like:
foreach(var li in lvCurrentMaps.Items)
{
li.DataItem = false;
}
AccesUpdatePanel.Update();
any ideas?
possibly through a ScriptManager?

Jquery solution:
<script type="text/javascript">
$(document).ready(function(){
$('.chk').prop('checked', false);
});
</script>

Try this instead
<input type="checkbox" Checked='<%# Eval("MapID") %> class="chk" runat="server"/>
If the value of data column MapID is not a Boolean, try this
Create a method
public bool CheckMapID(object mapID)
{
if (mapID == null)
{
return false;
}
return true;
}
and replace the HTML/ASPX code with this
<input type="checkbox" Checked=<%# CheckMapID(Eval("MapID")) %> class="chk" runat="server"/>

Related

How to bind nested repeater using imagebutton in updatepanel

I was using a simple html img with jQuery to show the nested table and binding the repeater on itemdatabound. Problem is, this was very expensive by getting all sub items from items in the list at the same time. So I decided it's better when i click the collapse image to show the nested table I should bind the repeater in there.
For this I use imagebutton and command argument to get the ID and use update panel to stop postback from button, but the repeater won't update?
<asp:ScriptManager runat="server"></asp:ScriptManager>
<asp:Repeater ID="Repeater1" runat="server" OnItemCommand="rptInventarioLocalizacoes_ItemCommand">
<HeaderTemplate>
<table id="tblInventarioLocalizacoes" class="table table-bordered table-striped dataTable text-center">
<thead class="thead-dark">
<tr>
<th></th>
<th>Nª</th>
<th>Localização</th>
<th>Etq. Por Inventariar</th>
<th>Etq. Inventariadas</th>
<th>Precisão</th>
</tr>
</thead>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:ImageButton ID="ibtnCollapse" runat="server" Style="cursor: pointer" ImageUrl="../../Images/Collapse/plus.png" Width="20" CommandName="BindEtiquetas" CommandArgument='<%# Eval("Localizacao") %>' />
<asp:Panel ID="pnlInventarioEtiquetas" runat="server" Style="display: none">
<asp:UpdatePanel runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ibtnCollapse" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:Repeater ID="rptLocalizacoesEtiquetas" runat="server">
<HeaderTemplate>
<table id="tblLocalizacoesEtiquetas" class="nestedtable table table-bordered table-striped dataTable">
<thead class="thead-dark">
<tr>
<th>#</th>
<th>Etiqueta</th>
<th>Validar</th>
</tr>
</thead>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Label ID="lblRowIndex" runat="server" Text='<%# (((RepeaterItem)Container).ItemIndex + 1) %>' />
</td>
<td>
<asp:Label ID="lblEtiqueta" runat="server" Text='<%# Eval("Etiqueta") %>' />
</td>
<td>
<asp:CheckBox ID="chkEtiqueta" runat="server" />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
<asp:Button ID="btnAddEtiqueta" runat="server" CssClass="btn btn-default" Text="Adicionar Etiqueta" BackColor="#020023" ForeColor="White" Font-Bold="true" />
<asp:Button ID="btnInventariar" runat="server" CssClass="btn btn-default" Text="Inventariar Etiquetas" BackColor="#020023" ForeColor="White" Font-Bold="true" />
</FooterTemplate>
</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
</td>
<td>
<asp:Label ID="lblRowIndex" runat="server" Text='<%# (((RepeaterItem)Container).ItemIndex + 1) %>' />
<asp:Label ID="lblIdlocalizacao" runat="server" Text='<%# Eval("IdInventarioLocalizacao") %>' Style="display: none" />
</td>
<td>
<asp:Label ID="lblLocalizacao" runat="server" Text='<%# Eval("Localizacao") %>' />
</td>
<td>
<asp:Label ID="lblEtiquetasPorInventariar" runat="server" Text='<%# Eval("EtiquetasPorInventariar") %>' />
</td>
<td>
<asp:Label ID="lblEtiquetasInventariadas" runat="server" Text='<%# Eval("EtiquetasInventariadas") %>' />
</td>
<td>
<asp:Label ID="lblPrecisao" runat="server" Text='<%# Eval("Precisao") %>' />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>

unable to export html table content to excel in asp.net

when the html table is exported to excel from asp.net the table is displayed but the content inside the table is not displayed below is my code.
protected void btnExportToExcel_Click(object sender, EventArgs e)
{
Response.Clear();
Response.Buffer = true;
lblCategorystatusReportHeader.Visible = true;
Response.AddHeader("content-disposition",
"attachment;filename=StatusReport.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
//Panel preOrderPanel = (Panel)rpt1.FindControl("pnlPreOrder");
//rptCP.RenderControl(hw);
//pnlPreOrder.RenderControl(hw);
order.RenderControl(hw);
string output = sw.ToString();
output = "<html><head><meta charset=" + Encoding.UTF8.WebName + " /></head><body>" + output + "</body></html>";
Response.Output.Write(output);
Response.Flush();
Response.End();
lblCategorystatusReportHeader.Visible = false;
}
below is the aspx code
&nbsp
</asp:TableRow>
</asp:Table>
<table>
<tr>
<td>
&nbsp
</td>
</tr>
</table>
<table>
<%-- <tr style="text-align:center">
<td colspan="20" style="font-size:16px; padding-left:100px;background-color:#90cad9;border:1px solid black;display:none">
<b><asp:Label ID="lblCategorystatusReportHeader" runat="server" Text="Category Status Report"></asp:Label></b>
</td>
</tr>--%>
<tr>
<td style="width:150px !important;vertical-align:middle;text-align:center; border-style:solid; border-width:1px" rowspan="2">
<asp:Label ID="lblCPPre" runat="server"></asp:Label>
</td>
<td>
<%-- <asp:Panel ID="pnlPreOrder" runat="server">--%>
<table border="1" style="border-collapse:collapse">
<tr>
<%--<td stylwe="width:40px">
<asp:Label ID="lblCPPre" runat="server"></asp:Label>
</td>--%>
<td style="vertical-align:middle;background-color:#90cad9;text-align:center">
<div style="width:100px !important">Category CP</div>
</td>
<td>
<asp:Label ID="lblMessagePre" runat="server" Text="No Records found" Visible ="false" ForeColor="Red"></asp:Label>
<asp:Repeater ID="rptStylePO" runat="server" OnItemDataBound="rptStylePO_ItemDataBound">
<ItemTemplate>
<table border="1" style="border-collapse:collapse;border-spacing:0px">
<tr>
<td class="stylestatusReport">
<div style="width:100px !important"> <asp:HiddenField ID="styleid" runat="server" Value='<%# Container.DataItem.ToString() %>'/>
<asp:Label ID="lblStyle" runat="server"></asp:Label></div>
</td>
<td>
<asp:Label ID="lblNoMilestonePre" runat="server" Text="No Records found" Visible ="false" ForeColor="Red"></asp:Label>
<asp:Repeater ID="rptt" runat="server" OnItemDataBound="rptt_ItemDataBound">
<ItemTemplate>
<table>
<tr>
<td style="width:60px;vertical-align:middle;text-align:center">
<div style="width:60px !important"><asp:HiddenField ID="stlId" runat="server" Value='<%# Container.DataItem.ToString() %>' /></div>
</td>
<td>
<asp:DataList ID="dataListPO" runat="server" RepeatDirection="Horizontal" OnItemDataBound="dataListPO_ItemDataBound">
<ItemTemplate>
<table border="1" style="border-collapse:collapse; border-spacing:0px" >
<tr>
<td style="word-wrap:break-word;width:110px; height:60px; color:#000000;vertical-align:middle;text-align:center; background-color:#90cad9 ; font-size:11px;">
<div style="word-wrap:break-word;width:100%;font-size:13px">
<asp:Label ID="lblMilestoneValue" runat="server" Text='<%# Eval("MilestoneName") %>'></asp:Label></div>
</td>
</tr>
<tr>
<td style="text-align:left;">
<asp:Table ID="tblStatus" runat="server" Width="100%">
<asp:TableRow ID="rowStatus" runat="server">
<asp:TableCell ID="cellStatus1" Width="25px" runat="server"><div style="width:100px; text-align:justify"><asp:Label ID="lblForecastedDate" Font-Size="13px" runat="server" Width="50%" ForeColor="Black"></asp:Label></div></asp:TableCell>
<asp:TableCell ID="cellStatus" Width="25px" runat="server"> <div style="width:100px; text-align:center">
<asp:Label ID="lblStatus" Font-Size="13px" runat="server" ForeColor="White"></asp:Label></div>
</asp:TableCell>
</asp:TableRow></asp:Table>
<asp:HiddenField ID="hdnPlannedDate" runat="server" Value='<%# Eval("MilestonePlannedDate") %>'></asp:HiddenField>
<asp:HiddenField ID="hdnRevisedDate" runat="server" Value='<%# Eval("MilestoneRevisedDate") %>'></asp:HiddenField>
<asp:HiddenField ID="hdnActualDate" runat="server" Value='<%# Eval("MilestoneActualDate") %>'></asp:HiddenField>
<asp:HiddenField ID="hdnMilestoneStatus" runat="server" Value='<%# Eval("MilestoneStatus") %>' />
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
</td>
</tr>
</table>
<%-- </asp:Panel>--%>
</td>
</tr>
<tr>
<td>
<%-- <asp:Panel ID="pnlPostOrder" runat="server">--%>
<table border="1" style="border-collapse:collapse;">
<tr>
<%--<td style="width:40px">
<asp:Label ID="lblCPPost" runat="server"></asp:Label>
</td>--%>
<td style=" background-color:#90cad9; font-size:14px;vertical-align:middle;text-align:center;white-space:nowrap; " ><div style="width: 100px;">Item CP</div></td>
<td style="font-size:14px">
<asp:Label ID="lblMessagePost" runat="server" Text="No Records found" Visible ="false" ForeColor="Red"></asp:Label>
<asp:Repeater ID="rptStylePostOrder" runat="server" OnItemDataBound="rptStylePostOrder_ItemDataBound">
<ItemTemplate>
<table border="1" style="border-collapse:collapse">
<tr>
<td class="stylestatusReport">
<div style="width:100px !important"><asp:HiddenField ID="styleid" runat="server" Value='<%# Container.DataItem.ToString() %>'/>
<asp:Label ID="lblStyle" runat="server"></asp:Label></div>
</td>
<td>
<asp:Label ID="lblNoMilestonePost" runat="server" Text="No Records found" Visible ="false" ForeColor="Red"></asp:Label>
<asp:Repeater ID="rptPO" runat="server" OnItemDataBound="rptPO_ItemDataBound">
<ItemTemplate>
<table>
<tr>
<td style="word-wrap:break-word;width:60px;vertical-align:middle;text-align:center;">
<div style="width:60px">
<asp:Label ID="lblPostOrderNumber" runat="server"></asp:Label>
<asp:HiddenField ID="hdnStylePOID" runat="server" Value='<%# Container.DataItem.ToString() %>'/></div>
</td>
<td>
<asp:DataList ID="dataListPostOrder" runat="server" RepeatDirection="Horizontal" OnItemDataBound="dataListPostOrder_ItemDataBound">
<ItemTemplate>
<table border="1" style="border-collapse:collapse">
<tr>
<td style="word-wrap:break-word;width:110px; height:60px;background-color:#90cad9 ; font-size:11px;vertical-align:middle;text-align:center">
<div style="word-wrap:break-word;width:100%; font-size:13px"><asp:Label ID="lblMilestoneValuePost" runat="server" Text='<%# Eval("MilestoneName") %>'></asp:Label></div>
</td>
</tr>
<tr>
<td style="text-align:left">
<asp:Table ID="tblStatusPost" runat="server" Width="100%">
<asp:TableRow ID="rowStatusPost" runat="server">
<asp:TableCell ID="cellStatus1Post" Width="25px" runat="server">
<div style="width:100px;text-align:justify;"><asp:Label ID="lblForecastedDatePost" Font-Size="13px" runat="server" Width="50%" ForeColor="Black"></asp:Label></div></asp:TableCell>
<asp:TableCell ID="cellStatusPost" runat="server"><div style="width:100px;text-align:center">
<asp:Label ID="lblStatusPost" Font-Size="13px" runat="server" Width="100%" ForeColor="White"></asp:Label></div></asp:TableCell></asp:TableRow></asp:Table>
<asp:HiddenField ID="hdnPlannedDatePost" runat="server" Value='<%# Eval("MilestonePlannedDate") %>'></asp:HiddenField>
<asp:HiddenField ID="hdnRevisedDatePost" runat="server" Value='<%# Eval("MilestoneRevisedDate") %>'></asp:HiddenField>
<asp:HiddenField ID="hdnActualDatePost" runat="server" Value='<%# Eval("MilestoneActualDate") %>'></asp:HiddenField>
<asp:HiddenField ID="hdnMilestoneStatusPost" runat="server" Value='<%# Eval("MilestoneStatus") %>' />
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
</td>
</tr>
</table>
<%-- </asp:Panel>--%>
</td>
</tr>
</table>
[Below is the image of the table that is being displayed in excel.]
http://i.stack.imgur.com/JhHQo.png
actual image
[1]: http://i.stack.imgur.com/ghl8I.png

Having Issues with using VISIBLE. My Javascript doesnt seem to be handling the event when the check box is clicked

All of my hidden fields have ID's. And in my JavaScript in trying to set the visible from false to true on the payment selection. The Cash payment should just display the address to be sent to. The credit card payment comes up with text boxes and labels in order to process the payment online. But when I run the script the wont appear with the checkbox selection. I assigned an onClick event and still doesnt work. Any suggestions?
<%# Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ShoppingCart.aspx.cs" Inherits="ShoppingCart" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
<head>
<script type="text/javascript">
function paymentFunction() {
if (document.getElementById("rbCash").checked) {
document.getElementById("lbCash").visible = true;
document.getElementById("lbCash2").visible = true;
document.getElementById("lbCash3").visible = true;
document.getElementById("lbCash4").visible = true;
}
else
{
if(document.getElementById("rbCreditCard").checked)
{
document.getElementById("lbCard").visible = true;
document.getElementById("lbCardNum").visible = true;
document.getElementById("lbCVV").visible = true;
document.getElementById("lbexp").visible = true;
document.getElementById("ddlCard").visible = true;
document.getElementById("tbCnum").visible = true;
document.getElementById("tbcvvnum").visible = true;
document.getElementById("tbexp").visible = true;
}
}
}
</script>
<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
width: 100%;
}
.style3
{
width: 130px;
}
</style>
</head>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<table class="style2">
<tr>
<td class="style3">
Payment Type:</td>
<td>
<asp:CheckBox ID="rbCash" runat="server" onClick="paymentFunction()" Text="Cash" ClientIDMode="Static"/>
<asp:CheckBox ID="rbCreditCard" runat="server" onClick="paymentFunction()" Text="Credit Card" />
</td>
</tr>
<tr>
<td class="style3">
</td>
<td>
<asp:Label ID="lbCash" runat="server" ForeColor="Black"
Text="Please Send Payment To:" Visible="False" ClientIDMode="Static"></asp:Label>
</td>
</tr>
<tr>
<td class="style3">
</td>
<td>
<asp:Label ID="lbCash2" runat="server" ForeColor="Black"
Text="Wild Style Shoes" Visible="False" ClientIDMode="Static"></asp:Label>
</td>
</tr>
<tr>
<td class="style3">
</td>
<td>
<asp:Label ID="lbCash3" runat="server" ForeColor="Black"
Text="1808 West Avenue" Visible="False" ClientIDMode="Static"></asp:Label>
</td>
</tr>
<tr>
<td class="style3">
</td>
<td>
<asp:Label ID="lbCash4" runat="server" ForeColor="Black"
Text="Chicago, IL 88947" Visible="False" ClientIDMode="Static"></asp:Label>
</td>
</tr>
<tr>
<td class="style3">
<asp:Label ID="lbcard" runat="server" Text="Card Type" Visible="False"></asp:Label>
</td>
<td>
<asp:DropDownList ID="ddlCard" runat="server" Visible="False">
<asp:ListItem>Select A Card</asp:ListItem>
<asp:ListItem>Visa</asp:ListItem>
<asp:ListItem>Discover</asp:ListItem>
<asp:ListItem>MasterCard</asp:ListItem>
<asp:ListItem>American Express</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="style3">
<asp:Label ID="lbcardnum" runat="server" Text="Card Number:" Visible="False"></asp:Label>
</td>
<td>
<asp:TextBox ID="tbCnum" runat="server" Visible="False" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style3">
<asp:Label ID="lbCVV" runat="server" Text="CVV Number" Visible="False"></asp:Label>
</td>
<td>
<asp:TextBox ID="tbcvvnum" runat="server" Visible="False" Width="58px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style3">
<asp:Label ID="lbexp" runat="server" Text="Expiration Date" Visible="False"></asp:Label>
</td>
<td>
<asp:TextBox ID="tbexp" runat="server" Visible="False"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style3">
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Submit Payment" Visible="False" />
</td>
</tr>
</table>
<p>
</p>
<p>
</p>
<p>
Thank You For Shopping With Us:<br />
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
</asp:Content>
If you set Visible = false on the server side like you are doing, then the server will not render the control.
You probably want to do the following:
<asp:Label ID="lbCash" runat="server" ForeColor="Black"
Text="Please Send Payment To:" style="visibility:hidden" ClientIDMode="Static"></asp:Label>
Then in the javascript do something like this:
document.getElementById('lbCash').style.visibility = 'visible';

Changing css with data binding

as you can see there is a MsgIsNew in select command with type of Bit in my sql data base. how can i put the BodyLiteral, in a span tag, if the valu of MsgIsNew field, is true?
I'm using asp.net with C#.
Thank you very much.
<asp:Panel ID="Panel2" runat="server" Visible='<%# Eval("MasSender") %>' Width="100%" Wrap="False">
<table style="width: 100%;">
<tr>
<td>
<asp:Literal ID="BodyLiteral" runat="server" Text='<%# Eval("MsgBody") %>'></asp:Literal>
</td>
</tr>
<tr>
<td>
<asp:Literal ID="DateLiteral" runat="server" Text='<%# DisplayDate(Eval("MsgDate")) %>'></asp:Literal>
</td>
</tr>
</table>
</asp:Panel>
SelectCommand="SELECT DISTINCT MsgIsNew, MsgBody, MsgDate, FROM Message"
<asp:Panel ID="Panel2" runat="server" Visible='<%# Eval("MasSender") %>' Width="100%" Wrap="False">
<table style="width: 100%;">
<tr>
<td>
<asp:Label runat="server" Visible='<%# Eval("MsgIsNew") %>'>
<asp:Literal ID="BodyLiteral" runat="server" Text='<%# Eval("MsgBody") %>'></asp:Literal>
</asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Literal ID="DateLiteral" runat="server" Text='<%# DisplayDate(Eval("MsgDate")) %>'></asp:Literal>
</td>
</tr>
</table>
Or maybe more exact:
Visible='<%# Convert.ToBoolean(Eval("MsgIsNew")) %>
But you need to be sure that the return from database is boolean or by converting (0 or 1)...
If this is not what you ment please be more specific.

How I get a Scrollbar for My ListView control in ASP.NET

I have built a ASP.NET Application and use two divs and a ListView. My ListView get Data from a Database and if I have to much Rows a I get a overflow but I want then a Scrollbar for this ListView.
My Site:
My Site if I have to much rows :(
My Site with a Scrollbar that I want!
My Code:
<asp:Content ID="Content2" ContentPlaceHolderID="lw_content" runat="server">
<div class="userlist">
<div class="liste">
<asp:ListView runat="server" ID="myListView">
<LayoutTemplate>
<table id="UserList" border="0" cellpadding="0" cellspacing="0">
<tr style="background-color:#ccdaeb">
<th align="left">
<asp:Label ID="header_name" runat="server" Text="Name"></asp:Label></th>
<th align="left">
<asp:Label ID="header_firma" runat="server" Text="Firma"></asp:Label></th>
<th align="left">
<asp:Label ID="header_von" runat="server" Text="gültig ab"></asp:Label></th>
<th align="left">
<asp:Label ID="header_bis" runat="server" Text="gültig bis"></asp:Label></th>
<th align="left">
<asp:Label ID="header_ersteller" runat="server" Text="erstellt von"></asp:Label></th>
</tr>
<tr id="itemPlaceholder" runat="server"></tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td align="left"><asp:Label ID="lblname" Text='<%# Eval("GanzerName") %>' runat="server" /></td>
<td align="left"><asp:Label ID="lblfirma" Text='<%# Eval("Firma") %>' runat="server" /></td>
<td align="left"><asp:Label ID="lblvon" Text='<%# Eval("GültigVon") %>' runat="server" /></td>
<td align="left"><asp:Label ID="lblbis" Text='<%# Eval("GültigBis") %>' runat="server" /></td>
<td align="left"><asp:Label ID="lblersteler" Text='<%# Eval("Ersteller") %>' runat="server" /></td>
</tr>
</ItemTemplate>
<EmptyDataTemplate>
<h4>Es wurden keine Einträge gefunden</h4><br/>
<asp:Button runat="server" ID="btnAnlegen" Text="Benutzer Anlegen"/>
</EmptyDataTemplate>
<AlternatingItemTemplate>
<tr>
<td align="left"><asp:Label ID="lblname" Text='<%# Eval("GanzerName") %>' runat="server" /></td>
<td align="left"><asp:Label ID="lblfirma" Text='<%# Eval("Firma") %>' runat="server" /></td>
<td align="left"><asp:Label ID="lblvon" Text='<%# Eval("GültigVon") %>' runat="server" /></td>
<td align="left"><asp:Label ID="lblbis" Text='<%# Eval("GültigBis") %>' runat="server" /></td>
<td align="left"><asp:Label ID="lblersteler" Text='<%# Eval("Ersteller") %>' runat="server" /></td>
</tr>
</AlternatingItemTemplate>
</asp:ListView>
</div>
</div>
</asp:Content>
You can fix the hsight if liste div and set overflow to visible or what ever suits you. Height must be less then the height taken by data in side div to see the scroll bar.
Change
<div class="liste">
to
<div class="liste" style="height:300px; overflow:scroll">
or
<div class="liste" style="height:300px; overflow:visible">
Try setting the overflow to scroll:
<div class="liste" style="height:200px; overflow:scroll;">

Categories