Adding Header to the repeater in asp.net - c#

How to add header to the Repeater control? I want to add the header for each columns mentioned
Below is my repeater control
<asp:Repeater ID="rptSingleSapDataInfo" runat="server">
<ItemTemplate>
<div class="widget-box widget-blue">
<div class="widget-main widget-repeater-horizontal">
<div class="pull-left">
<asp:Label ID="lblSapId" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SAP_ID") %>' CssClass="labelbold"></asp:Label>
</div>
<div class="pull-right">
<asp:Label ID="lblState" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "STATE") %>' CssClass="labelbold"></asp:Label>
</div>
<div class="pull-right">
<asp:Label ID="lblNLat" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "NEW_LATITUDE") %>' CssClass="labelbold"></asp:Label>
</div>
<div class="pull-right">
<asp:Label ID="lblNLong" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "NEW_LONGITUDE") %>' CssClass="labelbold"></asp:Label>
</div>
<div class="pull-right">
<asp:Label ID="lblOLat" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "OLD_LATITUDE") %>' CssClass="labelbold"></asp:Label>
</div>
<div class="pull-right">
<asp:Label ID="lblOLong" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "OLD_LONGITUDE") %>' CssClass="labelbold"></asp:Label>
</div>
<div class="pull-right1" style="padding: 5px 5px 5px 20px;">
<asp:Label ID="lblRemarks" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "REMARKS") %>' CssClass="labelbold"></asp:Label>
</div>
<div class="pull-right">
<asp:Label ID="lblCreatedBy" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "CREATED_BY") %>' CssClass="labelbold"></asp:Label>
</div>
<div class="pull-right">
<asp:Label ID="lblCreatedDate" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "CREATED_DATE", "{0:dd-MM-yyyy}") %>' CssClass="labelbold"></asp:Label>
</div>
</div>
</div>
</ItemTemplate>
</asp:Repeater>

You are already using the ItemTemplate so use the HeaderTemplate to add a header:
<asp:Repeater ID="rptSingleSapDataInfo" runat="server">
<HeaderTemplate>
My header
</HeaderTemplate>
<ItemTemplate>
<div class="widget-box widget-blue">
...
</div>
</ItemTemplate>
</asp:Repeater>

As i understand your question use Header Template
<asp:Repeater runat="server" ID="rowRepeater" OnItemDataBound="rowRepeater_ItemBound">
<HeaderTemplate>
<table>
<tr>
<asp:Repeater runat="server" ID="headerRepeater">
<ItemTemplate>
<th>
<%# Container.DataItem %>
</th>
</ItemTemplate>
</asp:Repeater>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:Label runat="server" ID="lblUserName" Text='<%# Eval("Key") %>' /></td>
<asp:Repeater runat="server" ID="columnRepeater">
<ItemTemplate>
<td>
<asp:HiddenField runat="server" ID="hfRoleIndex" Value='<%# Container.ItemIndex %>' />
<asp:CheckBox runat="server" ID="cbColumnValue" Checked='<%# Container.DataItem %>' OnCheckedChanged="cbColumnValue_CheckedChanged" AutoPostBack="true" />
</td>
</ItemTemplate>
</asp:Repeater>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Here is the reference link
Repeater and add columns to header and itemtemplate on page load
it will help you

Related

Textbox with textmode time, won't display data from sql database

