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

[Solved] some wrong after delete command

1 Answer 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 06 Mar 2010, 04:09 AM
hi

I have this unique problem that after i execute this code: it would automatically redirect to the login page which i do not want.
But before i place the delete directory code it was working fine, no redirection, just like a normal delete row operation you would see in page with radgrid. What is causing the redirection after delete? It is strange.

I have also set to automatic delete to true.

 <telerik:GridButtonColumn CommandName="Delete" HeaderText="Delete"
            Text="Delete" UniqueName="column1" ConfirmText="Are you sure?"
            ConfirmTitle="Confirm">
        </telerik:GridButtonColumn>

Protected Sub RadGrid1_DeleteCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.DeleteCommand
        Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
        Dim str As String = item("Document_ID").Text
        Dim filepath As String = item("Document_Path").Text.Substring(5, 40)
        Directory.Delete(Server.MapPath(filepath), True)
    End Sub

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 08 Mar 2010, 07:46 AM
Hi,

I believe the issue is not with the RadGrid but has something to do with the fact that you are deleting the directory of your application.
Please  take a look at the links below for a more detailed explanation:

Hope this helps.

Thanks,
Princy
Tags
Grid
Asked by
L
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or