Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
188 views
Hey,
I'm using radmenu with a xml site map file.
I have enabled security trimming in the site map provider and denied access to specific pages using the autherization element in the web.config (when I navigate directly to those pages I'm redirected to the login page so this works fine).

I've also performed a test - I inherited from XMLSiteMapProvider and implemented IsAccesibleToUser method.
I see in debug mode that this method is called and return the correct values (true to show , false to hide) but it has no effect on the menu and all the items is shown in the UI.

here are some parts from the code
Web.Config
<location path="Pages/ManageCategories.aspx">
   <system.web>
     <authorization>
       <allow roles="IT Admin"/>
       <deny roles="User"/>
       <deny roles="Company Admin"/>
       <deny users="?"/>
       <deny users="*"/>
         
     </authorization>
   </system.web>
 </location>
   <siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
           <providers>
               <add name="XmlSiteMapProvider" description="Default SiteMap provider." type="TrimmedXmlSiteMapProvider " siteMapFile="Web.sitemap" securityTrimmingEnabled="true"/>
           </providers>
       </siteMap>

TrimmedXMLSiteMap Class (again I dont really need it if the out of the box security trimming will work. for now this approch doesnt work also)
public override bool IsAccessibleToUser(HttpContext context, SiteMapNode node)
   {
       if (node.Roles != null && node.Roles.Count > 0)
       {
           bool ret = false;
           // need to be atleast in one of the roles
           foreach (var item in node.Roles)
           {
               if (System.Web.Security.Roles.IsUserInRole(item.ToString()))
               {
                   ret = true;
               }
           }
           return ret;
       }
       else
       {
           return true;
       }
   }

RadMenu declaration from the master page:
<telerik:RadSiteMapDataSource  ID="SubMenuDatasource"  runat="server" ShowStartingNode="False" SiteMapProvider="XmlSiteMapProvider"  StartingNodeOffset = "1"  />
   <telerik:RadMenu  ID="SubMenu12" runat="server"   EnableEmbeddedBaseStylesheet = "false" Skin="ChildMenu" EnableEmbeddedSkins="false"   DataSourceID="SubMenuDatasource"  >
     
   </telerik:RadMenu>

Thanks for the help...


Veronica
Telerik team
 answered on 27 Apr 2011
1 answer
207 views

hi

I getting the following exceptions sometimes there is a new request to the server:

System.Web.HttpException (0x80004005): This is an invalid webresource request. 
 at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context) 
 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
 at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at http://test.com:80/WebResource.axd?d=2GpuJsHz6f2MZvJGfqtMifySIIHrl4Fl6QhmfmHWNAle9eNy8spdiz4-9FiFaNKBKdTuA9ihLeft_btnBranch"%20class="btn"%20style="width:192px;"%20/>
تمامی%20حقوق%20این%20سایت%20محفوظ%20و%20متعلق%20به%20سامانه%20مدیریت%20تبلیغات%20اکسیر%20می%20باشد.//
System.Web.HttpException (0x80004005): The length of the query string for this request exceeds the configured maxQueryStringLength value. 
 at System.Web.HttpRequest.ValidateInputIfRequiredByConfig() 
 at System.Web.HttpApplication.ValidateRequestExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
 at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at http://test.com:80/WebResource.axd?d=ReRJmqv0EMoIrhksHtAP9NaSkMSs8rUuezr1BVaN91
دریافت%20آگهیواریز%20به%20حساببرداشت%20از%20حسابپیام%20های%20دریافت%20شدهارسال%20پیام%20به%20سایتویرایش%20مشخصاتخروجاطلاعاتامروز:%20دوشنبه%201390.2.5تبلیغات%20امروز:تبلیغات%20دیروز:1,809%20نمایش0%20کلیک7,906%20نمایش329%20کلیکجزئیات%20بیشتر...دریافت%20آگهی
تمامی%20حقوق%20این%20سایت%20محفوظ%20و%20متعلق%20به%20سامانه%20مدیریت%20تبلیغات%20اکسیر%20می%20باشد.//

