Daily Tips- Tip #10 - How to disable browser's back button using javascript?

Wednesday, July 15, 2009


Actually you cant disable the browser's back button, but if you are navigating between 2 pages , then you can give this functionality between them. You have to give the code in the following in the 1st page.
You can do that in 2 ways, they are:

1. <body onLoad="history.go(+1)">

2. function noBack(){window.history.forward()}
noBack();
window.onload=noBack;




www.codecollege.NET

What are PDB files? Where must they be located for debugging to work?


What are PDB files?
A program database (PDB) file holds debugging and project state information that allows incremental linking of a Debug configuration of your program.

Where must they be located for debugging to work?
You must deploy your PDB symbols to either the directory with the image or the directory where the symbols were originally built.



www.codecollege.NET

What is a nullable Type? How to assign a default value to it? Are nested nullable types allowed?


What are nullable types?
Nullable types are those which can represent a null in addition to the normal range of values. It is an instance of System.Nullable.

How to assign a default value to it?
Use the ?? operator to assign a default value when it is assigned to a non-nullable type.
Ex:
int? empid=null;
int tempid= empid ?? 1;

Are nested nullable types allowed?
No.




www.codecollege.NET

What is the Difference between imperative and interrogative code?



Interrogative:
Those statements which return values to the calling code are called Interrogative code.

Imperative:
Those statements which does not return values to the calling code are called imperative code.





www.codecollege.NET

What is the use of Checked and UnChecked operators?



They are used to control the overflow checking context for integral-type arithmetic operations and conversions.





www.codecollege.NET

What is a Resource File ? or What is a resx file ?


A resource file is an XML file which specify objects and strings inside XML tags.


For More Information see the following link,

http://msdn.microsoft.com/en-us/library/ekyft91f(VS.80).aspx




www.codecollege.NET

Is it possible to extend a struct?


No.







www.codecollege.NET

Is it possible to implement an interface to a structure?


Yes.







www.codecollege.NET

What is the control which can be used to reserve the space on web page for storing localized data?


It is a Localize control. It is a Literal control and it is used when you want to display localized text in a specific area on the page.


Ex:
<asp:Localize ID="Localize1" runat="server"></asp:Localize>




www.codecollege.NET

What are the Magic Tables in Sql server?


There are 2 magic table in sql server, they are:
1. Inserted
2. Deleted




www.codecollege.NET

What is an IIS metabase ?


It is a repository for most of the Internet Information Services (IIS) configuration values. It is a XML file and can be edited manually or programmatically.




www.codecollege.NET

How will you do an IIS backup/restore?


By clicking Action > Backup/Restore Configuration , and then giving the backup name.
Simillarly for Restore.




www.codecollege.NET

what are IIS Host headers?


IIS allows you to assign any number of sites to a single IP address and distinguish them by using host headers.




www.codecollege.NET

Where are the IIS log files stored?


By default, IIS log files are stored in the :\WINNT\system32\LogFiles\W3SVC# folder of the system running IIS.




www.codecollege.NET

What is the difference between managed and unmanaged code?


Managed Code:

Any code that runs under the CLR (common Language Runtime) is a managed code.

UnManaged Code:

Any code that is not running under the CLR is an unmanaged code.





www.codecollege.NET

If you want to restrict a user from entering non-numeric characters in a textbox, which event will you use?


You can use the following three events, but keypress is more effective,ie it will act even before the character appears in the text box.


1. keydown
2. keypress
3. keyup




www.codecollege.NET

What Is Kerberos?


Kerberos is a type of an authentication protocol which is created my Massachusetts Institute of Technology (MIT) which helps users to communicate through an insecure network by proving their identity to one another.




www.codecollege.NET

What is impersonation in ASP.NET?


Impersonation is when ASP.NET executes code in the context of an authenticated and authorized client.
Impersonation can significantly affect performance and scaling. It is generally more expensive to impersonate a client on a call than to make the call directly.


Ex:
<identity impersonate="true"
userName="domain\user"
password="password" />




www.codecollege.NET

What’s the use of SmartNavigation property?


SmartNavigation property is deprecated from .net2.0 onwards. Use the SetFocus method and the MaintainScrollPositionOnPostback property instead.





www.codecollege.NET

What is Reflection? What namespace is used for it? Explain with an example.


