Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
50 views
maybe through vsto
Slav
Telerik team
 answered on 09 Mar 2012
1 answer
207 views
I have the following setup as shown in the markup below. There is an ajaxified panel which contains an imagebutton and a hyperlink. Clicking on either of these opens a rad Window, which has a close handler. The close handler initiates the "click" event of a hidden button in order for me to be able to run some server-side code after the window closes. When I open the radwindow using the hyperlink, everything works as expected. When I do so using the image button, I get the following non-descript javascript error when the hidden button .click event is raised.

Error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 405

This error doesn not occur if I don't ajaxify the panel.

I have tried to research this error and track down the cause, but to no avail. When I look at this in Fiddler, I notice the URL that fiddler errors on is .{my path}/javascript:void(0);. I don't know where the javascript:void(0); comes from... but I obviously include that in the Imagebutton PostbackUrl to prevent a postback when the imagebutton is clicked. I also don't know why this piece of the imagebutton declaration would have anything to do with this since the error occurs on the attempt to raise the hidden button's click event.

Any Idea why the image button implementation wouldn't work, while the hyperlink does?

Markup:

<telerik:RadCodeBlock ID="rcb1" runat="server">
          
        <script language="javascript">
  
            function OpenDialog() {
                var oWin = radopen('http://www.yahoo.com', ''); 
                oWin.add_close(Refresh);            
             }
  
            function Refresh() {
                $get('<%= tiReloader.ClientID %>').click();
            }
              
  
        </script>
  
    </telerik:RadCodeBlock>
      
<asp:ScriptManager ID="MyScriptManager" runat="server" AsyncPostBackTimeout="7200"></asp:ScriptManager>
<telerik:RadAjaxLoadingPanel id="lpGlobal" Runat="server" Transparency="18" CssClass="AjaxLoadingProgress"></telerik:RadAjaxLoadingPanel>
<asp:Panel id="pnlT" runat="Server" height="400px">
    <asp:Button ID="tiReloader" runat="server" Text="Button" style="display:none;" />
    <asp:ImageButton id="ib" runat="Server" ImageUrl="~/global/images/icons/edit.png" AlternateText="Open Dialog from Image Button" ImageAlign="AbsMiddle" PostBackUrl="javascript:void(0);" OnClientClick="OpenDialog()" /><br/><br/>
    <asp:Hyperlink id="hl" runat="Server" target="_self" navigateurl="javascript:OpenDialog();" >Open Dialog from Hyperlink</asp:Hyperlink>
</asp:Panel>


In code-behind, I ajaxify the panel using an ajaxmanager which is part of my page base class:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        SetAjaxManagerSettings()
    End Sub
  
    Private Sub SetAjaxManagerSettings()
        Me.AddAjaxSetting(pnlT, pnlT, lpGlobal, Unit.Percentage(100), Web.UI.UpdatePanelRenderMode.Block )
    End Sub
  
    Private Sub tiReloader_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles tiReloader.Click
        Threading.Thread.Sleep(500)
    End Sub
  
Public Sub AddAjaxSetting(ByVal initiatorControl As Control, ByVal updatedControl As Control, ByVal loadingPanel As RadAjaxLoadingPanel, ByVal updatePanelHeight As Unit, ByVal updatePanelRenderMode As UpdatePanelRenderMode)
  
            Dim ajaxManager As RadAjaxManager = Telerik.Web.UI.RadAjaxManager.GetCurrent(Me)
  
            If ajaxManager IsNot Nothing Then
  
                If initiatorControl IsNot Nothing And updatedControl IsNot Nothing Then
  
                    Dim setting As AjaxSetting = New AjaxSetting
  
                    ajaxManager.AjaxSettings.Add(setting)
  
                    setting.AjaxControlID = initiatorControl.ID
  
                    Dim ajxUpdatedControl As New AjaxUpdatedControl()
  
                    ajxUpdatedControl.ControlID = updatedControl.ID
  
                    If loadingPanel IsNot Nothing Then
  
                        ajxUpdatedControl.LoadingPanelID = loadingPanel.ID
  
                    End If
  
                    setting.UpdatedControls.Add(ajxUpdatedControl)
  
                    ajxUpdatedControl.UpdatePanelRenderMode = updatePanelRenderMode
  
                    If Not updatePanelHeight.IsEmpty Then
  
                        ajxUpdatedControl.UpdatePanelHeight = updatePanelHeight
  
                    End If
  
                Else
  
                    Throw New Exception("The initiatorControl or updatedControl is NULL. Cannot add AjaxSetting.")
  
                End If
  
            Else
  
                Throw New Exception("Telerik RadAjaxManager not found on page. Set UseSharedAjaxManager property to True in Page_Init event or add a Telerik RadAjaxManager control to the page.")
  
            End If
  
        End Sub