i use telerik.web.ui.dll v2011.1.315.40

and i put just this dll (telerik.web.ui.dll) in BIN folder

in client side I use windows 7 with IIS7 and I never get this exceptions, but when I publish my site on web host that installed on windows server 2003 with iis 6 i get this exceptions Regularly!

my web.config is:

<?xml version="1.0"?>
<configuration>
  <system.web>
    <machineKey validationKey="4E034E7E7D3A8BD7B883864A59A1DCE0F0830BBB0A8EA155F5E3C43640F53EE78D1FD427F4C7A1FC88C273BD134A4A55F329EB552379EE45E74C5FA298CD270F"
      decryptionKey="6D01183050AEDE29C50CC073F906B4861CEEDDD1CB1EBBE31D04220359C6794C" validation="SHA1" decryption="AES" />
    <compilation debug="false" defaultLanguage="C#" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </assemblies>
    </compilation>
    <httpRuntime maxRequestLength="1024" requestLengthDiskThreshold="64" requestValidationMode="2.0"/>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
      <controls>
        <add tagPrefix="csm" namespace="customWebControls"/>
        <add tagPrefix="tlk" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
      </controls>
    </pages>
    <httpHandlers>
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>
      <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" />
    </httpHandlers>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <handlers>
      <add name="Telerik_Web_UI_WebResource_axd" verb="*" path="Telerik.Web.UI.WebResource.axd" preCondition="integratedMode" type="Telerik.Web.UI.WebResource"/>
    </handlers>
  </system.webServer>
</configuration>
 my aspx code is:

<%@ Page Language="C#" %>
<!doctype html>
<script runat="server">
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        if (txtUsername.Text == "1" && txtPassword.Text == "1")
            mlvLogin.ActiveViewIndex = 1;
    }
</script>
<head>
    <title>???</title>
</head>
<body>
    <form id="form" runat="server" enctype="multipart/form-data">
        <tlk:RadScriptManager ID="radScriptManager" runat="server" />
        <tlk:RadAjaxManager ID="radAjaxManager" runat="server"
            DefaultLoadingPanelID="radAjaxLoadingPanel">
            <AjaxSettings>
                <tlk:AjaxSetting AjaxControlID="pnlLogin">
                    <UpdatedControls>
                        <tlk:AjaxUpdatedControl ControlID="pnlLogin" />
                    </UpdatedControls>
                </tlk:AjaxSetting>
            </AjaxSettings>
        </tlk:RadAjaxManager>
        <tlk:RadAjaxLoadingPanel ID="radAjaxLoadingPanel" runat="server"
            InitialDelayTime="500"
            Skin="Default">
        </tlk:RadAjaxLoadingPanel>
        <div>
            <asp:Panel ID="pnlLogin" runat="server"
                DefaultButton="btnLogin">
                <asp:MultiView ID="mlvLogin" runat="server"
                    ActiveViewIndex="0">
                    <asp:View ID="loginView" runat="server">
                        <asp:Label ID="lblUsername" runat="server"
                            AssociatedControlID="txtUsername"
                            Text="username: " />
                        <asp:TextBox ID="txtUsername" runat="server" /><br />
                        <asp:Label ID="lblPassword" runat="server"
                            AssociatedControlID="txtPassword"
                            Text="password: " />
                        <asp:TextBox ID="txtPassword" runat="server"
                            TextMode="Password" /><br />
                        <asp:Button ID="btnLogin" runat="server"
                            OnClick="btnLogin_Click"
                            Text="signin" />
                    </asp:View>
                    <asp:View ID="linkListView" runat="server">
                        <div>Some code goes here!</div>
                    </asp:View>
                </asp:MultiView>
            </asp:Panel>
        </div>
    </form>
</body>
</html>

what can i do for solving this important issue?

