Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
294 views
I am trying to have a ajax page initiate self -  postback after the page loads on the client side the first time.  The script raises a "object is null error" when it trys to run.  However if I ignore the error and manually click the button it works.     Here is a simplified sample of the code. 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestAjax2.aspx.cs" Inherits="TestAjax2" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

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

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body  >
    <form id="form1" runat="server">
    <div>
       <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
 
  <script language=jscript>
  function xpress(){
 
   
  $find('<%=RadAjaxPanel1.ClientID%>').ajaxRequestWithTarget("<%= RadAjaxPanel1.UniqueID %>", "Button1Press")
  }
  </script>
  </telerik:RadScriptBlock >
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">

    </telerik:RadScriptManager>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">
          
      
        <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
   
   
      <br />
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
     <input type=button id=buttonx   value="Change color" onclick='<%=RadAjaxPanel1.ClientID%>.ajaxRequestWithTarget("<%= RadAjaxPanel1.UniqueID %>", "ButtonxPress")' />
      <input type=button id=button1   value="Change colorx" onclick='xpress()' />
    </telerik:RadCodeBlock>
    </telerik:RadAjaxPanel>
    </div>
    </form>
</body>
</html>



using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class TestAjax2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
                Type cstype = this.GetType();
              
            //    ClientScript.RegisterStartupScript(cstype, "", "xpress();", true);

                ScriptManager.RegisterStartupScript(this.Page, cstype, "", "javascript:xpress();", true);
           

        }

    }
    protected override void RaisePostBackEvent(IPostBackEventHandler source, String eventArgument)
    {
        base.RaisePostBackEvent(source, eventArgument);
        Label1.Text = eventArgument;
    }
}




Vlad
Telerik team
 answered on 08 May 2008
6 answers
245 views
I've got a user control which has a number of controls on it (one of which is a RadGrid). I have a client-side event handler hooked up to it to cause a postback when you double-click on a row. My user control implements IPostBackEventHandler and processes the request. This is currently working.

Now I'd like to add a RadAjaxManager (v2007.3.1425.35) to the page, but can't seem to get it to work correctly (and I also have a few questions about it). I added RadAjaxManager to the page, set the various properties based on what to update when, and then ran my test page. When a postback occurs, it keeps failing back on the client side with,

"Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed."

Since this is a user control, it occurred to me that I'll have problems using RadAjaxManager in the UC if I happen to have more than one of these controls on a form (or my form is already using RadAjaxManager). So I pulled the RadAjaxManager code out and moved it into my ASPX page, and adjusted the AjaxSettings control for the user control as the source and as the updated control. I re-ran the page and I still receive the "Sys.WebForms.PageRequestManagerParserErrorException" error.

Any thoughts on what I'm missing/what is causing the error? Also, it appears like I can't have as fine-grained control of the Ajax updating process in user controls because I can only have RadAjaxManager appear once on a page. Or am I missing something?
Maria Ilieva
Telerik team
 answered on 08 May 2008
1 answer
120 views
I have a Page with a list box. The List Box has been ajaxified. In the codebehind I have an if (listbox1.selected) statement but it never detects that an item has been selected.

Can anyone help.
Steve
Telerik team
 answered on 08 May 2008
2 answers
167 views

I just downloaded RadControls for ASPNET AJAX Q1 2008. I want to use web20 skin. Do I have to create a "RadControls" Folder in my asp.net web application directory? If yes, then what is the folder structure and from where can  get the web20 skin?. Even the skin chooser option does not show up in RagGrid Design view. The documentation does not mention this basic and important step.


Any help is appreciated.

Luv.
AL
Top achievements
Rank 1
 answered on 08 May 2008
0 answers
90 views
I've been able to generate a simple sample that generates a security exception when running on a shared hosting environment.

The error:

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) +150
   System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) +100
   System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, Boolean throwException) +281
   System.Security.PermissionSetTriple.CheckSetDemand(PermissionSet demandSet, PermissionSet& alteredDemandset, RuntimeMethodHandle rmh) +67
   System.Security.PermissionListSet.CheckSetDemand(PermissionSet pset, RuntimeMethodHandle rmh) +145
   System.Security.PermissionListSet.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +43
   System.Threading.CompressedStack.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +41
   System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant, CompressedStack securityContext) +139
   System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant) +51

The sample page:

<%

@ Page Language="C#" %>

<%

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!

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

<

html xmlns="http://www.w3.org/1999/xhtml">

<

head runat="server">

<title>PanelBar Test</title>

</

head>

<

body>

<form id="form1" runat="server">

<div>

<asp:ScriptManager ID="ScriptManager1" runat="server" />

<asp:XmlDataSource ID="XmlDataSource1" runat="server"

DataFile="~/menu.xml" XPath="/Items/Item"></asp:XmlDataSource>

<telerik:RadPanelbar runat="server" ID="RadPanelbar1" Skin="Mac"

datasourceid="XmlDataSource1"

DataTextField="Text" DataNavigateUrlField="Url" DataValueField="Text" Width="140px"

OnClientItemClicked="OnClientItemClickedHandlerForMenu" >

<ExpandAnimation Type="OutQuint" Duration="300" />

<CollapseAnimation Type="OutQuint" Duration="300" />

</telerik:RadPanelbar>

</div>

<

input type="submit" />

</form>

</

body>

<

script type="text/javascript">

function

OnClientItemClickedHandlerForMenu(sender, eventArgs)

{

}

</

script>

</

html>


The page loads fine.  However, when I click on the 'submit' button during the postback it generates the above security error.

Gerry
gerry
Top achievements
Rank 1
 asked on 08 May 2008
1 answer
95 views
So I take it if using ASP.NET RadEditor we can't use it to browse on the local machine for files?

Thanks!

Robert
Lini
Telerik team
 answered on 08 May 2008
3 answers
96 views
Hi, I am getting the error "The type name 'Charting' does not exist in the type ..." when I try to build this solution with your example. I am using the latest version of Telerik (2008 Quarter1). Can you tell me how to resolve this ?

Thanks a lot,

Pete Walker.
Ves
Telerik team
 answered on 08 May 2008
1 answer
141 views
Hi!

I want to add some custom css to the Content area css. In the sample I can see how to override the whole css. But how do I keep the defaults and just add to it? Is the default ContentAreaCssFile available, can´t find it.

Thanks!
Rumen
Telerik team
 answered on 08 May 2008
3 answers
290 views
I've been trying to figure out how to accomplish a specific behavior and I haven't been too successful.  Here's what I'd like:

I want to specify an EmptyMessage for a radTextBox and specify a style that displays that message in a light gray color.  I have successfully accomplished this by setting the Skin property to "" and specifying my desired class for the EmptyMessageStyle-CssClass property.  When someone actually types, the text should appear in black.

These two things work, but the problem is in the in-between phase -- if the user hovers over the empty message text, it turns black!  I have tried forcing the hover style to not apply, but I've been unsuccessful.

Any suggestions?  I really don't want any hover behavior whatsoever.

Josh
Dimo
Telerik team
 answered on 08 May 2008
10 answers
692 views
Hi,

I have RadGrid with details table. It is showing plus sign on left side for every record in the grid.
I don't want to show "+" sign for the records which do not have any child records. Currently if we expand by clicking "+" it is showing empty detail table structure.
Is there any way to show "+" sign only for those records with child records associated with them?

I have specified Master table/Detail table structure in .aspx. I am attaching datasource to both tables from code behind.

Regards,
Vinayak
Vinayak
Top achievements
Rank 1
 answered on 08 May 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?