Introduction
Acronym for Active Server Pages They are pages that deal with the server side and are dedicated to building large sites, which are called dynamics as well as small sites alike What are dynamic sites Sites that have a database, send emails and record different data such as company products, bank customers, factory management, and so on all large sites. How this technology works For this to work must be auxiliary factors. For example, man speaks a language .. Also this technique speaks several different languages Like C-Sharp - Visual Basic .NET In the book, the focus is only on C-Sharp because it is the most widely spoken language in the work of more than ninety percent between the world's programmers and programming companies and others. What we are interested in is after the course. I mean to be able to work in free projects or in a company or with programmers.
Asp.net technology has an extension ie the page is the last extension or characters are .Aspx Such as Page1.aspx One of the business requirements is IIS, which prepares your computer to work and make it a local server so you can experience the sites you create on it. It is automatically installed with Visual Studio. Hosting Type Hosting is where you put your site after you make it .. It is of course on the Internet The type of hosting that works with this technique is Windows hosting.
Chapter One
Use standard controls
This is the first lesson of the "Introduction to ASP.net" series, in which we will try to bring Microsoft's ASP.net platform to beginners, which is detailed into lessons. Each lesson talks about a specific topic.
The basic controls built into the ASP.NET platform are essential for creating web applications, where we will learn how to display information using the Label and Literal tools, and how to accept and handle user income through the TextBox, CheckBox, and RadioButton tools. View information The ASP.NET platform supports two tools for displaying text data Label, Literal. While Literal displays data in a simple way, the Label tool offers many additional features and formats. Use the Label control We use the information display tools so that we can modify the text displayed on the page at the time of execution where we can simply select the text to be displayed by assigning the text property of the Label tool, we can also use html formats for this tool to interpret them and generate the desired output, and by default this tool surrounds The text with the tag , in the following code we show different methods of assigning information to the Label tools: ASP.net code </ asp: Label>
Hi i'm Label2 </ asp: Label>
</ asp: Label> The Label tool supports many text formatting features, including: BackColor: Change the background color of the tool. BorderColor: Sets the color of a frame that surrounds the Label tool. BorderStyle: Specify the window style to display, this property can take one of the following values: NotSet, None, Dotted, Dashed, Solid, Double, Groove, Ridge, Inset, Outset.
BorderWidth: Specifies the thickness of the window. CssClass: Specifies the CSS row to be applied to this tool. Font: Specifies the type of font used. ForeColor: Specifies the font color. Style: Applies a specific design to the Label tool. ToolTip: Text that is displayed as a tip when the mouse passes over the Label tool.
The Label tool is usually used to display titles for other tools to help the user do his work, so this tool has the AssociatedControlID property to identify the associated tool and it is generally recommended to use this property. Use the Literal control This tool works very similar to the work of the tool Label, but it does not enclose the text tag This is what we may need in some sites where can not translate html code (such as determining the title of the page on the browser for example), and since this tool does not support the tag It is also Its properties do not support CssClass, BackColor, Literal supports an important feature and is not supported by the Label tool, which is the Mode property, which can take one of the following three values: PassThrough: Interpret the html symbols found in the text and display what they mean. Encode: Displays text without translating html symbols where they appear. Transform: Only symbols supported by the requesting device are interpreted for the page. ASP.net code When performing the previous page, Literal1 displays a horizontal line, Literal2 displays the text , while Literal3 scans the requesting device for the page. If it supports this tag, it displays a horizontal line or the text will be displayed as is .
Accept user income The ASP.NET platform includes tools that allow the user to enter and make choices on the site. It offers three basic tools: TextBox, CheckBox, and RadioButton. Use the TextBox control This tool allows the user to enter text according to three styles determined by the value of the TextMode property: SingleLine: Accept income as only one line. MultiLine: Accept multiple-line access. Password: The user's income appears as icons (stars *** or others). ASP.net code
TextBox tool properties:
AccessKey: To select a key from the keyboard when pressed, the focus is moved to this tool.
AutoCompleteType: Specify an AutoComplete mode where a user needs to enter a few characters in order to show previously entered matching words. This property can be deactivated by assigning the Disabled value to it. AutoPostBack: Send content to the server immediately when any changes in the entered text. Columns: Specifies the number of columns that will appear. Enabled: Activate or deactivate this tool. MaxLength: Specifies the maximum number of characters that can be entered (do not work with MulitLine).
ReadOnly: Prevents the user from changing the value in the TextBox. Rows: Specifies the number of lines that will appear. TabIndex: Specifies a number indicating the order of access for this tool via the Tab key. Warp: Specifies whether text can be automatically wrapped with MultiLine mode. The TextBox control supports the Focus method that allows focus to be placed on execution, and supports the TextChanged event that is fired when the contents of this tool change. To illustrate how the AutoPostBack property works, create a new page, add TextBox1 and set the previous property to True, then add Lable1.
What we will do is that when you type text, it will be displayed in the Label1 tool once the focus is moved out of TextBox1. : ASP.net code ontextchanged = "TextBox1_TextChanged"> </ asp: TextBox> In the TextChanged event of the TextBox1 tool, type the following code: #C code protected void TextBox1_TextChanged (object sender, EventArgs e) { Label1.Text = TextBox1.Text; } VB code Protected Sub TextBox1_TextChanged (ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged Label1.Text = TextBox1.Text End Sub Execute the page, type what you want in TextBox1, press the Tab key on the keyboard and see the result, close the browser and then execute again and type the first letter of the value you entered in the first execution to see how the autocomplete process is done, deactivate the autocomplete feature as shown above Then retry and retype the same word to notice that AutoComplete has stopped.
Use the CheckBox control tool
This tool allows the user to decide whether to accept or reject an order, ie it is considered as a question to the user and the answer is inevitably either yes or no, e.g. Find out the user option as we'll see shortly. Properties of the CheckBox control: * AccessKey: To select a key from the keyboard when pressed, the focus is moved to this tool. * Checked: Returns True or False depending on user acceptance or rejection. * Enabled: Activate or deactivate this tool. * TabIndex : Specifies a number indicating the order of access for this tool via the Tab key. * Text: Select the text that appears next to this tool (question asked). * TextAlign: The position of the text for the tool, to its right or left, takes one of the values Left, Right. * TextAlign: The position of the text for the tool, to its right or left, takes one of the values Left, Right.