Pagina 1 di 3 1 2 3 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 26
  1. #1
    Utente di HTML.it L'avatar di Girogio
    Registrato dal
    May 2007
    Messaggi
    366

    Aiuto con visualizzazione notizie

    Salve ragazzi.
    Sono fresco fresco di registrazione-ossia sono nuovo del forum-.
    Non sò più dove sbattere la capoccia...vi prego aiutatemi.
    Premetto che nn sono un granchè con asp anzi sono proprio a livello sotto-base, cmq mi sto applicando e spero di riuscire nel mio intento.
    Vengo al punto.
    Sto costruendo un sito in asp; in questo sito ho una pagina default in htm (Home page), la quale è collegata ad altre pagine in asp stavolta. Tra queste ci stanno delle pagine per le news.
    Sono riuscito a costruire tutte le pagine necessarie per la visualizzazione e modifica delle news...ma quello che nn riesco e mi sta facendo impazzire è questo:
    io posso farsì che nella mia home page nella colonna di destra appaiano in ordine di data, delle brevi descrizioni delle news, che una volta cliccate mi portino nella pagina news in dettaglio asp?
    Ripeto la mia home page è in htm. Devo farla per forza in asp?

  2. #2
    Puoi farlo, ovviamente, ma la pagina deve essere .asp e non .html

  3. #3
    Utente di HTML.it L'avatar di Girogio
    Registrato dal
    May 2007
    Messaggi
    366
    Grazie per la velocissima risposta.
    Ero fortemente convinto che dovevo fare la default.asp.
    Non ti arrabiare se ti faccio una domanda.
    Dunque la mia home page contiene i tag con i div (spero sia corretto dire così) con un link ad un foglio di stile che ne "gestisce la struttura" (Layout a tre colonne)
    Se io voglio far diventare asp questa pagina basta cambiarla da default.htm ad .asp?
    E poi.........come inserisco il codice asp della pagina news posizionandolo proprio nella colonna di destra?
    Ho fatto tqante prove ma nn riesco.
    Ti prego aiutami che sto rischiando un esaurimento nervoso....
    Ti ringr5azio già fin da ora per la tua benevolenza
    Ciao Giorgio!

  4. #4
    basta che rinomini la pagina htm in pagina.asp (dove pagina è il nome della tua homepage).
    e poi tutto il contenuto asp lo metti tra i tag <% (per aprire lo script asp) e %> (per chiuderlo).
    era questo che volevi sapere?
    ...Se avanzo seguitemi... Se indietreggio uccidetemi...
    BiteFight... arruolati con me e non te ne pentirai

  5. #5
    Come ha detto soundforges, basta che dentro al DIV di destra metti il codice ASP necessario per visualizzare le news e rinomini la pagina da .html a .asp

  6. #6
    Utente di HTML.it L'avatar di Girogio
    Registrato dal
    May 2007
    Messaggi
    366
    Grazie ragazzi..ora ho capito.
    Fatto ciò dettomi....la situazione và....
    ma mi spiegate na cosa?
    Perchè nn si visualizza immediatamente la pagina quando la lancio dal broswer ma devo premere mille volte aggiorna ed alla fine mi compare la pagina....
    Spero di essermi spiegato.
    Nella mia ignoranza penso che sia un problema di IIS o sbaglio?
    Cè na soluzione!

  7. #7
    Originariamente inviato da Girogio
    Grazie ragazzi..ora ho capito.
    Fatto ciò dettomi....la situazione và....
    ma mi spiegate na cosa?
    Perchè nn si visualizza immediatamente la pagina quando la lancio dal broswer ma devo premere mille volte aggiorna ed alla fine mi compare la pagina....
    Spero di essermi spiegato.
    Nella mia ignoranza penso che sia un problema di IIS o sbaglio?
    Cè na soluzione!
    Forse lasci oggetti connessione o recordset aperti e questo a lungo andare fa decadere le prestazioni del webserver... tutto può essere...

  8. #8
    si penso che il problema sia in IIS probabilmente è lento il server o la query impegna molto tempo.
    quante news devi visualizzare?
    o magari ti looppa da qualche parte.
    controlla i cicli delle pagine. probabilmente ce ne è uno che ti tiene occupato il server per troppo tempo
    ...Se avanzo seguitemi... Se indietreggio uccidetemi...
    BiteFight... arruolati con me e non te ne pentirai

  9. #9
    Utente di HTML.it L'avatar di Girogio
    Registrato dal
    May 2007
    Messaggi
    366
    Ragazzi sto impazzendo...
    sto cercando di fare qll che mi avete detto ma
    se vi allego il codice mi ci date un occhiata voi.
    Prima chiedo!

  10. #10
    Utente di HTML.it L'avatar di Girogio
    Registrato dal
    May 2007
    Messaggi
    366
    Questa è la pagina che dovrei visualizzare in home page:

    <?xml version="1.0" encoding="iso-8859-1"?>
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

    <%
    Dim rsNews
    Dim rsNews_numRows

    Set rsNews = Server.CreateObject("ADODB.Recordset")
    rsNews.ActiveConnection = MM_News_STRING
    rsNews.Source = "SELECT * FROM news"
    rsNews.CursorType = 0
    rsNews.CursorLocation = 2
    rsNews.LockType = 1
    rsNews.Open()

    rsNews_numRows = 0
    %>
    <%
    Dim Repeat1__numRows
    Dim Repeat1__index

    Repeat1__numRows = -1
    Repeat1__index = 0
    rsNews_numRows = rsNews_numRows + Repeat1__numRows
    %>
    <%
    ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

    Dim rsNews_total
    Dim rsNews_first
    Dim rsNews_last

    ' set the record count
    rsNews_total = rsNews.RecordCount

    ' set the number of rows displayed on this page
    If (rsNews_numRows < 0) Then
    rsNews_numRows = rsNews_total
    Elseif (rsNews_numRows = 0) Then
    rsNews_numRows = 1
    End If

    ' set the first and last displayed record
    rsNews_first = 1
    rsNews_last = rsNews_first + rsNews_numRows - 1

    ' if we have the correct record count, check the other stats
    If (rsNews_total <> -1) Then
    If (rsNews_first > rsNews_total) Then
    rsNews_first = rsNews_total
    End If
    If (rsNews_last > rsNews_total) Then
    rsNews_last = rsNews_total
    End If
    If (rsNews_numRows > rsNews_total) Then
    rsNews_numRows = rsNews_total
    End If
    End If
    %>

    <%
    ' *** Recordset Stats: if we don't know the record count, manually count them

    If (rsNews_total = -1) Then

    ' count the total records by iterating through the recordset
    rsNews_total=0
    While (Not rsNews.EOF)
    rsNews_total = rsNews_total + 1
    rsNews.MoveNext
    Wend

    ' reset the cursor to the beginning
    If (rsNews.CursorType > 0) Then
    rsNews.MoveFirst
    Else
    rsNews.Requery
    End If

    ' set the number of rows displayed on this page
    If (rsNews_numRows < 0 Or rsNews_numRows > rsNews_total) Then
    rsNews_numRows = rsNews_total
    End If

    ' set the first and last displayed record
    rsNews_first = 1
    rsNews_last = rsNews_first + rsNews_numRows - 1

    If (rsNews_first > rsNews_total) Then
    rsNews_first = rsNews_total
    End If
    If (rsNews_last > rsNews_total) Then
    rsNews_last = rsNews_total
    End If

    End If
    %>


    <%
    Dim Repeat2__numRows
    Dim Repeat2__index

    Repeat2__numRows = -1
    Repeat2__index = 0
    rsNews_numRows = rsNews_numRows + Repeat2__numRows
    %>
    <%
    Dim MM_paramName
    %>

    <%
    ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

    Dim MM_keepNone
    Dim MM_keepURL
    Dim MM_keepForm
    Dim MM_keepBoth

    Dim MM_removeList
    Dim MM_item
    Dim MM_nextItem

    ' create the list of parameters which should not be maintained
    MM_removeList = "&index="
    If (MM_paramName <> "") Then
    MM_removeList = MM_removeList & "&" & MM_paramName & "="
    End If

    MM_keepURL=""
    MM_keepForm=""
    MM_keepBoth=""
    MM_keepNone=""

    ' add the URL parameters to the MM_keepURL string
    For Each MM_item In Request.QueryString
    MM_nextItem = "&" & MM_item & "="
    If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
    End If
    Next

    ' add the Form variables to the MM_keepForm string
    For Each MM_item In Request.Form
    MM_nextItem = "&" & MM_item & "="
    If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
    End If
    Next

    ' create the Form + URL string and remove the intial '&' from each of the strings
    MM_keepBoth = MM_keepURL & MM_keepForm
    If (MM_keepBoth <> "") Then
    MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
    End If
    If (MM_keepURL <> "") Then
    MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
    End If
    If (MM_keepForm <> "") Then
    MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
    End If

    ' a utility function used for adding additional parameters to these strings
    Function MM_joinChar(firstItem)
    If (firstItem <> "") Then
    MM_joinChar = "&"
    Else
    MM_joinChar = ""
    End If
    End Function
    %>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>LEGGI LE NEWS</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    </head>

    <body>
    <div align="center">


    <font color="#0000CC" size="2" face="Verdana, Arial, Helvetica, sans-serif">NEWS
    NEL SITO
    </font></p>

    <%
    if((rsNews_total=0)) Then
    response.Write"<p align='center'>"
    response.Write"<font face=Verdana size=2 color='#000099'>"
    response.Write("Non ci sono attualmente articoli da leggere")
    response.Write"</font>"
    response.Write"</p>"
    end if
    %>

    <%
    if((rsNews_total >=1)) Then
    %>
    <table width="400" border="0" cellspacing="0" cellpadding="0">
    <tr bgcolor="#000099">
    <td colspan="3" valign="middle" height="20"><font size="1" face="Verdana" color="#FFFFFF">Sommario
    delle news di oggi <%=Date()%>:
    </font></td>
    </tr>
    <tr>
    <td width="1" height="10" bgcolor="#000099">[img]spacer.gif[/img]</td>
    <td width="398" height="10">[img]spacer.gif[/img]</td>
    <td width="1" height="10" bgcolor="#000099">[img]spacer.gif[/img]</td>
    </tr>
    <%
    While ((Repeat1__numRows <> 0) AND (NOT rsNews.EOF))
    %>
    <tr>
    <td width="1" height="19" bgcolor="#000099">[img]spacer.gif[/img]</td>
    <td width="398" height="19"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">"><%=(rsNews.Fields.Item("titolo").Value)%></font></td>
    <td bgcolor="#000099" width="1" height="19">[img]spacer.gif[/img]</td>
    </tr>
    <tr>
    <td width="1" bgcolor="#000099" height="4">[img]spacer.gif[/img]</td>
    <td width="398" height="4">[img]spacer.gif[/img]</td>
    <td width="1" bgcolor="#000099" height="4">[img]spacer.gif[/img]</td>
    </tr>
    <%
    Repeat1__index=Repeat1__index+1
    Repeat1__numRows=Repeat1__numRows-1
    rsNews.MoveNext()
    Wend
    %>
    <tr>
    <td width="1" bgcolor="#000099" height="1">[img]spacer.gif[/img]</td>
    <td width="398" bgcolor="#000099" height="1">[img]spacer.gif[/img]</td>
    <td width="1" bgcolor="#000099" height="1">[img]spacer.gif[/img]</td>
    </tr>
    </table>
    <%
    end if
    %>


    </div>



    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    </tr>
    </table>

    </body>
    </html>
    <%
    rsNews.Close()
    Set rsNews = Nothing
    %>


    QUEST'ALTRO è IL FILE CONNECTION:

    <%
    ' FileName="Connection_odbc_conn_dsn.htm"
    ' Type="ADO"
    ' DesigntimeType="ADO"
    ' HTTP="false"
    ' Catalog=""
    ' Schema=""
    Dim MM_News_STRING
    MM_News_STRING = "dsn=News"
    %>



    Aiutatemi a risolvere stò problema nn sò più che fare....

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.