473,386 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

problem with javascript

Hi,
this is the code of a (2005) asp page. I've a problem during the
execution. When I click on "Leggi" button the javascript function
"leggi1" is not done! Why?
Someone can I helm me, please!

<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="Homepage.aspx.vb" Inherits="Homepage" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<title>Homepage</title>

<script language=javascript>
function leggi1(a)
{
document.location.replace('Scheda.aspx?libro='+a);
return false
}
</script>

<script language=vb runat=server>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim rdr As OleDbDataReader

Dim ConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("bookstore.mdb")

Msg1.Text = "BENVENUTO " & Session("utente") & " "
cn = New OleDbConnection(ConnString)

cn.Open()

Dim titolo As String
titolo = Request.QueryString("libro")
Dim sql As String = "SELECT titolo, AUTORE.cognome, lettura_terminata,
ultimo_letto FROM ((BOOK INNER JOIN LIBRIUTENTE ON
BOOK.ID=LIBRIUTENTE.libro) INNER JOIN AUTORE on BOOK.autore=AUTORE.ID)
INNER JOIN UTENTE on UTENTE.ID=LIBRIUTENTE.utente WHERE login='" &
Session("utente") & "';"
cmd = New OleDbCommand(sql, cn)

rdr = cmd.ExecuteReader()
Response.Write("</br>")
Response.Write("</br>")
'Response.Write("<html><body><form>")

Response.Write("<p>Gli ultimi libri che ha letto sono:</p>")
Response.Write("<table border=1 cellspacing=1>")
Response.Write("<tr><th>TITOLO</th><th>AUTORE</th><th>LETTURA
TERMINATA</th><th>ULTIMO PARAGRAFO LETTO</th></tr>")
If rdr.HasRows Then
While (rdr.Read())
Response.Write("<tr>")
Response.Write("<td>" & rdr.Item(0) & "</td>")
Response.Write("<td>" & rdr.Item(1) & "</td>")
Response.Write("<td>" & rdr.Item(2) & "</td>")
Response.Write("<td>" & rdr.Item(3) & "</td>")
Response.Write("<td><input type=button value=Leggi onclick='return
leggi1(" & rdr.Item(0) & ");'></td>")
Response.Write("</tr>")
End While

Response.Write("</table>")
'Response.Write("</form>")
'Response.Write("</body></html>")
Else
Msg2.Text = ("Non hai letto ancora nessun libro")
End If
rdr.Close()
cn.Close()
End Sub
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<P>
<asp:Label ID="Msg1" runat="server" ForeColor="MidnightBlue"
Style="z-index: 108; left: 16px;
position: absolute; top: 19px" Font-Bold="True" Font-Size="Large"
Height="24px" Width="424px"></asp:Label>
</P>
<p>Per effettuare la ricerca di un libro inserire i parametri
<br />
<br />
<asp:Label ID="Label1" runat="server" Text="Inserisci Titolo"
Width="160px" Font-Size="Large" Height="24px"></asp:Label>
<asp:TextBox ID="txttitolo" runat="server" Font-Size="Large"
Height="25px"></asp:TextBox>
<asp:Button ID="Button2" runat="server" Text="Cerca" Font-Size="Large"
Height="32px" Width="72px" />
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="Inserisci Autore"
Font-Size="Large" Height="24px" Width="160px"></asp:Label>
<asp:TextBox ID="txtautore" runat="server" Font-Size="Large"
Height="25px"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Cerca" Font-Size="Large"
Height="32px" Width="72px" />
<br />
<br />
<asp:Label ID="Msg2" runat="server" Font-Bold="False" ForeColor="Red"
Style="z-index: 108; left: 560px; position: absolute; top: 320px"
Font-Size="Large" Height="32px" Width="352px"></asp:Label>
</p>
</div>
</form>
</body>
</html>

Mar 25 '06 #1
0 925

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Aaron Prohaska | last post by:
I have just run into a problem where I have a page that posts back to itself to execute code, except when the page does the post back it somehow executes code that is in our home page for the site....
4
by: Federico Bari | last post by:
Good morning all from italy, i have probably a compatibility problem with a html/javascript page. The aim of the code of the file test.htm you find here following (copy the 3 files in the...
1
by: Covad | last post by:
Hi all, For some reason my change() function is only called when the page loads. I'd much rather it gets called when the select changes. Here's the code: window.onload = init; function...
4
by: JesusFreak | last post by:
From: us_traveller@yahoo.com (JesusFreak) Newsgroups: microsoft.public.scripting.jscript Subject: toolbar script problem NNTP-Posting-Host: 192.92.126.136 Recently, I downloaded the following...
1
by: Julius Mong | last post by:
Dear all, according to the ASV3 manual known problem section, to make an <a> execute some Javascript onclick: ...
12
by: Jeff S | last post by:
In a VB.NET code behind module, I build a string for a link that points to a JavaScript function. The two lines of code below show what is relevant. PopupLink = "javascript:PopUpWindow(" &...
0
by: Thomas Due | last post by:
Hello, I am in the process of making my asp.net form to validate as xhtml 1.0 strict. So far I am doing well, but now I have a problem. The problem concerns specifically DropDownList and...
1
by: mostafahamdyfcis | last post by:
Hello all I have used the sample code which exist in the following URL: http://www.eggheadcafe.com/articles/javascript_modal_dialog.asp which create modal dialog box, but some problem...
4
by: r_ahimsa_m | last post by:
Hello, I am learning WWW technologies in Linux. I created index.html file which I can browse with Firefox/Konqueror using URL localhost/~robert/rozgloszenia/index.html. The page looks fine but...
1
by: paulyXvpf | last post by:
Hello javascript folks, PROBLEM: Javascript dropdown problem in IE 6 and IE7 DESCRIPTION: menu falls behind a container box on web page COMMENTS: It works fine in Firefox but not in IE 6/7...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.