Maria Ilieva
Telerik team
 answered on 09 Mar 2012
2 answers
103 views
We use the RAD Tab strip to divide the form under various sections and noticed that when we try to set a textbox value of one tab with value entered in another tab, we get an overlapping style in the target textbox.

This happens if the target textbox has a empty message set. I've attached the markup code below:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
 
<!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>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
    <script type="text/javascript" id="telerikClientEvents1">
//<![CDATA[
 
        function txtTab1Title_ClientOnBlur(sender, args) {
            //Add JavaScript handler code here
            var ctrl1 = $("input[id$='txtTab2Title']");
            var txtTab2Title = $find(ctrl1.get(0).id);
            txtTab2Title.set_value(sender.get_value());
        }
 
        function txtTab2Title_ClientOnBlur(sender, args) {
            //Add JavaScript handler code here
            var ctrl1 = $("input[id$='txtTab1Title']");
            var txtTab1Title = $find(ctrl1.get(0).id);
            txtTab1Title.set_value(sender.get_value());
        }
//]]>
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.       
    </script>
    <div class="MasterContainer">
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
            SelectedIndex="0" Skin="Hay" Width="100%">
            <Tabs>
                <telerik:RadTab runat="server" Text="Tab1" Value="Tab1" Owner="RadTabStrip1"
                    Selected="True" PageViewID="rpvTab1" />
                <telerik:RadTab runat="server" Text="Tab2" Value="Tab2" Owner="RadTabStrip1" PageViewID="rpvTab2" />
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server">
            <telerik:RadPageView ID="rpvTab1" runat="server" Selected="true" Width="100%">
                <h4>
                    Tab1 Tab Contents</h4>
                <div class="FormContainer">
                    <telerik:RadTextBox ID="txtTab1Title" runat="server" EmptyMessage="Tab1 Title"
                        Label="Title:" Width="400px">
                        <ClientEvents OnBlur="txtTab1Title_ClientOnBlur" />
                    </telerik:RadTextBox>
                </div>
            </telerik:RadPageView>
            <telerik:RadPageView ID="rpvTab2" runat="server" Width="100%">
                <h4>
                    Tab2 Tab Contents</h4>
                <div class="FormContainer">
                    <telerik:RadTextBox ID="txtTab2Title" runat="server" EmptyMessage="Tab2 Tab Title"
                        Label="Title:" Width="400px">
                        <ClientEvents OnBlur="txtTab2Title_ClientOnBlur" />
                    </telerik:RadTextBox>
                </div>
            </telerik:RadPageView>
        </telerik:RadMultiPage>
    </div>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    </form>
</body>
</html>


Vasil
Telerik team
 answered on 09 Mar 2012
1 answer
121 views
Hi everybody, i created, a site map dinamically, but all the nodes assume tha same navigateUrl.

Is possible to make that dinamically ? if so, how?
thnkz
<telerik:RadSiteMap runat="server" ID="RadSiteMap1"
    DataFieldID="ID" DataFieldParentID="ParentID" DataTextField="Text" ShowNodeLines="true">
    <DataBindings>
        <telerik:RadSiteMapNodeBinding NavigateUrl="#" />
    </DataBindings>
