Pages

Wednesday, October 31, 2012

Basics Menu Control Site Navigation in asp.net

0 comments
Basics Menu Control Site Navigation in asp.net

The ASP.NET Menu control allows you to develop both statically and dynamically displayed menus for your ASP.NET Web pages. You can configure the contents of theMenu control directly in the control, or you can specify the contents by binding the control to a data source.
Without writing any code, you can control the appearance, orientation, and content of an ASP.NET Menu control. In addition to the visual properties exposed by the control, the control supports ASP.NET control skins and themes.



Drag and drop menu control to Design view or source view


Right Click the menu control  and select properties

Properties window select Items and click the Collection



In the Menu Item Editor Window Select the first Icon Add a Root Item For adding root MENU


And select NewItem and change the
TEXT Value to Home....
NavigateUrl -Url location

to Add Sub-menu select the NewItem And click the icon Add to a Child Item (example for Contact you want to add a submenu click the Contact(newitem) and click Add a Child item ICON


And select NewItem and change the TEXT Value


Output:
Note:
Best working in Mozilla Firefox






Read more...

Sunday, October 28, 2012

install iis on windows 7

0 comments
When we try to open new website project in the IIS location  in a visual studio 2008 in  windows 7
visual studio 2008 specifics  IIS is not installed on this computer


 steps to install IIS

1. click Start Button, and then click Control Panel.

2.  Control Panel, click Programs.

3. Click Turn Windows features on or off under Programs and Features

4. Windows Features dialog box opens ,expand Internet Information Services

5. Under the

 Internet Information Services  > Web Management Tools > IIS 6 Management Compatibility  > Select (check) IIS Metabase and IIS6 Configuration compatibility

Internet Information Services  > Web Management Tools  > Select (check) IIS Management Console

Internet Information Services  > World Wide Web Services >  Application Development Features >
Select (check)  .NET Extensibility
Select (check)  ASP.NET
 Select (check)  ISAPI Extensions
Select (check) ISAPI Filters

Internet Information Services  > World Wide Web Services > Security >
Select (check)  Request Filtering
Select (check)  Windows Authentication


 

 Click ok button

to check IIS working or not ,Open the web browser  and type in the URL

http://localhost

 
Open visual studio 2008 , open new website in  IIS location,again  visual studio 2008 pass message
i.e
to access local iis web sites you must run visual studio in the context of an administrator account 





Read more...

Friday, October 26, 2012

RequiredFieldValidator

0 comments
RequiredFieldValidator

The RequiredFieldValidator control check the value is null("") or empty before the user submit the values.The control fails validation if the value it contains does not change from its initial value when validation is performed. If all the fields in the page are valid, the page is valid. 


Required Field Validator Propertites


ControlToValidate:
Gets or sets the input control to validate.

ErrorMessage: Gets or sets the text for the error message displayed in a ValidationSummary control when validation fails.

ValidationGroup: Gets or sets the name of the validation group to which this validation control belongs.

Text: Gets or sets the text displayed in the validation control when validation fails.


Example:


 <table >
        <tr>
            <td >
                Name</td>
            <td >
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="TextBox1" ErrorMessage="Please fill the name" 
                    ValidationGroup="validate">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td >
                &nbsp;</td>
            <td >
                <asp:Button ID="Button1" runat="server" Text="Submit" 
                    ValidationGroup="validate" />
            </td>
            <td>
                &nbsp;</td>
        </tr>
    </table>

Right click the required field validator and select  PROPERTIES

And change required field validator  PROPERTIES as shown in the image


Right click the button and select  PROPERTIES and set validationgroup : validate

Run the Example

Output:

Note: Error message properties work when we use validation summary control.


Read more...

Thursday, October 25, 2012

adding a image

0 comments
how to add image in asp.net page


Step 1: Right click on the solution and select Add Existing Item.


Step 2Browse for an image and add it.

Step 4: Now right click on any space on the page and select properties.

Step 5: Go to Background and click the ellipses symbol [...]

Step 6:    Browse for the image you added recently and give 



Step7:  The image will be set as page background!







Read more...

Monday, July 2, 2012

File Uploading to Folder in ASP.NET

0 comments

Step1: Drag and  drop a file uploader  and a button control to your form.

Eg:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Home.aspx.cs" Inherits="Home" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <p style="margin-bottom: 0px">
                FILE UPLOAD
    </p>
    <p style="margin-bottom: 0px">
                ADD FILE                 <asp:FileUpload ID="FileUpload1" runat="server" style="margin-bottom: 0px" />
                <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="SUBMIT"
                    style="height: 26px" />
            </p>
    </form>
</body>
</html>










Step 2:
Select solution explorer & create a new folder and name it as Img
















Step 3:

Double Click on the submit button

In the code behind window add the following code on the click event

protected void Button1_Click(object sender, EventArgs e)
    {




            FileUpload1.SaveAs(Server.MapPath("~/Img/") + FileUpload1.FileName);
 }


Step 4:

Run

Step 5:

Refresh the Img folder in the solution Explorer


Read more...

Friday, June 8, 2012

ASP.NET Mobile Development with Visual Studio 2008

0 comments
Download Template


1.Download Template First


2.Copy zip files with filenames ending with "_cs" to:

[My Documents]\Visual Studio 2008\Templates\ItemTemplates\Visual C#

3.open your visual studio 2008 website project again

4.Right Click Solution Explore and select Add new Item....


5.In the Add New Item dialog box ,in My Template Selection  select Mobile Form(select language  C#)


To help users with this scenario, I've created the following item templates for ASP.NET Web Site and ASP.NET Web Application projects:
  • Mobile Web Form
  • Mobile Web User Control
  • Mobile Web Configuration File
The templates are available in both VB and C# versions.




One limitation users should be aware of is the Design View in Visual Studio 2008, which is based on a completely new archtecure, does not display ASP.NET mobile controls.  However, using these templates you should be able to develop ASP.NET Mobile applicaitons using the Source View just fine.
Once installed, these templates enable users to create and edit new ASP.NET Mobile Web Forms in ASP.NET Web Site and ASP.NET Web Applicaiton project types.
To install these templates download the attachment included in this post, extract the ZIP file, and follow the instructions in the included readme.txt files.


Read more...

Wednesday, May 9, 2012

What is IIS?

0 comments
Internet Information Services (IIS) – formerly called Internet Information Server – is a web server application and set of feature extension modules created by Microsoft for use with Microsoft Windows



History

The first Microsoft web server was a research project at European Microsoft Windows NT Academic Centre (EMWAC), part of the University of Edinburghin Scotland, and was distributed as freeware. However, since the EMWAC server was unable to scale to handle the volume of traffic going toMicrosoft.com, Microsoft was forced to develop its own web server, IIS.


VersionObtained fromOperating System
1.0Included with Windows NT 3.51 SP 3 (or as a self-contained download).Windows NT Server 3.51
2.0Included with Windows NT Server 4.0.Windows NT Server 4.0
3.0Included with Windows NT Server 4.0 Service Pack 3 (Internet Information Server 2.0 is automatically upgraded to Internet Information Server 3.0 during the install of SP3).Windows NT Server 4.0
4.0Self-contained download from www.microsoft.com or the Windows NT Option Pack compact disc.Windows NT Server 4.0 SP3 and Microsoft Internet Explorer 4.01
5.0Built-in component of Windows 2000.Windows 2000
5.1Built-in component of Windows XP Professional.Windows XP Professional
6.0Built-in component of Windows Server 2003.WIndows Server 2003
7.0Built-in component of Windows Vista and Windows Server 2008.Windows Vista and WIndows Server 2008
7.5Built-in component of Windows 7 and Windows Server 2008 R2.Windows 7 and Windows Server 2008 R2


Read more...