How to enable javascript debugging in Visual Studio IDE?

Wednesday, July 15, 2009


You need to do 2 things for that.

1. Write debugger statement at the line from where you want to debug.
2. Enable javascript debugging in the browser property settings.






www.codecollege.NET

What are Attribute? What is the use of it? What are the types?


Attributes is feature using which you can add metadata to your classes. Metadata means giving declarative information about your classes, methods,etc.


Types:
1. Intrinsic
2. Custom


1. Intrinsic
The belong to .NET CLR.
2. Custom
They are the attributes developed the developer.






www.codecollege.NET

What is the use of params keyword? Give an example.

Tuesday, July 14, 2009


params is used on such situations where the number of arguments to a method is not known until runtime. If you prefix the params keyword followed by the type as array without size, then you can pass as many arguments as you want.


Ex:
using System;
using System.Collections.Generic;
using System.Text;

namespace ParamSample
{
class Program
{
public static void PrintWords(params String[] p)
{
for (int i = 0; i < p.GetLength(0); i++)
{
System.Console.WriteLine(p[i]);
System.Console.Read();
}
}

static void Main(string[] args)
{
PrintWords("1","2","3");
}
}
}



www.codecollege.NET

What is the use of the AssociatedControlID?


If you want to associate a control with Label, then you can give an access key to the label control and set the AssociatedControlID property of the Label to the control to which you want the label to associate. When you do so, upon clicking the AccessKey Focus will be set to the Associated Control.


Ex:
<form id="form1" runat="server">
<div>
<asp:Label ID="lblName" runat="server" AccessKey="N" AssociatedControlID="TextBox1"
Text="Name"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
<br />
<asp:Button ID="Button1" runat="server" Text="Button" AccessKey="B" OnClick="Button1_Click" /></div>
</form>



www.codecollege.NET

How will set an Accesskey for a button?


You can do that by setting the AccessKey attribute of the button.


Ex:
<asp:Button ID="btnTest" runat="server" AccessKey="T" Text="Test" OnClick="btnTest_Click" />



www.codecollege.NET

How will you make a button the default button?


You can do that by setting the DefaultButton attribute of the form in which the button is present.


Ex:
<form id=f1 defaultbutton="btnSubmit" runat="server">
<asp:textbox id="textbox1" runat="server"/>
<asp:button id="button1" text="btnSubmit" runat="server"/>
</form>



www.codecollege.NET

What is the purpose of AutoEventWireup Page directive?


When set to true , it ensures that the event handlers for the page will be automatically called when the events occur on the page.



www.codecollege.NET
Blog Widget by LinkWithin