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...