</telerik:RadSiteMap>
protected void Page_Load(object sender, EventArgs e)
       {
           RadSiteMap1.DataSource = SiteDataItem.GetSiteData();
           RadSiteMap1.DataBind();
       }
       /// <summary>
       /// Método que encapsula os atributos e monta a lista.
       /// </summary>
       public class SiteDataItem
       {
           private string _text;
           private int _parentId;
           private int prvID;
           private string prvLink;
 
           /// <summary>
           /// Descrição dos nodes
           /// </summary>
           public string Text
           {
               get { return _text; }
               set { _text = value; }
           }
           /// <summary>
           /// ID do node
           /// </summary>
           public int ID
           {
               get { return prvID; }
               set { prvID = value; }
           }
           /// <summary>
           /// ID de node pai
           /// </summary>
           public int ParentID
           {
               get { return _parentId; }
               set { _parentId = value; }
           }
           /// <summary>
           /// Atribui valor aos campos.
           /// </summary>
           /// <param name="ID"></param>
           /// <param name="nivel0"></param>
           /// <param name="nivel1"></param>
           /// <param name="nivel2"></param>
           /// <param name="nivel3"></param>
           /// <param name="nivel4"></param>
           /// <param name="text"></param>
           /// int ID, int nivel0, int nivel1, int nivel2, int nivel3, int nivel4,
           public SiteDataItem(int id, int parentId, string text)
           {
               //prvNivel0 = nivel0;
               //prvNivel1 = nivel1;
               //prvNivel2 = nivel2;
               //prvNivel3 = nivel3;
               //prvNivel4 = nivel4;
               prvID = id;
               _parentId = parentId;
               _text = text;
           }
           /// <summary>
           /// Monta a lista TreeView.
           /// </summary>
           /// <returns>Lista com dados TreeView.</returns>
           public static List<SiteDataItem> GetSiteData()
           {
               List<SiteDataItem> siteData = new List<SiteDataItem>();
 
               siteData.Add(new SiteDataItem(1, 0, "Products"));
               siteData.Add(new SiteDataItem(2, 1, "RadControls for ASP.NET Ajax"));
               siteData.Add(new SiteDataItem(3, 1, "RadControls for Silverlight"));
               siteData.Add(new SiteDataItem(4, 2, "RadGrid"));
               siteData.Add(new SiteDataItem(5, 2, "RadScheduler"));
               siteData.Add(new SiteDataItem(6, 2, "RadEditor"));
               siteData.Add(new SiteDataItem(7, 3, "RadGrid"));
               siteData.Add(new SiteDataItem(8, 3, "RadMenu"));
               siteData.Add(new SiteDataItem(9, 3, "RadEditor"));
 
               return siteData;
           }
       }
Peter
Telerik team
 answered on 09 Mar 2012
1 answer
103 views
Hi,
 In the following demo on telerik site if I click on html file in attachment column for downloading it in IE and click open option, it redirects me to that page instead of opening a new window. I have a requirement wherein new window should be opened for attachment if it is html file.

http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/gridattachmentcolumn/defaultcs.aspx 

Regards,
mahesh
Andrey
Telerik team
 answered on 09 Mar 2012
2 answers
64 views
Hi,

We would like to change the forecolor of WeightItem of the tag cloud control, currently weightitem has been set with grey color, the issue is, we have background image(see the screen shot) for cloud control and it also has the grey color so weight item is not visible properly. we will be able to solve this if we can change the color of the weight item.

Thanks
Venkat
Venkatakrishna
Top achievements
Rank 1
 answered on 09 Mar 2012
5 answers
61 views
Hello,

I have a problem regarding the scheduler. I have bind the break data using in calender(see the attachment file which content data of break or block). In weekly view, i want to delete particular date from the calender. I used the (e.Appointment.Start.Date) or RadScheduler1.SelectedDate  to find the date. It is not delete the selected break or block date.

