This is a migrated thread and some comments may be shown as answers.

RadScriptBlock

4 Answers 252 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Martin Sarosi
Top achievements
Rank 2
Martin Sarosi asked on 16 Jul 2008, 11:06 AM
I am getting some weird behaviour.

This is a bit of aspx in user control I have:

   <Telerik:RadScriptBlock ID="cb1" runat="server"
 
                <script type="text/javascript" language="javascript"
                   var myValue = '' 
                   function getSelectedRowValue() 
                    { 
                        if (myValue) 
                            return myValue; 
                        else 
                            return ''; 
                    }         

This will only be rendered after an ajax request.

When it is rendered I get some very strange stuff added to the head of my page

Firebug reports:

<link rel="stylesheet" href="\r\n var myValue = \u0027\u0027\r\n function getSelectedRowValue()\r\n {\r\n if (myValue)\r\n return myValue;\r\n else\r\n return \u0027\u0027;\r\n } \r\n function RowSelected(sender"
1<html> 
<head> 
<title>Bad Request</title> 
<style> 
5 body {font-family:"Verdana";font-weight:normal;font-size: 8pt;color:black;} 
6 p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} 
7 b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} 
8 h1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } 
9 h2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } 
10 pre {font-family:"Lucida Console";font-size: 8pt} 
11 .marker {font-weight: bold; color: black;text-decoration: none;} 
12 .version {color: gray;} 
13 .error {margin-bottom: 10px;} 
14 .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } 
15 </style> 
16 </head> 
17 <body bgcolor="white"
18 
19 <span><h1>Server Error in '/SafetyTortilla' Application.<hr width=100size=1 color=silver></h1> 
20 
21 <h2> <i>HTTP Error 400 - Bad Request.</i> </h2></span
22 
23 <hr width=100size=1 color=silver
24 
25 <b>Version Information:</b>&nbsp;ASP.NET Development Server 8.0.0.0 
26 
27 </font> 
28 
29 </body> 
30</html> 
31 
</link> 


I tried this in Opera Dragonfly as well.

I cannot find the javascript anywhere else.

Martin


4 Answers, 1 is accepted

Sort by
0
Neil Sloan
Top achievements
Rank 1
answered on 16 Jul 2008, 07:51 PM
Why are you using a RadScriptBlock in the head of your page? 

You can just use a standard <script> tag to define your javascript.
0
Martin Sarosi
Top achievements
Rank 2
answered on 17 Jul 2008, 10:11 AM
:) The codeblock is not in the head but in the user control.

The link to weird stylesheet gets added to the head when the user control appears .
0
Sebastian
Telerik team
answered on 21 Jul 2008, 07:57 AM
Hello Martin,

Does this happen with the latest version 2008.1.619 of RadControls for ASP.NET AJAX or with the Q2 2008 Futures release of our suite? Additionally, you may check whether replacing the RadScriptBlock with RadCodeBlock instead makes a difference.

If the problem persists, I will appreciate if you provide a live url where this abnormality can be observed. Thus we will do everything possible to give you more to-the-point answer/solution.

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Yuriy Rogach
Top achievements
Rank 1
Iron
answered on 27 Mar 2009, 01:26 PM
Hi Martin,

Have you found the solution for your problem ? I have the same one.
Tags
Ajax
Asked by
Martin Sarosi
Top achievements
Rank 2
Answers by
Neil Sloan
Top achievements
Rank 1
Martin Sarosi
Top achievements
Rank 2
Sebastian
Telerik team
Yuriy Rogach
Top achievements
Rank 1
Iron
Share this question
or