Avatar billede jpj Nybegynder
03. oktober 2002 - 21:08 Der er 3 kommentarer og
1 løsning

paging på side med testprofil.asp?ProfId=41 i browser felt

Jeg har en side der viser spiller profiler.
Nu mangler jeg "bare" to pile <---forrige næste--->
så man kan gå frem og tilbage mellem profilerne istedet for at man skal ud på menuén.
Siden kan ses her.
http://www.hilleroed-hk.dk/2003/profilmenutest.asp
Avatar billede t_kris Nybegynder
03. oktober 2002 - 22:09 #1
Kan vi se koden
Avatar billede jpj Nybegynder
03. oktober 2002 - 22:14 #2
hvilken en af siderne.
det er på denne side pilene skal være testprofil.asp
Her er koden. DEn er lavet med dreamweaver mx så der er en masse ekstra linier, jeg ved ikke lige hvor jeg skal skille det ad så i får det hele.
********
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="include/nyhold.asp" -->

<%
Dim Profil_1__MM_ColParam
Profil_1__MM_ColParam = "10"
if (Request.QueryString("ProfId")    <> "") then Profil_1__MM_ColParam = Request.QueryString("ProfId")   
%>
<%
set Profil_1 = Server.CreateObject("ADODB.Recordset")
Profil_1.ActiveConnection = MM_nyhold1_STRING
Profil_1.Source = "SELECT ProfilSex.SexID, ProfilSex.KønNavn, Plads.PladsID, Plads.Pladsnavn, Profil.ProfId, Profil.Blusenr, Profil.Navn, Profil.Kaldenavn, Profil.Dato, Profil.Saesoner, Profil.Klubber, Profil.Maalsaeson, Profil.Ambitioner, Profil.Oplevelser, Profil.Erhverv, Profil.Livret, Profil.TV, Profil.Idol, Profil.Favorit, Profil.Onske, Profil.Billed  FROM ProfilSex INNER JOIN (Plads INNER JOIN Profil ON Plads.PladsID = Profil.PladsID) ON ProfilSex.SexID = Profil.SexID  WHERE Profil.ProfId=" + Replace(Profil_1__MM_ColParam, "'", "''") + ""
Profil_1.CursorType = 0
Profil_1.CursorLocation = 2
Profil_1.LockType = 3
Profil_1.Open()
Profil_1_numRows = 0
%>
<%
Dim profil
Dim profil_numRows

Set profil = Server.CreateObject("ADODB.Recordset")
profil.ActiveConnection = MM_nyhold1_STRING
profil.Source = "SELECT ProfilSex.SexID, Profil.ProfId, Profil.Navn  FROM (Profil INNER JOIN Plads ON Profil.PladsID = Plads.PladsID) INNER JOIN ProfilSex ON Profil.SexID = ProfilSex.SexID  WHERE ProfilSex.SexID=1"
profil.CursorType = 0
profil.CursorLocation = 2
profil.LockType = 1
profil.Open()

profil_numRows = 0
%>

<html><!-- InstanceBegin template="/Templates/profil.dwt.asp" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MyFunc()
{
history.back();
}

//-->
</script>
</head>

<body onLoad="MM_preloadImages('Images/Forsiden1.gif','Images/klubben1.gif','Images/holdene1.gif','Images/nyheder1.gif','Images/gaestebog1.gif','Images/Galleri1.gif','Images/billetpriser1.gif','Images/Sponsorer1.gif','Images/kontakt1.gif','Images/Links1.gif')">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <!--DWLayoutTable-->
  <tr>
    <td height="92" colspan="2" valign="top" bgcolor="#0000FF"><img src="Images/hhklogo.gif" width="150" height="90"></td>
    <td width="100%" valign="top" bgcolor="#0000FF"><div align="center"> <font color="#FFFFFF" size="7" face="Verdana, Arial, Helvetica, sans-serif">
        <strong>Hiller&oslash;d H&aring;ndbold klub</strong></font></div></td>
    <td width="1" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
  </tr>
  <tr>
    <td width="120" height="440" valign="top" bgcolor="#0000FF"><p>&nbsp;</p>
      <p><a href="default.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('forside','','Images/Forsiden1.gif',1)"><img src="Images/Forsiden.gif" alt="Gå til forsiden" name="forside" width="120" height="20" border="0"></a>
        <a href="klubben.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('klubben','','Images/klubben1.gif',1)"><img src="Images/klubben.gif" alt="Klubinfo" name="klubben" width="120" height="20" border="0"></a><a href="holdene.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Holdene','','Images/holdene1.gif',1)"><img src="Images/holdene.gif" alt="Holdene" name="Holdene" width="120" height="20" border="0"></a><a href="nyhederne.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('nyheder','','Images/nyheder1.gif',1)"><img src="Images/nyheder.gif" alt="Se nyhederne" name="nyheder" width="120" height="20" border="0"></a><a href="gaestebog.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('gaestbog','','Images/gaestebog1.gif',1)"><img src="Images/gaestebog.gif" alt="Gæstebog" name="gaestbog" width="120" height="20" border="0"></a><a href="galleri.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('galleri','','Images/Galleri1.gif',1)"><img src="Images/Galleri.gif" alt="Galleri" name="galleri" width="120" height="20" border="0"></a><a href="billetpriser.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('billetpriser','','Images/billetpriser1.gif',1)"><img src="Images/billetpriser.gif" alt="Billetbriser" name="billetpriser" width="120" height="20" border="0"></a><a href="sponsorer.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('sponsor','','Images/Sponsorer1.gif',1)"><img src="Images/Sponsorer.gif" alt="Sponsorer" name="sponsor" width="120" height="20" border="0"></a><a href="kontakt.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('kontakt','','Images/kontakt1.gif',1)"><img src="Images/kontakt.gif" alt="Kontakt klubben" name="kontakt" width="120" height="20" border="0"></a><a href="links.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Links','','Images/Links1.gif',1)"><img src="Images/Links.gif" alt="Links" name="Links" width="120" height="20" border="0"></a></p>
      <p>
        <%
