Posts

Showing posts from October, 2019

FileUpload Control

Image
ASP.NET has two controls that allow users to upload files to the web server. Once the server receives the posted file data, the application can save it, check it, or ignore it. The following controls allow the file uploading: HtmlInputFile  - an HTML server control FileUpload  - and ASP.NET web control Both controls allow file uploading, but the FileUpload control automatically sets the encoding of the form, whereas the HtmlInputFile does not do so. In this tutorial, we use the FileUpload control. The FileUpload control allows the user to browse for and select the file to be uploaded, providing a browse button and a text box for entering the filename. Once, the user has entered the filename in the text box by typing the name or browsing, the SaveAs method of the FileUpload control can be called to save the file to the disk. The basic syntax of FileUpload is: <asp:FileUpload ID = "Uploader" runat = "server" /> The FileUpload class is ...

Calendar in Asp.net

Image
The calendar control is a functionally rich web control, which provides the following capabilities: Displaying one month at a time Selecting a day, a week or a month Selecting a range of days Moving from month to month Controlling the display of the days programmatically The basic syntax of a calendar control is: <asp:Calender ID = "Calendar1" runat = "server" > </asp:Calender> Properties and Events of the Calendar Control The calendar control has many properties and events, using which you can customize the actions and display of the control. The following table provides some important properties of the Calendar control: Properties Description Caption Gets or sets the caption for the calendar control. CaptionAlign Gets or sets the alignment for the caption. CellPadding Gets or sets the number of spaces between the data and the cell border. CellSpacing Gets or sets the space between cells. DayHeaderStyle Gets the style prope...

Basic control in Asp.net

Button Controls ASP.NET provides three types of button control: Button  : It displays text within a rectangular area. Link Button  : It displays text that looks like a hyperlink. Image Button  : It displays an image. When a user clicks a button, two events are raised: Click and Command. Basic syntax of button control: <asp:Button ID = "Button1" runat = "server" onclick = " Button1_Click " Text = "Click" / > Common properties of the button control: Property Description Text The text displayed on the button. This is for button and link button controls only. ImageUrl For image button control only. The image to be displayed for the button. AlternateText For image button control only. The text to be displayed if the browser cannot display the image. CausesValidation Determines whether page validation occurs when a user clicks the button. The default is true. CommandName A string value that is passed to the comm...