How to create user interface


  1. What is the main difference between the Button server control and the Button HTML control?

When clicked, the Button server control triggers an ASP.NET Click event procedure on the server. The Button HTML control triggers the event procedure indicated in the button’ s onclick attribute, which runs on the client.

  1. How do you get several RadioButton controls to interoperate on a Web form so that only one of the RadioButtons can be selected at once?

Set the GroupName property of each RadioButton to the same name.

  1. Why does ASP.NET perform validation on both the client and the server?

Client-side validation helps avoid round trips to the server. Validating on the client makes sure that the data is valid before it is submitted, in most cases. However, because validation might be turned off (or maliciously hacked) on the client, data must be revalidated on the server side. This provides full assurance that the data is valid while avoiding as many round trips as possible.

  1. What types of validation would you use to verify that a user entered a valid customer number?

You would use a RequiredFieldValidator and a RegularExpressionValidator. If you have access to a list of expected customer numbers, you could replace the RegularExpressionValidator with a CustomValidator that checked the list.

  1. What is wrong with the following line of code?

Visual Basic .NET

Server.Transfer("Default.htm")

Visual C#

Server.Transfer("Default.htm");

You can’ t use the Transfer method with HTML pages. It works only with .aspx pages.

  1. Why can’ t you open a new browser window from within server code?

Server code executes on the server, whereas the new window is created on the client. You need to use client-side code to do things that affect the client, such as upload files, display new windows, or navigate back in history.

Advertisements

Thanks a lot for visiting this site .. Please leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s