Set objAd = Server.CreateObject("MSWC.Adrotator")
objAd.ClickAble = True

Response.Write objAd.GetAdvertisement("adrotator.txt")
Set objAd = Nothing
%>
      </p></td>
    <td colspan="2" rowspan="2" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0">
        <!--DWLayoutTable-->
        <tr>
          <td width="195" height="21"><a href="http://infos3.infosport.dk/cgi-bin/Display2.dhf/k44.mml?rv2=5370&spilnavn=Frederiksborg-hallen&week=0" target="_blank">Kampe
            i Frederiksborghallen</a></td>
          <td width="87" valign="top"><a href="stilling.asp" target="_self">Stilling</a></td>
          <td width="120">&nbsp;</td>
          <td width="191" valign="top"><a href="java script:MyFunc();">Tilbage</a></td>
          <td width="67" rowspan="2" valign="top"><!--DWLayoutEmptyCell-->&nbsp; </td>
        </tr>
        <tr>
          <td height="209" colspan="4" valign="top"><!-- InstanceBeginEditable name="EditRegion3" -->
            <table width="95%" border="0">
              <tr>
                <td colspan="2">&nbsp; </td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td> <div align="right"></div></td>
              </tr>
              <tr>
                <td colspan="2"><b><%=(Profil_1.Fields.Item("Navn").Value)%></b></td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td colspan="2">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td rowspan="8" colspan="2"><img src="foto/<%=(Profil_1.Fields.Item("Billed").Value)%>" width="120" height="160" align="top"></td>
                <td>&nbsp;</td>
                <td><b><font size="-1">Tr&oslash;jenr.</font></b></td>
                <td><font size="-1"><%=(Profil_1.Fields.Item("Blusenr").Value)%></font></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><b><font size="-1">Navn</font></b></td>
                <td><font size="-1"><%=(Profil_1.Fields.Item("Navn").Value)%></font></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><b><font size="-1">Kaldenavn</font></b></td>
                <td><font size="-1"><%=(Profil_1.Fields.Item("Kaldenavn").Value)%></font></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><b><font size="-1">F&oslash;dselsdato</font></b></td>
                <td><font size="-1"><%=(Profil_1.Fields.Item("Dato").Value)%></font></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><b><font size="-1">Position</font></b></td>
                <td><font size="-1"><%=(Profil_1.Fields.Item("Pladsnavn").Value)%></font></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><b><font size="-1">S&aelig;soner i HHK</font></b></td>
                <td><font size="-1"><%=(Profil_1.Fields.Item("Saesoner").Value)%></font></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><b><font size="-1">Tidligere klubber</font></b></td>
                <td><font size="-1"><%=(Profil_1.Fields.Item("Klubber").Value)%></font></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><b><font size="-1">Erhverv</font></b></td>
                <td><font size="-1"><%=(Profil_1.Fields.Item("Erhverv").Value)%></font></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><b><font size="-1">M&aring;l for s&aelig;sonen</font></b></td>
                <td rowspan="2" valign="top"><font size="-1">
                  <%
If profil_1.Fields.Item("Maalsaeson").Value<>"Null" Then 
%>
                  <%=(Replace(Profil_1.Fields.Item("Maalsaeson").Value,vbCrLf,"<br>"))%>
                  <%
