Web user control in VB.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vektor
    New Member
    • Nov 2006
    • 2

    #1

    Web user control in VB.NET

    Hi,

    I am using VB.NET to create a user control which has this property called FileName. For now, when this control is created, I need to type in a file name in the properties window since the property is String. What I want to do is change this property to a file chooser type so that I can browse the file I want and choose instead of typing in the file path manually.

    Could any expert out there help me solve this?

    Thanks in advance.

    Code:
        <Bindable(True), Browsable(True), Category("More Options"), DefaultValue(""), Description("Set the name of the file.")> _
        Public Property FileName() As String
            Get
                If ViewState(strFileName) Is Nothing Then
                    Return "Data.txt"
                ElseIf Not File.Exists(strFileName) Then
                    Return "Data.txt"
                Else
                    Return ViewState(strFileName)
                End If
            End Get
            Set(ByVal value As String)
                ViewState(strFileName) = value
            End Set
        End Property
    Last edited by vektor; Jun 19 '08, 05:41 PM. Reason: forgot to put the language
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Greetings, vektor!

    Thank you for posting part of your code. Looks like you could do a lot better in our .net forum, but do come back if you need this in VB, give it a shot see what you can achieve.

    In a bit!

    I also modified your title from Web user control to Web user control in VB.NET just to help get you additional hits on your questions, folks passing through and all...

    See you around vektor:-)
    Last edited by Dököll; Jun 19 '08, 11:52 PM. Reason: added remark...

    Comment

    • kunal pawar
      Contributor
      • Oct 2007
      • 297

      #3
      Hi, i guess this is a web custom control or web control, which generate HTML dynamically. So i think u have to use file browse

      Comment

      Working...