Reflection is a mechanism using which you can get the details about .NET assemblies at runtime. The namespace used for Reflection is System.Reflection.





www.codecollege.NET

What is the namespace which manages Viewstate of Asp.net server controls?


System.Web.UI.StateBag




www.codecollege.NET

What is strong-typing versus weak-typing?


Strong Typing : Checks the type of variables at compile time
Weak Typying : checks the type of variables at Run time.




www.codecollege.NET

How many classes can a single .NET DLL contain?


Unlimited.




www.codecollege.NET

A good site for Testers.

A good site for Testers.


http://art-of-testing.blogspot.com/


www.codecollege.NET

Load and Stress Testing

A website which does Web Application Load and Stress Testing,


www.neotys.com


www.codecollege.NET

A website which gives the country-wise visitor count

A website which gives the country-wise visitor count with the flags of the countries being displayed.


www.flagcounter.com




www.codecollege.NET

A good site for Testers.

A good site for Testers.


http://art-of-testing.blogspot.com/


www.codecollege.NET

A website which does Web Application Load and Stress Testing

A website which does Web Application Load and Stress Testing,


www.neotys.com


www.codecollege.NET

What is App Pool in IIS ?


An application pool is a group of one or more URLs that are served by a worker process or set of worker processes. Any Web directory or virtual directory can be assigned to an application pool.




www.codecollege.NET

what are the Differences between Panel and GroupBox in asp.net ?





















Sno
GroupBox
Panel
1 Has a visible caption No
2 Always displays a border  Border is determined by BorderStyle Property.
3

Doesnot support scrolling

Enables automatic scrolling using AutoScroll
property.



www.codecollege.NET

What is the use of the Assert Method?


Debug.Assert checks for a condition and displays a message if the condition is false.



www.codecollege.NET

Can two different Languages be used in a single .aspx page?


No.



www.codecollege.NET

How to find the .NET version i am using through code?


Response.Write(System.Environment.Version.ToString());



www.codecollege.NET

What are the different types of JITs in .NET ?


There are 3 types of JITs in .NET, they are

1. Pre-JIT (Compiles entire code into native code at one stretch)
2. Ecno-JIT (Compiles code part by part freeing when required)
3. Normal JIT (Compiles only that part of code when called and places in cache)



www.codecollege.NET

Can we use multiple ScriptManagers on a page?


No.



www.codecollege.NET

Can a static class be instantiated ?


No.



www.codecollege.NET

Can a static class contain non static members?


No.



www.codecollege.NET

How many types of CommandType options are there in Command object of ADO.NET?


There are 3 types of CommandType in Command object of ADO.NET. They are :

1. CommandType.Text
2. CommandType.TableDirect
3. CommandType.StoredProcedure


1. CommandType.Text:
Should be used when you pass a TSQL statement(select,insert,update,etc).


2. CommandType.TableDirect
You will specify the name of the table from which you want the records.


3. CommandType.StoredProcedure
Is used when you pass the name of a stored procedure.



www.codecollege.NET

How many types of Execute methods are there in ADO.NET's Command Object?


There are 4 types of Execute Methods ADO.NET's Command Object. They are :

1. ExecuteNonQuery();
2. ExecuteReader();
3. ExecuteScalar();
4. ExecuteXmlReader();




www.codecollege.NET

Can you store multiple data types in a System.Array?


No.






www.codecollege.NET

Which .NET type maps to the C# keyword 'int' ?


System.Int32;






www.codecollege.NET

What are the different methods to deploy an Assembly?


MSI Installer, a CAB archive, XCOPY command.






www.codecollege.NET

What is the smallest unit of execution in .NET?


Assembly.






www.codecollege.NET

What is the name of technique used to convert a value-type to a reference-type ?


Boxing.






www.codecollege.NET

What is default modifier for an Interface ?


public.






www.codecollege.NET

What is the default modifier for a Class?


private.






www.codecollege.NET

What is Default Authentication in ASP.NET?


Windows.






www.codecollege.NET

Can we inherit a static class ?


No.






www.codecollege.NET

What is default time duration for a session?


20 seconds.






www.codecollege.NET

Daily Tips- Tip #9 - How to enable javascript debugging in Visual Studio IDE?


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

LinkWithin

Blog Widget by LinkWithin

Recommended Books