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.
casa51
Top achievements
Rank 2
casa51 asked on 23 Apr 2009, 10:21 AM

HI,
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

            System.Threading.Thread.Sleep(3000)

        End If

 

        For Each f As UploadedFile In RadUpload1.UploadedFiles

            If f.FileName <> "" Then

                Imageup = f.GetName

            Else

                Imageup = "none"

                'Dim imaup As String =

                'Open the SqlConnection

            End If

        Next

        Try

            SqlConnection.Open()

            '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

            SqlCommand.ExecuteNonQuery()

            'Close the SqlConnection

 

 

            SqlConnection.Close()

        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
0
casa51
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">

 

 

<ajaxsettings>

 

 

<telerik:AjaxSetting AjaxControlID="RadGrid1">

 

 

<updatedcontrols>

 

 

<telerik:AjaxUpdatedControl ControlID="RadGrid1" />

 

 

</updatedcontrols>

 

 

</telerik:AjaxSetting>

 

 

</ajaxsettings>

 

 

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

 

 

 

 

 

 

 


</
telerik:RadAjaxManager>

now all work

 

0
Neri
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
Tags
Upload (Obsolete)
Asked by
casa51
Top achievements
Rank 2
Answers by
casa51
Top achievements
Rank 2
Neri
Top achievements
Rank 1
Share this question
or