Sep 22, 2017, 7:27 AM
Visual problem with Imagebuttons
This issue is appearing in almost every .aspx file in my project. When I load the .aspx file for the fist time, the imagebuttons are not displaying properly. However if I reload the page, the buttons are displayed properly.
For expample:
When I run this .aspx pages for the first time imagebuttons are failing:
When I press F5 or I reload the pages the imagebuttons are displayed properly:
I have tried to modify the Css by adding a new class called ".btnspain", but is still not working:
Here you have my Login Code:
Pascu.
For expample:
When I run this .aspx pages for the first time imagebuttons are failing:
When I press F5 or I reload the pages the imagebuttons are displayed properly:
I have tried to modify the Css by adding a new class called ".btnspain", but is still not working:
Here you have my Login Code:
<%@ Page Title="Login Jhayber" Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Extranet.Default" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!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>B2B</title>
<style type="text/css">
.x-toolbar-footer{
background-color:#ffffff;
}
.x-window-header-default-top{
background-color:#ffffff;
}
.x-window-header-default{
border-color:#000000;
}
.x-window-header-title-default{
color:#000000;
font-size:16px;
line-height:30px;
}
.x-window-default{
border-color:#ffffff;
}
.x-btn-default-small
{
background-color:#ffffff;
}
.x-btn-default-small{
border-color:#ffffff;
}
.x-btn-inner-default-small{
color:#000000;
}
.x-btn-over.x-btn.x-btn-default-small{
background-color:#e6e3e3;
border-color:#ffffff;
}
.btnspain{
left:12px;
top:4px;
}
</style>
<script type="text/javascript">
var Alerta = function (keyCode, e) {
Ext.Msg.confirm(
'Delete Rows',
'Are you sure?',
function (btn) {
if (btn == 'yes') {
alert("dijo si");
}
});
};
var Alert2 = function () {
__doPostBack("btnLogin", "");
};
</script>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Label ID="lblMessage" runat="server" />
<ext:Panel ID="FormPanel1" runat="server">
<Content>
<ext:Window ID="Window1" runat="server" Closable="false" Resizable="false"
Height="200" Icon="Lock" Title="Iniciar Sesión" Draggable="false" Width="380" Modal="true"
BodyPadding="5" Layout="formlayout" >
<Items>
<ext:TextField ID="txtUsername" runat="server" FieldLabel="Usuario"
AllowBlank="false" BlankText="Your username is required." AnchorHorizontal="100%" AutoFocus="true" AutoFocusDelay="100" />
<ext:TextField ID="txtPassword" runat="server" InputType="Password" FieldLabel="Contraseña"
AllowBlank="false" BlankText="Your password is required." AnchorHorizontal="100%" />
<ext:TextField ID="Idioma" runat="server" FieldLabel="Idioma" Text="español"
AllowBlank="false" AnchorHorizontal="100%" hidden="true"/>
</Items>
<Buttons>
<ext:ImageButton
AnchorHorizontal="12px"
cls="btnspain"
MinWidth="10"
MarginSpec="0 10 0 0"
ToggleGroup="Grupoidiomas"
runat="server"
ImageUrl="/img/spain.png"
>
<DirectEvents>
<Click OnEvent="español"></Click>
</DirectEvents>
</ext:ImageButton>
<ext:ImageButton
MinWidth="10"
MarginSpec="0 10 0 0"
ToggleGroup="Grupoidiomas"
runat="server"
ImageUrl="/img/united-kingdom.png">
<DirectEvents>
<Click OnEvent="english"></Click>
</DirectEvents>
</ext:ImageButton>
<ext:ImageButton
MinWidth="10"
MarginSpec="0 10 0 0"
ToggleGroup="Grupoidiomas"
runat="server"
ImageUrl="/img/germany.png">
</ext:ImageButton>
<ext:ImageButton
MinWidth="10"
ToggleGroup="Grupoidiomas"
MarginSpec="0 20 0 0"
runat="server"
ImageUrl="/img/france.png">
</ext:ImageButton>
<ext:Button ID="btnLogin" runat="server" Text="Entrar" Icon="Accept" Width="100" TextAlign="Center">
<Listeners>
<Click Handler="
if (!#{txtUsername}.validate() || !#{txtPassword}.validate()) {
Ext.Msg.alert('Error','El usuario y la clave son campos obligatorios');
// return false to prevent the btnLogin_Click Ajax Click event from firing.
return false;
}" />
</Listeners>
<DirectEvents>
<Click OnEvent="btnLogin_Click">
<EventMask ShowMask="true" Msg="Comprobando..." MinDelay="500" />
</Click>
</DirectEvents>
</ext:Button>
<ext:Button ID="btnCancel" runat="server" Text="Cancelar" Icon="Decline" Width="100" TextAlign="Center">
<Listeners>
<Click Handler="#{Window1}.hide();#{lblMessage}.setText('LOGIN CANCELADO')" />
</Listeners>
</ext:Button>
</Buttons>
</ext:Window>
</Content>
</ext:Panel>
<ext:KeyMap runat="server" Target="={Ext.getBody()}" >
<Binding>
<ext:KeyBinding Handler="Alert2" >
<Keys>
<ext:Key Code="ENTER" />
</Keys>
</ext:KeyBinding>
</Binding>
</ext:KeyMap>
</form>
</body>
</html>
Thank You for your help, and sorry for English.Pascu.