Hello Friends lets work on User control in this post.
Going through the requirements programmers designed a format of editing a control and using that control in all over the project that is called User Control.
Lets start,
First of all
Create a New Web Site, and right click on the solution file and select Add New Item, then in Add New Item window select Web User Control and specify your desire Name in the Name feild and Click Add button.
Name:: sample
So you see a file with .ascx extension. In that file you see default code as shown below.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Sample.ascx.cs" Inherits="Sample" %>
So lets start writing some code here. You can add any number of controls. By adding any number of controls you need like .aspx page. I just show simple example how it works.
<p>
Welcome to CoolTuts friends, Number one Tutorial Website on WWW
</p>
Add this after the default code, you can also delete the default code and place this above code.
Just build and open .aspx page in which you want to place the usercontrol.
Here you need to add some code before <html> tag
<%@ Register TagPrefix="SomeTagText" TagName="SomeText" Src="~/Sample.ascx" %>
Here you need to add some code before <html> tag
Adding the line above html tag, then add user control on to the location where you desire.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<SomeTagText:SomeText runat="server" />
</div>
</form>
</body>
</html>
Debug and see your usercontrol on Web.
ASP Standard Controls
- ASP Label Control
- ASP TextBox Control
- ASP Button Control
- ASP Link Button Control
- ASP ImageButton Control
- ASP HyperLink Control
- ASP DropDownList Control
- ASP ListBox Control
- ASP CheckBox Control
- ASP CheckBoxList Control
- ASP RadioButton Control
- ASP RadioButtonList Control
- ASP Image Control
- ASP ImageMap Control
- ASP Calendar Control
- ASP Table Control
- ASP BulletedList Control
- ASP Hidden Control
- ASP Literal Control
- ASP AdRotator Control
- ASP Panel Control
- ASP PlaceHolder Control
- ASP FileUpload Control
- ASP UserControl
- ASP Custom Control
Random Tips and Tricks
Wednesday, September 29, 2010
Subscribe to:
Post Comments (Atom)
1 comments:
Hi,Two websites come to mind that fit this description. One is Squidoo.com and the other is Weebly.com. Both use WYSIWYG editors and both are very easy to learn to use. Both also have excellent tutorials in Web Design Cochin and help sections. You can create websites in pretty quick fashion at both locations. Let's talk about Squidoo first.thanks....
Post a Comment