-
How to pass value from imput control in a Web Form to a Variabe ???
Hi,
the problem is to pass the string value from a FormView Control or SqlDataSource Parameter to a Variable in order to get the name of a file to delete?
Scenario 1 traing to retrive the value from a hidden Field in a FormView1
--------------------------------------------------------------------------
Protected Sub DeleteButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim path As String
path = FormView1.Controls("s_file").ToString ' ????? does not work ?
File.Delete(path)
End Sub
--------------------------------------------------------------------------
Scenario 2 traing to get the value from SqlDataSource Parameter
--------------------------------------------------------------------------
Protected Sub DeleteButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim s_file As System.Data.SqlClient.SqlParameterCollection ' ? Not wrk ?
s_file = SqlDataSporce1.DeleteParameter("s_file").ToString
File.Delete(s_file)
End Sub
--------------------------------------------------------------------------
Houwever the point is to pass the value from a FormView Control to a variable or from data source parameter to a variable to the path variable for a delete file function. ( The string from the databse contains the pat and the file name - "~/Upload/logo.jpg").
May be I can use the name of a hidden Field named "s_file", where I have the value of the String directly ??? It does not work ???? even using Request.Form or Request.QuerySting ????
Please Help it is a strategic question, Very important !!!!
Last edited by alexnikolof; 05-06-2007 at 05:37 PM.
Similar Threads
-
By hellopraveen30 in forum ASP.NET
Replies: 0
Last Post: 11-14-2006, 06:42 AM
-
By software_develo in forum .NET
Replies: 1
Last Post: 01-19-2006, 11:15 PM
-
By Sync in forum VB Classic
Replies: 4
Last Post: 12-07-2005, 01:21 AM
-
By ASPSmith Training in forum dotnet.announcements
Replies: 0
Last Post: 06-18-2002, 03:39 AM
-
By David Campbell in forum dotnet.announcements
Replies: 0
Last Post: 05-09-2002, 07:06 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks