Framwork 1.1->2.0: PostBack error when client script is applied

B

Bjorn Sagbakken

Hello

I have just migrated from VS 2003 to VS 2005, and .NET framework 1.1 to 2.0
I am at the end of debugging and fixing stuff. Now there is one error I just
cannot find a solution to:

On some pages I have applied a small client-script to trap the enter-key
beeing pressed and re-route this action. With the new version this little
script still works, it traps the enter-key. BUT it causes postback-errors on
many other .NET control, dropdown lists, checkboxes. Tthe postback from
these controls generates a browser error, claiming error with this (Line: 1,
Char 2, Error: Invalid charcter, Code 0)

First of all; What line no 1 is the line in question? Is it the code file in
VS? No. Is it the html-file in VS? No. My best guess have been to click
"view source" to sse what this page actually looks like from the browser
point of view. The first line is a blank line, the second starts with
"<!DOCTYPE HTML PUBLIC....." and I even tried to remove the "!" - in
addition to many other more or less blind try and failure. When I disable
the client script, the postback is ok again. Had it not been for the script
actually working I would surely suspected the script itself.

The strange thing is that this worked well in the previous version (VS
2003), no change of code when the upgrade to VS 2005 was done. I suppose I
need to add some code lines somewhere, but I am getting exhausted by trying
all thinkable combination.

(I must add, I am not an expert at all, so maybe the obvious is staring wild
and hard at me, laughing and grinning at its best)

Regards
Bjorn
 
G

Guest

Hi Bjorn,

Let me (briefly) explain how it works:

Aspx pages generate html code (including your javascript) which is sent to
browser (you can see generated html document selecting 'view source' in any
browser). Error you're seeing is definitely caused by javascript you created
to detect enter key has been pressed. As you may know, after document is
retrived, browser parses its content and builds DOM objects in order to
provide dynamic functionality (i.e. message/prompt/confirmation box, dynamic
text, etc.). Usually all scripts are concatenated to one (simplifiyng
shortcut:), therefore line numbers represent lines in parsed, concatenated
script. But don't worry, it's easy to debug client scripts in IE and VS2005,
what you have to do is:
1. IE->Tools->Internet Options, select advanced tab, untick 'Disable Client
Script Debuging (Internet Explorer).
2. Close all IE windows.
3. Run asp.net application in debug mode and go to page that causes the
error,
4. In VS2005, go to Debug->Window->Script Expolorer
5. You should see list of all running documents
6. Double click on the page that causes the error (on the list of course)
7. put a breakpoint at the first line of your script
8. You're done, you are able to debug your script.

If it doesn't help, show us the script so we could provide a solution.

Hope this helps

"Error Line: 1, Char 2, Error: Invalid charcter, Code 0"
 
B

Bjorn Sagbakken

Thanks Milosz,

That was a great tip!
Now, one thing I forgot to say is that I used VBScript for the client
scripting. Because I'm only familiar with VB, and because this
web-application is only used in my companys intranet, I wanted a quick
solution. Well, now I understand that each page only can have one
script-language at the time, so my suspision goes to a mix of vbscript and
javascript.

Anyhow, I have taken the first step in writing my first javascript, since
this obviously is a general good idea. After some back and forth I'm
actually very close to obtain my target. The errors are gone, and I have
manged to trap the enter-key. Next, I want to code-wise click a button (that
is; to perform the click-method for this button)

The troubled code-line looks like this:

document.getElementById("cmdSearch").click

There is no error on this, a postback happens, but the desired search is not
executed.
I have no idea why. If I use the mouse and click on the "cmdSearch"-button
the search is ok.
Any idea? Is the code correct for "clicking the search-button from a
script"? I have tried with "()" and ";" at the end, but this causes an
error.

Bjorn
 
B

Bjorn Sagbakken

Howdy Bjorn
Paste entire code for the aspx page.

Regards

Well, her it is. There is a lot of stuff downwards that does not have
anything with the question at hand.
There are several UserControls involved too, but the scipt including its
references would be the issue here.
I don't know what you can make of it. Maybe I should add another line in
there, I have seen things like "Return=False" or "window.returnvalue false;"
to disable the default behaviour of hitting enter.

Regards
Bjorn

<%@ Reference Control="~/Sikkerhet_SM_Menu.ascx" %>
<%@ Reference Page="~/Sikkerhet_Home.aspx" %>
<%@ Reference Control="~/Sikkerhet_SM_Menu.ascx" %>
<%@ Reference Page="~/Sikkerhet_Home.aspx" %>
<%@ Reference Control="~/Sikkerhet_SM_Menu.ascx" %>
<%@ Page Language="vb" AutoEventWireup="false"
Inherits="SikkerhetWEB.Sikkerhet_SM_Kunder"
CodeFile="Sikkerhet_SM_Kunder.aspx.vb" %>
<%@ Register TagPrefix="Menu" TagName="Menu" src="Sikkerhet_Menu.ascx" %>
<%@ Register TagPrefix="Banner" TagName="Banner" src="Banner.ascx" %>
<%@ Register TagPrefix="SMMenu" TagName="SMMenu"
src="Sikkerhet_SM_Menu.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Sikkerhet_SM_Kunder</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<meta content="text/JScript" http-equiv="content-script-type" />
<script id="id1" language="jscript">
function SearchClient()
{
if (window.event.keyCode == 13)
{
document.getElementById("cmdSearch").click()
}
}
</script>
</HEAD>
<body onkeypress ="SearchClient()">
<form id="frmKunder" method="post" target="_self" runat="server">
<p>
<asp:button id="Button1" style="Z-INDEX: 106; LEFT: 712px; POSITION:
absolute; TOP: 168px"
runat="server" Text="Ny ordre"></asp:button><banner:banner id="Banner1"
runat="server"></banner:banner></p>
<p><menu:menu id="Menu1" runat="server"></menu:menu></p>
<p><smmenu:smmenu id="SMMenu1" runat="server"></smmenu:smmenu></p>
<p><asp:panel id="panelSearchCount" style="Z-INDEX: 103; LEFT: 16px;
POSITION: absolute; TOP: 632px"
runat="server" HorizontalAlign="Left" BorderStyle="Dotted"
BorderWidth="1px" BorderColor="Silver"
BackColor="DarkGoldenrod" Height="16px" Width="136px">
<FONT face="Arial Baltic" size="2"><FONT color="#ffffff">Antall
søk:</FONT>
<asp:label id="lblSearchCount" runat="server" Width="40px"
ForeColor="White">00</asp:label></FONT></asp:panel></P>
<P><asp:panel id="Panel1" style="Z-INDEX: 104; LEFT: 16px; POSITION:
absolute; TOP: 480px" runat="server"
HorizontalAlign="Left" BorderStyle="Dotted" BorderWidth="1px"
BorderColor="Silver" BackColor="Honeydew"
Height="136px" Width="136px">
<FONT face="Arial" size="2">Dette er en kopi av&nbsp;kunderegisteret som
benyttes i
Paradox i ODV. Etterhvert kan det tenkes at vi åpner for at flere legge
inn
sine egne kunder, dersom dette er av interesse.</FONT>
</asp:panel>
<P><asp:panel id="Panel2" style="Z-INDEX: 105; LEFT: 16px; POSITION:
absolute; TOP: 400px" runat="server"
HorizontalAlign="Left" BorderStyle="Dotted" BorderWidth="1px"
BorderColor="Silver" BackColor="Thistle"
Height="29px" Width="136px">
<FONT face="Arial" size="2"><STRONG>Merk: Informasjonen her er ikke
nødvendigvis
oppdatert</STRONG></FONT></asp:panel></P>
<TABLE id="Table1" style="Z-INDEX: 101; LEFT: 184px; WIDTH: 472px;
POSITION: absolute; TOP: 168px; HEIGHT: 29px"
borderColor="silver" cellSpacing="0" cellPadding="0" border="1">
<TR>
<TD style="WIDTH: 54px"><asp:button id="cmdTilbake" runat="server"
Height="22px" Width="72px" Enabled="False"
Text="<-Tilbake"></asp:button></TD>
<TD style="width: 872px"><asp:textbox id="txtSearch" runat="server"
Width="144px"></asp:textbox><asp:button id="cmdSearch" runat="server"
Text="Søk" ValidationGroup="txtSearch"></asp:button>&nbsp;
</TD>
</TR>
</TABLE>
<DIV style="Z-INDEX: 102; LEFT: 184px; WIDTH: 87.57%; POSITION: absolute;
TOP: 200px; HEIGHT: 669px"><asp:panel id="panelSearch" runat="server"
Height="128px" Width="80%">
<asp:repeater id="rpKunder" runat="server" EnableViewState="True">
<ItemTemplate>
<tr bgcolor="Beige">
<td align="center">
<%# Databinder.Eval(Container.DataItem, "Knr") %>
</td>
<td align="left">
<asp:LinkButton Runat =server OnClick ="VisKunde" CommandArgument
='<%# Databinder.Eval(Container.DataItem, "Knr") %>'>
<%# Databinder.Eval(Container.DataItem, "Navn") %>
</asp:LinkButton>
</td>
<td align="Left">
<%# Databinder.Eval(Container.DataItem, "Adresse") %>
</td>
<td align="left">
<%# Databinder.Eval(Container.DataItem, "Sted") %>
</td>
<td align="left">
<%# Databinder.Eval(Container.DataItem, "Tlf") %>
</td>
<td>
<%# Databinder.Eval(Container.DataItem, "Lev") %>
</td>
</tr>
</ItemTemplate>
<HeaderTemplate>
<table border="0" style="FONT-SIZE: 14px; FONT-FAMILY: Arial"
cellpadding="0" cellspacing="2"
width="100%">
<tr bgcolor="#939598" width="100%">
<td><FONT face="Arial" color="#ffffff">Knr</td>
<td><FONT face="Arial" color="#ffffff">Kunde</td>
<td><FONT face="Arial" color="#ffffff">Gateadresse</td>
<td><FONT face="Arial" color="#ffffff">Sted</td>
<td><FONT face="Arial" color="#ffffff">Tlf</td>
<td><FONT face="Arial" color="#ffffff">L</td>
</tr>
</HeaderTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:repeater>
<asp:panel ID="Panel3" runat="server" Height="32px"
Width="100%" HorizontalAlign="Left">
</asp:panel>
</asp:panel><asp:panel id="panelKunde" runat="server"
BackColor="Transparent" Height="353" Width="806px"
Visible="False">
<DIV style="WIDTH: 112.64%; FONT-FAMILY: Arial; POSITION: relative;
HEIGHT: 514px">
<asp:Label id="Label1" style="Z-INDEX: 101; LEFT: 0px; POSITION:
absolute; TOP: 56px" runat="server"
Width="80px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" BorderStyle="Solid"
Font-Size="Smaller">Navn</asp:Label>
<asp:Label id="lblNavn" style="Z-INDEX: 102; LEFT: 88px; POSITION:
absolute; TOP: 56px" runat="server"
Width="216px" Height="42px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="Label2" style="Z-INDEX: 103; LEFT: 320px; POSITION:
absolute; TOP: 80px" runat="server"
Width="80px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Gateadresse</asp:Label>
<asp:Label id="lblGateadresse" style="Z-INDEX: 104; LEFT: 408px;
POSITION: absolute; TOP: 80px"
runat="server" Width="216px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="Label3" style="Z-INDEX: 105; LEFT: 320px; POSITION:
absolute; TOP: 128px" runat="server"
Width="80px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Sted</asp:Label>
<asp:Label id="lblGateAdresse2" style="Z-INDEX: 106; LEFT: 408px;
POSITION: absolute; TOP: 80px"
runat="server" Width="216px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="lblPostNr" style="Z-INDEX: 107; LEFT: 408px; POSITION:
absolute; TOP: 128px"
runat="server" Width="48px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="lblSted" style="Z-INDEX: 108; LEFT: 472px; POSITION:
absolute; TOP: 128px" runat="server"
Width="152px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="Label4" style="Z-INDEX: 109; LEFT: 320px; POSITION:
absolute; TOP: 152px" runat="server"
Width="80px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Land</asp:Label>
<asp:Label id="lblLand" style="Z-INDEX: 110; LEFT: 408px; POSITION:
absolute; TOP: 152px" runat="server"
Width="216px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="lblKundeOverskrift" style="Z-INDEX: 111; LEFT: 0px;
POSITION: absolute; TOP: 8px"
runat="server" Width="806px" BackColor="#939598" BorderColor="Silver"
BorderWidth="1px"
BorderStyle="None" ForeColor="White" Font-Size="Smaller"
Font-Bold="True">Kundedata</asp:Label>
<asp:Label id="Label6" style="Z-INDEX: 112; LEFT: 0px; POSITION:
absolute; TOP: 128px" runat="server"
Width="80px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" BorderStyle="Solid"
Font-Size="Smaller">Tlf</asp:Label>
<asp:Label id="Label7" style="Z-INDEX: 113; LEFT: 0px; POSITION:
absolute; TOP: 152px" runat="server"
Width="80px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" BorderStyle="Solid"
Font-Size="Smaller">Fax</asp:Label>
<asp:Label id="Label8" style="Z-INDEX: 114; LEFT: 0px; POSITION:
absolute; TOP: 176px" runat="server"
Width="80px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" BorderStyle="Solid"
Font-Size="Smaller">Mail</asp:Label>
<asp:Label id="Label9" style="Z-INDEX: 115; LEFT: 0px; POSITION:
absolute; TOP: 200px" runat="server"
Width="80px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" BorderStyle="Solid"
Font-Size="Smaller">Hjemmeside</asp:Label>
<asp:Label id="Label10" style="Z-INDEX: 116; LEFT: 0px; POSITION:
absolute; TOP: 224px" runat="server"
Width="80px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" BorderStyle="Solid"
Font-Size="Smaller">Notat</asp:Label>
<asp:Label id="Label11" style="Z-INDEX: 117; LEFT: 320px; POSITION:
absolute; TOP: 56px" runat="server"
Width="304px" BackColor="#E0E0E0" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller">Gateadresse
(leveringsadresse)</asp:Label>
<asp:Label id="Label12" style="Z-INDEX: 118; LEFT: 0px; POSITION:
absolute; TOP: 104px" runat="server"
Width="80px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" BorderStyle="Solid"
Font-Size="Smaller">Bransje</asp:Label>
<asp:Label id="Label13" style="Z-INDEX: 119; LEFT: 320px; POSITION:
absolute; TOP: 176px" runat="server"
Width="302px" BackColor="#E0E0E0" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller">Fakturaadresse
(postboksadresse)</asp:Label>
<asp:Label id="Label14" style="Z-INDEX: 120; LEFT: 320px; POSITION:
absolute; TOP: 200px" runat="server"
Width="80px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Postboks</asp:Label>
<asp:Label id="Label16" style="Z-INDEX: 121; LEFT: 640px; POSITION:
absolute; TOP: 56px" runat="server"
Width="166px" BackColor="#E0E0E0" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller">Administrativ informasjon</asp:Label>
<asp:Label id="Label17" style="Z-INDEX: 122; LEFT: 640px; POSITION:
absolute; TOP: 80px" runat="server"
Width="88px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Kundenr</asp:Label>
<asp:Label id="Label18" style="Z-INDEX: 123; LEFT: 640px; POSITION:
absolute; TOP: 104px" runat="server"
Width="88px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Kundenr PAM</asp:Label>
<asp:Label id="Label19" style="Z-INDEX: 124; LEFT: 320px; POSITION:
absolute; TOP: 224px" runat="server"
Width="80px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Sted</asp:Label>
<asp:Label id="Label22" style="Z-INDEX: 125; LEFT: 320px; POSITION:
absolute; TOP: 248px" runat="server"
Width="302px" BackColor="#E0E0E0" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller">Besøksadresse</asp:Label>
<asp:Label id="Label15" style="Z-INDEX: 126; LEFT: 320px; POSITION:
absolute; TOP: 272px" runat="server"
Width="80px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Gateadresse</asp:Label>
<asp:Label id="Label23" style="Z-INDEX: 127; LEFT: 320px; POSITION:
absolute; TOP: 296px" runat="server"
Width="80px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Sted</asp:Label>
<asp:Label id="Label20" style="Z-INDEX: 128; LEFT: 0px; POSITION:
absolute; TOP: 328px" runat="server"
Width="800px" BackColor="#E0E0E0" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller">Kontaktpersoner</asp:Label>
<asp:Label id="lblNotat" style="Z-INDEX: 129; LEFT: 88px; POSITION:
absolute; TOP: 224px" runat="server"
Width="216px" Height="78px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="lblTlf1" style="Z-INDEX: 130; LEFT: 88px; POSITION:
absolute; TOP: 128px" runat="server"
Width="104px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="lblTlf2" style="Z-INDEX: 131; LEFT: 200px; POSITION:
absolute; TOP: 128px" runat="server"
Width="104px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="lblFax1" style="Z-INDEX: 132; LEFT: 88px; POSITION:
absolute; TOP: 152px" runat="server"
Width="104px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="lblFax2" style="Z-INDEX: 133; LEFT: 200px; POSITION:
absolute; TOP: 152px" runat="server"
Width="104px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="lblBransje" style="Z-INDEX: 134; LEFT: 88px; POSITION:
absolute; TOP: 104px"
runat="server" Width="216px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="lblMail" style="Z-INDEX: 135; LEFT: 88px; POSITION:
absolute; TOP: 176px" runat="server"
Width="216px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:HyperLink id="hlHjemmeside" style="Z-INDEX: 136; LEFT: 88px;
POSITION: absolute; TOP: 200px"
runat="server" Width="208px" Enabled="False" Font-Size="Smaller"
NavigateUrl="" Target="_blank"></asp:HyperLink>
<asp:Label id="lblKnr" style="Z-INDEX: 137; LEFT: 736px; POSITION:
absolute; TOP: 80px" runat="server"
Width="70px" BackColor="White" BorderColor="Silver" BorderWidth="1px"
Font-Size="Smaller"></asp:Label>
<asp:Label id="lblPAM" style="Z-INDEX: 138; LEFT: 736px; POSITION:
absolute; TOP: 104px" runat="server"
Width="70px" BackColor="White" BorderColor="Silver" BorderWidth="1px"
Font-Size="Smaller"></asp:Label>
<asp:Label id="lblKnrX" style="Z-INDEX: 139; LEFT: 640px; POSITION:
absolute; TOP: 296px" runat="server"
Width="166px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="Label21" style="Z-INDEX: 140; LEFT: 640px; POSITION:
absolute; TOP: 272px" runat="server"
Width="166px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Vårt kundnr hos
leverandør</asp:Label>
<asp:Label id="Label24" style="Z-INDEX: 141; LEFT: 640px; POSITION:
absolute; TOP: 128px" runat="server"
Width="88px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Leverandør</asp:Label>
<asp:Label id="Label25" style="Z-INDEX: 142; LEFT: 640px; POSITION:
absolute; TOP: 152px" runat="server"
Width="88px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Forhandler</asp:Label>
<asp:Label id="Label26" style="Z-INDEX: 143; LEFT: 640px; POSITION:
absolute; TOP: 176px" runat="server"
Width="88px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Fastpriskunde</asp:Label>
<asp:Label id="lblLev" style="Z-INDEX: 144; LEFT: 736px; POSITION:
absolute; TOP: 128px" runat="server"
Width="70px" BackColor="White" BorderColor="Silver" BorderWidth="1px"
Font-Size="Smaller"></asp:Label>
<asp:Label id="Label27" style="Z-INDEX: 145; LEFT: 640px; POSITION:
absolute; TOP: 200px" runat="server"
Width="88px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Lev. bet.</asp:Label>
<asp:Label id="lblLevBet" style="Z-INDEX: 146; LEFT: 736px; POSITION:
absolute; TOP: 200px"
runat="server" Width="70px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="lblForh" style="Z-INDEX: 147; LEFT: 736px; POSITION:
absolute; TOP: 152px" runat="server"
Width="70px" BackColor="White" BorderColor="Silver" BorderWidth="1px"
Font-Size="Smaller"></asp:Label>
<asp:Label id="lblFP" style="Z-INDEX: 148; LEFT: 736px; POSITION:
absolute; TOP: 176px" runat="server"
Width="70px" BackColor="White" BorderColor="Silver" BorderWidth="1px"
Font-Size="Smaller"></asp:Label>
<asp:Label id="lblPostboks" style="Z-INDEX: 149; LEFT: 408px;
POSITION: absolute; TOP: 200px"
runat="server" Width="216px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="lblnrPB" style="Z-INDEX: 150; LEFT: 408px; POSITION:
absolute; TOP: 224px" runat="server"
Width="56px" BackColor="White" BorderColor="Silver" BorderWidth="1px"
Font-Size="Smaller"></asp:Label>
<asp:Label id="lblStedPB" style="Z-INDEX: 151; LEFT: 472px; POSITION:
absolute; TOP: 224px"
runat="server" Width="152px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="lblGateadresseB" style="Z-INDEX: 152; LEFT: 408px;
POSITION: absolute; TOP: 272px"
runat="server" Width="216px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="lblStedB" style="Z-INDEX: 153; LEFT: 472px; POSITION:
absolute; TOP: 296px"
runat="server" Width="152px" BackColor="White" BorderColor="Silver"
BorderWidth="1px" Font-Size="Smaller"></asp:Label>
<asp:Label id="lblNrB" style="Z-INDEX: 154; LEFT: 408px; POSITION:
absolute; TOP: 296px" runat="server"
Width="56px" BackColor="White" BorderColor="Silver" BorderWidth="1px"
Font-Size="Smaller"></asp:Label>
<asp:Label id="Label28" style="Z-INDEX: 155; LEFT: 640px; POSITION:
absolute; TOP: 224px" runat="server"
Width="88px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Sist endret</asp:Label>
<asp:Label id="lblSED" style="Z-INDEX: 156; LEFT: 736px; POSITION:
absolute; TOP: 224px" runat="server"
Width="70px" BackColor="White" BorderColor="Silver" BorderWidth="1px"
Font-Size="Smaller"></asp:Label>
<asp:Label id="Label29" style="Z-INDEX: 157; LEFT: 640px; POSITION:
absolute; TOP: 248px" runat="server"
Width="88px" BackColor="WhiteSmoke" BorderColor="WhiteSmoke"
BorderWidth="1px" Font-Size="Smaller">Endret av</asp:Label>
<asp:Label id="lblEAV" style="Z-INDEX: 158; LEFT: 736px; POSITION:
absolute; TOP: 248px" runat="server"
Width="70px" BackColor="White" BorderColor="Silver" BorderWidth="1px"
Font-Size="Smaller"></asp:Label>
<asp:panel id="panelKontakter" style="Z-INDEX: 159; LEFT: 0px;
POSITION: absolute; TOP: 352px"
runat="server" Width="80%" Height="152px">
<asp:repeater id="rpKontakter" runat="server" EnableViewState="True">
<ItemTemplate>
<tr bgcolor="WhiteSmoke">
<td align="Left">
<%# Databinder.Eval(Container.DataItem, "Navn") %>
</td>
<td align="Left">
<%# Databinder.Eval(Container.DataItem, "Tittel") %>
</td>
<td align="left">
<%# Databinder.Eval(Container.DataItem, "Tlf") %>
</td>
<td align="left">
<%# Databinder.Eval(Container.DataItem, "Mobil") %>
</td>
<td>
<%# Databinder.Eval(Container.DataItem, "Email") %>
</td>
</tr>
</ItemTemplate>
<HeaderTemplate>
<table style="FONT-SIZE: 14px; FONT-FAMILY: Arial" border="0"
cellpadding="0" cellspacing="2"
width="100%">
<tr bgcolor="#939598" width="100%">
<td><FONT face="Arial" color="#ffffff">Navn</td>
<td><FONT face="Arial" color="#ffffff">Tittel</td>
<td><FONT face="Arial" color="#ffffff">Tlf</td>
<td><FONT face="Arial" color="#ffffff">Mobil</td>
<td><FONT face="Arial" color="#ffffff">Mail</td>
</tr>
</HeaderTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:repeater>
</asp:panel>
<TABLE id="Table2" style="Z-INDEX: 163; LEFT: 0px; WIDTH: 806px;
POSITION: absolute; TOP: 24px; HEIGHT: 2px"
cellSpacing="0" cellPadding="0" width="806" bgColor="whitesmoke"
border="0">
<TR>
<TD>
<asp:LinkButton id="cmdBestill" runat="server" Width="88px"
Height="24px" Font-Size="Smaller"></asp:LinkButton></TD>
<TD>
<asp:LinkButton id="cmdAnlegg" runat="server" Width="88px"
Height="24px" Font-Size="Smaller"></asp:LinkButton></TD>
<TD>
<asp:LinkButton id="cmdOrdre" runat="server" Width="88px"
Height="24px" Font-Size="Smaller"></asp:LinkButton></TD>
<TD>
<asp:LinkButton id="cmdTilbud" runat="server" Width="88px"
Height="24px" Font-Size="Smaller"></asp:LinkButton></TD>
</TR>
</TABLE>
</DIV>
</asp:panel></DIV>
</form>
</body>
</HTML>
 
B

Bjorn Sagbakken

I have fixed it!

event.returnvalue=false;
event.cancel = true;
document.getElementById("cmdSearch").click()

It struck me that the enter-key also needed to be inhibited in its default
action.
I found back to some code I had seen before, so now it works!

Regards
Bjorn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top