So i did a research about textmode time but it doesn't seem to help me. My problem is when i tried to bind the data with time textmode it won't display anything I already tried removing the textmode so i can see if it can display data and it does. Here's my code in the front, hope you'll help me. Thank you in advance
<asp:Repeater runat="server" ID="rptrTRFFormItems" OnItemDataBound="rptrTRFFormItems_ItemDataBound">
<ItemTemplate>
<tr>
<td>
<asp:Label runat="server" ID="No" Text='<%# Container.ItemIndex + 1 %>' Visible="false">
</asp:Label>
</td>
<td>
<asp:LinkButton runat="server" ID="btnAddItemRow" CssClass="actionbtnstyle fa fa-plus-square" CausesValidation="false" OnClick="btnAddItemRows" Style="font-size: 20px;">
</asp:LinkButton>
</td>
<td>
<asp:LinkButton runat="server" ID="btnDeleteItemRow" CssClass="actionbtnstyle fa fa-minus-square" CausesValidation="false" OnClick="btnDeleteItemRows" Style="font-size: 20px;">
</asp:LinkButton>
</td>
<td>
<div runat="server" id="divInputGroup">
<span runat="server" id="spanInputGroup">
<asp:Label runat="server" ID="validatetbName">
</asp:Label>
</span>
<asp:TextBox runat="server" ID="tbName" Text='<%#Eval("Name") %>' CssClass="form-control rptrtbstyle" ondrop="return false" title="Required" data-toggle="tooltip" TabIndex="13" data-placement="bottom">
</asp:TextBox>
</div>
</td>
<td>
<asp:UpdatePanel runat="server" ID="rptriddate" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="tbDate" EventName="TextChanged" />
</Triggers>
<ContentTemplate>
<div runat="server" id="divInputGroup0">
<span runat="server" id="spanInputGroup0">
<asp:Label runat="server" ID="validatetbDate">
</asp:Label>
</span>
<asp:TextBox runat="server" ID="tbDate" CssClass="form-control js-datepicker rptrtbstyle" Style="cursor: pointer;" TabIndex="14" data-toggle="tooltip" data-placement="bottom" title="Required" OnTextChanged="tbDate_TextChanged" autocomplete="off" AutoPostBack="true">
</asp:TextBox>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>
<div runat="server" id="divInputGroup2">
<span runat="server" id="spanInputGroup2">
<asp:Label runat="server" ID="validatetbPreferredTime">
</asp:Label>
</span>
<asp:TextBox runat="server" ID="tbPreferredTime" Text='<%#Eval("PreferredTime") %>' format="HH:mm" TextMode="Time" CssClass="form-control rptrtbstyle" data-toggle="tooltip" TabIndex="15" data-placement="bottom" title="Required">
</asp:TextBox>
</div>
</td>
<td>
<div runat="server" id="divInputGroup1">
<span runat="server" id="spanInputGroup1">
<asp:Label runat="server" ID="validatetbFromRptr">
</asp:Label>
</span>
<asp:TextBox runat="server" ID="tbFromRptr" Text='<%#Eval("FromRptr") %>' CssClass="form-control rptrtbstyle" data-toggle="tooltip" data-placement="bottom" TabIndex="16" title="Required" AutoPostBack="false">
</asp:TextBox>
</div>
</td>
<td>
<asp:LinkButton runat="server" ID="btnExchange" CssClass="actionbtnstyle fa fa-exchange" CausesValidation="false" Style="font-size: 20px;">
</asp:LinkButton>
</td>
<td>
<div runat="server" id="divInputGroup3">
<span runat="server" id="spanInputGroup3">
<asp:Label runat="server" ID="validatetbToRptr">
</asp:Label>
</span>
<asp:TextBox runat="server" ID="tbToRptr" Text='<%#Eval("ToRptr") %>' CssClass="form-control rptrtbstyle" TabIndex="17" data-toggle="tooltip" data-placement="bottom" title="Required">
</asp:TextBox>
</div>
</td>
</tr>
<%--</ContentTemplate> </asp:UpdatePanel>--%>
</ItemTemplate>
</asp:Repeater>
And here's the code to bind data from behind.
using(SqlConnection con = new SqlConnection(travelrequest))
{
using(SqlCommand cmd = con.CreateCommand())
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "TRFSearchByRefernce";
cmd.Parameters.AddWithValue("#trfNo", txtSearchByReference.Text);
cmd.Parameters.AddWithValue("#fullname", lblFullname01.Text);
using(SqlDataAdapter adp = new SqlDataAdapter(cmd))
{
DataTable dt = new DataTable();
adp.Fill(dt);
if(dt.Rows.Count > 0)
{
rptrTRFFormItems.DataSource = dt;
rptrTRFFormItems.DataBind();
ViewState["CurrentTable"] = dt;
}
else
{
SetInitialRow();
}
}
}
}
and here's my stored procedure sql query
SELECT
[TRFGName] as Name
,[TRFGDate] as [Date]
,[TRFGTimeRef] as PreferredTime
,[TRFGFrom] as FromRptr
,[TRFGTo] as ToRptr
,[TRFGNo]
,[TRFGControlNo]
,[TRFRequester]
FROM [TRAVELREQUESTFORM].[TRAVEL].[TRAVELGRID] WHERE TRFGControlNo = #trfNo and TRFRequester = #fullname