But no problem in day view. It is delete the selected date. But the problem in weekly view. In weekly view, RadScheduler1.SelectedDate not work because it only delete the today date.

Please help me as soon as possible

Thanks

Jiten Mutum
Plamen
Telerik team
 answered on 09 Mar 2012
1 answer
329 views
Good afternoon,

I am using the CSS div layout from 960.gs. Works like a charm with all ASP.Net AJAX controls apart RadButton.

When I set the button width to 100% to fill the div it always edges out ( see attached image ).

How can I avoid that ?

TIA,

S.R.
Bozhidar
Telerik team
 answered on 09 Mar 2012
3 answers
113 views
Hi,

While clicking on grid header for sorting an extra button becomes visible.Why this happens?

Help me.
Thnx in advance
Princy
Top achievements
Rank 2
 answered on 09 Mar 2012
1 answer
98 views
Hi

Well I finally came up with some client side code to enable and disable my TextBoxes and by extension I figured out how to manipulate NumericTextboxes.

Only to find the following gotcha.

If I initially set the NumericTextBoxes to disabled in server side code I can never enable them.

If they are initially enabled in server side code I can disable and enable them to my hearts content.

Any ideas?

Here is the server side and client side code I'm using.

C#:

 

 

if (saParam[1] == 'Always')

 

{

AlwaysRadioButton.Checked =

 

true;

 

ConnectionNameTextBox.ReadOnly =

 

true;

 

InitiateConnectionCheckBox.Enabled =

 

false;

 

WaitRadNumericTextBox.Enabled =

 

false;

 

DelayRadNumericTextBox.Enabled =

 

false;

 

}

 

 

else if (saParam[1] == 'Any')

 

{

RunIfAnyRadioButton.Checked =

 

true;

 

ConnectionNameTextBox.ReadOnly =

 

true;

 

InitiateConnectionCheckBox.Enabled =

 

false;

 

WaitRadNumericTextBox.Enabled =

 

true;

 

DelayRadNumericTextBox.Enabled =

 

true;

 

}

 

 

else if (saParam[1] == 'Specific')

 

{

SpecificRadioButton.Checked =

 

true;

 

ConnectionNameTextBox.ReadOnly =

 

false;

 

InitiateConnectionCheckBox.Enabled =

 

true;

 

WaitRadNumericTextBox.Enabled =

 

true;

 

DelayRadNumericTextBox.Enabled =

 

true;

 

}

javascript:

 

function

 

 

DisableDelayWaitControls( bDisabled )

 

{

 

 

var ntbDelay = $find( "CriteriaDelayRadNumericTextBox" );

 

 

 

var ntbDelayUp = document.getElementById( "CriteriaDelayRadNumericTextBox" + "_SpinUpButton" );

 

 

 

var ntbDelayDown = document.getElementById( "CriteriaDelayRadNumericTextBox" + "_SpinDownButton" );

 

 

 

var ntbWait = $find( "CriteriaWaitRadNumericTextBox" );

 

 

 

var ntbWaitUp = document.getElementById( "CriteriaWaitRadNumericTextBox" + "_SpinUpButton");

 

 

 

var ntbWaitDown = document.getElementById( "CriteriaWaitRadNumericTextBox" + "_SpinDownButton" );

 

ntbDelay.disabled = bDisabled;

ntbWait.disabled = bDisabled;

ntbDelay._textBoxElement.disabled = bDisabled;

ntbDelayUp.disabled = bDisabled;

ntbDelayDown.disabled = bDisabled;

ntbWait._textBoxElement.disabled = bDisabled;

ntbWaitUp.disabled = bDisabled;

ntbWaitDown.disabled = bDisabled;

}

If the 'Always' code branch is executed I can never enable my controls in javascript.?????

Vasil
Telerik team
 answered on 09 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?