ASPinterview
ASPinterview
PreRender() - the brief moment before the page is displayed to the user as HTML
After the Init() and before the Page_Load(), or OnLoad() for a control.
4. What namespace does the Web page belong in the .NET Framework class hierarchy?
System.Web.UI.Page
andSrc="MyCode.aspx.cs"?
The Global.asax (including the Global.asax.cs file) is used to implement application and session level
events.
This is where you can set the specific variables for the Application and Session objects.
9. Whats an assembly?
MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to
MSIL. MSIL also allows the .NET Framework to JIT compile the assembly on the installed computer.
11. Which method do you invoke on the DataAdapter control to load your generated dataset
with data?
13. Which template must you provide, in order to display data in a Repeater control?
ItemTemplate.
16. What is the difference between Server.Transfer and Response.Redirect? Why would I
Server.Transfer transfers page processing from one page directly to the next page without making a
round-trip back to the client's browser. This provides a faster response with a little less overhead on
the server. Server.Transfer does not update the clients url history list or current url.
Response.Redirect is used to redirect the user's browser to another page or site. This performas a
trip back to the client where the client's browser is redirected to the new page. The user's browser
ViewState allows the state of objects (serializable) to be stored in a hidden field on the page.
ViewState is transported to the client and back to the server, and is not stored on the server or any
other external source. ViewState is used the retain the state of server-side objects between
postabacks.
Item stored in ViewState exist for the life of the current page. This includes postbacks (to the same
page).
19. What does the "EnableViewState" property do? Why would I want it on or off?
It allows the page to save the users input on a form across postbacks. It saves the server-side values
for a given control into ViewState, which is stored as a hidden value on the page before sending the
page to the clients browser. When the page is posted back to the server the server control is
20. What are the different types of Session state management options available with
ASP.NET?
ASP.NET provides In-Process and Out-of-Process state management. In-Process stores the session in
memory on the web server. This requires the a "sticky-server" (or no load-balancing) so that the
user is always reconnected to the same web server. Out-of-Process Session state management
stores data in an external data source. The external data source may be either a SQL Server or a
State Server service. Out-of-Process state management requires that all objects stored in session
are serializable.
1. Why are Server control tags shown in the browser instead of the controls it represents?
This is because the server control tags were not converted into their respecting HTML element tags
by ASP.Net. This happens when ASP.Net is not properly registered with IIS. .Net framework provides
an Administration utility that manages the installation and uninstallation of multiple versions of
aspnet_regiis.exe use the command: aspnet_regiis.exe -u ---> to uninstall current asp.net version.
2.[1.] What are the Best practices for side-by-side execution of Framework 1.1 and 2.0?
In ASP.NET, applications are said to be running side by side when they are installed on the same
Yes! VS.Net works with the .Net framework, while VS6.0 works with MFC or the Windows API directly,
for the most part. They can be installed and run on the same machine without any considerations.
An assembly is a logical unit of code. Physically it may exist as dll or an exe. which can contain one
or more files and they can be any file types like image files, text files etc. along with DLLs or
EXEs.When you compile your source code by default the exe/dll which is generated is actually an
assemblyand every assembly file contains information about itself which is called as Assembly
Manifest.Namespace is an abstract container providing context for the items it holds and allows
disambiguation of items having the same name (residing in different namespaces. It can also be said
as a context for identifiers. So under a namespace you can have multiple assemblies.
6.[5.] What is deployment? How do you deploy .Net and Java applications
Deployment - It is the procedure to deploy Web Application on the Server. You can deploy .Net
application by simply Xcopy and create virtual directory for the application on server.
Dataset is an in-memory representation of a database. Its stored no where but in memory. Goes off
When a class is not provided with full functionalitythen it is declared as abstract.it doesn't support
if you install biztalk server it provides Biztalk Project in the project types like webproject, windows
project, console project. We use rest of the products of the Biztalk like adapters and all those thing
Marshaling performs the necessary conversions in data formats between managed and unmanaged
code.CLR allows managed code to interoperate with unmanaged code usining COM
Marshaler(Component of CLR).
11. Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
o A DataSet can represent an entire relational database in memory, complete with tables,
o A DataSet is designed to work without any continuing connection to the original data
source.
o DataSets have no current record pointer You can use For Each loops to move through the
data.
o You can store many edits in a DataSet, and write them to the original data source in a single
operation.
o Though the DataSet is universal, other objects in ADO.NET come in different versions for
12. In .NET Compact Framework, can I free memory explicitly without waiting for garbage
.NET Compact Framework come with CLR which perform automatic garbage collector to free the
[code]
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<html>
<head>
<title>Dynamic Form</title>
<script type="text/javascript" >
function CreateTextbox()
{
var i = 1;
createTextbox.innerHTML = createTextbox.innerHTML +"<input type=text name='mytext'+ i/>"
createTextbox.innerHTML = createTextbox.innerHTML +"<input type=button value='Dynamci Button'+ i
name='mytext'+ i/>"
}
</script>
</head>
<body>
<form name="form">
<input type="button" value="clickHere" onClick="CreateTextbox()"/>
<div id="createTextbox">
</div>
</form>
</body>
</html>
[/code]
Posted by Rajandaran G at 1:54 AM 0 comments Links to this post
How to load all country name to dropdownlist?
This dropdownlist contains all the countries of the world.It should save you time if you need to create a
dropdownlist with all the countries populated.
check the code here
[code]
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList id="ddlCountry" runat="server">
<asp:ListItem Value="" Selected="True">Select Country</asp:ListItem>
<asp:ListItem Value="AF">Afghanistan</asp:ListItem>
<asp:ListItem Value="AL">Albania</asp:ListItem>
<asp:ListItem Value="DZ">Algeria</asp:ListItem>
<asp:ListItem Value="AS">American Samoa</asp:ListItem>
<asp:ListItem Value="AD">Andorra</asp:ListItem>
<asp:ListItem Value="AO">Angola</asp:ListItem>
<asp:ListItem Value="AI">Anguilla</asp:ListItem>
<asp:ListItem Value="AQ">Antarctica</asp:ListItem>
<asp:ListItem Value="AG">Antigua And Barbuda</asp:ListItem>
<asp:ListItem Value="AR">Argentina</asp:ListItem>
<asp:ListItem Value="AM">Armenia</asp:ListItem>
<asp:ListItem Value="AW">Aruba</asp:ListItem>
<asp:ListItem Value="AU">Australia</asp:ListItem>
<asp:ListItem Value="AT">Austria</asp:ListItem>
<asp:ListItem Value="AZ">Azerbaijan</asp:ListItem>
<asp:ListItem Value="BS">Bahamas</asp:ListItem>
<asp:ListItem Value="BH">Bahrain</asp:ListItem>
<asp:ListItem Value="BD">Bangladesh</asp:ListItem>
<asp:ListItem Value="BB">Barbados</asp:ListItem>
<asp:ListItem Value="BY">Belarus</asp:ListItem>
<asp:ListItem Value="BE">Belgium</asp:ListItem>
<asp:ListItem Value="BZ">Belize</asp:ListItem>
<asp:ListItem Value="BJ">Benin</asp:ListItem>
<asp:ListItem Value="BM">Bermuda</asp:ListItem>
<asp:ListItem Value="BT">Bhutan</asp:ListItem>
<asp:ListItem Value="BO">Bolivia</asp:ListItem>
<asp:ListItem Value="BA">Bosnia And Herzegowina</asp:ListItem>
<asp:ListItem Value="BW">Botswana</asp:ListItem>
<asp:ListItem Value="BV">Bouvet Island</asp:ListItem>
<asp:ListItem Value="BR">Brazil</asp:ListItem>
<asp:ListItem Value="IO">British Indian Ocean Territory</asp:ListItem>
<asp:ListItem Value="BN">Brunei Darussalam</asp:ListItem>
<asp:ListItem Value="BG">Bulgaria</asp:ListItem>
<asp:ListItem Value="BF">Burkina Faso</asp:ListItem>
<asp:ListItem Value="BI">Burundi</asp:ListItem>
<asp:ListItem Value="KH">Cambodia</asp:ListItem>
<asp:ListItem Value="CM">Cameroon</asp:ListItem>
<asp:ListItem Value="CA">Canada</asp:ListItem>
<asp:ListItem Value="CV">Cape Verde</asp:ListItem>
<asp:ListItem Value="KY">Cayman Islands</asp:ListItem>
<asp:ListItem Value="CF">Central African Republic</asp:ListItem>
<asp:ListItem Value="TD">Chad</asp:ListItem>
<asp:ListItem Value="CL">Chile</asp:ListItem>
<asp:ListItem Value="CN">China</asp:ListItem>
<asp:ListItem Value="CX">Christmas Island</asp:ListItem>
<asp:ListItem Value="CC">Cocos (Keeling) Islands</asp:ListItem>
<asp:ListItem Value="CO">Colombia</asp:ListItem>
<asp:ListItem Value="KM">Comoros</asp:ListItem>
<asp:ListItem Value="CG">Congo</asp:ListItem>
<asp:ListItem Value="CK">Cook Islands</asp:ListItem>
<asp:ListItem Value="CR">Costa Rica</asp:ListItem>
<asp:ListItem Value="CI">Cote D'Ivoire</asp:ListItem>
<asp:ListItem Value="HR">Croatia (Local Name: Hrvatska)</asp:ListItem>
<asp:ListItem Value="CU">Cuba</asp:ListItem>
<asp:ListItem Value="CY">Cyprus</asp:ListItem>
<asp:ListItem Value="CZ">Czech Republic</asp:ListItem>
<asp:ListItem Value="DK">Denmark</asp:ListItem>
<asp:ListItem Value="DJ">Djibouti</asp:ListItem>
<asp:ListItem Value="DM">Dominica</asp:ListItem>
<asp:ListItem Value="DO">Dominican Republic</asp:ListItem>
<asp:ListItem Value="TP">East Timor</asp:ListItem>
<asp:ListItem Value="EC">Ecuador</asp:ListItem>
<asp:ListItem Value="EG">Egypt</asp:ListItem>
<asp:ListItem Value="SV">El Salvador</asp:ListItem>
<asp:ListItem Value="GQ">Equatorial Guinea</asp:ListItem>
<asp:ListItem Value="ER">Eritrea</asp:ListItem>
<asp:ListItem Value="EE">Estonia</asp:ListItem>
<asp:ListItem Value="ET">Ethiopia</asp:ListItem>
<asp:ListItem Value="FK">Falkland Islands (Malvinas)</asp:ListItem>
<asp:ListItem Value="FO">Faroe Islands</asp:ListItem>
<asp:ListItem Value="FJ">Fiji</asp:ListItem>
<asp:ListItem Value="FI">Finland</asp:ListItem>
<asp:ListItem Value="FR">France</asp:ListItem>
<asp:ListItem Value="GF">French Guiana</asp:ListItem>
<asp:ListItem Value="PF">French Polynesia</asp:ListItem>
<asp:ListItem Value="TF">French Southern Territories</asp:ListItem>
<asp:ListItem Value="GA">Gabon</asp:ListItem>
<asp:ListItem Value="GM">Gambia</asp:ListItem>
<asp:ListItem Value="GE">Georgia</asp:ListItem>
<asp:ListItem Value="DE">Germany</asp:ListItem>
<asp:ListItem Value="GH">Ghana</asp:ListItem>
<asp:ListItem Value="GI">Gibraltar</asp:ListItem>
<asp:ListItem Value="GR">Greece</asp:ListItem>
<asp:ListItem Value="GL">Greenland</asp:ListItem>
<asp:ListItem Value="GD">Grenada</asp:ListItem>
<asp:ListItem Value="GP">Guadeloupe</asp:ListItem>
<asp:ListItem Value="GU">Guam</asp:ListItem>
<asp:ListItem Value="GT">Guatemala</asp:ListItem>
<asp:ListItem Value="GN">Guinea</asp:ListItem>
<asp:ListItem Value="GW">Guinea-Bissau</asp:ListItem>
<asp:ListItem Value="GY">Guyana</asp:ListItem>
<asp:ListItem Value="HT">Haiti</asp:ListItem>
<asp:ListItem Value="HM">Heard And Mc Donald Islands</asp:ListItem>
<asp:ListItem Value="VA">Holy See (Vatican City State)</asp:ListItem>
<asp:ListItem Value="HN">Honduras</asp:ListItem>
<asp:ListItem Value="HK">Hong Kong</asp:ListItem>
<asp:ListItem Value="HU">Hungary</asp:ListItem>
<asp:ListItem Value="IS">Icel And</asp:ListItem>
<asp:ListItem Value="IN">India</asp:ListItem>
<asp:ListItem Value="ID">Indonesia</asp:ListItem>
<asp:ListItem Value="IR">Iran (Islamic Republic Of)</asp:ListItem>
<asp:ListItem Value="IQ">Iraq</asp:ListItem>
<asp:ListItem Value="IE">Ireland</asp:ListItem>
<asp:ListItem Value="IL">Israel</asp:ListItem>
<asp:ListItem Value="IT">Italy</asp:ListItem>
<asp:ListItem Value="JM">Jamaica</asp:ListItem>
<asp:ListItem Value="JP">Japan</asp:ListItem>
<asp:ListItem Value="JO">Jordan</asp:ListItem>
<asp:ListItem Value="KZ">Kazakhstan</asp:ListItem>
<asp:ListItem Value="KE">Kenya</asp:ListItem>
<asp:ListItem Value="KI">Kiribati</asp:ListItem>
<asp:ListItem Value="KP">Korea, Dem People'S Republic</asp:ListItem>
<asp:ListItem Value="KR">Korea, Republic Of</asp:ListItem>
<asp:ListItem Value="KW">Kuwait</asp:ListItem>
<asp:ListItem Value="KG">Kyrgyzstan</asp:ListItem>
<asp:ListItem Value="LA">Lao People'S Dem Republic</asp:ListItem>
<asp:ListItem Value="LV">Latvia</asp:ListItem>
<asp:ListItem Value="LB">Lebanon</asp:ListItem>
<asp:ListItem Value="LS">Lesotho</asp:ListItem>
<asp:ListItem Value="LR">Liberia</asp:ListItem>
<asp:ListItem Value="LY">Libyan Arab Jamahiriya</asp:ListItem>
<asp:ListItem Value="LI">Liechtenstein</asp:ListItem>
<asp:ListItem Value="LT">Lithuania</asp:ListItem>
<asp:ListItem Value="LU">Luxembourg</asp:ListItem>
<asp:ListItem Value="MO">Macau</asp:ListItem>
<asp:ListItem Value="MK">Macedonia</asp:ListItem>
<asp:ListItem Value="MG">Madagascar</asp:ListItem>
<asp:ListItem Value="MW">Malawi</asp:ListItem>
<asp:ListItem Value="MY">Malaysia</asp:ListItem>
<asp:ListItem Value="MV">Maldives</asp:ListItem>
<asp:ListItem Value="ML">Mali</asp:ListItem>
<asp:ListItem Value="MT">Malta</asp:ListItem>
<asp:ListItem Value="MH">Marshall Islands</asp:ListItem>
<asp:ListItem Value="MQ">Martinique</asp:ListItem>
<asp:ListItem Value="MR">Mauritania</asp:ListItem>
<asp:ListItem Value="MU">Mauritius</asp:ListItem>
<asp:ListItem Value="YT">Mayotte</asp:ListItem>
<asp:ListItem Value="MX">Mexico</asp:ListItem>
<asp:ListItem Value="FM">Micronesia, Federated States</asp:ListItem>
<asp:ListItem Value="MD">Moldova, Republic Of</asp:ListItem>
<asp:ListItem Value="MC">Monaco</asp:ListItem>
<asp:ListItem Value="MN">Mongolia</asp:ListItem>
<asp:ListItem Value="MS">Montserrat</asp:ListItem>
<asp:ListItem Value="MA">Morocco</asp:ListItem>
<asp:ListItem Value="MZ">Mozambique</asp:ListItem>
<asp:ListItem Value="MM">Myanmar</asp:ListItem>
<asp:ListItem Value="NA">Namibia</asp:ListItem>
<asp:ListItem Value="NR">Nauru</asp:ListItem>
<asp:ListItem Value="NP">Nepal</asp:ListItem>
<asp:ListItem Value="NL">Netherlands</asp:ListItem>
<asp:ListItem Value="AN">Netherlands Ant Illes</asp:ListItem>
<asp:ListItem Value="NC">New Caledonia</asp:ListItem>
<asp:ListItem Value="NZ">New Zealand</asp:ListItem>
<asp:ListItem Value="NI">Nicaragua</asp:ListItem>
<asp:ListItem Value="NE">Niger</asp:ListItem>
<asp:ListItem Value="NG">Nigeria</asp:ListItem>
<asp:ListItem Value="NU">Niue</asp:ListItem>
<asp:ListItem Value="NF">Norfolk Island</asp:ListItem>
<asp:ListItem Value="MP">Northern Mariana Islands</asp:ListItem>
<asp:ListItem Value="NO">Norway</asp:ListItem>
<asp:ListItem Value="OM">Oman</asp:ListItem>
<asp:ListItem Value="PK">Pakistan</asp:ListItem>
<asp:ListItem Value="PW">Palau</asp:ListItem>
<asp:ListItem Value="PA">Panama</asp:ListItem>
<asp:ListItem Value="PG">Papua New Guinea</asp:ListItem>
<asp:ListItem Value="PY">Paraguay</asp:ListItem>
<asp:ListItem Value="PE">Peru</asp:ListItem>
<asp:ListItem Value="PH">Philippines</asp:ListItem>
<asp:ListItem Value="PN">Pitcairn</asp:ListItem>
<asp:ListItem Value="PL">Poland</asp:ListItem>
<asp:ListItem Value="PT">Portugal</asp:ListItem>
<asp:ListItem Value="PR">Puerto Rico</asp:ListItem>
<asp:ListItem Value="QA">Qatar</asp:ListItem>
<asp:ListItem Value="RE">Reunion</asp:ListItem>
<asp:ListItem Value="RO">Romania</asp:ListItem>
<asp:ListItem Value="RU">Russian Federation</asp:ListItem>
<asp:ListItem Value="RW">Rwanda</asp:ListItem>
<asp:ListItem Value="KN">Saint K Itts And Nevis</asp:ListItem>
<asp:ListItem Value="LC">Saint Lucia</asp:ListItem>
<asp:ListItem Value="VC">Saint Vincent, The Grenadines</asp:ListItem>
<asp:ListItem Value="WS">Samoa</asp:ListItem>
<asp:ListItem Value="SM">San Marino</asp:ListItem>
<asp:ListItem Value="ST">Sao Tome And Principe</asp:ListItem>
<asp:ListItem Value="SA">Saudi Arabia</asp:ListItem>
<asp:ListItem Value="SN">Senegal</asp:ListItem>
<asp:ListItem Value="SC">Seychelles</asp:ListItem>
<asp:ListItem Value="SL">Sierra Leone</asp:ListItem>
<asp:ListItem Value="SG">Singapore</asp:ListItem>
<asp:ListItem Value="SK">Slovakia (Slovak Republic)</asp:ListItem>
<asp:ListItem Value="SI">Slovenia</asp:ListItem>
<asp:ListItem Value="SB">Solomon Islands</asp:ListItem>
<asp:ListItem Value="SO">Somalia</asp:ListItem>
<asp:ListItem Value="ZA">South Africa</asp:ListItem>
<asp:ListItem Value="GS">South Georgia , S Sandwich Is.</asp:ListItem>
<asp:ListItem Value="ES">Spain</asp:ListItem>
<asp:ListItem Value="LK">Sri Lanka</asp:ListItem>
<asp:ListItem Value="SH">St. Helena</asp:ListItem>
<asp:ListItem Value="PM">St. Pierre And Miquelon</asp:ListItem>
<asp:ListItem Value="SD">Sudan</asp:ListItem>
<asp:ListItem Value="SR">Suriname</asp:ListItem>
<asp:ListItem Value="SJ">Svalbard, Jan Mayen Islands</asp:ListItem>
<asp:ListItem Value="SZ">Sw Aziland</asp:ListItem>
<asp:ListItem Value="SE">Sweden</asp:ListItem>
<asp:ListItem Value="CH">Switzerland</asp:ListItem>
<asp:ListItem Value="SY">Syrian Arab Republic</asp:ListItem>
<asp:ListItem Value="TW">Taiwan</asp:ListItem>
<asp:ListItem Value="TJ">Tajikistan</asp:ListItem>
<asp:ListItem Value="TZ">Tanzania, United Republic Of</asp:ListItem>
<asp:ListItem Value="TH">Thailand</asp:ListItem>
<asp:ListItem Value="TG">Togo</asp:ListItem>
<asp:ListItem Value="TK">Tokelau</asp:ListItem>
<asp:ListItem Value="TO">Tonga</asp:ListItem>
<asp:ListItem Value="TT">Trinidad And Tobago</asp:ListItem>
<asp:ListItem Value="TN">Tunisia</asp:ListItem>
<asp:ListItem Value="TR">Turkey</asp:ListItem>
<asp:ListItem Value="TM">Turkmenistan</asp:ListItem>
<asp:ListItem Value="TC">Turks And Caicos Islands</asp:ListItem>
<asp:ListItem Value="TV">Tuvalu</asp:ListItem>
<asp:ListItem Value="UG">Uganda</asp:ListItem>
<asp:ListItem Value="UA">Ukraine</asp:ListItem>
<asp:ListItem Value="AE">United Arab Emirates</asp:ListItem>
<asp:ListItem Value="GB">United Kingdom</asp:ListItem>
<asp:ListItem Value="US">United States</asp:ListItem>
<asp:ListItem Value="UM">United States Minor Is.</asp:ListItem>
<asp:ListItem Value="UY">Uruguay</asp:ListItem>
<asp:ListItem Value="UZ">Uzbekistan</asp:ListItem>
<asp:ListItem Value="VU">Vanuatu</asp:ListItem>
<asp:ListItem Value="VE">Venezuela</asp:ListItem>
<asp:ListItem Value="VN">Viet Nam</asp:ListItem>
<asp:ListItem Value="VG">Virgin Islands (British)</asp:ListItem>
<asp:ListItem Value="VI">Virgin Islands (U.S.)</asp:ListItem>
<asp:ListItem Value="WF">Wallis And Futuna Islands</asp:ListItem>
<asp:ListItem Value="EH">Western Sahara</asp:ListItem>
<asp:ListItem Value="YE">Yemen</asp:ListItem>
<asp:ListItem Value="ZR">Zaire</asp:ListItem>
<asp:ListItem Value="ZM">Zambia</asp:ListItem>
<asp:ListItem Value="ZW">Zimbabwe</asp:ListItem>
</asp:DropDownList>
</div>
</form>
</body>
</html>
[/code]
Posted by Rajandaran G at 1:54 AM 0 comments Links to this post
How to get system ip using javascript
In page load event just call GetIPAddress().This function will return your ip address.
[code]
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script language="JavaScript">
function GetIPAddress()
{
var obj = null;
var rslt = "";
try
{
obj = new ActiveXObject("rcbdyctl.Setting");
rslt = obj.GetIPAddress;
obj = null;
}
catch(e)
{
//
}
alert(rslt);
return rslt;
}
</script>
</head>
<body onload="return GetIPAddress()">
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
[/code]