473,385 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Stopping Attributes.Add from converting my JavaScript event code to HTML

I add several JavaScript events (onchange, onkeypress, etc.) to Controls
using the Add method of the Attributes collection. However, if the
JavaScript code contains certain characters, such as & or < or several
others, it converts them to html, such as &amp; or &lt; which can sometimes
cause my scripts not to work. How can I prevent ASP.NET from doing this?
Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Jul 24 '06 #1
11 1389
Hi Nathan,

For that is the HTML en/decode classes.

http://msdn.microsoft.com/library/de...codeTopic1.asp

I hope this helps,

Cor

"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:OW*************@TK2MSFTNGP03.phx.gbl...
>I add several JavaScript events (onchange, onkeypress, etc.) to Controls
using the Add method of the Attributes collection. However, if the
JavaScript code contains certain characters, such as & or < or several
others, it converts them to html, such as &amp; or &lt; which can sometimes
cause my scripts not to work. How can I prevent ASP.NET from doing this?
Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

Jul 25 '06 #2
That would be great if I were using something like the
System.Web.UI.HtmlTextWriter, but I am simply adding attributes objects
created declaratively in my *.aspx file. For example, I have the following
as part of my *.aspx file:
<asp:TextBox ID="txtRed" runat="server" MaxLength="3"
Width="35px">0</asp:TextBox>
And I have the following in my *.aspx.vb file:
txtRed.Attributes.Add("onchange", "if(this.value>=0&&this.value<=255){" &
redslider.ClientSetFunctionName & "(this.value);}else{this.value=" &
redslider.ClientGetFunctionName & "();}")
When my page is rendered, this comes out as the following (notice that the
&'s and < are replaced with their HTML representations):
onchange="if(this.value>=0&amp;&amp;this.value&lt; =255){sliderRed_setvalue(this.value);}else{this.va lue=sliderRed_getvalue();}"
The Server.HtmlDecode() method would not help me here because the
Attributes.Add() method takes a String as it's second parameter, and
Server.HtmlDecode() would not have any effect on it in my case, so I would
actually be passing the same String. Any other ideas? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:OG**************@TK2MSFTNGP04.phx.gbl...
Hi Nathan,

For that is the HTML en/decode classes.

http://msdn.microsoft.com/library/de...codeTopic1.asp

I hope this helps,

Cor

"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:OW*************@TK2MSFTNGP03.phx.gbl...
>>I add several JavaScript events (onchange, onkeypress, etc.) to Controls
using the Add method of the Attributes collection. However, if the
JavaScript code contains certain characters, such as & or < or several
others, it converts them to html, such as &amp; or &lt; which can
sometimes cause my scripts not to work. How can I prevent ASP.NET from
doing this? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/


Jul 25 '06 #3
Nathan,

Are you sure you do not need this one. (In this page is a nice sample)
http://msdn2.microsoft.com/en-us/lib...ttributes.aspx

Now you are using this one to add an attribute let say to an listbox, which
is in my idea sure not a piece of javascript
http://msdn2.microsoft.com/en-us/lib...ction.add.aspx

I hope this helps,

Cor
"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:ew*************@TK2MSFTNGP04.phx.gbl...
That would be great if I were using something like the
System.Web.UI.HtmlTextWriter, but I am simply adding attributes objects
created declaratively in my *.aspx file. For example, I have the following
as part of my *.aspx file:
<asp:TextBox ID="txtRed" runat="server" MaxLength="3"
Width="35px">0</asp:TextBox>
And I have the following in my *.aspx.vb file:
txtRed.Attributes.Add("onchange", "if(this.value>=0&&this.value<=255){" &
redslider.ClientSetFunctionName & "(this.value);}else{this.value=" &
redslider.ClientGetFunctionName & "();}")
When my page is rendered, this comes out as the following (notice that the
&'s and < are replaced with their HTML representations):
onchange="if(this.value>=0&amp;&amp;this.value&lt; =255){sliderRed_setvalue(this.value);}else{this.va lue=sliderRed_getvalue();}"
The Server.HtmlDecode() method would not help me here because the
Attributes.Add() method takes a String as it's second parameter, and
Server.HtmlDecode() would not have any effect on it in my case, so I would
actually be passing the same String. Any other ideas? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:OG**************@TK2MSFTNGP04.phx.gbl...
>Hi Nathan,

For that is the HTML en/decode classes.

http://msdn.microsoft.com/library/de...codeTopic1.asp

I hope this helps,

Cor

"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:OW*************@TK2MSFTNGP03.phx.gbl...
>>>I add several JavaScript events (onchange, onkeypress, etc.) to Controls
using the Add method of the Attributes collection. However, if the
JavaScript code contains certain characters, such as & or < or several
others, it converts them to html, such as &amp; or &lt; which can
sometimes cause my scripts not to work. How can I prevent ASP.NET from
doing this? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/



Jul 25 '06 #4
I almost always create a .js file and include a reference in the head
tag to it on every page in a web app, if you did it this way you would
not need to add javascript to .net control attributes and could simply
add a function name rather than the full javascript?
Cor Ligthert [MVP] wrote:
Nathan,

Are you sure you do not need this one. (In this page is a nice sample)
http://msdn2.microsoft.com/en-us/lib...ttributes.aspx

Now you are using this one to add an attribute let say to an listbox, which
is in my idea sure not a piece of javascript
http://msdn2.microsoft.com/en-us/lib...ction.add.aspx

I hope this helps,

Cor
"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:ew*************@TK2MSFTNGP04.phx.gbl...
That would be great if I were using something like the
System.Web.UI.HtmlTextWriter, but I am simply adding attributes objects
created declaratively in my *.aspx file. For example, I have the following
as part of my *.aspx file:
<asp:TextBox ID="txtRed" runat="server" MaxLength="3"
Width="35px">0</asp:TextBox>
And I have the following in my *.aspx.vb file:
txtRed.Attributes.Add("onchange", "if(this.value>=0&&this.value<=255){" &
redslider.ClientSetFunctionName & "(this.value);}else{this.value=" &
redslider.ClientGetFunctionName & "();}")
When my page is rendered, this comes out as the following (notice that the
&'s and < are replaced with their HTML representations):
onchange="if(this.value>=0&amp;&amp;this.value&lt; =255){sliderRed_setvalue(this.value);}else{this.va lue=sliderRed_getvalue();}"
The Server.HtmlDecode() method would not help me here because the
Attributes.Add() method takes a String as it's second parameter, and
Server.HtmlDecode() would not have any effect on it in my case, so I would
actually be passing the same String. Any other ideas? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:OG**************@TK2MSFTNGP04.phx.gbl...
Hi Nathan,

For that is the HTML en/decode classes.

http://msdn.microsoft.com/library/de...codeTopic1.asp

I hope this helps,

Cor

"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:OW*************@TK2MSFTNGP03.phx.gbl...
I add several JavaScript events (onchange, onkeypress, etc.) to Controls
using the Add method of the Attributes collection. However, if the
JavaScript code contains certain characters, such as & or < or several
others, it converts them to html, such as &amp; or &lt; which can
sometimes cause my scripts not to work. How can I prevent ASP.NET from
doing this? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Jul 25 '06 #5
In the first link you provided, the following example is given:

TextBox1.Attributes("onblur") = "javascript:alert('Hello! Focus lost from
text box!!');"

First of all, the value in this example does not have any characters that
would be affected by Server.HtmlEncode(). Second, it does not use the Add()
method (I would be willing to use either one, I do prefer the Add() method).
In your second link, the following example is given:

FirstSelect.Attributes.Add("Multiple", "True")

This example, like you said, is not even JavaScript, and also does not have
any characters that would be affected by Server.HtmlEncode().
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2***************@TK2MSFTNGP05.phx.gbl...
Nathan,

Are you sure you do not need this one. (In this page is a nice sample)
http://msdn2.microsoft.com/en-us/lib...ttributes.aspx

Now you are using this one to add an attribute let say to an listbox,
which is in my idea sure not a piece of javascript
http://msdn2.microsoft.com/en-us/lib...ction.add.aspx

I hope this helps,

Cor
"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:ew*************@TK2MSFTNGP04.phx.gbl...
>That would be great if I were using something like the
System.Web.UI.HtmlTextWriter, but I am simply adding attributes objects
created declaratively in my *.aspx file. For example, I have the
following as part of my *.aspx file:
<asp:TextBox ID="txtRed" runat="server" MaxLength="3"
Width="35px">0</asp:TextBox>
And I have the following in my *.aspx.vb file:
txtRed.Attributes.Add("onchange", "if(this.value>=0&&this.value<=255){" &
redslider.ClientSetFunctionName & "(this.value);}else{this.value=" &
redslider.ClientGetFunctionName & "();}")
When my page is rendered, this comes out as the following (notice that
the &'s and < are replaced with their HTML representations):
onchange="if(this.value>=0&amp;&amp;this.value&lt ;=255){sliderRed_setvalue(this.value);}else{this.v alue=sliderRed_getvalue();}"
The Server.HtmlDecode() method would not help me here because the
Attributes.Add() method takes a String as it's second parameter, and
Server.HtmlDecode() would not have any effect on it in my case, so I
would actually be passing the same String. Any other ideas? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:OG**************@TK2MSFTNGP04.phx.gbl...
>>Hi Nathan,

For that is the HTML en/decode classes.

http://msdn.microsoft.com/library/de...codeTopic1.asp

I hope this helps,

Cor

"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:OW*************@TK2MSFTNGP03.phx.gbl...
I add several JavaScript events (onchange, onkeypress, etc.) to Controls
using the Add method of the Attributes collection. However, if the
JavaScript code contains certain characters, such as & or < or several
others, it converts them to html, such as &amp; or &lt; which can
sometimes cause my scripts not to work. How can I prevent ASP.NET from
doing this? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/



Jul 25 '06 #6
That might be true if you're talking about generating a *.js file using
ASP.NET. The reason I am adding the attributes using ASP.NET code is because
a large amount of the JavaScript is generated (it is different for different
instances of the control). You are correct in that I could create functions
and then call the functions, but since a large amount of my JavaScript is
generated, this would involve creating a lot of functions, many of which
might be only one line, almost doubling the amount of JavaScript, and it
would also involve generating unique names for all the functions. This could
end up being very inefficient, as well as confusing and increasing the
download size of the page.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"tfsmag" <tf****@gmail.comwrote in message
news:11*********************@75g2000cwc.googlegrou ps.com...
>I almost always create a .js file and include a reference in the head
tag to it on every page in a web app, if you did it this way you would
not need to add javascript to .net control attributes and could simply
add a function name rather than the full javascript?
Cor Ligthert [MVP] wrote:
>Nathan,

Are you sure you do not need this one. (In this page is a nice sample)
http://msdn2.microsoft.com/en-us/lib...ttributes.aspx

Now you are using this one to add an attribute let say to an listbox,
which
is in my idea sure not a piece of javascript
http://msdn2.microsoft.com/en-us/lib...ction.add.aspx

I hope this helps,

Cor
"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:ew*************@TK2MSFTNGP04.phx.gbl...
That would be great if I were using something like the
System.Web.UI.HtmlTextWriter, but I am simply adding attributes objects
created declaratively in my *.aspx file. For example, I have the
following
as part of my *.aspx file:
<asp:TextBox ID="txtRed" runat="server" MaxLength="3"
Width="35px">0</asp:TextBox>
And I have the following in my *.aspx.vb file:
txtRed.Attributes.Add("onchange", "if(this.value>=0&&this.value<=255){"
&
redslider.ClientSetFunctionName & "(this.value);}else{this.value=" &
redslider.ClientGetFunctionName & "();}")
When my page is rendered, this comes out as the following (notice that
the
&'s and < are replaced with their HTML representations):
onchange="if(this.value>=0&amp;&amp;this.value&lt; =255){sliderRed_setvalue(this.value);}else{this.va lue=sliderRed_getvalue();}"
The Server.HtmlDecode() method would not help me here because the
Attributes.Add() method takes a String as it's second parameter, and
Server.HtmlDecode() would not have any effect on it in my case, so I
would
actually be passing the same String. Any other ideas? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:OG**************@TK2MSFTNGP04.phx.gbl...
Hi Nathan,

For that is the HTML en/decode classes.

http://msdn.microsoft.com/library/de...codeTopic1.asp

I hope this helps,

Cor

"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:OW*************@TK2MSFTNGP03.phx.gbl...
I add several JavaScript events (onchange, onkeypress, etc.) to
Controls
using the Add method of the Attributes collection. However, if the
JavaScript code contains certain characters, such as & or < or several
others, it converts them to html, such as &amp; or &lt; which can
sometimes cause my scripts not to work. How can I prevent ASP.NET from
doing this? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/



Jul 25 '06 #7
Nathan,

You cannot use a ship to fly, in my opinion are you trying that by using the
wrong commands, if you want to fly with a ship, than you have a lot of
troubles, with a plane it is much easier.

What your cargo is, is not the first question.

Just my thought, reading your reply.

Cor

"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:%2****************@TK2MSFTNGP06.phx.gbl...
In the first link you provided, the following example is given:

TextBox1.Attributes("onblur") = "javascript:alert('Hello! Focus lost from
text box!!');"

First of all, the value in this example does not have any characters that
would be affected by Server.HtmlEncode(). Second, it does not use the
Add() method (I would be willing to use either one, I do prefer the Add()
method). In your second link, the following example is given:

FirstSelect.Attributes.Add("Multiple", "True")

This example, like you said, is not even JavaScript, and also does not
have any characters that would be affected by Server.HtmlEncode().
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2***************@TK2MSFTNGP05.phx.gbl...
>Nathan,

Are you sure you do not need this one. (In this page is a nice sample)
http://msdn2.microsoft.com/en-us/lib...ttributes.aspx

Now you are using this one to add an attribute let say to an listbox,
which is in my idea sure not a piece of javascript
http://msdn2.microsoft.com/en-us/lib...ction.add.aspx

I hope this helps,

Cor
"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:ew*************@TK2MSFTNGP04.phx.gbl...
>>That would be great if I were using something like the
System.Web.UI.HtmlTextWriter, but I am simply adding attributes objects
created declaratively in my *.aspx file. For example, I have the
following as part of my *.aspx file:
<asp:TextBox ID="txtRed" runat="server" MaxLength="3"
Width="35px">0</asp:TextBox>
And I have the following in my *.aspx.vb file:
txtRed.Attributes.Add("onchange", "if(this.value>=0&&this.value<=255){"
& redslider.ClientSetFunctionName & "(this.value);}else{this.value=" &
redslider.ClientGetFunctionName & "();}")
When my page is rendered, this comes out as the following (notice that
the &'s and < are replaced with their HTML representations):
onchange="if(this.value>=0&amp;&amp;this.value&l t;=255){sliderRed_setvalue(this.value);}else{this. value=sliderRed_getvalue();}"
The Server.HtmlDecode() method would not help me here because the
Attributes.Add() method takes a String as it's second parameter, and
Server.HtmlDecode() would not have any effect on it in my case, so I
would actually be passing the same String. Any other ideas? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:OG**************@TK2MSFTNGP04.phx.gbl...
Hi Nathan,

For that is the HTML en/decode classes.

http://msdn.microsoft.com/library/de...codeTopic1.asp

I hope this helps,

Cor

"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:OW*************@TK2MSFTNGP03.phx.gbl...
>I add several JavaScript events (onchange, onkeypress, etc.) to
>Controls using the Add method of the Attributes collection. However, if
>the JavaScript code contains certain characters, such as & or < or
>several others, it converts them to html, such as &amp; or &lt; which
>can sometimes cause my scripts not to work. How can I prevent ASP.NET
>from doing this? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
>




Jul 26 '06 #8
Nathan, in addition to Cor's suggestions, let me add that there is not much
you can do at this point that can change what is output by the
htmltextwriter. It's this writer which actually minimally HTML-encodes
everything. This is possibly for xhtml comformance, since an & is not a
legal character within an xml document and needs to be escaped. So are
characters like <>. I cant imagine you working around this, without doing
something a bit trival like through the HttpResponse.Filter which gives you
a chance to rewrite what is output by the htmltextwriter before it is
transmitted to the page =P
http://msdn2.microsoft.com/en-us/lib...se.filter.aspx

There is full working example in the above url, that shows you howto attach
a filter to the response stream that makes the text displayed to the page
all uppercase.You will be searching for &amp; or whatever other html code
characters you dont want, and replacing them with the original you had
wanted.

That said, can you explain further why you want to work around this ? I dont
understand why your script shouldnt work *sometimes* with those characters
escaped.

Your problem, in my humble opinion is somewhere else, possibly in the js
code that you are writing, but i cant say much since the code you pasted
works very well *always* for me. I have pasted the code i tested below. Let
us know, what you are doing differently and under what circumstance its not
working for you.

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
TextBox1.Attributes.Add("onchange", "if (parseInt(this.value) >= 0
&& parseInt(this.value) <= 255){ alert('more than 0 and less than a
100');}");
}

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" Text="" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>

"Cor Ligthert [MVP]" <no************@planet.nlha scritto nel messaggio
news:OU**************@TK2MSFTNGP03.phx.gbl...
Nathan,

You cannot use a ship to fly, in my opinion are you trying that by using
the wrong commands, if you want to fly with a ship, than you have a lot of
troubles, with a plane it is much easier.

What your cargo is, is not the first question.

Just my thought, reading your reply.

Cor

"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:%2****************@TK2MSFTNGP06.phx.gbl...
>In the first link you provided, the following example is given:

TextBox1.Attributes("onblur") = "javascript:alert('Hello! Focus lost from
text box!!');"

First of all, the value in this example does not have any characters that
would be affected by Server.HtmlEncode(). Second, it does not use the
Add() method (I would be willing to use either one, I do prefer the Add()
method). In your second link, the following example is given:

FirstSelect.Attributes.Add("Multiple", "True")

This example, like you said, is not even JavaScript, and also does not
have any characters that would be affected by Server.HtmlEncode().
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2***************@TK2MSFTNGP05.phx.gbl...
>>Nathan,

Are you sure you do not need this one. (In this page is a nice sample)
http://msdn2.microsoft.com/en-us/lib...ttributes.aspx

Now you are using this one to add an attribute let say to an listbox,
which is in my idea sure not a piece of javascript
http://msdn2.microsoft.com/en-us/lib...ction.add.aspx

I hope this helps,

Cor
"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:ew*************@TK2MSFTNGP04.phx.gbl...
That would be great if I were using something like the
System.Web.UI.HtmlTextWriter, but I am simply adding attributes objects
created declaratively in my *.aspx file. For example, I have the
following as part of my *.aspx file:
<asp:TextBox ID="txtRed" runat="server" MaxLength="3"
Width="35px">0</asp:TextBox>
And I have the following in my *.aspx.vb file:
txtRed.Attributes.Add("onchange", "if(this.value>=0&&this.value<=255){"
& redslider.ClientSetFunctionName & "(this.value);}else{this.value=" &
redslider.ClientGetFunctionName & "();}")
When my page is rendered, this comes out as the following (notice that
the &'s and < are replaced with their HTML representations):
onchange="if(this.value>=0&amp;&amp;this.value& lt;=255){sliderRed_setvalue(this.value);}else{this .value=sliderRed_getvalue();}"
The Server.HtmlDecode() method would not help me here because the
Attributes.Add() method takes a String as it's second parameter, and
Server.HtmlDecode() would not have any effect on it in my case, so I
would actually be passing the same String. Any other ideas? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:OG**************@TK2MSFTNGP04.phx.gbl...
Hi Nathan,
>
For that is the HTML en/decode classes.
>
http://msdn.microsoft.com/library/de...codeTopic1.asp
>
I hope this helps,
>
Cor
>
"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:OW*************@TK2MSFTNGP03.phx.gbl...
>>I add several JavaScript events (onchange, onkeypress, etc.) to
>>Controls using the Add method of the Attributes collection. However,
>>if the JavaScript code contains certain characters, such as & or < or
>>several others, it converts them to html, such as &amp; or &lt; which
>>can sometimes cause my scripts not to work. How can I prevent ASP.NET
>>from doing this? Thanks.
>--
>Nathan Sokalski
>nj********@hotmail.com
>http://www.nathansokalski.com/
>>
>
>




Jul 26 '06 #9
I haven't really had any problems with the JavaScript not working because of
this, but it worries (not to mention frustrates) me that I might in the
future for the following reason:

Cross-browser compatibility: I am afraid that some new version of some
browser (or maybe even an existing one, as of now I have only tested on IE6)
will not like this incorrect JavaScript syntax
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Alessandro Zifiglio" <AlessandroZifiglio @ -h-o-t-m-a-i-l-c-o-mwrote in
message news:%2***************@TK2MSFTNGP05.phx.gbl...
Nathan, in addition to Cor's suggestions, let me add that there is not
much you can do at this point that can change what is output by the
htmltextwriter. It's this writer which actually minimally HTML-encodes
everything. This is possibly for xhtml comformance, since an & is not a
legal character within an xml document and needs to be escaped. So are
characters like <>. I cant imagine you working around this, without doing
something a bit trival like through the HttpResponse.Filter which gives
you a chance to rewrite what is output by the htmltextwriter before it is
transmitted to the page =P
http://msdn2.microsoft.com/en-us/lib...se.filter.aspx

There is full working example in the above url, that shows you howto
attach a filter to the response stream that makes the text displayed to
the page all uppercase.You will be searching for &amp; or whatever other
html code characters you dont want, and replacing them with the original
you had wanted.

That said, can you explain further why you want to work around this ? I
dont understand why your script shouldnt work *sometimes* with those
characters escaped.

Your problem, in my humble opinion is somewhere else, possibly in the js
code that you are writing, but i cant say much since the code you pasted
works very well *always* for me. I have pasted the code i tested below.
Let us know, what you are doing differently and under what circumstance
its not working for you.

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
TextBox1.Attributes.Add("onchange", "if (parseInt(this.value) >= 0
&& parseInt(this.value) <= 255){ alert('more than 0 and less than a
100');}");
}

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" Text="" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>

"Cor Ligthert [MVP]" <no************@planet.nlha scritto nel messaggio
news:OU**************@TK2MSFTNGP03.phx.gbl...
>Nathan,

You cannot use a ship to fly, in my opinion are you trying that by using
the wrong commands, if you want to fly with a ship, than you have a lot
of troubles, with a plane it is much easier.

What your cargo is, is not the first question.

Just my thought, reading your reply.

Cor

"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:%2****************@TK2MSFTNGP06.phx.gbl...
>>In the first link you provided, the following example is given:

TextBox1.Attributes("onblur") = "javascript:alert('Hello! Focus lost
from text box!!');"

First of all, the value in this example does not have any characters
that would be affected by Server.HtmlEncode(). Second, it does not use
the Add() method (I would be willing to use either one, I do prefer the
Add() method). In your second link, the following example is given:

FirstSelect.Attributes.Add("Multiple", "True")

This example, like you said, is not even JavaScript, and also does not
have any characters that would be affected by Server.HtmlEncode().
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2***************@TK2MSFTNGP05.phx.gbl...
Nathan,

Are you sure you do not need this one. (In this page is a nice sample)
http://msdn2.microsoft.com/en-us/lib...ttributes.aspx

Now you are using this one to add an attribute let say to an listbox,
which is in my idea sure not a piece of javascript
http://msdn2.microsoft.com/en-us/lib...ction.add.aspx

I hope this helps,

Cor
"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:ew*************@TK2MSFTNGP04.phx.gbl...
That would be great if I were using something like the
System.Web.UI.HtmlTextWriter, but I am simply adding attributes
objects created declaratively in my *.aspx file. For example, I have
the following as part of my *.aspx file:
>
>
<asp:TextBox ID="txtRed" runat="server" MaxLength="3"
Width="35px">0</asp:TextBox>
>
>
And I have the following in my *.aspx.vb file:
>
>
txtRed.Attributes.Add("onchange",
"if(this.value>=0&&this.value<=255){" &
redslider.ClientSetFunctionName & "(this.value);}else{this.value=" &
redslider.ClientGetFunctionName & "();}")
>
>
When my page is rendered, this comes out as the following (notice that
the &'s and < are replaced with their HTML representations):
>
>
onchange="if(this.value>=0&amp;&amp;this.value &lt;=255){sliderRed_setvalue(this.value);}else{thi s.value=sliderRed_getvalue();}"
>
>
The Server.HtmlDecode() method would not help me here because the
Attributes.Add() method takes a String as it's second parameter, and
Server.HtmlDecode() would not have any effect on it in my case, so I
would actually be passing the same String. Any other ideas? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
>
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:OG**************@TK2MSFTNGP04.phx.gbl.. .
>Hi Nathan,
>>
>For that is the HTML en/decode classes.
>>
>http://msdn.microsoft.com/library/de...codeTopic1.asp
>>
>I hope this helps,
>>
>Cor
>>
>"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
>news:OW*************@TK2MSFTNGP03.phx.gbl.. .
>>>I add several JavaScript events (onchange, onkeypress, etc.) to
>>>Controls using the Add method of the Attributes collection. However,
>>>if the JavaScript code contains certain characters, such as & or < or
>>>several others, it converts them to html, such as &amp; or &lt; which
>>>can sometimes cause my scripts not to work. How can I prevent ASP.NET
>>>from doing this? Thanks.
>>--
>>Nathan Sokalski
>>nj********@hotmail.com
>>http://www.nathansokalski.com/
>>>
>>
>>
>
>




Jul 26 '06 #10
In case it helps you feel better about this, I have tested in IE6,
firefox1.5 and opera9. Works well. In your place i wont worry too much,
since this is pretty standard functionality supported by the browser and
tbh, i have not heard about this type of problem before.

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net

"Nathan Sokalski" <nj********@hotmail.comha scritto nel messaggio
news:%2****************@TK2MSFTNGP04.phx.gbl...
>I haven't really had any problems with the JavaScript not working because
of this, but it worries (not to mention frustrates) me that I might in the
future for the following reason:

Cross-browser compatibility: I am afraid that some new version of some
browser (or maybe even an existing one, as of now I have only tested on
IE6) will not like this incorrect JavaScript syntax
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Alessandro Zifiglio" <AlessandroZifiglio @ -h-o-t-m-a-i-l-c-o-mwrote in
message news:%2***************@TK2MSFTNGP05.phx.gbl...
>Nathan, in addition to Cor's suggestions, let me add that there is not
much you can do at this point that can change what is output by the
htmltextwriter. It's this writer which actually minimally HTML-encodes
everything. This is possibly for xhtml comformance, since an & is not a
legal character within an xml document and needs to be escaped. So are
characters like <>. I cant imagine you working around this, without doing
something a bit trival like through the HttpResponse.Filter which gives
you a chance to rewrite what is output by the htmltextwriter before it is
transmitted to the page =P
http://msdn2.microsoft.com/en-us/lib...se.filter.aspx

There is full working example in the above url, that shows you howto
attach a filter to the response stream that makes the text displayed to
the page all uppercase.You will be searching for &amp; or whatever other
html code characters you dont want, and replacing them with the original
you had wanted.

That said, can you explain further why you want to work around this ? I
dont understand why your script shouldnt work *sometimes* with those
characters escaped.

Your problem, in my humble opinion is somewhere else, possibly in the js
code that you are writing, but i cant say much since the code you pasted
works very well *always* for me. I have pasted the code i tested below.
Let us know, what you are doing differently and under what circumstance
its not working for you.

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
TextBox1.Attributes.Add("onchange", "if (parseInt(this.value) >= 0
&& parseInt(this.value) <= 255){ alert('more than 0 and less than a
100');}");
}

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" Text="" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>

"Cor Ligthert [MVP]" <no************@planet.nlha scritto nel messaggio
news:OU**************@TK2MSFTNGP03.phx.gbl...
>>Nathan,

You cannot use a ship to fly, in my opinion are you trying that by using
the wrong commands, if you want to fly with a ship, than you have a lot
of troubles, with a plane it is much easier.

What your cargo is, is not the first question.

Just my thought, reading your reply.

Cor

"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:%2****************@TK2MSFTNGP06.phx.gbl.. .
In the first link you provided, the following example is given:

TextBox1.Attributes("onblur") = "javascript:alert('Hello! Focus lost
from text box!!');"

First of all, the value in this example does not have any characters
that would be affected by Server.HtmlEncode(). Second, it does not use
the Add() method (I would be willing to use either one, I do prefer the
Add() method). In your second link, the following example is given:

FirstSelect.Attributes.Add("Multiple", "True")

This example, like you said, is not even JavaScript, and also does not
have any characters that would be affected by Server.HtmlEncode().
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2***************@TK2MSFTNGP05.phx.gbl.. .
Nathan,
>
Are you sure you do not need this one. (In this page is a nice sample)
http://msdn2.microsoft.com/en-us/lib...ttributes.aspx
>
Now you are using this one to add an attribute let say to an listbox,
which is in my idea sure not a piece of javascript
http://msdn2.microsoft.com/en-us/lib...ction.add.aspx
>
I hope this helps,
>
Cor
>
>
"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:ew*************@TK2MSFTNGP04.phx.gbl...
>That would be great if I were using something like the
>System.Web.UI.HtmlTextWriter, but I am simply adding attributes
>objects created declaratively in my *.aspx file. For example, I have
>the following as part of my *.aspx file:
>>
>>
><asp:TextBox ID="txtRed" runat="server" MaxLength="3"
>Width="35px">0</asp:TextBox>
>>
>>
>And I have the following in my *.aspx.vb file:
>>
>>
>txtRed.Attributes.Add("onchange",
>"if(this.value>=0&&this.value<=255){" &
>redslider.ClientSetFunctionName & "(this.value);}else{this.value=" &
>redslider.ClientGetFunctionName & "();}")
>>
>>
>When my page is rendered, this comes out as the following (notice
>that the &'s and < are replaced with their HTML representations):
>>
>>
>onchange="if(this.value>=0&amp;&amp;this.valu e&lt;=255){sliderRed_setvalue(this.value);}else{th is.value=sliderRed_getvalue();}"
>>
>>
>The Server.HtmlDecode() method would not help me here because the
>Attributes.Add() method takes a String as it's second parameter, and
>Server.HtmlDecode() would not have any effect on it in my case, so I
>would actually be passing the same String. Any other ideas? Thanks.
>--
>Nathan Sokalski
>nj********@hotmail.com
>http://www.nathansokalski.com/
>>
>"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
>news:OG**************@TK2MSFTNGP04.phx.gbl. ..
>>Hi Nathan,
>>>
>>For that is the HTML en/decode classes.
>>>
>>http://msdn.microsoft.com/library/de...codeTopic1.asp
>>>
>>I hope this helps,
>>>
>>Cor
>>>
>>"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
>>news:OW*************@TK2MSFTNGP03.phx.gbl. ..
>>>>I add several JavaScript events (onchange, onkeypress, etc.) to
>>>>Controls using the Add method of the Attributes collection. However,
>>>>if the JavaScript code contains certain characters, such as & or <
>>>>or several others, it converts them to html, such as &amp; or &lt;
>>>>which can sometimes cause my scripts not to work. How can I prevent
>>>>ASP.NET from doing this? Thanks.
>>>--
>>>Nathan Sokalski
>>>nj********@hotmail.com
>>>http://www.nathansokalski.com/
>>>>
>>>
>>>
>>
>>
>
>




Jul 27 '06 #11
Nathan, also, i forgot to mention that this is not* incorrect. Doing it
otherwise, the way you want is incorrect. For eg. if you were using js
codeblocks in your page as <script type="text/javascript">code here</script>
then you will be wrapping your code in cData blocks to escape the usual <>
and & ampersand characters and is mandatory for compliance with xhtml strict
doctype.
For inline js, you have to escape special characters, of which asp.net's
htmltextwriter is automatically escaping for you is the properway. So any
standards compliant useragent will support this and well.

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net
"Alessandro Zifiglio" <AlessandroZifiglio @ -h-o-t-m-a-i-l-c-o-mha scritto
nel messaggio news:%2****************@TK2MSFTNGP03.phx.gbl...
In case it helps you feel better about this, I have tested in IE6,
firefox1.5 and opera9. Works well. In your place i wont worry too much,
since this is pretty standard functionality supported by the browser and
tbh, i have not heard about this type of problem before.

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net

"Nathan Sokalski" <nj********@hotmail.comha scritto nel messaggio
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>I haven't really had any problems with the JavaScript not working because
of this, but it worries (not to mention frustrates) me that I might in the
future for the following reason:

Cross-browser compatibility: I am afraid that some new version of some
browser (or maybe even an existing one, as of now I have only tested on
IE6) will not like this incorrect JavaScript syntax
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Alessandro Zifiglio" <AlessandroZifiglio @ -h-o-t-m-a-i-l-c-o-mwrote
in message news:%2***************@TK2MSFTNGP05.phx.gbl...
>>Nathan, in addition to Cor's suggestions, let me add that there is not
much you can do at this point that can change what is output by the
htmltextwriter. It's this writer which actually minimally HTML-encodes
everything. This is possibly for xhtml comformance, since an & is not a
legal character within an xml document and needs to be escaped. So are
characters like <>. I cant imagine you working around this, without
doing something a bit trival like through the HttpResponse.Filter which
gives you a chance to rewrite what is output by the htmltextwriter
before it is transmitted to the page =P
http://msdn2.microsoft.com/en-us/lib...se.filter.aspx

There is full working example in the above url, that shows you howto
attach a filter to the response stream that makes the text displayed to
the page all uppercase.You will be searching for &amp; or whatever other
html code characters you dont want, and replacing them with the original
you had wanted.

That said, can you explain further why you want to work around this ? I
dont understand why your script shouldnt work *sometimes* with those
characters escaped.

Your problem, in my humble opinion is somewhere else, possibly in the js
code that you are writing, but i cant say much since the code you pasted
works very well *always* for me. I have pasted the code i tested below.
Let us know, what you are doing differently and under what circumstance
its not working for you.

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
TextBox1.Attributes.Add("onchange", "if (parseInt(this.value) >=
0 && parseInt(this.value) <= 255){ alert('more than 0 and less than a
100');}");
}

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" Text="" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>

"Cor Ligthert [MVP]" <no************@planet.nlha scritto nel messaggio
news:OU**************@TK2MSFTNGP03.phx.gbl...
Nathan,

You cannot use a ship to fly, in my opinion are you trying that by
using the wrong commands, if you want to fly with a ship, than you have
a lot of troubles, with a plane it is much easier.

What your cargo is, is not the first question.

Just my thought, reading your reply.

Cor

"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
news:%2****************@TK2MSFTNGP06.phx.gbl. ..
In the first link you provided, the following example is given:
>
TextBox1.Attributes("onblur") = "javascript:alert('Hello! Focus lost
from text box!!');"
>
First of all, the value in this example does not have any characters
that would be affected by Server.HtmlEncode(). Second, it does not use
the Add() method (I would be willing to use either one, I do prefer
the Add() method). In your second link, the following example is
given:
>
FirstSelect.Attributes.Add("Multiple", "True")
>
This example, like you said, is not even JavaScript, and also does not
have any characters that would be affected by Server.HtmlEncode().
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
>
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2***************@TK2MSFTNGP05.phx.gbl. ..
>Nathan,
>>
>Are you sure you do not need this one. (In this page is a nice
>sample)
>http://msdn2.microsoft.com/en-us/lib...ttributes.aspx
>>
>Now you are using this one to add an attribute let say to an listbox,
>which is in my idea sure not a piece of javascript
>http://msdn2.microsoft.com/en-us/lib...ction.add.aspx
>>
>I hope this helps,
>>
>Cor
>>
>>
>"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
>news:ew*************@TK2MSFTNGP04.phx.gbl.. .
>>That would be great if I were using something like the
>>System.Web.UI.HtmlTextWriter, but I am simply adding attributes
>>objects created declaratively in my *.aspx file. For example, I have
>>the following as part of my *.aspx file:
>>>
>>>
>><asp:TextBox ID="txtRed" runat="server" MaxLength="3"
>>Width="35px">0</asp:TextBox>
>>>
>>>
>>And I have the following in my *.aspx.vb file:
>>>
>>>
>>txtRed.Attributes.Add("onchange",
>>"if(this.value>=0&&this.value<=255){" &
>>redslider.ClientSetFunctionName & "(this.value);}else{this.value=" &
>>redslider.ClientGetFunctionName & "();}")
>>>
>>>
>>When my page is rendered, this comes out as the following (notice
>>that the &'s and < are replaced with their HTML representations):
>>>
>>>
>>onchange="if(this.value>=0&amp;&amp;this.val ue&lt;=255){sliderRed_setvalue(this.value);}else{t his.value=sliderRed_getvalue();}"
>>>
>>>
>>The Server.HtmlDecode() method would not help me here because the
>>Attributes.Add() method takes a String as it's second parameter, and
>>Server.HtmlDecode() would not have any effect on it in my case, so I
>>would actually be passing the same String. Any other ideas? Thanks.
>>--
>>Nathan Sokalski
>>nj********@hotmail.com
>>http://www.nathansokalski.com/
>>>
>>"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
>>news:OG**************@TK2MSFTNGP04.phx.gbl.. .
>>>Hi Nathan,
>>>>
>>>For that is the HTML en/decode classes.
>>>>
>>>http://msdn.microsoft.com/library/de...codeTopic1.asp
>>>>
>>>I hope this helps,
>>>>
>>>Cor
>>>>
>>>"Nathan Sokalski" <nj********@hotmail.comschreef in bericht
>>>news:OW*************@TK2MSFTNGP03.phx.gbl.. .
>>>>>I add several JavaScript events (onchange, onkeypress, etc.) to
>>>>>Controls using the Add method of the Attributes collection.
>>>>>However, if the JavaScript code contains certain characters, such
>>>>>as & or < or several others, it converts them to html, such as
>>>>>&amp; or &lt; which can sometimes cause my scripts not to work. How
>>>>>can I prevent ASP.NET from doing this? Thanks.
>>>>--
>>>>Nathan Sokalski
>>>>nj********@hotmail.com
>>>>http://www.nathansokalski.com/
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>




Jul 27 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Dave | last post by:
I have a situation where I want to react to a ctrl-click on a <span> and it works in Netscape and Firefox browsers but in IE I have a problem. In IE I do catch the ctrl-click but IE also renders...
3
by: Stephan Brunner | last post by:
Hi I have created two flavors of an XSLT stylesheet to transform all attributes of an XML document to elements: They both work as expected with MSXML and XMLSPY but throw an exception ...
5
by: Rob Lynch | last post by:
This one has me perplexed from vs.net web app add a new aspx pag add 3 textbox's and a command butto in the command buttons click event add response.write "button1 click from any textbox...
1
by: Bruce | last post by:
I use btnSave.Attributes.Add("onclick", "ShowMessage()") to link my web control button to a JavaScript function. It works well until I added a Validation control into the page. After that,...
8
by: Nathan Sokalski | last post by:
I add a JavaScript event handler to some of my Webcontrols using the Attributes.Add() method as follows: Dim jscode as String = "return (event.keyCode>=65&&event.keyCode<=90);"...
3
by: Jon Delano | last post by:
Hi I was wondering if it were possible to somehow stop a page from posting back to the server and running the server side code. I have a datagrid and the first column is basically a button. I...
11
by: Nathan Sokalski | last post by:
I add several JavaScript events (onchange, onkeypress, etc.) to Controls using the Add method of the Attributes collection. However, if the JavaScript code contains certain characters, such as & or...
6
by: Andrew Poulos | last post by:
I'm using Windows Media Audio, via a WAX file, and I have some custom controls to start and stop the audio. While it works in IE, FF gives an error. The HTML looks like this: <object id='obj'...
2
by: Safalra | last post by:
Recently I've rewritten much of my old Javascript code to use DOM functions so that enhancements can be attached to documents without needing to alter the HTML code. I assumed that adding event...
8
by: Christine Forber | last post by:
I have created a form that incorporates AJAX to provide suggestions from the database contents for the given field. The problem is that many browsers do their own "suggestions" based on previous...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.