I have migrated my .net projet from framework 3.5 to 4.5 and my the site was previously running under IE7.
I need to run it under IE11 now. I have a page which upon selecting an element in a dropdown display the values of the element selected.
The element has 3 different fields:
Code, name and info et a button delete which upon clicking delete the element and empty the fields.
Below is the code which does the reset:
protected void LB_Supprimer_Click(object sender, System.EventArgs e)
{
if ( this.DBDelete_TRF() )
{
this.TB_NOM.Text = "" ;
this.TB_CODE.Text = "" ;
this.TB_ACTCORR.Text = "" ;
}
MngMessage.refresh();
}
Code in aspx:
<TABLE id="Table1" borderColor="lightgrey" cellSpacing="5" cellPadding="0" width="100%"
border="0">
<TR>
<TD style="WIDTH: 168px; HEIGHT: 19px" align="right">
<asp:Label id="Lbl_code" runat="server" CssClass="label" DESIGNTIMEDRAGDROP="47">Code : </asp:Label></TD>
<TD style="WIDTH: 403px; HEIGHT: 19px">
<asp:TextBox id="TB_CODE" runat="server" Width="96px" CssClass="txt" DESIGNTIMEDRAGDROP="73"
ToolTip="Code" Font-Bold="True" ontextchanged="TB_CODE_TextChanged"></asp:TextBox>
</TD>
</TR>
<TR>
<TD style="WIDTH: 168px; HEIGHT: 68px" align="right">
<asp:Label id="Label_Nom" runat="server" CssClass="label" DESIGNTIMEDRAGDROP="86">Nom : </asp:Label></TD>
<TD style="WIDTH: 403px; HEIGHT: 68px">
<asp:TextBox id="TB_NOM" runat="server" Height="54px" Width="360px" CssClass="txt" DESIGNTIMEDRAGDROP="85"
Font-Bold="True" TextMode="MultiLine" Rows="4"></asp:TextBox></TD>
</TR>
<TR>
<TD style="WIDTH: 168px" align="right"></TD>
<TD style="WIDTH: 403px">
<asp:Label id="LB_INFO" runat="server" CssClass="label">Info</asp:Label></TD>
</TR>
<TR>
<TD style="WIDTH: 168px" align="right">
<asp:Label id="Label8" runat="server" CssClass="label" DESIGNTIMEDRAGDROP="49">Action : </asp:Label>
<asp:CheckBox id="chk_Confirmee" runat="server" CssClass="DBLabel" ToolTip="xxx yyy"
Text="Confirmée"></asp:CheckBox></TD>
<TD style="WIDTH: 403px">
<asp:TextBox id="TB_ACTCORR" runat="server" Height="74px" Width="360px" CssClass="txt" TextMode="MultiLine"
Rows="5"></asp:TextBox></TD>
</TR>
<TR>
<TD align="center" height="15"><cc1:linkbutton id="LB_Supprimer" runat="server" DisableText="Traitement en cours" DisableAfterClick="True" onclick="LB_Supprimer_Click">Supprimer</cc1:linkbutton></TD>
</TR>
</TABLE>
The above does not work in IE11 only but in chrome it does.
Any idea how to solve this pls?
Related
I'm working on simple asp.net project with master page and content page. On the content page I have a ImageButton inside a gridview. I'm trying to show a modal popup when I click Image button, but it does not appear.
This is the necessary code:
<asp:Button ID="showPopUp" runat="server" Text="Button" Visible="False" />
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" style="display:none">
<table class="nav-justified">
<tr>
<td colspan="3" style="background-color: #CCCC00; color: #FFFFFF;" title="Purchase Invoice Details"></td>
</tr>
<tr>
<td class="auto-style5">Invoice</td>
<td class="auto-style6">:</td>
<td class="auto-style13">
<asp:Label ID="lblInvoice" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style12">Name</td>
<td class="auto-style8">:</td>
<td class="auto-style14">
<asp:Label ID="lblName" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style12">Category</td>
<td class="auto-style8">:</td>
<td class="auto-style14">
<asp:Label ID="lblCategory" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style5">Total Qty</td>
<td class="auto-style6">:</td>
<td class="auto-style13">
<asp:Label ID="lblQuantity" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style12">Total Price</td>
<td class="auto-style8">:</td>
<td class="auto-style14">
<asp:Label ID="lblPrice" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style12">SalePrice/Item</td>
<td class="auto-style8">:</td>
<td class="auto-style14">
<asp:Label ID="lblSalePrice" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style12">Comments</td>
<td class="auto-style8">:</td>
<td class="auto-style14">
<asp:Label ID="lblComments" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style12">Date</td>
<td class="auto-style8">:</td>
<td class="auto-style14">
<asp:Label ID="lblDate" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style12"></td>
<td class="auto-style8"></td>
<td class="auto-style14"></td>
</tr>
<tr>
<td colspan="3" style="height: 20px">
<asp:Button ID="btnClose" CssClass="btn-info" runat="server" Text="Close" OnClick="btnClose_Click" />
</td>
</tr>
</table>
</asp:Panel>
<ajax:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
TargetControlID="showPopUp"
PopupControlID="Panel1"
CancelControlID="btnClose"
BackgroundCssClass="backgroundcss" >
</ajax:ModalPopupExtender>
<style type="text/css">
.backgroundcss{
background-color:gray;
filter:alpha(opacity=80);
opacity:0.8;
z-index:10000;
}
.modalPopup
{
background-color: #FFFFFF;
width: 300px;
border: 3px solid #0DA9D0;
padding: 0;
}
</style>
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
ImageButton imgbtn = (ImageButton)sender;
GridViewRow gvr = (GridViewRow)imgbtn.NamingContainer;
lblInvoice.Text = gvr.Cells[1].Text;
lblName.Text = gvr.Cells[2].Text;
lblCategory.Text = gvr.Cells[3].Text;
lblQuantity.Text = gvr.Cells[4].Text;
lblPrice.Text = gvr.Cells[5].Text;
lblSalePrice.Text = gvr.Cells[6].Text;
lblComments.Text = gvr.Cells[7].Text;
lblDate.Text = gvr.Cells[8].Text;
this.ModalPopupExtender1.Show();
}
I was setting the targetcontrolid of the extender to a hidden button and trying to fire the Show() event in server side code. It wasn't being displayed even though the code was getting hit. I discovered that the problem was that I was hiding the hidden button using "visible = false" which doesn't render the control to the page. I changed it to "style='display:none'" and it started working. Try changing your target control to a hidden button and make sure it's getting rendered and maybe it will work.
I am unable to see the radio button list yes or NO in my screen I am getting the values from XML file.
Following code in aspx page:
<asp:Panel ID="pnlAction" runat="server" Width="100%" Visible="false">
<table cellpadding="0" cellspacing="0" border="0" width="99%">
<tr style="height: 20px;">
<td style="width: 25px;">
<hr />
</td>
<td class="secHeading frmlblBold"" style="width: 80px;" align="center">
Action
</td>
<td>
<hr />
</td>
</tr>
</table>
<table style="font-weight:normal" width="100%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td style="width:250px;"></td>
<td style="width:350px;"></td>
<td style="width:250px;"></td>
<td style="width:350px;"></td>
</tr>
<tr>
<td class="frmlblBold" style="text-align:right;vertical-align:top">Action </td>
<td><asp:DropDownList ID="ddlAction" runat="server" CssClass="DropDown" DataSourceID="dsAction" DataValueField="CODE" DataTextField="CDDesc" AutoPostBack = "False" Width="342px"></asp:DropDownList></td>
</tr>
<tr>
<td class="frmlblBold" style="text-align:right;vertical-align:top">Service Agreement Clause </td>
<td style="vertical-align:top" style="width: 350px;">
<%-- <fieldset id="fldSLA" runat="server" style="width: 280px;">--%>
<asp:RadioButtonList ID="radSLA" runat="server" RepeatDirection="Horizontal" DataValueField="SLAID" DataTextField="SLADESC" DataSourceID="dsSLA" visible = "true">
</asp:RadioButtonList>
<asp:RequiredFieldValidator ID="rfvSLA" runat="server" ControlToValidate="radSLA" ErrorMessage="Please select if service agreement is applicable or not."
Enabled="true" Display="none"></asp:RequiredFieldValidator>
<%-- </fieldset>--%>
</td>
</tr>
<tr>
<td class="frmlblBold" style="text-align:right;vertical-align:top">Comments </td>
<td style="vertical-align:top">
<asp:TextBox runat="server" ID="txtActionComments" MaxLength="500" TextMode="MultiLine" width="95%" Rows="5" /> </td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" CssClass="btnOther" />
</tr>
</asp:Panel>
<asp:XmlDataSource ID="dsSLA" runat="server" EnableCaching="false" DataFile="~/XML/VisaTracking.xml"
XPath="BVILetter/SLA/ITEM" />
Code in .cs file:
if (!IsPostBack)
{
base.PageLoad();
GetReqPndActTknByMe(base.LogShortID);
radSLA.DataBind();
radSLA.SelectedValue = "Yes";
BindDataToDropdownListAction();
}
I am able to see the row count of radSLA.DataBind(); as '2'
My XML code:
<BVILetter>
<SLA>
<ITEM SLAID ="Yes" SLADESC ="Yes" />
<ITEM SLAID ="No" SLADESC ="No" />
</SLA>
</BVILetter>
But I am not able to see the radio buttons in my screen:
Please help me.
Please Check the Binding function clearly. If binding not happened properly then RadioBottonList does not appear.RadioBottonList apear only when when listItem bind properly
I'm designing a website in ASP.NET and I want to build table with some text, textboxes and validators in it. The problem is that table looks different in Firefox and IE. Here is an example:
http://www.freeimagehosting.net/image.php?224860e266.png
Here is the table code in ASP.NET:
<table align="center" cellpadding="0" cellspacing="1" style="text-align: right; border-collapse: separate;">
<tr>
<td>
Nadawca:
</td>
<td>
<asp:TextBox ID="TextBoxNadawca" runat="server" Width="250px" BorderStyle="none"
BackColor="#c1ae85"></asp:TextBox>
</td>
<td align="left">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Nadawca jest wymagany."
ControlToValidate="TextBoxNadawca" ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
Adres e-mail:
</td>
<td>
<asp:TextBox ID="TextBoxMail" runat="server" Width="250px" BorderStyle="none" BackColor="#c1ae85"></asp:TextBox>
</td>
<td align="left">
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="E-mail jest wymagany."
ControlToValidate="TextBoxMail" ForeColor="Red"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBoxMail"
ErrorMessage="Nieprawidłowy format." ForeColor="Red" Style="position: absolute;
top: 589px; left: 632px; width: 160px;" ValidationExpression="\w+([-+.']\w+)*#\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td>
Temat:
</td>
<td>
<asp:DropDownList ID="DropDownTemat" runat="server" Style="margin-left: 0px;" Width="250px"
BorderStyle="none" BackColor="#c1ae85">
<asp:ListItem>Reklama w serwisie</asp:ListItem>
<asp:ListItem>Pomysł na rozwój serwisu</asp:ListItem>
<asp:ListItem>Chcę zostać moderatorem</asp:ListItem>
<asp:ListItem>Prawa autorskie</asp:ListItem>
<asp:ListItem>Banicja</asp:ListItem>
<asp:ListItem>Błąd na stronie</asp:ListItem>
<asp:ListItem>Inne</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
Treść:
</td>
<td>
<asp:TextBox ID="TextBoxTresc" runat="server" Height="150px" TextMode="MultiLine"
Width="250px" BorderStyle="none" BackColor="#c1ae85"></asp:TextBox>
</td>
<td align="left">
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Treść jest wymagana."
ControlToValidate="TextBoxTresc" ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
</td>
<td style="text-align: center;">
<asp:Button ID="Button1" runat="server" Text="Wyślij" OnClick="Button1_Click" Width="250px"
BorderStyle="None" BackColor="#c1ae85" />
</td>
</tr>
<tr>
<td>
</td>
<td style="text-align: justify">
<br />
<asp:Label ID="Label1" runat="server" Width="250px"></asp:Label>
</td>
</tr>
</table>
Thanks in advice,
Peter.
When i remove your styling code
<table align="center" cellpadding="0" cellspacing="1" style="text-align: right; border-collapse: separate;">
to
<table align="center">
It shows same for IE, Firefox and Chrome. So if you want to style your table ill suggest you to try CSS
Don't use tables for your layout, use CSS. The only time you should use tables is for tabular data. By using CSS here you can omit border-bottom where you are getting the double borders.
i am using model popup in asp.net on this linkbutton
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="addProduct-disable" Enabled ="false" Text="Assign Filter Criteria" CausesValidation="true" ></asp:LinkButton>
when i click a button in popup the event is getting fired but the asp panel and label are not getting displayed
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td colspan="3" class="style3" align="center">
Assign Filtering Criteria
</td>
</tr>
<tr>
<td colspan="3">
<asp:Label ID="lblSuccess" runat="server" Text="" ></asp:Label>
</td>
</tr>
<tr>
<td class="logText" width="30%">
Filter:
<asp:ImageButton ID="imgFilter" runat="server" ImageUrl="../images/helpIcon.png"
border="0" CausesValidation="false" OnClientClick="return showHelp('ctl00_ContentPlaceHolder1_pnlFilterHelp');" />
<cc1:ModalPopupExtender ID="mdlFilter" runat="server" TargetControlID="imgFilter"
PopupControlID="pnlFilterHelp" DropShadow="false" CancelControlID="lnkFilterCancel"
X="410" Y="200" />
<asp:Panel ID="pnlFilterHelp" runat="server" Height="70px" Width="170px" Style="display: none;">
<asp:Panel ID="pnlFilterOuter" runat="server" CssClass="modalPopup2" Height="100px"
Width="180px" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" BackColor="#FFFCF9">
<table cellpadding="0" cellspacing="0" width="90%">
<tr>
<td align="center" valign="middle" style="padding-top: 15px; padding-left: 5px;">
<table cellpadding="0" align="center" cellspacing="0" width="100%" height="40px">
<tr>
<td class="style8">
Set Filter Criteria so that customer can easily search product.
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
<asp:LinkButton ID="lnkFilterCancel" runat="server" Text="" CssClass="gridPagerlink"
ForeColor="Black">Close <b>X</b></asp:LinkButton>
</td>
</tr>
</table>
</asp:Panel>
</asp:Panel>
</td>
<td width="4px">
</td>
<td class="logBox">
<asp:UpdatePanel ID="filter" runat="server">
<ContentTemplate>
<asp:DropDownList ID="drpFilter" runat="server" AutoPostBack="True" OnSelectedIndexChanged="drpFilter_SelectedIndexChanged"
Width="150px">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td colspan="3">
</td>
</tr>
<tr>
<td class="logText">
Filter Option:
<asp:ImageButton ID="imgFilterOption" runat="server" ImageUrl="../images/helpIcon.png"
border="0" CausesValidation="false" OnClientClick="return showHelp('ctl00_ContentPlaceHolder1_pnlFilterOption');" />
<cc1:ModalPopupExtender ID="mdlFilterOption" runat="server" TargetControlID="imgFilterOption"
PopupControlID="pnlFilterOption" DropShadow="false" CancelControlID="lnkFilterOptionCancel"
X="410" Y="220" />
<asp:Panel ID="pnlFilterOption" runat="server" Height="70px" Width="170px" Style="display: none;">
<asp:Panel ID="pnlFilterOptionOuter" runat="server" CssClass="modalPopup2" Height="300px"
Width="580px" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" BackColor="#FFFCF9">
<table cellpadding="0" cellspacing="0" width="90%">
<tr>
<td align="center" valign="middle" style="padding-top: 15px; padding-left: 5px;">
<table cellpadding="0" align="center" cellspacing="0" width="100%" height="40px">
<tr>
<td class="style8">
Set Filter Criteria Option so that customer can easily search product.
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td style="padding-left: 20px;">
<asp:LinkButton ID="lnkFilterOptionCancel" runat="server" Text="" CssClass="gridPagerlink"
ForeColor="Black">Close <b>X</b></asp:LinkButton>
</td>
</tr>
</table>
</asp:Panel>
</asp:Panel>
</td>
<td width="4px">
</td>
<td class="logBox">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:DropDownList ID="drpFilterOption" runat="server" Width="150px" Enabled="false">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td colspan="3">
</td>
</tr>
<tr>
<td class="logText">
</td>
<td width="4px">
</td>
<td class="logBox">
<asp:UpdatePanel ID="cancel" runat="server">
<ContentTemplate>
<asp:Button ID="btnAdd" runat="server" Style="font-weight: 700; text-align: right"
Text="Add" CssClass="Login-btn" OnClick="btnAdd_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</td> </tr>
<tr>
<td>
</td>
<td colspan="2">
</td>
</tr>
<tr>
<td align="center" colspan="3">
<asp:Panel ID="pnlAddFilter" runat="server" style="display:none">
<table id="list">
</table>
<div id="pager" style="text-align: center;">
</div>
<br />
</asp:Panel>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
</tr>
</table>
event is
protected void btnAdd_Click(object sender, EventArgs e)
{
pnlAddFilter.Style.Add("display", "block");
//pnlAddFilter.Visible = true;
DataTable dtFilter = new DataTable();
dtFilter.Columns.Add("FOId");
dtFilter.Columns.Add("Filtername");
dtFilter.Columns.Add("FilterOption");
DataRow drFilter;
if (Session["Filter"] != null)
{
dtFilter = (DataTable)Session["Filter"];
}
drFilter = dtFilter.NewRow();
drFilter["FOId"] = drpFilterOption.SelectedValue;
drFilter["Filtername"] = drpFilter.SelectedItem.Text;
drFilter["FilterOption"] = drpFilterOption.SelectedItem.Text;
dtFilter.Rows.Add(drFilter);
Session["Filter"] = dtFilter;
btnAdd.Enabled = false;
if (Session["Filter"] == null)
{
// pnlAddFilter.Visible = false;
pnlAddFilter.Style.Add("display", "none");
}
else
{
pnlAddFilter.Style.Add("display", "block");
// pnlAddFilter.Visible = true;
}
lblSuccess.Visible = true;
lblSuccess.Text = AppHardcodeValue.strAddFilterProduct;
}
In my experience, the modal popup doesn't support dynamically rendered data very well. I'm thinking you probably need to put your modal content inside of an update panel in order to be able to use the server side code to update the label.
I have a listview and a label in the ItemTemplate, i have set the text to
<asp:Label id="GreenDate" runat="server" Text='<%# Eval("NewsDate") %>'></asp:Label>
but i want to manipulate the value returned by datasource,which is Eval("NewsDate") and show the new value in the label.
in which event i can access this value and how?
protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
HtmlTableCell lblpwdHeader = (HtmlTableCell)this.ListView1.FindControl("tdColumn");
HtmlTableCell tdPwdData = (HtmlTableCell)e.Item.FindControl("tdPwd");
if (lblpwdHeader != null)
{
lblpwdHeader.Visible = false;
}
if (tdPwdData != null)
{
tdPwdData.Visible = false;
}
}
}
============
<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" OnItemDataBound="ListView1_ItemDataBound">
<LayoutTemplate>
<table border="0" cellpadding="1" width="50%">
<tr style="background-color: #E5E5FE">
<th style="width: 30%">
<asp:LinkButton ID="lnkId" runat="server" CommandName="Sort" CommandArgument="ID">Id</asp:LinkButton>
</th>
<th style="width: 40%">
<asp:LinkButton ID="lnkName" runat="server" CommandName="Sort" CommandArgument="UserName">Name</asp:LinkButton>
</th>
<th id="tdColumn" runat="server" style="width: 30%">
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="Sort" CommandArgument="Password">Password</asp:LinkButton>
</th>
</tr>
<tr id="itemPlaceholder" runat="server">
</tr>
</table>
</LayoutTemplate>
<ItemTemplate>
<table border="0" cellpadding="1" cellspacing="2" width="50%">
<tr>
<td style="width: 30%; text-align: center">
<asp:Label runat="server" ID="lblId"><%#Eval("ID") %></asp:Label>
</td>
<td style="width: 40%; text-align: center">
<asp:Label runat="server" ID="lblName"><%#Eval("UserName")%></asp:Label>
</td>
<td id="tdPwd" runat="server" style="width: 30%; text-align: center">
<asp:Label ID="lblPwd" runat="server"><%#Eval("Password")%></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
<AlternatingItemTemplate>
<table border="0" cellpadding="1" cellspacing="2" width="50%">
<tr>
<td style="width: 30%; text-align: center">
<asp:Label runat="server" ID="lblId"><%#Eval("ID") %></asp:Label>
</td>
<td style="width: 40%; text-align: center">
<asp:Label runat="server" ID="lblName"><%#Eval("UserName")%></asp:Label>
</td>
<td id="tdPwd" runat="server" style="width: 30%; text-align: center">
<asp:Label ID="lblPwd" runat="server"><%#Eval("Password")%></asp:Label>
</td>
</tr>
</table>
</AlternatingItemTemplate>
</asp:ListView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TestAshokConnectionString %>"
SelectCommand="SELECT * FROM [Users]"></asp:SqlDataSource>
Use the following Event: ItemDataBound, and use DataBinder.Eval(e.Item.DataItem, "NewsDate") which is equivalent to this <%# Eval("NewsDate") %>.
Here's the syntax to get the Label Control:
Label lbl = (Label) Item.Controls.FindControlByID("GreenDate");