Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
131 views
Hello Telerik Community,

I am attempting to get the RadRotator to work with some Client API.

Everything works except there is a minor bug that I can't figure out what I am doing wrong.

I have the following Rotator Control:

<telerik:RadRotator runat="server" ID="imageSlider" RotatorType="AutomaticAdvance"
                        ScrollDirection="Left" FrameDuration="300" ScrollDuration="1" Width="640px" ItemWidth="640px"
                        Height="640px" ItemHeight="640px" PauseOnMouseOver="False"  OnClientLoad="onRotatorLoadHandler" >
                        <ItemTemplate>
                            <asp:Image ID="Image1" ImageUrl='<%# "~/" + Eval("Path") %>' runat="server" />
                        </ItemTemplate>
                    </telerik:RadRotator>

Now, i have the following buttons:

<table>
                        <tr>
                            <td>
                                <asp:ImageButton ID="cmdStepBack" runat="server" ImageUrl="~/App_Themes/Default/Images/360Controls/first.png"
                                    OnClientClick="return stepBackward();" ToolTip="Step Backwards" />
                            </td>
                            <td>
                                <asp:ImageButton ID="cmdPause" runat="server" ImageUrl="~/App_Themes/Default/Images/360Controls/pause.png"
                                    OnClientClick="return pauseRotator();" ToolTip="Pause Animation" />
                                <asp:ImageButton ID="cmdPlay" runat="server" ImageUrl="~/App_Themes/Default/Images/360Controls/play.png"
                                    OnClientClick="return startRotator();" Style="display: none;" ToolTip="Play Animation" />
                            </td>
                            <td>
                                <asp:ImageButton ID="cmdStepForward" runat="server" ImageUrl="~/App_Themes/Default/Images/360Controls/last.png"
                                    OnClientClick="return stepForward();" ToolTip="Step Forward" />
                            </td>
                        </tr>
                    </table>

And finally, I have the following javascript:

<script language="javascript" type="text/javascript">
            var oRotator;
            function onRotatorLoadHandler(sender, args) {
                oRotator = sender;
            }
 
            function pauseRotator() {
               
                document.getElementById("cmdPause").style.display = "none";
                document.getElementById("cmdPlay").style.display = "";
 
                oRotator.pause();
 
                return false;
            }
 
            function startRotator() {
               
                document.getElementById("cmdPause").style.display = "";
                document.getElementById("cmdPlay").style.display = "none";
 
                oRotator.resume();
                return false;
            }
 
            function stepBackward() {
                oRotator.showNext(Telerik.Web.UI.RotatorScrollDirection.Right);
                pauseRotator();
                return false;
            }
 
            function stepForward() {
                oRotator.showNext(Telerik.Web.UI.RotatorScrollDirection.Left);
                pauseRotator();
                return false;
            }
 
        </script>

So, when I click on Play/Pause, it works just fine and dandy. No issues.

However, when I click on stepForward or stepBackward, I have to call showNext then pause the rotator in order for it to work (this is while the animation is going -- there is a different issue when i pause it).

When I pause the animation first, and then click on stepForward/Back it does not work at all.

If i don't pause the animation (while it is playing) after calling showNext it does not work.

Any thoughts how i can click on showNext(either direction) and have it pause the animation and step forward/back without jumping through hoops?

Thanks,

Jason
Rumen
Telerik team
 answered on 12 Jan 2011
2 answers
137 views
Hi,

I have a rad time picker in my application.

I am setting start and end time using the radtimepicker.timeview.starttime and endtime .

And as mentioned above i can able to set the interval as well.

On button click i have to get the all items from the radtimepicker and have to insert into database.

Can any one suggest me how to get the time collection from the radtimepicker timeview.

Thanks
Thenmozhi
Thenmozhi
Top achievements
Rank 1
 answered on 12 Jan 2011
1 answer
186 views
Hi,

I want to inject some JavaScript code into the aspx page (on some server side event). But the script doesn't get rendered on the page.
I have RadScriptManager on the MasterPage, and RadScriptBlock on the ContentPage.

Then I wrote below code , but it didn't worked:
StringBuilder sb = new StringBuilder();
sb.Append("<script>alert('script test')</script>");
LiteralControl script = new LiteralControl(sb.ToString());
RadScriptBlockCP.Controls.Add(script);

I also tried below code but failed:
String scriptContent = "script type=\"text/javascript\" language=\"javascript\">alert('test alert')</script>";
(RadScriptBlockCP.Controls[0] as LiteralControl).Text = scriptContent;

Please help.
Simon
Telerik team
 answered on 12 Jan 2011
1 answer
82 views
Hi All:
I have an RadUpload control inside sharepoint 2010 webpart , when i click upload button the RadUpload required a valid user name and password .

How do to enable anonymous  access for RadUpload??
Genady Sergeev
Telerik team
 answered on 12 Jan 2011
3 answers
68 views
Hello,

I've encountered an odd problem attempting to use the "PostBackUrl" property of the button used to send the postback which causes the uploader to save the file.

Everything works as planned as long as the button is initially enabled.  However, if the button starts out disabled then the cross page postback doesn't occur. 

This is hard for me to explain clearly so I'm including some code I was testing with.   There are two buttons on this page.  The only difference between the buttons, besides their ID, is that one button is initially disabled and the other one is enabled.  The file is uploaded when either button is clicked.  But only the button which is initally enabled sends a response to the second page.  

I did notice there was a query in the URL after testing with the disabled button:  test.aspx?RadUrid=4ec5a3c0-0503-422b-83d0-743982ca7ffa

I also tried, without luck,  the suggestion in this post ASyncUpload Issue? forum post since it was possible the problem was caused by the same factors.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
   
