Showing posts with label expected. Show all posts
Showing posts with label expected. Show all posts

Saturday, March 31, 2012

Strange "expected ;" error

I am getting an error and I can't seem to figure out why. The error is on line 32.

Compiler Error Message: CS1002: ; expected

Line 30: strScriptName=Request.ServerVariables("SCRIPT_NAME");
Line 31: strFolder="/buildlauncher/";
Line 32: If (strScriptName.IndexOf(strFolder)=-1)
Line 33: {
Line 34: strbuildlauncher="class='selected'";

The language I am using is C# and I don't seem to understand what a ; would be doing in an if statement. What I am trying to do is determine if the folder specified in the strFolder variable is in the server variable SCRIPT_NAME.There are some syntax problems here:

If (strScriptName.IndexOf(strFolder)=-1)

should probably be

if(strScriptName.IndexOf(strFolder) == -1)

Note the case sensitivity and the equality operator.

Monday, March 26, 2012

Strange danish letters bug.

Hello,
I have a web site and i use some danish text on some of the page.
The letters appear as expected when i view the site with the VS 2005 built
in web server.
When i deploy the site either by XCOPY or as precompiled on win 2k3 IIS 6,
then i loose my danish chars.
can someone tell me how i can best deal with this problem.
many thanks in advance
JJOn 13 Feb, 10:15, "Jens Jensen" <j...@.jensen.dk> wrote:
> Hello,
> I have a web site and i use some danish text on some of the page.
> The letters appear as expected when i view the site with the VS 2005 built
> in web server.
> When i deploy the site either by XCOPY or as precompiled on win 2k3 IIS 6
,
> then i loose my danish chars.
> can someone tell me how i can best deal with this problem.
> many thanks in advance
> JJ
Are you including charset="UTF-8" in your html headers? Might be the
browser not interpreting the encoding correctly, so if you set it
explicitly it could work (alternatively, ISO-88591 should also be a
suitable encoding for Danish).
Tobes
> Are you including charset="UTF-8" in your html headers? Might be the
> browser not interpreting the encoding correctly, so if you set it
> explicitly it could work (alternatively, ISO-88591 should also be a
> suitable encoding for Danish).
> Tobes
>
Hi Tobes, that is an interesting detail. Can you give an example of where i
need to write this?
I'm using a master page.
Thanks
JJ
I tried the following :
<head runat="server">
<title>Untitled Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-88591"/>
</head>
<head runat="server">
<title>Untitled Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
non of them seems to help

Strange danish letters bug.

Hello,
I have a web site and i use some danish text on some of the page.
The letters appear as expected when i view the site with the VS 2005 built
in web server.
When i deploy the site either by XCOPY or as precompiled on win 2k3 IIS 6,
then i loose my danish chars.

can someone tell me how i can best deal with this problem.

many thanks in advance
JJOn 13 Feb, 10:15, "Jens Jensen" <j...@.jensen.dkwrote:

Quote:

Originally Posted by

Hello,
I have a web site and i use some danish text on some of the page.
The letters appear as expected when i view the site with the VS 2005 built
in web server.
When i deploy the site either by XCOPY or as precompiled on win 2k3 IIS 6,
then i loose my danish chars.
>
can someone tell me how i can best deal with this problem.
>
many thanks in advance
JJ


Are you including charset="UTF-8" in your html headers? Might be the
browser not interpreting the encoding correctly, so if you set it
explicitly it could work (alternatively, ISO-88591 should also be a
suitable encoding for Danish).

Tobes
Are you including charset="UTF-8" in your html headers? Might be the

Quote:

Originally Posted by

browser not interpreting the encoding correctly, so if you set it
explicitly it could work (alternatively, ISO-88591 should also be a
suitable encoding for Danish).
>
Tobes
>


Hi Tobes, that is an interesting detail. Can you give an example of where i
need to write this?
I'm using a master page.

Thanks
JJ
I tried the following :
<head runat="server">

<title>Untitled Page</title>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-88591"/>

</head>

<head runat="server">

<title>Untitled Page</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

</head>

non of them seems to help