asp .net assignments

5
  ASP .NET Assignments Important: Your code must be properly commented and your variables, files, project well named. 1) There exist a TextBox named tbName and you want to know if its “Rin”. Does the following validation solve the problem? Explain! <asp:CompareValidator runat="server" ControToValidate = "tbName" ControlToCompare = "Rin" ErrorMessage = "The value is not Rin" /> 2) Which control should be used to validate:  A password which is entered twice for confirmation  The age of the user to be over 21  The date to be after the 10/10/2000 Justify your answer by writing correct Validators and conditions. 3) What are the meaning of the following regular expressions?  Rin.*@.*\..*\.il  (ba){3,}  ^[A-Za-z]+$  [0-5]?0+$ 4) Write a regular expression that  Checks if the given input has a sequence 123 at the end of line.  checks if a given input is a .html file that starts with underscore and has only Latin letters in its name 5) Write the following application. The page is called “Persondetails.aspx” and it has 7 text boxes representing (Name, Family Name, Address, City, Zip Code, Phone and e-mail address) and a Check button. The required validation actions are:  All the fields are mandatory  Name different from family name  Address at least 2 letters  City at least 2 letters  Zip-code 5 digits  Phone according to the format XX-XXXXXXX or XXX-XXXXXXX  E-mail is a valid email Once all the validations are completed, redirect the user to “Thankyou.aspx” page.

Upload: shivuhc

Post on 03-Nov-2015

3 views

Category:

Documents


3 download

DESCRIPTION

.NET

TRANSCRIPT

  • ASP .NET Assignments Important:

    Your code must be properly commented and your variables, files, project well named.

    1) There exist a TextBox named tbName and you want to know if its Rin. Does the following validation solve the problem? Explain!

    2) Which control should be used to validate: A password which is entered twice for confirmation The age of the user to be over 21 The date to be after the 10/10/2000

    Justify your answer by writing correct Validators and conditions.

    3) What are the meaning of the following regular expressions? Rin.*@.*\..*\.il (ba){3,} ^[A-Za-z]+$ [0-5]?0+$

    4) Write a regular expression that

    Checks if the given input has a sequence 123 at the end of line. checks if a given input is a .html file that starts with underscore and has only Latin letters in

    its name

    5) Write the following application. The page is called Persondetails.aspx and it has 7 text boxes representing (Name, Family Name, Address, City, Zip Code, Phone and e-mail address) and a Check button.

    The required validation actions are:

    All the fields are mandatory Name different from family name Address at least 2 letters City at least 2 letters Zip-code 5 digits Phone according to the format XX-XXXXXXX or XXX-XXXXXXX E-mail is a valid email

    Once all the validations are completed, redirect the user to Thankyou.aspx page.

  • ASP .NET Assignments 6) You are required to construct a SQL database named CustomerDB and a table named Clients

    that has 4 fields: client_id (primary key, autonumber ), name, fname, address (the address can be written using maximum 250 chars). The initial page is called Menu.aspx and it has a 4 buttons: ADD Client, Update Address, Delete Client, Show Clients.

    After clicking one of menu's buttons a user is redirected (use the Response.Redirect method) to another aspx page.

    Adding a new client page Add.aspx the user is required to fill the following text boxes - name, fname, address. After checking that all the fields are entered (validation) client's data is inserted to database and the current user is redirected to the menu page. For updating user's address Update.aspx the user should enter client_id and after clicking on "Submit" button the user should get a new page named UpdateAddress.aspx with a textbox with current client's address. After changing the text inside the textbox (address) and clicking the "Update" button a new address should be entered to database. After the update operation the current user is redirected to the menu page. Deleting a client Delete.aspx - the user should enter client_id and after clicking on "Delete" button current client's information should be deleted from database. After the delete operation the current user is redirected to the menu page. Show Clients page Show.aspx is a very simple page that shows the content of Clients table using a Gridview with addition of "Back" button that redirects the current user back to the menu page.

    7) In this exercise you are required to build a simple web application that accesses an xml file as a database. You are expected to write an application that contains StudentDetails.aspx and .cs. The StudentDetails.aspx page should have the following interface:

  • ASP .NET Assignments

    The page contains:

    Several TextBoxes for inserting: Id, Name, Family, Grade, DropDownList for choosing a school from the following options (Computer, Business, Law,

    International) RadioButtonList for choosing the gender (: Male, Female - one of them should be selected

    when page uploads! Button to submit the data clicking the button should add new data to the xml file named

    StudentsDB.xml and show it through a Gridview using DataSet object

    Xml file structure:

    An XML file name is "StudentsDB.xml" The Root Element will be: "Students"

    Element: "Student" with 3 attributes: "id", "gender", "school. Element: "Student" contains 3 Elements as well: "Name", "Family", "Grade".

    Use exactly the same Elements and Attributes!! !

    8) Create one website. The first page will ask the user whether or not they have taken a trip lately. If they have, send them to the trip survey page. If they havent, send them to the travel survey page. After the user has submits the page, send them to a page that thanks them for answering the particular survey page they were on. NOTE: you will have to pass the type of survey from the first page to Thank you page

    Create web pages with 3 questions per page. In each page, you must provide at least one question that uses RadioButtonList and one question that uses CheckBoxList. A summary page that tells the user what they answered to what questions

  • ASP .NET Assignments

    Allow user to use previous and next to go between the survey pages without losing the state of their answers

    The following are the question and answers for the trip survey are

    How many vacations do you take per year?

    Options 1-2 3-4 5+

    Did you enjoy your trip?

    Options- Yes No

    What services did you use on your trip?

    Options- Hotel Car Bus Plane Restaurant

    The following are the question and answers for the travel survey are

    When are you planning on taking your next vacation?

    Options 1 Month < 3 Months > 3 Moths

    What type of vacation do you prefer?

    Options- Adventure Relaxing Romantic Foreign

    What is your budget for next trip?

    Options- 1-2 lakhs 3-4 lakhs > 5 Lakhs

    The thank you should say thank you for answering the < Travel or Trip > survey.

    9) Create a website to do the operations of Calculator like windows calculator (use calc command in run prompt to get the calculator to see the UI and check the functionality)

    10) Create a website to work with Employee Database. Below are the pages should be present in website. Login Page

    * Username

    * Password

    Login

  • ASP .NET Assignments

    After successful Login, user should be redirected to Home Page.