Iana Tsolova
Telerik team
 answered on 27 Apr 2011
5 answers
204 views
Hello,

I am having an issue using a custom drop down editor in the rad filter. When I set the value of my first filter criteria and click the link to add more criteria I lose the value of the first criteria I set. I think the issue has to do with when the handler is added for setting the value is after the binding already takes place.

Thanks!

Don

MyRuntimeEditor.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="MyRuntimeEditor.aspx.vb" Inherits="MyRuntimeEditor" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Namespace="MyCustomEditors" TagPrefix="mycustom" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <div>
        <asp:Button ID="Button1" Text="Postback" runat="server" />
        <telerik:RadFilter runat="server" OnFieldEditorCreating="RadFilter1_FieldEditorCreating" OnApplyExpressions="RadFilter1_ApplyExpressions">
            <FieldEditors>
                <mycustom:MyRadFilterDropDownEditor DataTextField="Text" DataValueField="Value" FieldName="USR_ID" DataType="System.Int32" DisplayName="User name" DDLType="Usernames" />
                <mycustom:MyRadFilterDropDownEditor DataTextField="Text" DataValueField="Value" FieldName="PNT_ID" DataType="System.Int32" DisplayName="Note" DDLType="PartyNotes" />
                <mycustom:MyRadFilterDropDownEditor DataTextField="Text" DataValueField="Value" FieldName="PGT_ID" DataType="System.Int32" DisplayName="Group" DDLType="PartyGroups" />
            </FieldEditors>
        </telerik:RadFilter>
        Expression:
        <asp:Label runat="server" ID="Log"/>
    </div>
    </form>
</body>
</html>

MyRuntimeEditor.aspx.vb
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports Telerik.Web.UI
Imports CustomEditors
Imports MyCustomEditors
 
Partial Class MyRuntimeEditor
    Inherits System.Web.UI.Page
 
 
    Protected Sub RadFilter1_ApplyExpressions(ByVal sender As Object, ByVal e As RadFilterApplyExpressionsEventArgs)
        Dim provider As New RadFilterSqlQueryProvider()
        provider.ProcessGroup(e.ExpressionRoot)
 
        Log.Text = provider.Result
    End Sub
 
    Protected Sub RadFilter1_FieldEditorCreating(ByVal sender As Object, ByVal e As RadFilterFieldEditorCreatingEventArgs)
        e.Editor = New MyRadFilterDropDownEditor()
    End Sub
 
End Class

CustomEditor.vb
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports Telerik.Web.UI
Imports System.Web.UI
Imports System.Collections
 
Namespace CustomEditors
    Public Class RadFilterDropDownEditor
        Inherits RadFilterDataFieldEditor
 
 
        Public Property DataTextField() As String
            Get
                Return If(DirectCast(ViewState("DataTextField"), String), String.Empty)
            End Get
            Set(ByVal value As String)
                ViewState("DataTextField") = value
            End Set
        End Property
        Public Property DataValueField() As String
            Get
                Return If(DirectCast(ViewState("DataValueField"), String), String.Empty)
            End Get
            Set(ByVal value As String)
                ViewState("DataValueField") = Value
            End Set
        End Property
        Public Property DataSourceID() As String
            Get
                Return If(DirectCast(ViewState("DataSourceID"), String), String.Empty)
            End Get
            Set(ByVal value As String)
                ViewState("DataSourceID") = Value
            End Set
        End Property
 
        Private _combo As RadComboBox
 
        Protected Overrides Sub CopySettings(ByVal baseEditor As RadFilterDataFieldEditor)
            MyBase.CopySettings(baseEditor)
            Dim editor As RadFilterDropDownEditor = TryCast(baseEditor, RadFilterDropDownEditor)
            If editor IsNot Nothing Then
                DataSourceID = editor.DataSourceID
                DataTextField = editor.DataTextField
                DataValueField = editor.DataValueField
            End If
        End Sub
 
        Public Overrides Function ExtractValues() As System.Collections.ArrayList
            Dim list As New ArrayList()
            list.Add(_combo.SelectedValue)
            Return list
        End Function
 
        Public Overrides Sub InitializeEditor(container As System.Web.UI.Control)
            _combo = New RadComboBox()
            _combo.ID = "MyCombo"
            _combo.DataTextField = DataTextField
            _combo.DataValueField = DataValueField
            _combo.DataSourceID = DataSourceID
 
            container.Controls.Add(_combo)
        End Sub
 
        Public Overrides Sub SetEditorValues(values As System.Collections.ArrayList)
            If values IsNot Nothing AndAlso values.Count > 0 Then
                If values(0) Is Nothing Then
                    Return
                End If
 
                AddHandler _combo.DataBound, _
                    Sub(sender, args)
                        Dim item As RadComboBoxItem = _combo.FindItemByValue(values(0).ToString())
                        If item IsNot Nothing Then
                            item.Selected = True
                        End If
                    End Sub
            End If
 
        End Sub
    End Class
