DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 1 of 1
  1. #1
    Join Date
    May 2007
    Posts
    1

    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

  1. Replies: 0
    Last Post: 11-14-2006, 06:42 AM
  2. Windows form ( VB.NET ) with web Control
    By software_develo in forum .NET
    Replies: 1
    Last Post: 01-19-2006, 11:15 PM
  3. Loading Custom Control onto the form
    By Sync in forum VB Classic
    Replies: 4
    Last Post: 12-07-2005, 01:21 AM
  4. Free ASP.NET Web Matrix Design/Editor Tool Released
    By ASPSmith Training in forum dotnet.announcements
    Replies: 0
    Last Post: 06-18-2002, 03:39 AM
  5. New Web Form control for on-the-fly data retrieval
    By David Campbell in forum dotnet.announcements
    Replies: 0
    Last Post: 05-09-2002, 07:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links