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

errors in radupoad

0 Answers 67 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Cécil
Top achievements
Rank 2
Cécil asked on 18 Nov 2008, 05:51 PM
Hi

Are occurring in compiling the following errors:
Error 1 'RadGrid1_InsertCommand' is not a member of 'ASP.default_aspx'. C: \ Inetpub \ wwwroot \ upvb \ Default.aspx 43
Error 2 'RadGrid1_ItemDataBound' is not a member of 'ASP.default_aspx'. C: \ Inetpub \ wwwroot \ upvb \ Default.aspx 43
Error 3 'RadGrid1_UpdateCommand' is not a member of 'ASP.default_aspx'. C: \ Inetpub \ wwwroot \ upvb \ Default.aspx 43
I would like to know if you have any solution.


Default.aspx

<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">
<html xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Test</title>
    
</head>
<body class="BODY">
    <form runat="server" id="mainForm" method="post" style="width: 100%">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

            <script type="text/javascript">
                    //On insert and update buttons click temporarily disables ajax to perform upload actions
                    function conditionalPostback(e, sender)
                    {
                        var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");
         if (sender.EventTarget.match(theRegexp))
         {
         var upload = $find(window['UploadId']);
                    
         //AJAX is disabled only if file is selected for upload
         if(upload.getFileInputs()[0].value != "")
         {
         sender.EnableAjax = false;
         }
         }
                    }
            </script>

        </telerik:RadScriptBlock>
        <asp:HiddenField ID="ComboValue" runat="server" />
        
       
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" ClientEvents-OnRequestStart="conditionalPostback">
            <telerik:RadProgressManager ID="RadProgressManager1" runat="server" />
            
            <telerik:RadGrid runat="server" ID="RadGrid1" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" Width="97%" DataSourceID="SqlDataSource2" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowAutomaticDeletes="True"
                OnUpdateCommand="RadGrid1_UpdateCommand"
                OnInsertCommand="RadGrid1_InsertCommand"
                OnItemDataBound="RadGrid1_ItemDataBound"
                ShowStatusBar="True" GridLines="None">
                 
                <PagerStyle Mode="NextPrevAndNumeric" />
                
                <MasterTableView Width="100%" CommandItemDisplay="Top" DataSourceID="SqlDataSource2" DataKeyNames="ID">
                    <Columns>
                   
                        <telerik:GridTemplateColumn HeaderText="Nome" UniqueName="ImageName" SortExpression="Name">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblName" Text='<%# Eval("Name") %>' />
                            </ItemTemplate>
                            
                            
                            <EditItemTemplate>
                            
                            <asp:TextBox runat="server" Style="width: 205px; margin-left: 3px;" ID="txbName" Text='<%# Bind("Name") %>' />
                            <asp:RequiredFieldValidator ID="Requiredfieldvalidator1" runat="server" ControlToValidate="txbName" ErrorMessage="Please, enter a name!" Display="Dynamic" SetFocusOnError="true">
                            </asp:RequiredFieldValidator>
                            
                            </EditItemTemplate>
                        
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Description" UniqueName="Description" DataField="Description">
                            <ItemTemplate>
                                <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("Description") %>' />
                            </ItemTemplate>
                            <EditItemTemplate>
<asp:TextBox ID="txbDescription" Style="width: 205px; margin-left: 4px;" runat="server"
TextMode="MultiLine" Text='<%# Bind("Description") %>' />
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Image" UniqueName="Upload">
                            <ItemTemplate>
                                
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadUpload ID="RadUpload1" runat="server" InitialFileInputsCount="1" MaxFileInputsCount="1"
                                    ControlObjectsVisibility="None" MaxFileSize="1000000" AllowedFileExtensions=".jpg,.bmp,.gif,.dib,.jpeg,.jpe,.jfif,.png,.tif,.tiff" />
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridButtonColumn HeaderText="Deletar" Text="Deletar" CommandName="Delete" UniqueName="column">
                        </telerik:GridButtonColumn>
                        
                        <telerik:GridEditCommandColumn HeaderText="Alterar" UpdateText="" UniqueName="Editar">
                        </telerik:GridEditCommandColumn>
                       
                    </Columns>
                   
                    <EditFormSettings>
                        <EditColumn UniqueName="EditCommandColumn1">
                        </EditColumn>
                    </EditFormSettings>
                    
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="20px" />
                    </ExpandCollapseColumn>
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px" />
                    </RowIndicatorColumn>
                </MasterTableView>
                <FilterMenu EnableTheming="True" Skin="Web20">
                    <CollapseAnimation Duration="200" Type="OutQuint" />
                </FilterMenu>
                <HeaderContextMenu EnableTheming="True">
                    <CollapseAnimation Duration="200" Type="OutQuint" />
                </HeaderContextMenu>
            </telerik:RadGrid>
        </telerik:RadAjaxPanel>
       
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:UpTesteConnectionString %>"
            SelectCommand="SELECT * FROM [Images]"
            InsertCommand="INSERT INTO [Images] ([Name], [Description], [Data]) VALUES (@Name, @Description, @Data)"
            UpdateCommand="UPDATE [Images] SET [Name] = @Name, [Description] = @Description, [Data] = @Data WHERE [ID] = @ID"
            DeleteCommand="DELETE FROM [Images] WHERE [ID] = @ID">
            
            <InsertParameters>
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="Data" Type="Byte" />
            </InsertParameters>
            
            <UpdateParameters>
                <asp:Parameter Name="ID" Type="Int32" />
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="Description" Type="String" />
                
            </UpdateParameters>
            
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            
        </asp:SqlDataSource>
                       
    </form>
</body>
</html>

Default.aspx.vb

Imports System
Imports System.Data
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports System.IO

Imports Telerik.Web.UI
Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub
End Class

Namespace Telerik.Web.Examples.Ajax.Integration.RadUploadInAjaxifiedGrid
    Partial Public Class DefaultVB

        Inherits System.Web.UI.Page
        Dim RadAjaxPanel1 As RadAjaxPanel
        Protected Sub RadGrid1_UpdateCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)
            InitializeUpdateParameter(DirectCast(e.Item.FindControl("RadUpload1"), RadUpload))
        End Sub

        Protected Sub RadGrid1_InsertCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)
            InitializeUpdateParameter(DirectCast(e.Item.FindControl("RadUpload1"), RadUpload))
        End Sub

        Private Sub InitializeUpdateParameter(ByVal currentUpload As RadUpload)
            If currentUpload.UploadedFiles.Count > 0 Then
                Dim data As Byte() = New Byte(currentUpload.UploadedFiles(0).ContentLength) {}
                currentUpload.UploadedFiles(0).InputStream.Read(data, 0, data.Length)
                Session("DataVB") = data
            End If
        End Sub

        Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs)


            If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then

                Dim upload As RadUpload = DirectCast(e.Item.FindControl("RadUpload1"), RadUpload)
                RadAjaxPanel1.ResponseScripts.Add(String.Format("window['UploadId'] = '{0}';", upload.ClientID))
            End If
        End Sub

    End Class
End Namespace




No answers yet. Maybe you can help?

Tags
Upload (Obsolete)
Asked by
Cécil
Top achievements
Rank 2
Share this question
or