New to using the ListView control and I'm trying to retrieve the value of some textboxes in the layout template. Here's my aspx code:
<asp:ListView
ID="lvFundingSummary"
OnItemCommand="lvFundingSummary_onItemCommand"
OnItemDataBound="lvFundingSummary_ItemDataBound"
runat="server" >
<EmptyDataTemplate>
<table
id="Table1"
runat="server"
style="background-color: #FFFFFF;
border-collapse: collapse;
border-color: #999999;
border-style:none;
border-width:1px;">
<tr>
<td>No data was returned.</td>
</tr>
</table>
</EmptyDataTemplate>
<ItemTemplate>
<tr>
<td style="width: 50%; text-align:left; padding-top: 5px; padding-bottom:5px;">
<asp:Label ID="lblResearchArea" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "PlName")%>' />
</td>
<td style="width: 30%; text-align:right; padding-top: 5px; padding-bottom:5px;">
<asp:Label ID="lblFundingGross" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "FundingGross", "{0:c}")%>' />
</td>
<td style="width: 20%; text-align:right; padding-top: 5px; padding-bottom:5px;">
<asp:Label ID="lblGross" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "AllGross", "{0:c}")%>' />
</td>
</tr>
</ItemTemplate>
<LayoutTemplate>
<table id="Table2" style="width: 90%" runat="server">
<tr id="Tr1" runat="server">
<td id="Td1" runat="server" width="100%">
<table
ID="itemPlaceholderContainer"
runat="server"
style="width: 98%">
<tr id="TrHeading" runat="server">
<th id="Th1" style="width: 50%; text-align:left;" runat="server">
Research Area</th>
<th id="Th2" style="width: 30%; text-align:right;" runat="server">
Gross</th>
<th id="Th3" style="width: 20%; text-align:right;" runat="server">
All Gross</th>
</tr>
</table>
<div style="overflow-y:scroll; height:400px;">
<table style="border: 10px; width: 100%">
<tr ID="itemPlaceholder" runat="server"></tr>
</table>
</div>
</td>
</tr>
<tr id="Tr2" runat="server">
<td id="Td2" runat="server"
style="text-align: center;background-color: #5D7B9D;font-family: Verdana, Arial, Helvetica, sans-serif;color: #FFFFFF">
</td>
</tr>
<tr id="TrFooter" runat="server">
<td style="width: 50%; text-align:left;">
<b>Total(s)</b>
</td>
<td id="TdTotal" style="width: 30%; text-align:right;">
<b>
<asp:Label ID="lblTotalFunding" runat="server" /></b>
</td>
<td id="TdTotal" style="width: 20%; text-align:left;">
<b>
<asp:Label ID="lblTotalGross" runat="server" /></b>
</td>
</tr>
</table>
</LayoutTemplate>
</asp:ListView>
in the lvFundingSummary_PreRender event, I'm trying to access the control as such:
Label lbTotFund = this.lvFundingSummary.FindControl("TrFooter").FindControl("lblTotalFunding") as Label
but that's not working. I know this should be a snap, just can't quite seem to find it.
According to this post, use
var lbTotFund = lvFundingSummary.FindControl("lblTotalFunding") as Label;
in lvFundingSummary_LayoutCreated event, it should do the work
Related
I have a repeater which has table as per below code and I need to send param to code behind when table row is clicked.
At the moment I am passing it on LinkButton1 click.
I have also tried wrapping in LinkButton but it's not working
How do I do this?
<asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand" OnItemDataBound="Repeater1_ItemDataBound" OnItemCreated="Repeater1_ItemCreated">
<HeaderTemplate>
<table class="table table-striped table-bordered dttable dataTable no-footer" style="border-style: solid; border-color: rgb(252, 253, 250); text-align: center; font-weight: 700; width: 100%;" id="JsDataTable" role="grid" aria-describedby="JsDataTable_info">
<thead style="width: 100%">
<tr style="color: #fff; width: 100%;">
<td id="tdSr">Sr</td>
<td id="tdCode" style="white-space: nowrap;">
<asp:LinkButton ID="lnCode" runat="server" CommandName="CourseNo" CssClass="linkHeader">Code<i class = "fa fa-fw fa-sort" ></i></asp:LinkButton>
</td>
<td id="tdName" style="width: 50%; white-space: nowrap; text-align: left;">
<asp:LinkButton ID="lnName" runat="server" CommandName="VName" CssClass="linkHeader">Name<i class = "fa fa-fw fa-sort" ></i></asp:LinkButton>
</td>
<td id="tdType" style="width: 20%">
<asp:LinkButton ID="lnType" runat="server" CommandName="VType" CssClass="linkHeader">Type<i class = "fa fa-fw fa-sort" ></i></asp:LinkButton>
</td>
</tr>
</thead>
<tbody style="width: 100%">
</HeaderTemplate>
<ItemTemplate>
<tr id="trID" runat="server" class="box" style="height: 30px; color: #08516F; vertical-align: middle;">
<td style="color: #004457; border-right: 1px solid #004457; vertical-align: middle;" class="labelTxt">
<asp:HiddenField ID="hfAllowSubscription" runat="server" Value='<%#Eval("AllowSubscription") %>' />
<asp:Label ID="lblSR" runat="server"></asp:Label>
</td>
<td style="color: #004457; border-right: 1px solid #004457; vertical-align: middle;">
<%#Eval("CourseNo") %>
</td>
<td style="color: #004457; border-right: 1px solid #004457; text-align: left !important; vertical-align: middle;">
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="PlayPrev" CommandArgument='<%#Eval("Id") %>' Text='<%#Eval("Name") %>' CssClass="name"></asp:LinkButton>
</td>
<td style="color: #004457; border-right: 1px solid #004457; vertical-align: middle;">
<asp:Label Text='<%#Eval("VType") %>' runat="server" ID="lblType" CssClass="lblType" Style="font-family: 'Segoe UI semiBold' !important;"></asp:Label>
<span id="lblsubtype" runat="server" class="subtype_color T"></span>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
<div id="repeatorEmptyRow" runat="server" style="text-align: center; color: red;">
No matching records found
</div>
</FooterTemplate>
</asp:Repeater>
I'm guessing you want the value of the CommandArgument in Repeater1_ItemCommand. But if you try to cast the sender to a LinkButton that will not work because the Sender is the Repeater, not the button inside.
So cast the CommandSource and get the correct value.
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
{
LinkButton lb = e.CommandSource as LinkButton;
Label1.Text = lb.CommandArgument;
}
You cannot bind a tr click directly, so you have to use a trick. You can use jQUery to set the click of the LinkButton to the row itself.
<table border="1" id="Repeater1Table">
<asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand">
<ItemTemplate>
<tr>
<td>Click here</td>
<td>
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="PlayPrev" CommandArgument='<%#Eval("Id") %>' Text='<%#Eval("Name") %>' CssClass="name"></asp:LinkButton>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
<script type="text/javascript">
$(document).ready(function () {
$("#Repeater1Table tr").each(function () {
var href = $(this).find(".name").prop("href").split(":")[1];
$(this).attr("onclick", href);
});
});
</script>
I know that this question has been posted a few times but I've tried every answer in those without finding a solution.
My problem is that none of my controls (in a specific aspx file) is showing in the designer file. This makes it hard to access some of the controls from the code-behind.
What I've tried:
Tried just saving the .aspx file to regenerate the designer file. (nothing happens)
I've deleted the designer file and pressed "Convert to web application". Which gets me back my designer file. But it's still empty.
Tried removing all the code and saving then pasting the code back in (no success)
Tried changing Codebehind="" to CodeFile="" and back again with no success.
What am I missing?!
I'm on Visual Studio 2013, latest version.
Aspx file
<%# Page Language="C#" MasterPageFile="Framework/Email.master" Inherits="OrderConfirmationEmail1" EnableViewState="false" Codebehind="OrderConfirmationEmail1.aspx.cs" AutoEventWireup="True" %>
<asp:Content ContentPlaceHolderID="Content" runat="server">
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<web:UsePage runat="server" StructureLevel="1">
<web:PageLink runat="server">
<site:UseWebsiteSettings runat="server">
<web:Image runat="server" MaxWidth="200" Name="Logotype1" />
</site:UseWebsiteSettings>
</web:PageLink>
</web:UsePage>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"> </td></tr>
<tr>
<td style="font: bold 16px Arial, Sans-serif;"><web:Text runat="server" Name="Title" /></td>
<td style="font: bold 16px Arial, Sans-serif; text-align: right;"><web:Text runat="server" Name="OrderNumberLabel" /> <Ecom:OrderID runat="server"></Ecom:OrderID></td>
</tr>
<tr><td colspan="2"> </td></tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td bgcolor="#f6f6f6" style="font: 14px Arial, Sans-serif;"><strong><web:Text runat="server" Name="DeliveryTitle" /></strong></td>
</tr>
<tr>
<td style="font: 14px Arial, Sans-serif;">
<Ecom:DeliveryRepeater runat="server">
<ItemTemplate>
<Ecom:FirstName runat="server" />
<Ecom:LastName runat="server" /><br/>
<Ecom:Address1 runat="server" />
<Ecom:Address2 runat="server" /><br/>
<Ecom:Zip runat="server" />
<Ecom:City runat="server" /><br/>
<Ecom:Country runat="server" /><br/>
<Ecom:Phone runat="server" />
</ItemTemplate>
</Ecom:DeliveryRepeater>
</td>
</tr>
<tr><td> </td></tr>
</table>
<%// Order rows %>
<Ecom:OrderRowRepeater runat="server" OnItemDataBound="OnOrderItemDataBound" OnItemCreated="OnOrderItemCreated" RenderEmpty="True">
<HeaderTemplate>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td bgcolor="#f6f6f6" style="font: 14px Arial, Sans-serif;">
<strong><web:Text Name="OrderProductsColumnTitle" runat="server" /></strong>
</td>
<td bgcolor="#f6f6f6" style="text-align: right;font: 14px Arial, Sans-serif;">
<strong><web:Text Name="OrderQuantityColumnTitle" runat="server" /></strong>
</td>
<td bgcolor="#f6f6f6" style="text-align: right;font: 14px Arial, Sans-serif;">
<strong><web:Text Name="OrderPriceColumnTitle" runat="server" /></strong>
</td>
<td bgcolor="#f6f6f6" style="text-align: right;font: 14px Arial, Sans-serif;">
<strong><web:Text Name="OrderTotalColumnTitle" runat="server" /></strong>
</td>
</tr>
</HeaderTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
<ItemTemplate>
<tr>
<td style="font: 14px Arial, Sans-serif;">
<strong><PC:DisplayName runat="server" /></strong>
</td>
<td style="text-align: right; font: 14px Arial, Sans-serif;">
<Ecom:OrderRowQuantity runat="server" />
<web:Text runat="server" Name="OrderRowQuantityAbbreviation"/>
</td>
<td style="text-align: right; font: 14px Arial, Sans-serif;">
<Ecom:OrderRowHasCampaign runat="server">
<OnTrue>
<Ecom:OrderRowCampaignPrice DisplayCurrencySymbol="true" runat="server" />
</OnTrue>
<OnFalse>
<Ecom:OrderRowListPrice runat="server" DisplayCurrencySymbol="true" />
</OnFalse>
</Ecom:OrderRowHasCampaign>
</td>
<td style="text-align: right; font: 14px Arial, Sans-serif;">
<Ecom:OrderRowTotalPrice DisplayCurrencySymbol="true" runat="server" />
</td>
</tr>
</ItemTemplate>
</Ecom:OrderRowRepeater>
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<td style="font: 14px Arial, Sans-serif;">
<web:Text Name="OrderRowDiscountTitle" runat="server" />
</td>
<td></td>
<td style="text-align: right; font: 14px Arial, Sans-serif;">
<Ecom:OrderTotalDiscountAmount DisplayCurrencySymbol="true" runat="server" />
</td>
</tr>
<tr>
<td style="font: 14px Arial, Sans-serif;">
<web:Text Name="OrderRowDeliveryMethodTitle" runat="server" />
</td>
<td style="font: 14px Arial, Sans-serif;">
<Ecom:DeliveryMethodDisplayName runat="server" />
</td>
<td style="text-align: right; font: 14px Arial, Sans-serif;">
<Ecom:OrderTotalDeliveryCost DisplayCurrencySymbol="true" runat="server" />
</td>
</tr>
<tr>
<td style="font: 14px Arial, Sans-serif;">
<web:Text Name="OrderRowPaymentMethodTitle" runat="server" />
</td>
<td style="font: 14px Arial, Sans-serif;">
<Ecom:PaymentMethodDisplayName runat="server" />
</td>
<td style="text-align: right; font: 14px Arial, Sans-serif;">
<Ecom:OrderTotalFee DisplayCurrencySymbol="True" runat="server" />
</td>
</tr>
<tr class="grandtotal">
<td style="font: 18px Arial, Sans-serif;">
<web:Text Name="OrderRowTotalTitle" runat="server" />
</td>
<td></td>
<td style="text-align: right; font: 18px Arial, Sans-serif;">
<Ecom:OrderGrandTotal DisplayCurrencySymbol="true" runat="server" />
</td>
</tr>
<tr>
<td style="font: 14px Arial, Sans-serif;">
<web:Text Name="OrderRowWhereOfVATTitle" runat="server" />
</td>
<td></td>
<td style="text-align: right; font: 14px Arial, Sans-serif;">
<Ecom:OrderTotalVAT DisplayCurrencySymbol="true" runat="server" />
</td>
</tr>
</tbody>
</table>
<web:ValueExists ID="TrackingContainer" runat="server" Name="TrackingUrlInformation">
<OnTrue>
<asp:HyperLink ID="TrackingLink" runat="server" CssClass="tracking-link" Target="_blank"><web:Text runat="server" Name="TrackingUrlText"/></asp:HyperLink>
<div style="padding: 20px 0; font: 14px Arial, Sans-serif;">
<web:Text Name="TrackingUrlInformation" runat="server" />
</div>
</OnTrue>
</web:ValueExists>
<web:ValueExists runat="server" Name="Text1">
<OnTrue>
<div style="padding: 20px 0; font: 14px Arial, Sans-serif;">
<web:Text Name="Text1" runat="server" />
</div>
</OnTrue>
</web:ValueExists>
</td>
</tr>
</table>
<web:Text runat="server" Name="OrderRowQuantityAbbreviation" Visible="false"/>
Solved
Not sure what I did but eventually it worked. Sorry, for anyone in the same position.
I have an HTML table that is generated for printing purposes. It has a Repeater that populates from a DataSet built from SQL; so the total row count is unknown.
The issue is when the page is printed, table rows that are supposed to be together are separated between the end of the previous page and the beginning of the next page. I need to insert a Page-Break to keep the table rows together. With most efforts made found from Google Searches, the table row for the "Standard" keeps getting pushed to the next page. Other methods just create 10+ blank pages first then the table with "Standard" on the next pages.
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
<style type="text/css">
body {
font-family: Arial;
font-size: 10pt;
}
table {
border-collapse: collapse;
}
.alignL {
text-align: left;
}
.alignC {
text-align: center;
}
.alignR {
text-align: right;
}
.border1 {
border-color: black;
border-style: groove;
border-width: 2px;
white-space: nowrap;
}
.border1L {
border-color: black;
border-style: groove;
border-width: 2px;
border-right: none;
height: 35px;
font-size: 12pt;
}
.border1R {
background-image: url(../_images/LgtGrey.png);
border-color: black;
border-style: groove;
border-width: 2px;
font-size: 12pt;
border-left: none;
}
.border2 {
border-color: black;
border-style: groove;
border-width: 2px;
border-bottom: none;
width: 60px;
}
.border3 {
border-color: black;
border-style: groove;
border-width: 2px;
border-top: none;
width: 60px;
}
.borderBottom {
border-bottom-color: black;
border-bottom-style: groove;
border-bottom-width: 2px;
}
.center {
margin-right: auto;
margin-left: auto;
width: 11in;
}
</style>
<style media="print" type="text/css">
#page {
size: landscape;
}
#media print {
thead {
display: table-header-group;
}
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div class="page">
<div class="center">
<table class="alignC" style="width: 90%">
<thead>
<tr>
<th> </th>
</tr>
<tr>
<th colspan="16" class="alignC">
<h3 class="alignC">Technical Evaluation Worksheet</h3>
</th>
</tr>
<tr>
<th> </th>
</tr>
<tr>
<th> </th>
<th colspan="2" class="border1L alignR">
<asp:Label ID="Label1" runat="server" Text="Model: " Font-Bold="true" /></th>
<th colspan="2" class="border1R alignC">
<asp:Label ID="lblModel" runat="server" /></th>
<th> </th>
<th colspan="2" class="border1L alignR">
<asp:Label ID="Label2" runat="server" Text="Serial #: " Font-Bold="true" /></th>
<th colspan="2" class="border1R alignC">
<asp:Label ID="lblSN" runat="server" /></th>
<th> </th>
<th colspan="2" class="border1L alignR">
<asp:Label ID="Label3" runat="server" Text="Program: " Font-Bold="true" /></th>
<th colspan="2" class="border1R alignC">
<asp:Label ID="lblProgram" runat="server" /></th>
</tr>
<tr>
<th> </th>
</tr>
</thead>
<tbody>
<tr class="alignC">
<td></td>
<td colspan="4" class="border1">(FQA)</td>
<td></td>
<td colspan="4" class="border1">(MTF)</td>
<td></td>
<td colspan="4" class="border1">(FA)</td>
</tr>
<tr>
<td> </td>
<td class="border2 alignC">Record<br />
Error</td>
<td class="border2 alignC">Circle X</td>
<td class="border2 alignC">Red X</td>
<td class="border2 alignC">Diagonal</td>
<td> </td>
<td class="border2 alignC">Record<br />
Error</td>
<td class="border2 alignC">Circle X</td>
<td class="border2 alignC">Red X</td>
<td class="border2 alignC">Diagonal</td>
<td> </td>
<td class="border2 alignC">Record<br />
Error</td>
<td class="border2 alignC">Circle X</td>
<td class="border2 alignC">Red X</td>
<td class="border2 alignC">Diagonal</td>
<td rowspan="3" class="border2 alignC"><b>Quality<br />
Score</b></td>
</tr>
<tr>
<td valign="bottom" class="border1 alignR">Deduction</td>
<td valign="bottom" class="border3 alignC">-1%</td>
<td valign="bottom" class="border3 alignC">-2%</td>
<td valign="bottom" class="border3 alignC">-4%</td>
<td valign="bottom" class="border3 alignC">0%</td>
<td> </td>
<td valign="bottom" class="border3 alignC">-1%</td>
<td valign="bottom" class="border3 alignC">-2%</td>
<td valign="bottom" class="border3 alignC">-4%</td>
<td valign="bottom" class="border3 alignC">0%</td>
<td> </td>
<td valign="bottom" class="border3 alignC">-1%</td>
<td valign="bottom" class="border3 alignC">-2%</td>
<td valign="bottom" class="border3 alignC">-4%</td>
<td valign="bottom" class="border3 alignC">0%</td>
</tr>
<tr class="alignC">
<td class="border1 alignR"># of Incidents</td>
<td class="border1" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblFQA1" runat="server" /></td>
<td class="border1" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblFQA2" runat="server" /></td>
<td class="border1" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblFQA3" runat="server" /></td>
<td class="border1" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblFQA4" runat="server" /></td>
<td> </td>
<td class="border1" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblMTF1" runat="server" /></td>
<td class="border1" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblMTF2" runat="server" /></td>
<td class="border1" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblMTF3" runat="server" /></td>
<td class="border1" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblMTF4" runat="server" /></td>
<td> </td>
<td class="border1" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblFA1" runat="server" /></td>
<td class="border1" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblFA2" runat="server" /></td>
<td class="border1" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblFA3" runat="server" /></td>
<td class="border1" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblFA4" runat="server" /></td>
</tr>
<tr class="alignC">
<td class="border1 alignR">Total</td>
<td class="border1">
<asp:Label ID="lblTFQA1" runat="server" Text="0%" /></td>
<td class="border1">
<asp:Label ID="lblTFQA2" runat="server" Text="0%" /></td>
<td class="border1">
<asp:Label ID="lblTFQA3" runat="server" Text="0%" /></td>
<td class="border1">
<asp:Label ID="lblTFQA4" runat="server" Text="0%" /></td>
<td> </td>
<td class="border1">
<asp:Label ID="lblTMTF1" runat="server" Text="0%" /></td>
<td class="border1">
<asp:Label ID="lblTMTF2" runat="server" Text="0%" /></td>
<td class="border1">
<asp:Label ID="lblTMTF3" runat="server" Text="0%" /></td>
<td class="border1">
<asp:Label ID="lblTMTF4" runat="server" Text="0%" /></td>
<td> </td>
<td class="border1">
<asp:Label ID="lblTFA1" runat="server" Text="0%" /></td>
<td class="border1">
<asp:Label ID="lblTFA2" runat="server" Text="0%" /></td>
<td class="border1">
<asp:Label ID="lblTFA3" runat="server" Text="0%" /></td>
<td class="border1">
<asp:Label ID="lblTFA4" runat="server" Text="0%" /></td>
<td class="border1">
<asp:Label ID="lblTotal" runat="server" Font-Bold="true" /></td>
</tr>
<tr>
<td> </td>
</tr>
<asp:Repeater ID="Repeater" runat="server">
<ItemTemplate>
<tr>
<td class="borderBottom alignR"><b>Auditor:</b></td>
<td colspan="5" class="borderBottom alignC" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblAuditor" runat="server" Text='<%# Eval("Auditor") %>' /></td>
<td class="borderBottom alignR"><b>CTR:</b></td>
<td colspan="5" class="borderBottom alignC" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblCTR" runat="server" Text='<%# Eval("Mitigator") %>' /></td>
<td class="borderBottom alignR"><b>Date:</b></td>
<td colspan="3" class="borderBottom alignC" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblDate" runat="server" Text='<%# Eval("Date", "{0:dd-MMM-yy}") %>' /></td>
</tr>
<tr>
<td class="borderBottom alignR" style="min-height: 30px"><b>Finding:</b></td>
<td colspan="15" class="borderBottom alignL" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblFinding" runat="server" Text='<%# Eval("Finding") %>' /></td>
</tr>
<tr>
<td class="borderBottom alignR"><b>Status:</b></td>
<td colspan="5" class="borderBottom alignC" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblStatus" runat="server" Text='<%# Eval("FS") %>' /></td>
<td class="borderBottom alignR" colspan="2"><b>Location:</b></td>
<td colspan="8" class="borderBottom alignC" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblLocation" runat="server" Text='<%# Eval("Location") %>' /></td>
</tr>
<tr>
<td class="borderBottom alignR"><b>Standard:</b></td>
<td colspan="15" class="borderBottom alignC" style="background-image: url(../_images/LgtGrey.png)">
<asp:Label ID="lblStandard" runat="server" Text='<%# Eval("Standard") %>' /></td>
</tr>
<tr>
<td> </td>
</tr>
</ItemTemplate>
</asp:Repeater>
</tbody>
</table>
</div>
</div>
</asp:Content>
I am Having a code for Modal PopUp windoe in which I wanna perform login operation and code for extender is as follows.
<div class="wrapper">
<ul id="icons">
<li><asp:ImageButton runat="server" ImageUrl="images/lgn.png" ID="btnimg" CssClass="image" /></li>
</ul>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btnimg" PopupControlID="Panel1" BackgroundCssClass="modalBackground">
</asp:ModalPopupExtender >
<asp:panel id="Panel1" CssClass="popup" runat="server">
<div class="popup">
<div id="PopupHeader" style="height:55px;background-color:#f6f6f6;border-radius:10px;width:348px;font-size:2.7em; "> <font style="margin:30px 0px 0px 20px;vertical-align:middle;color:Black;line-height:1.2em; font-size:37px; font-family: BonvenoCF;"> Login </font></div>
<div class="PopupBody">
<table width="350px" style="vertical-align:middle;text-align:center;">
<tr>
<td style="width:43.5px"> </td>
<td style="width:131.25px"> </td>
<td style="width:131.25px"> </td>
<td style="width:43.5px"> </td>
</tr>
<tr>
<td style="width:43.5px"> </td>
<td style="width:131.25px">
<asp:Label ID="Label1" runat="server" Text="User Name: "></asp:Label>
</td>
<td style="width:131.25px">
<asp:TextBox ID="txtUserName" runat="server" Height="20px" style="border-radius:8px;"> </asp:TextBox>
<asp:TextBoxWatermarkExtender ID="txtUserName_TextBoxWatermarkExtender" runat="server" Enabled="True" TargetControlID="txtUserName"WatermarkText="User Name">
</asp:TextBoxWatermarkExtender>
</td>
<td style="width:43.5px"> </td>
</tr>
<tr>
<td style="width:43.5px"> </td>
<td style="width:131.25px"> </td>
<td style="width:131.25px"> </td>
<td style="width:43.5px"> </td>
</tr>
<tr>
<td style="width:43.5px"> </td>
<td style="width:131.25px">
<asp:Label ID="Label2" runat="server" Text="Password: " ></asp:Label>
</td>
<td style="width:131.25px">
<asp:TextBox ID="txtPassword" runat="server" Height="20px" style="border-radius:8px;"> </asp:TextBox>
<asp:TextBoxWatermarkExtender ID="txtPassword_TextBoxWatermarkExtender"
runat="server" Enabled="True" TargetControlID="txtPassword"
WatermarkText="Password">
</asp:TextBoxWatermarkExtender>
</td>
<td style="width:43.5px"> </td>
</tr>
<tr>
<td style="width:43.5px"> </td>
<td colspan="2">
<asp:Label ID="Label3" runat="server" Text="Invalid User Name Or Password." Visible="False"></asp:Label>
</td>
<td style="width:43.5px"> </td>
</tr>
<tr>
<td style="width: 43.5px"> </td>
<td style="width: 131.25px">
<asp:Button ID="Button2" runat="server" CssClass="button" Text="Login" />
</td>
<td style="width: 131.25px">
<asp:Button ID="Button1" runat="server" CssClass="button" Text="Cancle" /></td>
<td style="width: 43.5px"> </td>
</tr>
<tr>
<td style="width: 43.5px"> </td>
<td style="width: 131.25px">
<asp:LinkButton ID="LinkButton1" runat="server">Forgot Password</asp:LinkButton>
</td>
<td style="width: 131.25px">
<asp:Button ID="Button3" runat="server" CssClass="button" Text="Sign Up" />
</td>
<td style="width: 43.5px"> </td>
</tr>
</table>
</div>
</div>
</asp:panel>
</div>
on button2_Click code behind is as follows.
protected void Button2_Click(object sender, EventArgs e)
{
ds = obj.sel("select UserName and Password from tblUserMaster where UserName='"+txtUserName.Text+"' AND Password='"+txtPassword.Text+"'");
if (ds.Tables[0].Rows.Count == 0)
{
Label3.Visible = true;
}
else
{
Response.Redirect("Default.aspx");
}
}
But when i'm clicking on LOGIN Button it is not redirection me on Default.aspx page popup is getting closed.
while on clicking on cancel button it is not working at all.
please suggest an solution as soon as possible.
use update panel for refreshing problem .
here is complete code .
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div class="wrapper">
<ul id="icons">
<li><asp:ImageButton runat="server" ImageUrl="images/lgn.png" ID="btnimg" CssClass="image" /></li>
</ul>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btnimg" PopupControlID="Panel1" BackgroundCssClass="modalBackground" CancelControlID="Button1"></asp:ModalPopupExtender>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Panel ID="Panel1" CssClass="popup" runat="server">
<div class="popup">
<div id="PopupHeader" style="height: 55px; background-color: #f6f6f6; border-radius: 10px; width: 348px; font-size: 2.7em;"><font style="margin: 30px 0px 0px 20px; vertical-align: middle; color: Black; line-height: 1.2em; font-size: 37px; font-family: BonvenoCF;"> Login </font></div>
<div class="PopupBody">
<table width="350px" style="vertical-align: middle; text-align: center;">
<tr>
<td style="width: 43.5px"> </td>
<td style="width: 131.25px"> </td>
<td style="width: 131.25px"> </td>
<td style="width: 43.5px"> </td>
</tr>
<tr>
<td style="width: 43.5px"> </td>
<td style="width: 131.25px">
<asp:Label ID="Label1" runat="server" Text="User Name: "></asp:Label>
</td>
<td style="width: 131.25px">
<asp:TextBox ID="txtUserName" runat="server" Height="20px" Style="border-radius: 8px;"> </asp:TextBox>
</td>
<td style="width: 43.5px"> </td>
</tr>
<tr>
<td style="width: 43.5px"> </td>
<td style="width: 131.25px"> </td>
<td style="width: 131.25px"> </td>
<td style="width: 43.5px"> </td>
</tr>
<tr>
<td style="width: 43.5px"> </td>
<td style="width: 131.25px">
<asp:Label ID="Label2" runat="server" Text="Password: "></asp:Label>
</td>
<td style="width: 131.25px">
<asp:TextBox ID="txtPassword" runat="server" Height="20px" Style="border-radius: 8px;"> </asp:TextBox>
<asp:TextBoxWatermarkExtender ID="txtPassword_TextBoxWatermarkExtender"
runat="server" Enabled="True" TargetControlID="txtPassword"
WatermarkText="Password">
</asp:TextBoxWatermarkExtender>
</td>
<td style="width: 43.5px"> </td>
</tr>
<tr>
<td style="width: 43.5px"> </td>
<td colspan="2">
<asp:Label ID="Label3" runat="server" Text="Invalid User Name Or Password." Visible="False"></asp:Label>
</td>
<td style="width: 43.5px"> </td>
</tr>
<tr>
<td style="width: 43.5px"> </td>
<td style="width: 131.25px">
<asp:Button ID="Button2" runat="server" CssClass="button" Text="Login" OnClick="Button2_Click" />
</td>
<td style="width: 131.25px">
<asp:Button ID="Button1" runat="server" CssClass="button" Text="Cancle" /></td>
<td style="width: 43.5px"> </td>
</tr>
<tr>
<td style="width: 43.5px"> </td>
<td style="width: 131.25px">
<asp:LinkButton ID="LinkButton1" runat="server">Forgot Password</asp:LinkButton>
</td>
<td style="width: 131.25px">
<asp:Button ID="Button3" runat="server" CssClass="button" Text="Sign Up" OnClick="Button3_Click" />
</td>
<td style="width: 43.5px"> </td>
</tr>
</table>
</div>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
#Chirag : you haven't added the onclick event on your button . so please add this ..
edit your code .
<asp:Button ID="Button2" runat="server" CssClass="button" Text="Login" OnClick="Button2_Click"/>
This code seems to run fine on every browser except for firefox. On firefox the first row of each table is properly aligned, but then the rest of the rows are way off to the right. This is my first website, so if there are any other proper coding practices im not following please let me know. The website is live and can be viewed at www.topclassfifa.com the coin pages are the ones having alignment problems with firefox.
<div class="center">
<table id="XboxTable1" cellspacing="0" cellpadding="0" width="1000"
align="center" dir="ltr">
<tr>
<td style="padding-left:50px; padding-right:50px; padding-top:0px; padding-bottom:0px;" align="center" width="333" colspan="0" rowspan="0">
<asp:Image ID="Image7" runat="server" ImageUrl="~/Images/Xbox50kIcon.png" /></td>
<td style="padding-left:50px; padding-right:50px; padding-top:0px; padding-bottom:0px;" align="center" width="334" colspan="0" rowspan="0"><asp:Image ID="Image8" runat="server" ImageUrl="~/Images/Xbox100kIcon.png"/></td>
<td style="padding-left:50px; padding-right:50px; padding-top:0px; padding-bottom:0px;" align="center" width="333" colspan="0" rowspan="0"><asp:Image ID="Image9" runat="server" ImageUrl="~/Images/Xbox250kIcon.png" /></td>
</tr>
<tr>
<td style="font-weight: bold; font-size:medium"; width="333" align="center"colspan="0" rowspan="0">
<font color="#92C83E">£<%=Xbox50kPrice %></font></td>
<td style="font-weight: bold; font-size:medium" width="334" align="center" colspan="0" rowspan="0">
<font color="#92C83E">£<%=Xbox100kPrice %></font></td>
<td style="font-weight: bold; font-size:medium" width="333" align="center" colspan="0" rowspan="0">
<font color="#92C83E">£<%=Xbox250kPrice %></font></td>
</tr>
<tr>
<td style="width: 333px" align="center" colspan="0" rowspan="0">
<asp:Label ID="Label4" runat="server" Text="Quantity: " ForeColor="#92C83E"></asp:Label>
<asp:DropDownList ID="DropDown50kXbox" runat="server" Width="44px"
onselectedindexchanged="Changed50kXbox" AutoPostBack="true" BackColor="#0168D4"
ForeColor="#92C83E">
<asp:ListItem>0</asp:ListItem>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
<asp:ListItem>7</asp:ListItem>
<asp:ListItem>8</asp:ListItem>
<asp:ListItem>9</asp:ListItem>
<asp:ListItem>10</asp:ListItem>
</asp:DropDownList>
</td>
<td style="width: 334px" align="center" colspan="0" rowspan="0">
<asp:Label ID="Label5" runat="server" Text="Quantity: " ForeColor="#92C83E"></asp:Label>
<asp:DropDownList ID="DropDown100kXbox" runat="server" Width="44px"
onselectedindexchanged="Changed100kXbox" AutoPostBack="true" BackColor="#0168D4"
ForeColor="#92C83E">
<asp:ListItem>0</asp:ListItem>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
<asp:ListItem>7</asp:ListItem>
<asp:ListItem>8</asp:ListItem>
<asp:ListItem>9</asp:ListItem>
<asp:ListItem>10</asp:ListItem>
</asp:DropDownList>
</td>
<td style="width: 333px" align="center" colspan="0" rowspan="0">
<asp:Label ID="Label6" runat="server" Text="Quantity: " ForeColor="#92C83E"></asp:Label>
<asp:DropDownList ID="DropDown250kXbox" runat="server" Width="44px"
onselectedindexchanged="Changed250kXbox" AutoPostBack="true" BackColor="#0168D4"
ForeColor="#92C83E">
<asp:ListItem>0</asp:ListItem>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
<asp:ListItem>7</asp:ListItem>
<asp:ListItem>8</asp:ListItem>
<asp:ListItem>9</asp:ListItem>
<asp:ListItem>10</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td style="width: 333px; font-weight: bold; font-size:large" align="center" colspan="0" rowspan="0">
<font color="#92C83E">£<%=Xbox50kTotal %></font></td>
<td style="width: 333px; font-weight: bold; font-size:large" align="center" colspan="0" rowspan="0">
<font color="#92C83E">£<%=Xbox100kTotal %></font></td>
<td style="width: 333px; font-weight: bold; font-size:large" align="center" colspan="0" rowspan="0">
<font color="#92C83E">£<%=Xbox250kTotal %></font></td>
</tr>
Try removing the rowspan="0" and colspan="0" attributes from your <td> tags.