I currently have am working on encrypting all of the URLs in my web application and was thinking about using a control adapter to find any window.location changes and encrypting the URL.
However I cannot find which properties I would use in order to find out what is inside the RadCodeBlock. Any ideas?
However I cannot find which properties I would use in order to find out what is inside the RadCodeBlock. Any ideas?
3 Answers, 1 is accepted
0
Hello Christian,
The RadScriptBlock does not generate any html markup at the page so there is no option to access its content at the client.
However you can access the script contents of the control at the server. It is represented as a Text property of a Literal which is added at the control collection of the RadScriptBlock.
Best wishes,
Kalina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
The RadScriptBlock does not generate any html markup at the page so there is no option to access its content at the client.
However you can access the script contents of the control at the server. It is represented as a Text property of a Literal which is added at the control collection of the RadScriptBlock.
Best wishes,
Kalina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Christian
Top achievements
Rank 1
answered on 19 Apr 2010, 04:07 PM
You are correct about the literal control that works in some instances.
It appears that if there are RadCodeBlocks with the <%= %> tags though a literal control does not appear in the control collection of the RadCodeBlock
| <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
| <script type="text/javascript"> |
| function CreateEvaluationOpen() |
| { |
| var oWnd = $find("<%=rwCreateEvaluation.ClientID %>"); |
| oWnd.setUrl("/Content/Evaluation/Contractor/Create.aspx"); |
| oWnd.SetTitle('Loading...'); |
| oWnd.show(); |
| return false; |
| } |
| </script> |
| </telerik:RadCodeBlock> |
How would I get to the script contents of the RadCodeBlock (server side) in those instances?
0
Hi Christian,
You can retrieve the controls collection of the RadCodeBlock server-side.
There is only one object if type System.Web.UI.ResourceBasedLiteralControl in it, you can cast this object to LiteralControl and get the script contents as text:
Regards,
Kalina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
You can retrieve the controls collection of the RadCodeBlock server-side.
There is only one object if type System.Web.UI.ResourceBasedLiteralControl in it, you can cast this object to LiteralControl and get the script contents as text:
ControlCollection collection = this.RadCodeBlock1.Controls;foreach (Control item in collection){ LiteralControl _item = item as LiteralControl; string codeBlockContent = _item.Text;}Regards,
Kalina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.