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

Archive for the 'Controls' Category

Resize image before upload

Markup Page <div id=”FileUpd1″ runat=”server” > Default: <asp:FileUpload ID=”ImgUpload1″ runat=”server” /> <asp:Button ID=”Btn1″ runat=”server” Text=”Submit ” CssClass=”btnSubmit” CausesValidation=”true”/> Code Behind – Click to read more… Imports System.IO Imports System.Web.UI Imports System.Data.Sql Imports System.Data.SqlClient Imports System.Drawing Imports System.Drawing.Imaging Protected Sub Btn1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Btn1.Click ‘define variable Dim adPhotoName As String = […]

Multiple file upload – VB.NET

Code behind only Imports System.IO Imports System.Web.UI Imports System.Data.Sql Imports System.Data.SqlClient ‘define public classes/share them on page Public ImgUpConf1 As String ‘displays img after success. upload Public ImgUpConf2 As String ‘ ” Public BadImgFormat As String ‘passing banned file ext msg to page Public NoImage As String = “no_image.jpg” ‘default image no image jpg Public […]

ASP.NET Validator – validate one of the two values

Validate one of the two textbox values Markup page Please enter on of at least one contact point: <asp:CustomValidator ID=”ContactInfoAlert” runat=”server” ErrorMessage=”CustomValidator” OnServerValidate=”CustomValidator_ServerValidate”> </asp:CustomValidator> User email: <asp:TextBox ID=”EmailTbx” runat=”server” ToolTip=”Enter email.” > </asp:TextBox> User phone: <asp:TextBox ID=”PhoneTbx” runat=”server” ToolTip=”Enter phone number.” > </asp:TextBox> <asp:Button ID=”Btn1″ runat=”server” Text=”Next” CausesValidation=”true”/> Click to read more… Code-behind page Protected […]