Avatar billede nat Nybegynder
23. juni 2005 - 13:16 Der er 2 kommentarer og
1 løsning

Fejl i include fil

Hej experter

Jeg har includeret en breadcrumbfil fra microsoft, men den ser ud til at være lavet i vb og jeg er c#, så jeg kan ikke helt se hvad den brokker sig over, fejlen er følgende:

Compiler Error Message: CS1010: Newline in constant

Source Error:

Line 1:  <%
Line 2:  ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Line 3:  ' Microsoft Content Management Server - Sample Code File
Line 4:  '
Line 5:  ' This sample code is provided "AS IS" with no warranties, and confers no rights.


Source File: C:\Program Files\Microsoft Content Management Server\Server\IIS_NR\Microsoft Sample Includes\Breadcrumb.inc    Line: 3


Hele filen ser således ud:

<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Microsoft Content Management Server - Sample Code File
'
' This sample code is provided "AS IS" with no warranties, and confers no rights.
' You assume all risk for your use. © 2001 Microsoft Corporation. All rights reserved.
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'**********************************************************************************
'     File: Breadcrumb.inc
'    Author: Microsoft
'    Purpose: To provide a visual trail of sub-channels the user has navigated through within a channel.
'**********************************************************************************


' This recursive sub procedure accepts a channel as a parameter. It displays the current channel with
' a trail of channels (that it is nested within) trailing behind it.
Sub Breadcrumb(objChannel)
   
    ' If the current channel is not the root channel Then...
    If(Not objChannel.isRoot) Then
        'Test to see if the channel's parent is the root.  If it is then display it as a link
        If (objChannel.parent.isRoot) Then
            response.write("<a href = """& objChannel.URL &""">" & objChannel.DisplayName & "</a>")
        Else
            ' Call the sub procedure if the above conditions were not met. The nature of this recursive sub
            ' procedure means that each time the sub procedure calls itself, it "stacks" the information to be displayed
            ' until finally the the above condition is met; in this case until the channel's parent is the root channel.  It
            ' then displays each "stacked" channels information as a trail behind the current channel.           
            BreadCrumb(objChannel.parent)
            ' Display the "stacked" channels as a link
            response.write(" &gt; ")
            response.write("<a href = """& objChannel.URL &""">" & objChannel.DisplayName &"</a>")
        End if
    End if
End sub


' Setting the sub procedure into action; calling the sub procedure and passing in the current channel as a parameter
Call Breadcrumb(autosession.thischannel)

'EOF - SC - V1.0 Nov 2001
%>


Filen må meget gerne blive lavet om til c#.net
Avatar billede arne_v Ekspert
23. juni 2005 - 13:21 #1
Avatar billede nat Nybegynder
23. juni 2005 - 13:36 #2
Efter jeg har fjernet <%%> (som den ikke kan convertere), får jeg følgende fejl: An error occured while processing your code: -- line 19 col 1: invalid StructureMemberDecl

Så der må være noget i koden der ikke er korrekt
Avatar billede nat Nybegynder
30. juni 2005 - 16:41 #3
Jeg har fik en til at konverterer koden til C#, jeg lukker spørgsmålet
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