No, you might not totally understand my meaning.
The problem may occur under such situation, like below:
for example, I have a function of a tool bar control (an user
control), that's in my
code behind file, I used it to generate several lines of javascripts:
public string SetButtonVisibility(string btnName, bool visible)
{
string sResult = "";
sResult = "var e =
document.all."+this.fID+".getElementsByTagName('SPAN');\r\n"
+ "if (e) { e.style.display =
"+visible.ToString().ToLower()
+"?'inline':'none';}\r\n"; }
then, I want to use this function in page AA.aspx within a javascript
segment:
<script language="javascript">
<%= Toolbar.SetButtonVisibility(Toolbar.BtnEditName, true) %>
</script>
That's fine, and as a result, that server side code would generate
two lines:
<script language="javascript">
var e = document.all.Toolbar.getElementsByTagName('SPAN');
if (e) { e.style.display = true?'inline':'none';}
</script>
But, the problem would occur if I want to comment that server side
code
using "//":
<script language="javascript">
//<%= Toolbar.SetButtonVisibility(Toolbar.BtnEditName, true) %>
</script>
Then, the result would be unexpected, like this:
<script language="javascript">
//var e = document.all.Toolbar.getElementsByTagName('SPAN');
if (e) { e.style.display = true?'inline':'none';}
</script>
So, an erorr would occur, is that a bug?