.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

deleting files wthin gridview

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :ASP.Net

Hi Experts,

Im looking for help. Hope you can help me.

I have a small website with a database. Just two tables for personaldata and for files belongs to the personal data.

This files are stored on HD. My problem is to delete this file by clicking on delete button within gridview. At the moment only the record is deleting but not the file which belongs to this record.

That is my Gridview:

<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
                    AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" BorderColor="Tan"
                    BorderWidth="1px" CellPadding="2" DataKeyNames="filesID" DataSourceID="SqlDataSource3"
                    ForeColor="Black" GridLines="None" PageSize="2">
                        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                         <asp:TemplateField HeaderText="Datei">  
                              <asp:LinkButton ID="LinkButton1" runat="server" CausesVali

View Complete Post

More Related Resource Links

jpg files will not display in gridview on aspx page

I have an image object in a template of a gridview The datasource of the image object evaluates to the path of the jpg file. However, the aspx page displays a little red x instead of the picture. How do I get the image to display/Frank learning vs 2005

read delimited files into a datatable and bind to a gridview

I have a delimted file , like a csv file but the delimters are # and not ,I assume I would use SqlConnection and SqlDataAdapterSo for a csv file what is the sequence to read in for example c:\data\demo.csvWhat would the connection string be.Also can you specifiy a different delimiter.The code below is what I assume it would possibly look likea although its only a frst guess. ThanksJim Dim connectionString As String = "Data Source=localhost;Initial Catalog=master;Integrated Security=true;" Dim con As New SqlConnection(ConfigurationManager.ConnectionStrings("Northwind_ConnectionString").ConnectionString) Dim str As String = "SELECT * FROM Employees" Dim cmd As New SqlCommand(str, con) Dim da As New SqlDataAdapter(cmd) Dim dt As New DataTable() da.Fill(dt) GridView1.DataSource = dt GridView1.DataBind()

GridView Deleting



I am using VS2005 and SQL Server 2005. The problem I am having is when I call my SQLDataSource to delete rows the delete is firing twice. The trace and debugging show the code executing once. In fact right after the delete, the table only shows one delete, but right after the command function is exited the 2nd row is deleted. Also, I have tested the stored procedure to make sure it only deletes 1 one and then resequences the records.

Show below are excerpts from my .aspx and code behind files.

                            <asp:LinkButton ID="PreCompanyCensusDeleteBtn" runat="server" 
                                CommandName="Delete" text="Delete"
                                CommandArgument='<%# Eval("PecEmpSeqNr") %> />
<asp:SqlDataSource ID="PreCompanyCensusGridViewDataSource" ConnectionString="<%$ ConnectionStrings:PreCompanyConnectionString %>"
                DataSourceMode="dataset" SelectCommand="PreCompanyCensusSelect" SelectCommandType="StoredProcedure"

delete confirmation before gridview row deleting



I have a command field delete button in gridview and i wantto show the delete confirmation  before delteing the row

 <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ButtonType="Image"
                                CancelImageUrl="~/Images/delete.png" UpdateImageUrl="~/Images/save.png" EditImageUrl="~/Images/edit.png"
                                DeleteImageUrl="~/Images/delete.png" CancelText="?????" DeleteText="???" EditText="?????"

SharePoint 2007 - SharePoint deleting files and libraries


There was a process that ran overnight that randomly deleted document libraries and directories within some document libraries thoughout our sharePoint Site.  I do not have any archive jobs running and there was not rhyme or reason to why some were deleted and others were not.  Most of the items deleted were moved to the second recycle bin or stie recycle bin - deleted from end user recycle bin but it was done with the SharePoint administrator account.  I have looked at the logs for anything out of the ordinary but this has never happened in the 3 years since SharePoint was installed.  I have restored the items that were located but others were deleted completely

This deletion of items went through 21 of my site collections but did not delete items from 18 other site collections.

We are running SharePoint 2007 version, MS SQL 2005, NO CUSTOMIZATION straight out of the box installation, 32 bit, 2 WFE's - one running application and one running search, central admin

Any help would be appreciated.

Dewayne Burt

Deleting files in VS 2010