</head>
<body>  
  
    <form id="form1" runat="server">
        
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        //<![CDATA[
  
        function fileUploaded(sender, eventArgs) {
            var btn = $get("<%= Me.BTN_loadfile.ClientID%>");
            if (typeof (btn) != "defined") {
                btn.disabled = false;
            }
        }
  
        //]]>
    </script>
    </telerik:RadCodeBlock>
  
    <telerik:RadProgressManager ID="RPM_importAdmin" runat="server" />
        <br />
        File to load administrators from (.CSV,.XLS, or .XLSX):
        <br />
        <br />
        <telerik:RadAsyncUpload ID="RAU_uploadFile" MaxFileInputsCount="1" MaxFileSize="10485760" InputSize="60" AllowedFileExtensions="csv,xls,xlsx" runat="server" OverwriteExistingFiles="true" OnClientFileUploaded="fileUploaded" >
            <Localization Select="Browse" />
        </telerik:RadAsyncUpload>
        <br />
        <br />
        <telerik:RadProgressArea ID="RPA_uploadFile" DisplayCancelButton="true" runat="server">
        </telerik:RadProgressArea>
        <asp:Button ID="BTN_loadfile" runat="server" Text="Should Go" Enabled="false" CausesValidation="false" PostBackUrl="~/test2.aspx"></asp:Button>
        <asp:Button ID="Button1" runat="server" Text="Goes" CausesValidation="false" PostBackUrl="~/test2.aspx"></asp:Button>
    <br />
    </form>
</body>
</html>


The code-behind for the SECOND page is the following.   The code-behind for the first page just sets values for the TemporaryFolder and TargetFolder properties.

Imports System.IO
Imports Telerik.Web.UI
  
Partial Class test2
    Inherits System.Web.UI.Page
  
    Protected fileUploader As RadAsyncUpload = Nothing
  
    Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
        If PreviousPage Is Nothing Then
            If Not IsPostBack Then
                Me.Label1.Text = "no previous page"
            End If
        Else
            Me.fileUploader = CType(PreviousPage.Form.FindControl("RAU_uploadFile"), RadAsyncUpload)
            If Me.fileUploader IsNot Nothing AndAlso Me.fileUploader.UploadedFiles.Count > 0 Then
                Me.Label1.Text = "File: " & Path.Combine(Me.fileUploader.TargetFolder, Me.fileUploader.UploadedFiles(0).FileName)
            End If
        End If
    End Sub
  
End Class

The version of the Telerik .dll is: 2010.3.1215.35

Any help or ideas would be greatly appreciated.

Thanks,
Genady Sergeev
Telerik team
 answered on 12 Jan 2011
6 answers
184 views
Hi,

I had a form for eg. let say userprofile, In that i have to create new users. So the user name should be unique. I had placed required field validator for  validating mandatory fields (ie. Fields should not be empty while insert). I have checked with sql query for user name duplication. Now i want display a message if the user name already exist. I need your help in this regards.

Thanks & Regards
Kannan
Naunton
Top achievements
Rank 1
 answered on 12 Jan 2011
1 answer
86 views
Hi

Can we place image right side to the Text in a RadTab? is it possible?
Shinu
Top achievements
Rank 2
 answered on 12 Jan 2011
3 answers
121 views
I found a KB article on how to print the content of a RadToolTip (http://www.telerik.com/support/kb/aspnet-ajax/tooltip/print-radtooltip-content.aspx), but I can't get this sort of functionality to work with the RadToolTipManager.

I'm using the manager because I have a GridView that I've got a "details" column in - this shows a tooltip with a user control, i want to be able to print just the contents of the user control.  Please provide assistance in doing so.
Svetlina Anati
Telerik team
 answered on 12 Jan 2011
1 answer
106 views
I've got a simple user control which contains a Rad Combo Box, and the Combo has a Rad Tooltip attached.

The UC is then placed inside another tooltip within another form and opened when a button is pressed.  However when I click into the combo in the UC with the tooltip the tooltip with the UC closes...

Any advice anyone...!???

Cheers
Cliff
Svetlina Anati
Telerik team
 answered on 12 Jan 2011
1 answer
127 views
We have been using version 2010.3.1109.35 since 2010-11-11 without problems, upgraded to version 2010.3.1215.35 on 2010-12-25. The RadAsyncUpload is now failing to deserialize our custom AsyncUploadConfiguration properties.
Sample code below.
ASPX page with the RadAsyncUpload control:
<telerik:RadAsyncUpload runat="server" ID="FilesToUpload" MultipleFileSelection="Automatic"
    HttpHandlerUrl="~/Tracking/FileUpload.ashx" AutoAddFileInputs="true" />

Custom Configuration:
public class CustomConfiguration : AsyncUploadConfiguration
{
    public string UserName { get; set; }
    public long FileNoteID { get; set; }
    public bool SaveContentOnly { get; set; }
}

Initializing configuration in code behind of ASPX page with RadAsyncUpload control
public partial class UploadFiles
{
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
CustomConfiguration config = FilesToUpload.CreateDefaultUploadConfiguration<CustomConfiguration>();
            config.FileNoteID = 1234; // sample ID
            config.UserName = "michael"; // sample user name
            config.SaveContentOnly = true;
            FilesToUpload.UploadConfiguration = config;
    }
}

Code behind of Http handler, our additional properties (UserName, FileNoteID) are not being deserialized here anymore.
public class FileUpload : AsyncUploadHandler
{
    protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName)
    {
        CustomConfiguration config = configuration as CustomConfiguration;
        if (config != null)
        {
            // UserName & FileNoteID come through as "" and 0 with latest release.
            DoSomething(config.UserName, Config.FileNoteID);
        }
    }
}

Can someone please let me know how to resolve this issue? Do we need to change something in our web.config?

Thanks
Genady Sergeev
Telerik team
 answered on 12 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?