how to get selected value of dropdownlist on nested gridview row command

how can i get selected value of dropdownlist on nested gridview row command.
I have a nested gridview in my page, inside of second gridview i want to use a drop down list for Driver. I am trying to get the selected value for that drop down list but unable to got it in gridview rowcommand. i try button click event also but i am unable to got it.
<asp:GridView ID="dtgNewTrips" runat="server" AllowPaging="true" AutoGenerateColumns="false" CssClass="table table-striped table-bordered table-hover" OnRowDataBound="dtgNewTrips_RowDataBound" DataKeyNames="Trips_ID">
<Columns>
<asp:TemplateField ItemStyle-Width="20px">
<ItemTemplate>
<a href="JavaScript:ViewDetails('div<%# Eval(" Trips_ID ") %>');">
<img alt="City" id="imgdiv<%# Eval("Trips_ID") %>" src="Images/Icons/plusicon.png" />
</a>
<div id="div<%# Eval(" Trips_ID ") %>" style="display: none;">
<asp:GridView ID="dtgViewDetails" runat="server" AutoGenerateColumns="false" DataKeyNames="Trips_ID" CssClass="ChildGrid" ShowHeader="false" OnRowDataBound="dtgViewDetails_RowDataBound" OnRowCommand="dtgViewDetails_RowCommand">
<Columns>
<asp:TemplateField ShowHeader="false">
<ItemTemplate>
<div>
<table style="width: 100%;">
<tr>
<td>Adults:
<asp:Label ID="lblTrip_ID" runat="server" Text='<%#Eval("Trips_ID") %>' Visible="false"></asp:Label>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("AdultsCount") %>'></asp:Label>
</td>
<td>Children:
<asp:Label ID="Label2" runat="server" Text='<%#Eval("ChildrensCount") %>'></asp:Label>
</td>
<td>Passenger Comments:
<asp:Label ID="Label4" runat="server" Text='<%#Eval("PassengerComments") %>'></asp:Label>
</td>
</tr>
<tr>
<td>Trip Stops:</td>
<td>
<asp:Label ID="Label3" runat="server" Text='<%#Eval("TripStops") %>'></asp:Label>
</td>
<td>TripStops Comments:
<asp:Label ID="Label5" runat="server" Text='<%#Eval("TripStopsComments") %>'></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlDriver" runat="server" DataTextField="DriverName" DataValueField="DriversInfo_ID" CssClass="form-control" AutoPostBack="false"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>
<asp:Button ID="btnAssign" runat="server" Text="Assign To Driver" CssClass="btn btn-primary" CommandArgument='<%# ((GridViewRow)Container).RowIndex %>' CommandName="Assign" />
</td>
<td>
<asp:Button ID="btnAssignToAll" runat="server" OnClick="btnAssignToAll_Click" Text="Notify All Drivers" CssClass="btn btn-primary" />
<asp:Button ID="btnCancelTrip" runat="server" OnClick="btnCancelTrip_Click" Text="Cancel Trip" CssClass="btn btn-warning" />
</td>
</tr>
</table>
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Trip No">
<ItemTemplate>
<asp:Label ID="lblTripRefID" runat="server" Text='<%#Eval("TripRefID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Customer Name">
<ItemTemplate>
<asp:Label ID="lblCompanyName" runat="server" Text='<%#Eval("CompanyName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Pickup Location">
<ItemTemplate>
<asp:Label ID="lblPickupLocation" runat="server" Text='<%#Eval("PickupLocation") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
C# Code
protected void dtgViewDetails_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Assign")
{
int rowIndex = Convert.ToInt32(e.CommandArgument);
GridView grid = (GridView)sender;
if (grid.ID == "dtgViewDetails")
{
Label lblTrip_ID = (Label)grid.Rows[rowIndex].FindControl("lblTrip_ID");
DropDownList ddlDriver = (DropDownList)grid.Rows[rowIndex].FindControl("ddlDriver");
}
}
}
But i get the by default of dropdownlist that zeroth index value.
please help me..
thanks in advance..