End If
%>
                  </font></td>
                <td>&nbsp;</td>
                <td><b><font size="-1">Livret</font></b></td>
                <td><font size="-1"><%=(Profil_1.Fields.Item("Livret").Value)%></font></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td><b><font size="-1">Yndlings TV</font></b></td>
                <td><font size="-1"><%=(Profil_1.Fields.Item("TV").Value)%></font></td>
              </tr>
              <tr>
                <td height="15"><b><font size="-1">Ambitioner</font></b></td>
                <td height="15" rowspan="2" valign="top"><font size="-1">
                  <%
If profil_1.Fields.Item("Ambitioner").Value<>"Null" Then 
%>
                  <%=(Replace(Profil_1.Fields.Item("Ambitioner").Value,vbCrLf,"<br>"))%>
                  <%
End If
%>
                  </font></td>
                <td height="15">&nbsp;</td>
                <td height="15"><b><font size="-1">Idol</font></b></td>
                <td height="15"><font size="-1"><%=(Profil_1.Fields.Item("Idol").Value)%></font></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td><b><font size="-1">Yndlingsspiller</font></b></td>
                <td><font size="-1"><%=(Profil_1.Fields.Item("Favorit").Value)%></font></td>
              </tr>
              <tr>
                <td><b><font size="-1">St&oslash;rste h&aring;ndboldoplevelse</font></b></td>
                <td rowspan="2" valign="top"><font size="-1">
                  <%
If profil_1.Fields.Item("Oplevelser").Value<>"Null" Then 
%>
                  <%=(Replace(Profil_1.Fields.Item("Oplevelser").Value,vbCrLf,"<br>"))%>
                  <%
End If
%>
                  </font></td>
                <td>&nbsp;</td>
                <td><b><font size="-1">St&oslash;rste &oslash;nske</font></b></td>
                <td><font size="-1"><%=(Profil_1.Fields.Item("Onske").Value)%></font></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td height="23">&nbsp;</td>
                <td height="23">&nbsp;</td>
                <td height="23">&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp; </td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table>
            <!-- InstanceEndEditable --></td>
        </tr>
      </table></td>
    <td rowspan="3" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
  </tr>
  <tr>
    <td height="19" valign="top" bgcolor="#0000FF"><!--DWLayoutEmptyCell-->&nbsp;</td>
  </tr>
  <tr>
    <td height="11"></td>
    <td width="30"></td>
    <td></td>
  </tr><tr><td height="1"><img src="../images/spacer.gif" alt="" width="120" height="1"></td><td><img src="../images/spacer.gif" alt="" width="30" height="1"></td><td></td><td><img src="../images/spacer.gif" alt="" width="1" height="1"></td></tr>
 
</table>
</body>
<!-- InstanceEnd --></html>
<%
Profil_1.Close()
%>
<%
profil.Close()
Set profil = Nothing
%>
Avatar billede jpj Nybegynder
22. oktober 2002 - 00:24 #3
Jeg lukker uden at få det fixet........
Avatar billede jpv Nybegynder
11. januar 2003 - 20:51 #4
Her er nogle koder jeg fandt et andet sted. Jeg har ikke afprøvet dem selv, men du kan se dem på på http://activedeveloper.dk/aspdigital/kapitel2/paging.asp
Så har du noget til næste gang

<html><head>
<title>Paging af et recordset</title>
</head><body>

<%
intPage = Request("page")
If isNumeric(intPage) = False Or intPage < 1 Then
    intPage = 1
End If

Set rs = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT LinkURL FROM Links"
strDSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&Server.MapPath("/aspdigital/db/demo.mdb")
rs.Open strSQL, strDSN, 1
If Not (rs.BOF Or rs.EOF) Then
    rs.PageSize = 10
    rs.AbsolutePage = intPage
    intRecCount = rs.PageSize
    intPageCount = rs.PageCount
    Response.Write "<p><b>Side " & intPage & " af " & intPageCount & "</b></p>"
    Do While Not rs.EOF And intRecCount > 0
        Response.Write rs("LinkURL") & "<br>"
    intRecCount = intRecCount - 1
    rs.MoveNext
    Loop
End If
rs.Close
Set rs = Nothing

Response.Write "<p>Gå til side "
For intNum = 1 To intPageCount
    Response.Write "<a href=paging.asp?page=" & intNum & ">" & intNum & "</a> "
Next

Response.Write "<p>"
If Clng(intPage) > 1 Then
    Response.Write "<a href=paging.asp?page=" & intPage - 1 & ">&lt;&lt;</a>"
Else
    Response.Write "&lt;&lt;"
End If

Response.Write "&nbsp;"

If Clng(intPage) < Clng(intPageCount) Then
    Response.Write "<a href=paging.asp?page=" & intPage + 1 & ">&gt;&gt;</a> "
Else
    Response.Write "&gt;&gt;"
End If
%>

</body></html>
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester