Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > problem with javascript

Reply
Thread Tools

problem with javascript

 
 
sara
Guest
Posts: n/a
 
      03-25-2006
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>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generated JavaScript vs. Manually Created JavaScript: Which one comes first? Nathan Sokalski ASP .Net 4 11-08-2007 07:24 AM
JavaScript or not JavaScript Mark Rae ASP .Net 36 09-09-2006 01:12 PM
href="javascript:func()" vs href="#" onclick="javascript:func()" CRON HTML 24 06-20-2006 08:05 PM
Javascript -> Applet: variable reset after method call from javascript?! mcdeveloper Java 1 06-13-2006 08:34 AM
tricky javascript problem requires javascript guru ! Andy Javascript 2 03-04-2004 08:19 PM



Advertisments