How I can open a ModalDialog about a LinkButton from a ListView

I want open a Dialog with Controls and it must open if I click on a LinkButton in a ListView. I want make it with a CommandName and OnCommand Argumen.
My Application:
In My Application can a User search other Users about a textBox and list the users in a ListView. Than he can display more Informations about one User if the user click on the LinkButton.
If I make it about a normal Button, the Dialog open but if I make it about the LinkButton with CommandName it Don't work.
My Code:
<form id="form1" runat="server">
<asp:HiddenField ID="hidForModel" runat="server" />
<asp:scriptmanager id="ScriptManager1" runat="server">
</asp:scriptmanager>
<asp:modalpopupextender id="ModalPopupExtender1"
runat="server" cancelcontrolid="btnCancel"
okcontrolid="btnOkay" targetcontrolid="hidForModel"
popupcontrolid="Panel1" popupdraghandlecontrolid="PopupHeader"
drag="true" backgroundcssclass="ModalPopupBG">
</asp:modalpopupextender>
<div class="popupConfirmation" id="Panel1" >
<asp:Panel runat="server" ID="PopupHeader" CssClass="modalPopup">Benutzerinformationen</asp:Panel>
<div class="Body">
Hallo
<asp:Button id="btnOkay" runat="server" text="Speichern" />
<asp:Button id="btnCancel" runat="server" text="Abbrechen" />
</div>
</div>
<div class="header">
<table id="SuchTabelle" runat="server" border="0">
<tr>
<th><asp:Label ID="id_SearchUser" runat="server" Text="lblSearchUser"></asp:Label></th>
<th><asp:TextBox ID="txtBenutzer" runat="server" Width="250px"></asp:TextBox></th>
</tr>
<tr>
<th><asp:Label ID="id_location" runat="server" Text="lblLocation"></asp:Label></th>
<th><asp:DropDownList ID="dropWerk" runat="server" Width="250px" /></th>
<th><asp:Button ID="Button2" runat="server" Text="Suchen"
onclick="btnBenutzerSuchen_Click" Width="219px" /></th>
</tr>
</table>
<div id="bild">
<asp:Image runat="server" ImageUrl="~/App_Theme/lw_logo.jpg" Height="58px"
Width="277px" />
</div>
</div>
<div class="bodyList">
<asp:ListView runat="server" ID="myListView">
<LayoutTemplate>
<table id="UserTable" runat="server" border="0" width="800" cellpadding="0" cellspacing="0">
<tr style="background-color:#E5E5FE" class="TableClass">
<th id="th1" runat="server"><asp:LinkButton ID="lnkBenutzer" runat="server" >id_Benutzer</asp:LinkButton></th>
<th id="th2" runat="server"><asp:LinkButton ID="lnkemail" runat="server" >id_Email</asp:LinkButton></th>
<th id="th3" runat="server"><asp:LinkButton ID="lnkVorname" runat="server" >id_Vorname</asp:LinkButton></th>
<th id="th4" runat="server"><asp:LinkButton ID="lnkNachname" runat="server" >id_Nachname</asp:LinkButton></th>
<th id="th5" runat="server"><asp:LinkButton ID="lnkTelefon" runat="server" >id_Telefon</asp:LinkButton></th>
</tr>
<tr runat="server" id="ItemPlaceholder">
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr class="TableClass">
<td align="left" ><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label1" Text='<%# Eval("Benutzername") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label2" Text='<%# Eval("eMail") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label3" Text='<%# Eval("Vorname") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label4" Text='<%# Eval("Nachname") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label5" Text='<%# Eval("Telefonnummer") %>' runat="server" /></td>
<td align="left"><asp:Label ID="Label6" Text='<%# Eval("GUID") %>' runat="server" Visible="False" /></td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr class="TableClass">
<td align="left" ><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label1" Text='<%# Eval("Benutzername") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label2" Text='<%# Eval("eMail") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label3" Text='<%# Eval("Vorname") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label4" Text='<%# Eval("Nachname") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label5" Text='<%# Eval("Telefonnummer") %>' runat="server" /></td>
<td align="left"><asp:Label ID="Label6" Text='<%# Eval("GUID") %>' runat="server" Visible="False" /></td>
</tr>
</AlternatingItemTemplate>
</asp:ListView>
<br />
<br />
</div>
</form>
My C# Code:
protected void Button1_Command(object sender, CommandEventArgs e)
{
if (e.CommandName == "Select")
{
ModalPopupExtender1.Show(); // error :(
}
}
My Errortext:
System.InvalidOperationException: The ListView "myListView" has one SelectedIndexChanging-Event execute, which was not treated.
I need help :(
The Update:
protected void myListView_ItemCommand(object sender, ListViewCommandEventArgs e)
{
if (e.CommandName == "Select")
{
txtVorname.Text = "test";
PopUpDialog.Show(); //<-- Here is the error
}
}
I make a breakpoint and see ...
tarasov
Try this:
Handle "ItemCommand" Event of "ListView":
protected void myListView_ItemCommand(object sender, ListViewCommandEventArgs e)
{
if (String.Equals(e.CommandName, "Select"))
{
ModalPopupExtender1.Show();
//your code
}
}

How do I set my Web Form in the jQuery Modal Dialog and use this?

I have a ASP.NET application for list all search User in a ListView in "BenutzerListe.aspx". A client user can select a User and show that user's Properties in an extra Web Form, named "benutzer.aspx". In "Benutzer.aspx", the user can change these Properties.
I want show this informations, not in a second Web Form, but in a Dialog, create by jQuery. I hear that I can input my "Benutzer.aspx" in the dialog.
How I can do this?
My Idea:
aspx:
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="~/BenutzerListe.aspx.cs" Inherits="BenutzerListe.BenutzerListe" %>
<!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>
<script src="Scripte/jquery-1.7.2.js" type="text/javascript"></script>
<link href="~/App_Theme/BenutzerListeStyle.css" type="text/css" rel="Stylesheet" />
<style type="text/css">
#SuchTabelle
{
width: 587px;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
$("#Button2").click(function (event) {
//How I open a Dialog with Benutzer.aspx
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div class="header">
<table id="SuchTabelle" runat="server" border="0">
<tr>
<th><asp:Label ID="id_SearchUser" runat="server" Text="lblSearchUser"></asp:Label></th>
<th><asp:TextBox ID="txtBenutzer" runat="server" Width="250px"></asp:TextBox></th>
</tr>
<tr>
<th><asp:Label ID="id_location" runat="server" Text="lblLocation"></asp:Label></th>
<th><asp:DropDownList ID="dropWerk" runat="server" Width="250px" /></th>
<th><asp:Button ID="Button2" runat="server" Text="Suchen"
onclick="btnBenutzerSuchen_Click" Width="219px" /></th>
</tr>
</table>
<div id="bild">
<asp:Image runat="server" ImageUrl="~/App_Theme/lw_logo.jpg" Height="58px"
Width="277px" />
</div>
<div id="meldung">
<asp:Label runat="server" ID="lblMeldung"></asp:Label>
</div>
</div>
<div class="bodyList">
<asp:ListView runat="server" ID="myListView">
<LayoutTemplate>
<table id="UserTable" runat="server" border="0" width="800" cellpadding="0" cellspacing="0">
<tr style="background-color:#E5E5FE" class="TableClass">
<th id="th1" runat="server"><asp:LinkButton ID="lnkBenutzer" runat="server" >id_Benutzer</asp:LinkButton></th>
<th id="th2" runat="server"><asp:LinkButton ID="lnkemail" runat="server" >id_Email</asp:LinkButton></th>
<th id="th3" runat="server"><asp:LinkButton ID="lnkVorname" runat="server" >id_Vorname</asp:LinkButton></th>
<th id="th4" runat="server"><asp:LinkButton ID="lnkNachname" runat="server" >id_Nachname</asp:LinkButton></th>
<th id="th5" runat="server"><asp:LinkButton ID="lnkTelefon" runat="server" >id_Telefon</asp:LinkButton></th>
</tr>
<tr runat="server" id="ItemPlaceholder">
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr class="TableClass">
<td align="left" ><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label1" Text='<%# Eval("Benutzername") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label2" Text='<%# Eval("eMail") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label3" Text='<%# Eval("Vorname") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label4" Text='<%# Eval("Nachname") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label5" Text='<%# Eval("Telefonnummer") %>' runat="server" /></td>
<td align="left"><asp:Label ID="Label6" Text='<%# Eval("GUID") %>' runat="server" Visible="False" /></td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr class="TableClass">
<td align="left" ><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label1" Text='<%# Eval("Benutzername") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label2" Text='<%# Eval("eMail") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label3" Text='<%# Eval("Vorname") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label4" Text='<%# Eval("Nachname") %>' runat="server" /></td>
<td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label5" Text='<%# Eval("Telefonnummer") %>' runat="server" /></td>
<td align="left"><asp:Label ID="Label6" Text='<%# Eval("GUID") %>' runat="server" Visible="False" /></td>
</tr>
</AlternatingItemTemplate>
</asp:ListView>
<br />
<br />
</div>
</form>
</body>
</html>
Try if this helps:
http://msdn.microsoft.com/en-us/library/ie/ms536759(v=vs.85).aspx
You could do something as simple with the JQUERY UI dialog:
In your page:
<div id="dialog">
<iframe src="Benutzer.aspx"></iframe>
</div>
In your jquery function:
$(document).ready(function () {
$("#Button2").click(function (event) {
$( "#dialog" ).dialog();
});

How to increase row of a repeater as text increases?

How to increase row of a repeater as text increases? I am using a repeater to display image , and image description .if image description contains more character , the text is overlapping with the other rows . how can i solve this problem?
<HeaderTemplate>
<div class="HeaderStyle">
<div class="HeaderStyle5">Edit</div>
<div class="HeaderStyle5">Delete</div>
<div class="HeaderStyle1">Image</div>
<div class="HeaderStyle2">ImageDescription</div>
</div>
<ul id="defaultList">
</HeaderTemplate>
<ItemTemplate>
<li id='item_<%# Container.ItemIndex + 1 %>' originalId='<%# DataBinder.Eval(Container.DataItem, "ImageId") %>' class="itemStyle">
<div class="itemStyle">
<div class="itemStyle4"> <asp:HyperLink ID="LinkButton2" runat="server" Text="Edit" NavigateUrl='<%#Request.Url.AbsoluteUri+"&ImageId="+ DataBinder.Eval(Container.DataItem, "ImageId") %>'></asp:HyperLink> </div>
<div class="itemStyle5">
<asp:LinkButton ID="lnkDelete" runat="server"
CommandName='<%# DataBinder.Eval(Container.DataItem, "ImageId") %>' CommandArgument='<%# DataBinder.Eval(Container.DataItem, "SortId") %>' OnClientClick="return confirm('Are you sure , you want to delete..?');" OnCommand="Calling_Delete" >Delete</asp:LinkButton> </div>
<div class="itemStyle1"><asp:Image ID="Image1" runat="server" ImageUrl='<%# DataBinder.Eval(Container.DataItem, "ImageUrl") %> ' Height="50px" Width="50px" /> </div>
<div><%# DataBinder.Eval(Container.DataItem, "ImageDesc") %> </div>
</div>
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
Use
myRepeater.Attributes["Style"] = "OVERFLOW-Y:auto;";

Categories

Resources