DotNet & Netscape4

P

Patrice

- do you have this problem on accented characters ?
- what if you write directly to the document object ?
- can you give us the character code used instead of the expected characters
?
- can you see the HTTP header of the page in NS4 ?

Patrice

--
 
A

amos

Okay I think you're right, I post you the source code so you'll see.

I will post 3 files, the .html file, then the .aspx file and then the
..aspx.cs


----------------------------------------------------------------------------
HTML FILE :
----------------------------------------------------------------------------


<html>
<head>

<script language=javascript>
function ChangeIntitule()
{
if (document.Form1.Origine.selectedIndex==0)
stringX="";
if (document.Form1.Origine.selectedIndex==1)
stringX="Exemple: '1992-1998 : Ecole supérieure d'art dramatique de
Paris'";
if (document.Form1.Origine.selectedIndex==2)
stringX="Exemple: '2002 : Sara Pearson, Patrik Widrig (Contact
Improvisation)'";
if (document.Form1.Origine.selectedIndex==3)
stringX="Exemple: '2003 : Cinéma - Film Snatch - figuration 3
jours'";
if (document.Form1.Origine.selectedIndex==4)
stringX="Exemple: 'Mime', 'Pianiste', 'Trapeziste', etc..";
if (document.Form1.Origine.selectedIndex==5)
stringX="Exemple: 'yoga', 'photographie', 'sculpture', etc..";

if (document.layers){

document.countdownnsmain.document.countdownnssub.document.write(stringX);
document.countdownnsmain.document.countdownnssub.document.close();
}
else if (document.all||document.getElementById)
crosscount.innerHTML=stringX;
}
</script>

</head>

<body>


<form name=Form1>
<select name="Origine" id="Origine" class="letras"
onchange="ChangeIntitule();">
<option value="-1">Choisissez une rubrique</option>
<option value="0">Etudes / Formation Artistique</option>
<option value="1">Stage / Séminaire</option>
<option value="2">Expérience professionnelle</option>
<option value="3">Activité Artistique</option>
<option value="4">Loisirs</option>

</select>
</form>
<form name=qsd>
<ilayer id="countdownnsmain" width=300; height=50; visibility=show>
<layer id="countdownnssub" width=300; height=50; left=0 top=0>
</layer>
</ilayer>
</form>

</body>

</html>

----------------------------------------------------------------------------
END OF HTML FILE
----------------------------------------------------------------------------




----------------------------------------------------------------------------
..ASPX FILE (HTML VIEW)
----------------------------------------------------------------------------

<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="ProjectTest.WebForm1" %>
<html>
<head>

<script language=javascript>
function ChangeIntitule()
{
if (document.Form1.Origine.selectedIndex==0)
stringX="";
if (document.Form1.Origine.selectedIndex==1)
stringX="Exemple: '1992-1998 : Ecole supérieure d'art dramatique de
Paris'";
if (document.Form1.Origine.selectedIndex==2)
stringX="Exemple: '2002 : Sara Pearson, Patrik Widrig (Contact
Improvisation)'";
if (document.Form1.Origine.selectedIndex==3)
stringX="Exemple: '2003 : Cinéma - Film Snatch - figuration 3
jours'";
if (document.Form1.Origine.selectedIndex==4)
stringX="Exemple: 'Mime', 'Pianiste', 'Trapeziste', etc..";
if (document.Form1.Origine.selectedIndex==5)
stringX="Exemple: 'yoga', 'photographie', 'sculpture', etc..";

if (document.layers){

document.countdownnsmain.document.countdownnssub.document.write(stringX);
document.countdownnsmain.document.countdownnssub.document.close();
}
else if (document.all||document.getElementById)
crosscount.innerHTML=stringX;
}
</script>

</head>

<body>


<form name=Form1>
<select name="Origine" id="Origine" class="letras"
onchange="ChangeIntitule();">
<option value="-1">Choisissez une rubrique</option>
<option value="0">Etudes / Formation Artistique</option>
<option value="1">Stage / Séminaire</option>
<option value="2">Expérience professionnelle</option>
<option value="3">Activité Artistique</option>
<option value="4">Loisirs</option>

</select>
</form>
<form name=qsd>
<ilayer id="countdownnsmain" width=300; height=50; visibility=show>
<layer id="countdownnssub" width=300; height=50; left=0 top=0>
</layer>
</ilayer>
</form>

</body>

</html>

----------------------------------------------------------------------------
END OF .ASPX FILE (HTML VIEW)
----------------------------------------------------------------------------





----------------------------------------------------------------------------
..ASPX.CS FILE
----------------------------------------------------------------------------


using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;




namespace ProjectTest
{
public class WebForm1 : System.Web.UI.Page
{

private void Page_Load(object sender, System.EventArgs e)
{
}

#region Code généré par le Concepteur Web Form
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion
}
}


----------------------------------------------------------------------------
END OF .ASPX.CS FILE
----------------------------------------------------------------------------


So check the .HTML render and .ASPX render in Netscape 4 (or any
browser
that accepts LAYERS and you'll see some amazing stuff.


And by the way, thank you for the time you spend on my problem.
 
A

amos

I will post 3 files, the .html file, then the .aspx file and then the
..aspx.cs so you'll see by yourself where the bug comes from.


----------------------------------------------------------------------------
HTML FILE :
----------------------------------------------------------------------------


<html>
<head>

<script language=javascript>
function ChangeIntitule()
{
if (document.Form1.Origine.selectedIndex==0)
stringX="";
if (document.Form1.Origine.selectedIndex==1)
stringX="Exemple: '1992-1998 : Ecole supérieure d'art dramatique de
Paris'";
if (document.Form1.Origine.selectedIndex==2)
stringX="Exemple: '2002 : Sara Pearson, Patrik Widrig (Contact
Improvisation)'";
if (document.Form1.Origine.selectedIndex==3)
stringX="Exemple: '2003 : Cinéma - Film Snatch - figuration 3
jours'";
if (document.Form1.Origine.selectedIndex==4)
stringX="Exemple: 'Mime', 'Pianiste', 'Trapeziste', etc..";
if (document.Form1.Origine.selectedIndex==5)
stringX="Exemple: 'yoga', 'photographie', 'sculpture', etc..";

if (document.layers){

document.countdownnsmain.document.countdownnssub.document.write(stringX);
document.countdownnsmain.document.countdownnssub.document.close();
}
else if (document.all||document.getElementById)
crosscount.innerHTML=stringX;
}
</script>

</head>

<body>


<form name=Form1>
<select name="Origine" id="Origine" class="letras"
onchange="ChangeIntitule();">
<option value="-1">Choisissez une rubrique</option>
<option value="0">Etudes / Formation Artistique</option>
<option value="1">Stage / Séminaire</option>
<option value="2">Expérience professionnelle</option>
<option value="3">Activité Artistique</option>
<option value="4">Loisirs</option>

</select>
</form>
<form name=qsd>
<ilayer id="countdownnsmain" width=300; height=50; visibility=show>
<layer id="countdownnssub" width=300; height=50; left=0 top=0>
</layer>
</ilayer>
</form>

</body>

</html>

----------------------------------------------------------------------------
END OF HTML FILE
----------------------------------------------------------------------------




----------------------------------------------------------------------------
..ASPX FILE (HTML VIEW)
----------------------------------------------------------------------------

<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="ProjectTest.WebForm1" %>
<html>
<head>

<script language=javascript>
function ChangeIntitule()
{
if (document.Form1.Origine.selectedIndex==0)
stringX="";
if (document.Form1.Origine.selectedIndex==1)
stringX="Exemple: '1992-1998 : Ecole supérieure d'art dramatique de
Paris'";
if (document.Form1.Origine.selectedIndex==2)
stringX="Exemple: '2002 : Sara Pearson, Patrik Widrig (Contact
Improvisation)'";
if (document.Form1.Origine.selectedIndex==3)
stringX="Exemple: '2003 : Cinéma - Film Snatch - figuration 3
jours'";
if (document.Form1.Origine.selectedIndex==4)
stringX="Exemple: 'Mime', 'Pianiste', 'Trapeziste', etc..";
if (document.Form1.Origine.selectedIndex==5)
stringX="Exemple: 'yoga', 'photographie', 'sculpture', etc..";

if (document.layers){

document.countdownnsmain.document.countdownnssub.document.write(stringX);
document.countdownnsmain.document.countdownnssub.document.close();
}
else if (document.all||document.getElementById)
crosscount.innerHTML=stringX;
}
</script>

</head>

<body>


<form name=Form1>
<select name="Origine" id="Origine" class="letras"
onchange="ChangeIntitule();">
<option value="-1">Choisissez une rubrique</option>
<option value="0">Etudes / Formation Artistique</option>
<option value="1">Stage / Séminaire</option>
<option value="2">Expérience professionnelle</option>
<option value="3">Activité Artistique</option>
<option value="4">Loisirs</option>

