Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
218 views
Hello,

I get this error when I try to add a radcaptcha inside the template of a createuserwizard
"Cannot unregister UpdatePanel with ID '' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported"

It seems that captcha is inserting itself automatically in some control collection and create a related updatepanel ?

How to solve this ?

Thank you for help.
CS

PS: seems the updatepanels have no ids ?
Pero
Telerik team
 answered on 01 Nov 2010
3 answers
76 views
Hi,
In my page I used to have RadGrid with pagination and SEO enabled.
Everything was working fine, but I needed to have Div layout, I changed it to RadListView and RadDataPager.
Now the only problem that I have is that the pages' links changes the re-written urls to the original one.
For example:
Re-written Url: http://www.mysite.com/car/123
Original Url: http://www.mysite.com/cars.aspx?carId=123

I expect for page 2 the link would be:
http://www.mysite.com/cars/123?pageno=2

But the link is changed back to the original and is like this:
http://www.mysite.com/cars.aspx?carId=123&pageno=2

I did not have such a problem with RagGrid Pagination.
By the way, I am using Telerik controls of DotNetNuke. The version is 2010.1.309.35.

Thanks.
Iana Tsolova
Telerik team
 answered on 01 Nov 2010
1 answer
68 views
I am running into an issue where my RadScheduler's TimeSlotCreated event gets fired BEFORE my Page_Load function on a postback, where my logic in Page_Load() needs to run before the TimeSlotCreated event gets fired off.

I saw in some past patch notes for Q2 2008 SP1 (version 2008.2.826) HERE  one of the fix notes under RadScheduler:
                               - TimeSlotCreating is not fired before Page_Load on post back.


I am currently developing with ASP.NET AJAX Q3 2009, and am still seeing TimeSlotCreated event getting called before my Page_Load

Something I am doing wrong? Or is the bug still in the version I am using?
T. Tsonev
Telerik team
 answered on 01 Nov 2010
8 answers
94 views
Hi Telerik team,

In our application, we allow user insert media. One thing is very confuse for our clients is the default size for the media file ( 150 * 150 ). Is there have any way we can use orignal video size unless the user really want to change it?

Best regards,

lan
Top achievements
Rank 1
 answered on 01 Nov 2010
3 answers
149 views
hi,
I have asp.net LinkButton, where it has been configured with RadAjaxManager to update asp.net panel.
now I wanna after the update done (the content of that panel changed) I need to call a javascript function, because in this new content, there is div which making a type of sliding effect, but it will not start the effect unless the javascript function is called, so I need to call that javascript function once the update of asp.net panel is done.

I tried to add "OnClientClick" property to LinkButton, but that does not working, and even it did not triggered!

and I have tried to create another panel and in ajax calling, I tried to fill it with a Literal control, where this literal:
        Literal l = new Literal();
        l.Text = "<script type='text/javascript'>coda_side_it();</script>";

but this is not working, and moreover, I tried to Response.Write("<script type='text/javascript'>coda_side_it();</script>"); but that makes a big problem with ajax!!

so please any help?
Iana Tsolova
Telerik team
 answered on 01 Nov 2010
6 answers
242 views
Hi all,

I´ve created a web user control (.ascx) which is dynamically added to the page. It contains a RadAjaxPanel which contains a RadGrid, as follows:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ComentarioLista.ascx.cs"
    Inherits="Include_RedeSocial20_MuralItem_ComentarioLista" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="../../Investidor/Foto.ascx" TagName="Foto" TagPrefix="uc1" %>
<%@ Register Src="ComentarioItem.ascx" TagName="ComentarioItem" TagPrefix="uc2" %>
<%@ Register Src="../../Mensagem.ascx" TagName="Mensagem" TagPrefix="uc3" %>
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" HorizontalAlign="NotSet">
    <table style="width: 100%;">
        <tr>
            <td>
                <asp:LinkButton ID="btnComentar" runat="server" OnClick="btnComentar_Click">Comentar</asp:LinkButton>
            </td>
        </tr>
        <tr runat="server" id="trNovoComentario" visible="false">
            <td>
                <asp:TextBox ID="tbComentario" runat="server" MaxLength="2000" TextMode="MultiLine"
                    Width="100%"></asp:TextBox>
                <br />
                <asp:Button ID="btnPostar" runat="server" Text="Postar comentário" CssClass="btnLaranja"
                    OnClick="btnPostar_Click" />
            </td>
        </tr>
        <tr>
            <td>
                <telerik:RadGrid ID="RadGridLista" runat="server" AutoGenerateColumns="False" border="1"
                    GridLines="None" OnItemCreated="RadGridLista_ItemCreated" PageSize="10" SkinID="RadGridForum"
                    OnItemCommand="RadGridLista_ItemCommand">
                    <ClientSettings EnableAlternatingItems="true" EnableRowHoverStyle="false">
                    </ClientSettings>
                    <PagerStyle SEOPagingQueryStringKey="page" />
                    <MasterTableView AllowPaging="true" CellSpacing="-1" NoMasterRecordsText="Nenhum comentário"
                        ShowHeader="False">
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridTemplateColumn UniqueName="CODIGO">
                                <ItemTemplate>
                                    <uc2:ComentarioItem ID="ComentarioItem1" runat="server" Codigo='<%#Eval("CODIGO") %>'
                                        DthrInclusao='<%#Eval("DTHR_INCLUSAO") %>' FotoUrl='<%#Eval("FOTO_URL") %>' PublicacaoCodigo='<%#Eval("SLN_PUBL_CODIGO") %>'
                                        Texto='<%#Eval("TEXTO") %>' UsuarioCodigo='<%#Eval("SLN_USUA_CODIGO") %>' UsuarioCodigoPublicacao='<%#Eval("SLN_USUA_CODIGO_AUTOR") %>'
                                        UsuarioNome='<%#Eval("SLN_USUA_NOME") %>' />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn UniqueName="EXCLUIR" HeaderStyle-Width="18px">
                                <ItemTemplate>
                                    <div align="center">
                                        <asp:ImageButton ID="btnExcluir" runat="server" ImageUrl="~/Images/Botao/excluir2.gif"
                                            CommandArgument='<%#Eval("CODIGO") %>' CommandName="Excluir" Visible='<%#GetVisible(Eval("SLN_USUA_CODIGO").ToString(),Eval("SLN_USUA_CODIGO_AUTOR").ToString()) %>' />
                                    </div>
                                </ItemTemplate>
                                <HeaderStyle Width="18px" />
                            </telerik:GridTemplateColumn>
                        </Columns>
                        <PagerStyle Position="Bottom" />
                    </MasterTableView>
                </telerik:RadGrid>
            </td>
        </tr>
    </table>
</telerik:RadAjaxPanel>
<uc3:Mensagem ID="Mensagem1" runat="server" />
<input type="hidden" runat="server" id="tbPublicacaoCodigo" />

And the .CS for this file is as follows:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data.SqlClient;
  
public partial class Include_RedeSocial20_MuralItem_ComentarioLista : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
  
    }
  
    public Nullable<decimal> PublicacaoCodigo
    {
        get
        {
            decimal cod;
            bool isCodValido = decimal.TryParse(tbPublicacaoCodigo.Value, out cod);
            if (!isCodValido)
                return null;
            else
                return cod;
        }
        set { tbPublicacaoCodigo.Value = value.ToString(); }
    }
  
    public void BuscaDados()
    {
        UsuarioDataSetTableAdapters.SLN_VW_PUBLICACAO_COMENTARIOTableAdapter ta =
            new UsuarioDataSetTableAdapters.SLN_VW_PUBLICACAO_COMENTARIOTableAdapter();
        UsuarioDataSet.SLN_VW_PUBLICACAO_COMENTARIODataTable dt = new UsuarioDataSet.SLN_VW_PUBLICACAO_COMENTARIODataTable();
  
        dt = ta.GetDataByPublicacao((decimal)PublicacaoCodigo);
        if (dt.Count == 0)
        {
            RadGridLista.Visible = false;
        }
        else
        {
            RadGridLista.Visible = true;
  
            RadGridLista.DataSource = dt;
            RadGridLista.DataBind();
        }
    }
  
    protected bool GetVisible(string usuarioCodigo, string usuarioCodigoPublicacao)
    {
        if ((usuarioCodigoPublicacao.Equals(Sln.Usuario.Usuario.CodigoSessao)) || (usuarioCodigo.Equals(Sln.Usuario.Usuario.CodigoSessao)))
            return true;
        else
            return false;
  
    }
  
    protected void RadGridLista_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridPagerItem)
        {
            Util.EscondeGridPageSize((GridPagerItem)e.Item);
        }
    }
  
    protected void btnPostar_Click(object sender, EventArgs e)
    {
        SqlTransaction tran = null;
        try
        {
            if (string.IsNullOrEmpty(tbComentario.Text))
            {
                //Page.ClientScript.RegisterStartupScript(Page.GetType(), "aviso", "alert('Comentário não pode ser vazio.');");
                RadAjaxPanel1.ResponseScripts.Add("alert('Comentário não pode ser vazio.');");
                return;
            }
  
            // Pega o código da publicação
            decimal pub = PublicacaoCodigo.Value;
  
            UsuarioDataSetTableAdapters.SLN_PUBLICACAO_COMENTARIOTableAdapter ta = new UsuarioDataSetTableAdapters.SLN_PUBLICACAO_COMENTARIOTableAdapter();
            tran = TableAdapterHelper.BeginTransaction(ta);
  
            decimal cod = (decimal)ta.ProximoCodigo();
  
            ta.Insert(cod, pub, Sln.Usuario.Usuario.CodigoSessao, tbComentario.Text, DateTime.Now);
  
            tran.Commit();
            //Response.Redirect(Request.Url.ToString(), false);
  
            tbComentario.Text = "";
            trNovoComentario.Visible = false;
            BuscaDados();
        }
        catch (Exception ex)
        {
            if (tran != null)
                tran.Rollback();
  
            if (ex.Message.ToLower().IndexOf("a potentially dangerous") >= 0)
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "aviso", "alert('Dangerous text');");
            else
            {
                Log.Insere(string.Format("RedeSocial20.ComentarioLista.Inserir - Usuario: {0} Publicacao: {1} Mensagem: {2} Erro: {3} Trace: {4}",
                    Sln.Usuario.Usuario.CodigoSessao, PublicacaoCodigo, tbComentario.Text, ex.Message, ex.StackTrace), Log.ERROR);
                Mensagem1.Exibe("Desculpe-nos, houve um erro que será analisado por nossa equipe.", false);
            }
        }
        finally
        {
            if (tran != null)
                tran.Dispose();
        }
    }
  
    protected void btnComentar_Click(object sender, EventArgs e)
    {
        if (!trNovoComentario.Visible)
            trNovoComentario.Visible = true;
        else
            trNovoComentario.Visible = false;
    }
  
    protected void RadGridLista_ItemCommand(object source, GridCommandEventArgs e)
    {
        string strCod = e.CommandArgument.ToString();
  
        decimal codigo = decimal.Parse(strCod);
  
        if (e.CommandName.Equals("Excluir"))
        {
            // Efetua exclusão do item e então atualiza lista de comentários
            UsuarioDataSetTableAdapters.SLN_PUBLICACAO_COMENTARIOTableAdapter taCom = new UsuarioDataSetTableAdapters.SLN_PUBLICACAO_COMENTARIOTableAdapter();
            taCom.Delete(codigo);
  
            //RadGridLista.Rebind();
            BuscaDados();
        }
    }
}



Well, the ItemCommand event is not firing, even when "btnExcluir" (the ImageButton) is clicked. What am I doing wrong?

Thanks in advance!
Iana Tsolova
Telerik team
 answered on 01 Nov 2010
5 answers
345 views
I hope this is an easy question to answer.  I have a RadGrid with various bound columns, one of which is a GridDropDownColumn.  I'm binding the column declaritively to a SQLDataSource as follows:

GridDropDownColumn:
<telerik:RadGrid runat="server" ID="rgUserMapping" AutoGenerateColumns="false" AllowPaging="true" PageSize="20">
...
    <%-- MasterTableView Settings --%>
    <MasterTableView AllowSorting="true" Caption="" Summary="" AllowFilteringByColumn="true" ItemStyle-VerticalAlign="Top" DataKeyNames="UserMappingID" CommandItemDisplay="Bottom" EditMode="PopUp">
...
        <%-- Columns --%>
        <Columns>
...
            <telerik:GridDropDownColumn DataField="Component" HeaderText="Component" FilterControlWidth="50" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataSourceID="dsComponentDataSource" ListTextField="Title" ListValueField="ID" DropDownControlType="RadComboBox" />
...
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

When the RadGrid loads, I get what looks like text in the place of the  GridDropDownColumn, and the text is what would be the first item in the bound dropdownlist.

I want the text to read the actual value that comes from the database.  How do I make that happen?
Ryan
Top achievements
Rank 1
 answered on 01 Nov 2010
1 answer
114 views
I'm using the Grid with oData (aka ADO Data Services http://www.telerik.com/help/aspnet-ajax/grdclientbindingtowcfserviceadonetdataservice.html) and am unable to get the grid to scroll with a vertical scrollbar.

How do I make this happen?  It seems that the page size is fixed and won't allow me to render anything outside of a default page boundary.

Also, I'd like to programmaticly navigate to a specific row, on a different page, using javascript. 
Veli
Telerik team
 answered on 01 Nov 2010
2 answers
80 views

Hello All,
 I use an example here: telerik example , I have RadGrid2 with property AllowPaging="true"
In this example, there ia a button and write:"Click PostBack to see the state of the grid is preserved."
And it works well, if I don't  change number of this page,
but if I change the page number all selected values from the preview page  not saved.
I have added to the grid property EnableViewState = "True", but it did not help .

Can you help me please?
Thank you

Oren Kremer
Top achievements
Rank 1
 answered on 01 Nov 2010
2 answers
93 views

Hello All,
 I use an example here: telerik example , I have RadGrid2 with property AllowPaging="true"
In this example, there ia a button and write:"Click PostBack to see the state of the grid is preserved."
And it works well, if I don't  change number of this page,
but if I change the page number all selected values from the preview page  not saved.
I have added to the grid property EnableViewState = "True", but it did not help .

Can you help me please?
Thank you

Oren Kremer
Top achievements
Rank 1
 answered on 01 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?