Home » Applications » ASP.NET » Archive by category "Controls" (Page 4)

Archive for the 'Controls' Category

List Directory Content with Bulleted List Hyperlink – VB.NET

Code Behind Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) ‘ make a reference to a directory Dim DirPath As New IO.DirectoryInfo(“C:\\My_Website\My_Folder”) Dim FCollect As IO.FileInfo() = DirPath.GetFiles() Dim FInfo As IO.FileInfo ‘list the names of all files in the specified directory For Each FInfo In FCollect ‘bind url to line item – […]

Form control state in code behind

On page load event we define button css properties Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ‘define control css ValidatUser.Attributes.Add(“class”, “btnSubmit”) vUsername.Attributes.Add(“class”, “txtBox”) ‘on post back page we change the state of control If Page.IsPostBack Then ‘hide validate button ValidateUser.Visible = False ‘disable textbox vUsername.Enabled = False End If End […]

Delete confirm message – VB.NET

Delete confirm message when deleting record in GridView <asp:TemplateField> <ItemTemplate> <asp:LinkButton ID=”LinkButton1″ Runat=”server” OnClientClick=”return confirm(‘Are you sure you want to delete this record?’);” CommandName=”Delete”>Delete </ItemTemplate> </asp:TemplateField>