End Namespace

DataObject.vb
Imports Microsoft.VisualBasic
Imports System.Data
 
Public Class DataObject
    Public Function GetUsers() As DataTable
        Dim dt As DataTable = CreateDataTable()
        dt.Rows.Add(CreateDataRow(dt.NewRow(), 1, "Joe One"))
        dt.Rows.Add(CreateDataRow(dt.NewRow(), 2, "Joe Two"))
        dt.Rows.Add(CreateDataRow(dt.NewRow(), 3, "Joe Three"))
        dt.Rows.Add(CreateDataRow(dt.NewRow(), 4, "Joe Four"))
        Return dt
    End Function
 
    Public Function GetNoteTypes() As DataTable
        Dim dt As DataTable = CreateDataTable()
        dt.Rows.Add(CreateDataRow(dt.NewRow(), 1, "Internal"))
        dt.Rows.Add(CreateDataRow(dt.NewRow(), 2, "Email"))
        dt.Rows.Add(CreateDataRow(dt.NewRow(), 3, "Phone"))
        dt.Rows.Add(CreateDataRow(dt.NewRow(), 4, "Sales Call"))
        Return dt
    End Function
 
    Public Function GetPartyGroups() As DataTable
        Dim dt As DataTable = CreateDataTable()
        dt.Rows.Add(CreateDataRow(dt.NewRow(), 1, "Internet Lead"))
        dt.Rows.Add(CreateDataRow(dt.NewRow(), 2, "Website"))
        dt.Rows.Add(CreateDataRow(dt.NewRow(), 3, "Cold calling"))
        dt.Rows.Add(CreateDataRow(dt.NewRow(), 4, "Phoned in"))
        Return dt
    End Function
 
    Private Function CreateDataRow(ByVal r As DataRow, ByVal Value As Integer, ByVal Text As String) As DataRow
        r("Value") = Value
        r("Text") = Text
        Return r
    End Function
 
    Private Function CreateDataTable() As DataTable
        Dim dt As New DataTable
        dt.Columns.Add("Value", GetType(Integer))
        dt.Columns.Add("Text", GetType(String))
        Return dt
    End Function
End Class


Thanks
Don Tompkins
Top achievements
Rank 1
 answered on 27 Apr 2011
4 answers
73 views
Hello,

I am trying to export a grid to PDF on shared hosting. From what I can tell PDF export needs full trust to write a temporary pdf to the server. I do not have full trust on the server.
Is there a way to export the PDF to MemoryStream and then write the MemoryStream's content using something like:
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Type", "application/pdf");
Response.BinaryWrite(....);
Response.Ende();

?
Brecht
Top achievements
Rank 1
 answered on 27 Apr 2011
1 answer
37 views
Hi ,

I am facing problem in showing the sum of values on top of stacked bar chart .

Can any one help me with this.

Thanks


Evgenia
Telerik team
 answered on 27 Apr 2011
1 answer
66 views
I have a grid in web page.  At that grid, I add an "edit all" button at command template.  When user clicks it, all rows at that grid will be in edit mode.  And another "update all" will update all user's change and update data into database.  That works fine.  Problem comes when I try to add spelling check function to it.

I add spelling check to "update all" and it works, and speeling check "update" button at a grid row and it works fine too.  But when user clicks "edit all" button, all rows in edit mode. "Hidden" controls  are needed for each row to hold "update" button client id, and radajaxmanager needs to add <ajaxsettings> dynamically too.  I want to check with you the way I try to code is right, and please provide me some sample code to accomplish it.

Thanks
Radoslav
Telerik team
 answered on 27 Apr 2011
1 answer
55 views
Hello,

I have a problem with radwindow.
Silverlight controls hides the radwindow control border (Please view the attached image).

Here is my code:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" >
            <Windows>
                <telerik:RadWindow id="RadWindow2" runat="server" Width="400px" Height="300px" style="z-index:100000;"
                    VisibleTitlebar="false" VisibleStatusbar="false" BackColor="#cccccc" title="Telerik RadWindow" VisibleOnPageLoad="false" >
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
  
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function UseMainRadWindow() {
                    var oWindow = radopen("http://zajal.rayanet.co.il/Common/Alerts/Silverlight/Default.aspx", "RadWindow2");
                    oWindow.set_visibleTitlebar(false);
                    oWindow.set_visibleStatusbar(false);
                }
  
                function onloadFunction() {
                    var slVersion = GetSilverlightVersion();
                        if (slVersion != -1)
                            UseMainRadWindow();
                }
            </script>
        </telerik:RadCodeBlock>


Please, I need you help,
It is apprecited to send me the modified code with an explaination.

Regards,
Bader
Cori
Top achievements
Rank 2
 answered on 27 Apr 2011
4 answers
187 views
Hello,

I am not able to close a radwindow. I tried using the following code but the javascript is not getting invoked. Can someone help me please? Is there something funky going on with Ajax?

    <script type="text/javascript">
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }
        function CloseOnReload() {
            GetRadWindow().Close();
        }
    </script>

//CS Code
//injectscript is a label
InjectScript.Text = "<script type='text/javascript'>CloseOnReload()</" + "script>";


Cori
Top achievements
Rank 2
 answered on 27 Apr 2011
5 answers
828 views
Hi,

Can somebody help me set text box property on the client. The problem I'm having is that the text box is within the rad grid control.
I'm able to set the textbox text property with the following but not when the textbox is in telerik:GridTemplateColumn.

        var textbox =  $find("txtDescription");
  textbox .set_value(result);

but this doesn't work for the following.

  <telerik:GridTemplateColumn HeaderText="Description" DataField="Description"  UniqueName="Description">
                        <EditItemTemplate>
                             <telerik:RadTextBox ID="txtDescription" runat="server" Width="200px"> </telerik:RadTextBox>
                        </EditItemTemplate>
</telerik:GridTemplateColumn>

Thanks,
Ron.

Ron
Top achievements
Rank 1
 answered on 27 Apr 2011
3 answers
40 views

When using the RadFileExplorer in IE (and IE only…Firefox, Safari, Chrome all handle the following perfectly/quickly…only IE has the issue), if the directory has a lot of images in it (say, 50 or more, or perhaps the file sizes of the images are quite large), the launching of this tool will literally FREEZE the IE browser for 30-60 seconds (IE's windows-bar displays "(Not Responding)" if you try to click anywhere in the window). The RadEditor is a part of our online application where significant numbers of fairly novice users utilize it to build simple email content. So…the patience level of these authors is very low, and they often will simply attempt to close the browser, as they believe the system has crashed….when in fact, if they just waited 30-60 seconds the problem would go away. 

Rumen
Telerik team
 answered on 27 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?