</select>
</form>
<form name=qsd>
<ilayer id="countdownnsmain" width=300; height=50; visibility=show>
<layer id="countdownnssub" width=300; height=50; left=0 top=0>
</layer>
</ilayer>
</form>

</body>

</html>

----------------------------------------------------------------------------
END OF .ASPX FILE (HTML VIEW)
----------------------------------------------------------------------------





----------------------------------------------------------------------------
..ASPX.CS FILE
----------------------------------------------------------------------------


using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;




namespace ProjectTest
{
public class WebForm1 : System.Web.UI.Page
{

private void Page_Load(object sender, System.EventArgs e)
{
}

#region Code généré par le Concepteur Web Form
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

} #endregion
}
}


----------------------------------------------------------------------------
END OF .ASPX.CS FILE
----------------------------------------------------------------------------


So check the .HTML render and .ASPX render in Netscape 4 (or any
browser
that accepts LAYERS and you'll see some amazing stuff.


And by the way, thank you for the time you spend on my problem.
 
K

Ken Dopierala Jr.

Hi,

I took a look at this. I couldn't test it on Netscape 4 because the only
version I could find to download was 4.78 and it wouldn't install on Windows
2000. But I have a few suggestions. First of all the HTML that is rendered
is different. ASP.Net doesn't support using two forms. So what happens is
that in your HTML rendered page it adds an id attribute: id="Form1" and
id="Form2", when the .ASPX page renders it doesn't add those. This could be
what is allowing the javascript engine in Netscape 4 to be able to access
the layer stuff in the HTML page and not the ASPX page.

What I suggest you try is to inject your 2nd form into the page when the
page renders. You do this by overriding the Render method of the page.
This is in VB but to move it to C# about all you should have to change is
the function declaration and the variable declarations. Remember to include
the System.IO and System.Text namespaces.

Protected Overrides Sub Render(ByVal writer As
System.Web.UI.HtmlTextWriter)
Dim sw As StringWriter
Dim htmltw As HtmlTextWriter
Dim strText As String
'Assign the html to strText here.
sw = New StringWriter()
htmltw = New HtmlTextWriter(sw)
MyBase.Render(htmltw)
Dim temp As StringBuilder
temp = sw.GetStringBuilder
Dim str As String
str = temp.ToString
str = str.Replace("</form>", "</form> " + strText)
writer.Write(str)
End Sub

Set strText equal to the code below (don't forget to include the form ID and
make sure your quotes are correct):

<form name='qsd' id='Form2'>
<ilayer id="countdownnsmain" width=300; height=50; visibility=show>
<layer id="countdownnssub" width=300; height=50; left=0 top=0>
</layer>
</ilayer>
</form>

And remove that form from your ASPX page. This might get it working for you
but no guarantees. Also in your ilayer and layer tags make sure they are
formated properly. In some places you use ';' others you don't, around one
attribute you have quotes and others you don't. Anyway, that's how I would
approach making this work. Since I can't actually test this I can't tell
you how it will play out, but even if it doesn't work 100% keep your eyes
open for small things that might point you in the right direction. Good
luck! Ken.
 
G

Guest

Hello

try changing this in web.config the globalization setting in web.config to
look like this
<globalization requestEncoding="windows-1252"
responseEncoding="windows-1252" fileEncoding="windows-1252" />

Best regards,
Sherif
 
A

amos

Thank you, it solved the problem!!!!!


Sherif El-Metainy said:
Hello

try changing this in web.config the globalization setting in web.config to
look like this
<globalization requestEncoding="windows-1252"
responseEncoding="windows-1252" fileEncoding="windows-1252" />

Best regards,
Sherif
 
A

amos

The solution comes from sherif !! :

Hello

try changing this in web.config the globalization setting in web.config to
look like this
<globalization requestEncoding="windows-1252"
responseEncoding="windows-1252" fileEncoding="windows-1252" />

Best regards,
Sherif
 
A

amos

it works great,

just a question, when I change from utf8 to windows-1252,
will it change something for the rest of my app ?
 
K

Ken Dopierala Jr.

Hey, congratulations!

I actually thought you tried that already and it didn't work. Patrice told
you back on the 29th to do that. Glad it is working for you! Ken.
 
G

Guest

Hello
As long as you use only english and western european characters (characters
from code page 1252) in your pages, your app will not be affected. But if you
need to display text in other languages (such as russian, chinese or arabic)
you will need to use utf-8. I think Netscape 4 doesn't support unicode, but I
am not sure. Any
ways this setting can be applied per page. by changing the @page directive
or using <location> tag in web.config

Best regards,
Sherif
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top