When I delete a file in VS 2010 (whether or not the file is in source control) Visual Studio takes at least a minute to finish deleting it. Why is this? I have lots of disk space available and a very fast (32-bit) workstation running Windows XP (latest patches) with 2GB ram. If I delete files from Windows, it happens as expected - sometimes I have to wait a second or two.

Any ideas? Does this happen for others, or is it just me?




Deleting SQL log files killed SharePoint installation


our E: drive was full, and we were told it was all log files (_log.ldf), and that we could delete them or most of them, so I did. Most of the log files were too big to put in the recycle bin, so they were permanently deleted.

Now I get this error message trying to run any site in SharePoint 2010:
Cannot open database "SharePoint_Config" requested by the login. The login failed.

Any ideas on how to get this site back up and running, without a backup?

Creating and Deleting Files on Fly on WebServer through Javascript (Magic of HTML and Jquery)

The article Creating and Deleting Files on Fly on WebServer through Javascript (Magic of HTML and Jquery) was added by nikxgupta on Sunday, January 23, 2011.

Creating and Deleting Files on Fly on WebServer through Javascript (Magic of HTML and Jquery)We usually know the methods of POST and GET for posting and fetching data from WebServer.There are many other HTML verbs used . Two of them are PUT and DELETEPUT

Clean Web.Config Files (VS 2010 and .NET 4.0 Series)

.NET 4 includes a new version of the CLR, and a new .NET 4 specific machine.config file (which is installed side-by-side with the one used by .NET 2, .NET 3 and .NET 3.5).

The new .NET 4 machine.config file now automatically registers all of the ASP.NET tag sections, handlers and modules that we've added over the years, including the functionality for:

.ASP.NET Dynamic Data
.ASP.NET Routing (which can now be used for both ASP.NET WebForms and ASP.NET MVC)
.ASP.NET Chart Control (which now ships built-into ASP.NET V4)
What this means is that when you create a new "Empty ASP.NET application" project in VS 2010, you'll find that the new default application-level web.config file is now clean and simple:

Inplace Edit in GridView

In this article I am presenting a different way to look at EditItemTemplate, using which user navigation for editing is reduced and . it looks very different (see screeen shots) then regular implementation of GridView.

GridView Confirmation Box Using JQuery BlockUI in asp.net

JQuery is the most popular JavaScript library. One of the main reasons for its fame is the plugin architecture. Anyone can create a separate library that leverage the JQuery library. In this article we are going to look at the BlockUI library which is used to block the user screen while performing a task.

Textbox Editable GridView in ASP.NET

This article describes how I made a fully editable gridview in C# using ASP.NET 2. The idea is that the GridView looks and works like an Excel spreadsheet. You see all the cells in the table, and you can edit any of the cells you like, and they are automatically updated (i.e. saved to the database). This is very often how people expect data tables to work in web pages, and I've often seen people clicking in vain on un-editable gridview cells, somehow expecting to edit them, and not understanding that they need to click an Edit button at the end of the row.

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

AJAX GridView Checkbox Select All in ASP.Net

In the previous article GridView Select Multiple Rows you learnt the multiple row selection in GridView control. Here you will get the C# code sample to select all the gridview rows using single checkbox server control. You can highlight the selected rows with different color and Font state Bold. If you want to use the selection values on different ASP.Net

AJAX GridView Paging and Sorting using C# in ASP.Net

To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.

GridView Paging Using Ajax in ASP.Net

To enable the GridView Paging and Sorting to update the GridView Data without refreshing the ASP.Net web page AJAX Extension controls are used. UpdatePanel is used to hold the GridView control that triggers the events for the controls placed inside it. By Default UpdatePanel triggers the asynchronous postbacks for its child controls.

Displaying Row Details Tooltip on GridView using JQuery

Continuing exploring JQuery! I decided to implement a feature to display some kind of details related to a row displayed on GridView. For example when displaying employees details on GridView some information might not fit in the GridView because it will make it huge and wide. These infomration can be diplayed as Tooltip. Or when you want to display a picture and some kind of formated text to be diplayed as tooltip when mouse hover on the image.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend