This is a migrated thread and some comments may be shown as answers.

Radupload / Radgrid / webusercontrol and masterpage

2 Answers 73 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 2
casa51 asked on 23 Apr 2009, 10:21 AM

excuse for my english am french
i start  to build my new back office manager with your solution.
they start to develop in dotnet (transfer  to  asp 3.0)

i build an news manager with
datagrid / insert-update-delete with usercontrol ( in datagrid)
my news manager use 2 racontrols : editor (they work fine !!!) and radupload for litle image of the news  all page are in masterpage :


In actu.aspx they have one raddatagrid they call webusercontrol.ascx

In webusercontrolascx they have radeditor and radupload.

this code work when they run in single page (not include in master page)


In masterpage the radeditor work well but the radupload return nothing I thinks i can’t find this control.

    Protected Sub RadGrid1_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand

        'Get the GridEditableItem of the RadGrid

        Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)

        Dim MyUserControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)

        'InitializeUpdateParameter(DirectCast(e.Item.FindControl("RadUpload1"), RadUpload))

        'Get the primary key value using the DataKeyValue.

        Dim actuID As String = editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("ID").ToString()

        'Access the textbox from the edit form template and store the values in string variables.


        Dim Titre As String = CType(MyUserControl.FindControl("titre"), TextBox).Text

        Dim Description As String = CType(MyUserControl.FindControl("RadEditor1"), RadEditor).Content

        'Dim RadUpload1 As RadUpload = TryCast(e.Item.FindControl("RadUpload1"), RadUpload)

        Dim RadUpload1 As RadUpload = CType(MyUserControl.FindControl("RadUpload1"), RadUpload)

        Dim Imageup As String

        If RadUpload1.UploadedFiles.Count > 0 Then


        End If


        For Each f As UploadedFile In RadUpload1.UploadedFiles

            If f.FileName <> "" Then

                Imageup = f.GetName


                Imageup = "none"

                'Dim imaup As String =

                'Open the SqlConnection

            End If




            'Update Query to update the Datatable

            Dim updateQuery As String = "UPDATE Actuvdotnet set TitreNews='" & Titre & "',Description='" & Description & "',Image='" & Imageup & "' where ID='" & actuID & "'"

            SqlCommand.CommandText = updateQuery

            SqlCommand.Connection = SqlConnection


            'Close the SqlConnection




        Catch ex As Exception


            RadGrid1.Controls.Add(New LiteralControl("Impossible de mettre à jour la base de donnée : " + ex.Message))

            e.Canceled = True


        End Try


    End Sub

In master page the radeditor work well but the radupload return nothing I thinks i can find this control

Can you help me please.

2 Answers, 1 is accepted

Sort by
Top achievements
Rank 2
answered on 23 Apr 2009, 02:33 PM
I found  !!!!
it my ajax manager they block something


telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">






<telerik:AjaxSetting AjaxControlID="RadGrid1">






<telerik:AjaxUpdatedControl ControlID="RadGrid1" />












 i put
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">









now all work


Top achievements
Rank 1
answered on 22 Aug 2012, 09:08 PM
Bonjour, j'ai le même problème que vous, mais je n'ai pas bien compris comment vous avez résolu le problème ?
Merci d'avance pour votre aide
Upload (Obsolete)
Asked by
Top achievements
Rank 2
Answers by
Top achievements
Rank 2
Top achievements
Rank 1
Share this question