Home| Progetto| Web| Faq| Acronimi | ||||
Argomenti Documenti pubblicabili:1120
Scripts:1282 Documenti non pubblicabili:162 Categorie tematiche:68 .Net |_C# |_Visual basic.net |_Asp.net Active Server Pages C++ Cascade Style Sheet JavaScript Mysql Php Xml Java |_Java 2 Micro Edition |_Java server pages |_Java Servlet Oracle |_PLSQL PostgreSQL Unix
Asp.net...
Info:
Esecuzione di una pagina aspx
Oracle...
Script:
Esempio schema per analisi sui processi e parametri del db
Unix...
Tip:
Rimuovere un file in Unix / Delete a file
PLSQL...
Script:
Eliminare tutti oggetti di uno schema
Asp.net...
Tip:
Un solo web form lato server...
Asp.net...
Faq:
Cosa è un Controllo Server (Server Control)?
Shell scripting...
Script:
How to get size or other file info in a shell script
A User Agent, like a web browser, uses HTTP to request a HTML document
Php Funzione mail()
In programming the danger of exploring the small details of coding is that you get obsessed with every line of code you write, thereby greatly reducing productivity.
In general, is not worth obsessing over code. On the other hand you should code with deliberation and intent. Steven Feurstein Oracle Magazine July /August 2004 A User Agent, like a web browser, uses HTTP to request a HTML document
|
Asp.net
Home >Asp.net > Web controls and C# Sharp (Part II)
Web formAs the user is required to insert a new book, the page has to provide a form and some input field.We are going to use an Asp.Net Web Control that basically provides:
A web form is an Asp.Net technology to develop rapidly user interfaces. When the page is requested the .Net Framework engine produces an html and JavaScript code, tags and commands such as: text and button input or Onclick events, etc. Indeed, web form and web controls are objects of .Net Framework installed on the web server, usually Microsoft IIS and then they are Runat=server. Let's see the whole code for the web control:
<form id="myform" runat="server" >
<strong>Title:*<br /></strong></form> As you can see, some html is incapsulated in the web form. Let's focus on some of the main properties of these web controls. The TextBox control prints on video a textbox input field and identified the inputed value by an id. <asp:TextBox id="title" Runat= "server"/> The RequiredFieldValidator control provides validation of mandatory field, the property ControlToValidate identified by id the mandatory field. The property ErrorMessage prints the message when the filed is left empty. <asp:RequiredFieldValidator id="rfvname" ControlToValidate="title" ErrorMessage="*Mandatory" Font-Bold= "True" Runat="server" /> As you see the default font color is red: ![]() The CompareValidator control provides logical validation of input data. When the property EnableClientScript is set true, the Asp.net engine generates client code (JavaScript) so the validation is executed without send to the server another request. In our example, we think that for our hypothetical user appreciates time saving controls, we test positively the page with some browser non Microsoft (as Firefox), and then we decide to keep true this property... The property Type declares the type of data allowed, in fact for the field price is Integer. The property Operator if is set to DataTypeCheck to check the type of input data is conformant with the type declared. <asp: CompareValidator id="Compare2" ControlToValidate="price" EnableClientScript="True" Type="Currency" Operator="DataTypeCheck" ErrorMessage="Incorrect type" Font-Bold= "True" runat="server"/> No doubt, the property ErrorMessage prints the message when the filed is left empty: ![]() The Button control is the last element in our form. It prints the button that, if pressed, (event <asp:Button id="LinksPost" Text="Save data" OnClick="btnAddBook_Click" Runat="server" /> The output of this web form looks something like this: ![]() Setting the Sql statement after the button click eventThe function btnAddBook_Click()'duty is retrieve data from the web form, composing the insert sql statement and pass this string to the function ExecuteSqlCommand() that actually inserts the new row in the table.As mentioned above, the function btnAddBook_Click() is activated by the button at the end of the web form.
private void btnAddBook_Click(object sender, System.EventArgs e)
{ // Declaring variables} Executing a non query statementA frequent solution to execute insert,delete,update command is developing a function good for any of this type sql statement.So it is time for ExecuteSqlCommand()function 's code:
// ExecuteNonQuery for insert, delete, update sql command
private void ExecuteSqlCommand(string sql) { OleDbConnection conn = null; Now, it up to you developing further this script ... enjoying your programming! Downloads: bookstore.zip ( 12 KB) ![]() Warning: include(ads/text468x15.html): failed to open stream: No such file or directory in D:\inetpub\webs\fishscriptcom\documents\view_document.php on line 131 Warning: include(): Failed opening 'ads/text468x15.html' for inclusion (include_path='.;C:\php\pear') in D:\inetpub\webs\fishscriptcom\documents\view_document.php on line 131 Tutorial ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Script ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Esercizi ![]() ![]() ![]() Comandi ![]() ![]() ![]() |
Cerca
Asp.net...
Info:
Esecuzione di una pagina aspx
Anger is creative, depression is useless.
Dyson, Freeman J. Anger is creative, depression is useless.
Dyson, Freeman J.
Asp.net...
Info:
Esecuzione di una pagina aspx
Oracle...
Definizioni:
Transazione
Shell scripting...
Script:
Hide user input on screen
fishScript.Com is accessible by Mobile access technology
as mobile phones, Palm and Pocket PC .
Nicoleta e Marco Magnani tutorial, examples, courses, esempi, corsi, esercizi, appunti vari Dottoressa Nicoleta Dragu Formatrice Docente Insegnante Mediatrice Culturale Dott. Marco Magnani Universita La Sapienza Roma Master Computer Science Hunter College New York , Data Base Administrator DBA oracle System architect |