Do I need IIS to run Web applications?
If you are using Visual Studio, you can use the ASP.NET Development Server built into Visual Studio to test your pages. The server functions as a local Web server, running ASP.NET Web pages in a manner virtually identical to how they run in IIS. To deploy a Web application, you need to copy it to a computer running IIS version 5 or 6.
How do I create pages for mobile devices?
ASP.NET will automatically detect the type of browser making the request. This information is used by the page and by individual controls to render appropriate markup for that browser. You therefore do not need to use a special set of pages or controls for mobile devices. (Whether you can design a single page to work with all types of browsers will depend on the page, on the browsers you want to target, and on your own goals.)
Are ASP.NET pages XHTML compatible?
Yes. Individual controls render markup that is compatible with the XHTML 1.1 standard. It is up to you, however, to include the appropriate document type declaration and other XHTML document elements. ASP.NET does not insert elements for you to ensure XHTML compatibility. For details, see ASP.NET and XHTML Compliance.
Can I hide the source code for my page?
Server-side code is processed on the server and is not sent to the browser, so users cannot see it. However, client script is not protected; any client script that you add to your page, or that is injected into the page by server processing, is visible to users. If you are concerned about protecting your source code on the server, you can precompile your site and deploy the compiled version. For details, see Publishing Web Sites.
When I run a page, I get the error "The page cannot be displayed" and an HTTP 502 Proxy Error. Why?
This error can occur if you are running ASP.NET Web pages using the Visual Web Developer Web server, because the URL includes a randomly selected port number. Proxy servers do not recognize the URL and return this error. To get around the problem, change your settings in Internet Explorer to bypass the proxy server for local addresses, so that the request is not sent to the proxy. In Internet Explorer, you can make this change in Tools > Internet Options. In the Connections tab, click LAN Settings and then select Bypass proxy server for local addresses.
Which page code model is preferable, single-file or code-behind?
Both models function the same and have the same performance. The choice of using single-file pages versus code-behind pages is one of personal preference and convenience. For details, see ASP.NET Web Page Code Model.
The QuickStart examples and examples in the API reference seem to use single-file pages frequently. Does this mean that single-file is the preferred model for pages?
No. Single-file pages are frequently used in examples because they are easier to illustrate — the writer does not have to create a separate file to show the code.
Is it better to write code in C# or Visual Basic?
You can write code for your Web application in any language supported by the .NET Framework. That includes Visual Basic, C#, J#, JScript, and others. Although the languages have different syntax, they all compile to the same object code. The languages have small differences in how they support different features. For example, C# provides access to unmanaged code, while Visual Basic supports implicit event binding via the Handles clause. However, the differences are minor, and unless your requirements involve one of these small differences, the choice of programming language is one of personal preference. Once programs are compiled, they all perform identically; that is, Visual Basic programs run just as fast as C# programs, since they both produce the same object code.
Do I have to use one programming language for all my Web pages?
No. Each page can be written in a different programming language if you want, even in the same application. If you are creating source code files and putting them in the \App_Code folder to be compiled at run time, all the code in must be in the same language. However, you can create subfolders in the \App_Code folder and use the subfolders to store components written in different programming languages.
Is the code in single-file and code-behind pages identical?
Almost. A code-behind file contains an explicit class declaration, which is not required for single-file pages.
Is the old code-behind model still supported?
Old projects will continue to run without change. In Visual Studio 2005, if you open a project created in Visual Studio .NET 2002 or 2003, by default, the project is converted to the new project layout used in Visual Studio 2005. As part of the conversion, pages that use the old code-behind model are converted to use the new code-behind model. Visual Studio 2005 Web Application Projects provide an alternative web project model that uses the same project, build and compilation semantics as the Visual Studio .NET 2003 code-behind model. For details, see Visual Studio 2005 Web Application Projects.
Questions on ASP.NET 2.0 Controls
Why is there no DataGrid control on the Toolbox?
The DataGrid control has been superseded by the GridView control, which can do everything the DataGrid control does and more. The GridView control features automatic data binding; auto-generation of buttons for selecting, editing, and deleting; automatic sorting; and automatic paging. There is full backward compatibility for the DataGrid control, and pages that use the DataGrid will continue to work as they did in version 1.0 of ASP.NET.
Can I still use the DataList and Repeater controls?
Absolutely. You can use them the way you always have. But note that the controls have been enhanced to be able to interact with data source controls and to use automatic data binding. For example, you can bind a DataList or Repeater control to a SqlDataSource control instead of writing ADO.NET code to access the database.
What's the difference between login controls and Forms authentication?
Login controls are an easy way to implement Forms authentication without having to write any code. For example, the Login control performs the same functions you would normally perform when using the FormsAuthentication classprompt for user credentials, validate them, and issue the authentication ticketbut with all the functionality wrapped in a control that you can just drag from the Toolbox in Visual Studio. Under the covers, the login control uses the FormsAuthentication class (for example, to issue the authentication ticket) and ASP.NET membership (to validate the user credentials). Naturally, you can still use Forms authentication yourself, and applications you have that currently use it will continue to run.
Configuring ASP.NET 2.0
How is ASP.NET configuration data formatted?
ASP.NET configuration data is encoded in XML and stored as plaintext files. You can access these files programmatically by using administration tools or by using a text editor. For more information, see ASP.NET Configuration Overview.
Where are the ASP.NET configuration files stored?
System-wide configuration settings and some ASP.NET schema settings are stored in a file named Machine.config, which is located in the %SystemRoot%\Microsoft .NET\Framework\versionNumber\CONFIG directory. This directory also contains other default settings for ASP.NET Web applications in a file that is referred to as the root Web.config file. ASP.NET configuration files for individual Web sites and applications, which are also named Web.config files, can be stored in any Web site root directory, application root directory, application subdirectory, or all of these. For more information, see ASP.NET Configuration File Hierarchy.
How are the ASP.NET configuration files related to the Internet Information Services (IIS) configuration file (the IIS metabase)?
In IIS versions 6.0 and earlier, the ASP.NET configuration system redirects any IIS-specific settings that it controls. The ASP.NET configuration system then configures IIS for you by automatically editing the IIS metabase. For information about the IIS metabase, see Working with the IIS Metabase.
I used the ASP.NET configuration system to restrict access to my ASP.NET application, but anonymous users can still view some of my files. Why is that?
The features of the ASP.NET configuration system only apply to ASP.NET resources. For example, Forms Authentication only restricts access to ASP.NET files, not to static files or ASP (classic) files unless those resources are mapped to ASP.NET file name extensions. Use the configuration features of IIS to configure non-ASP.NET resources.
Since there can be multiple ASP.NET configuration files on one computer, how does ASP.NET configuration handle inheritance?
ASP.NET integrates the settings in configuration files (the Machine.config and Web.config files) into a single inheritance hierarchy. With a few exceptions, you can place a Web.config file wherever you need to override the configuration settings that are inherited from a configuration file located at a higher level in the hierarchy. For more information, see ASP.NET Configuration File Hierarchy.
How does ASP.NET consolidate the settings in all of the configuration files?
At run time, ASP.NET reads the settings in the Machine.config file and all of the Web.config files and then assembles a cache of the settings for each valid URL in each application on the server.
What happens when a configuration setting changes during run time?
ASP.NET invalidates the existing cache and assembles a new cache. Then ASP.NET automatically restarts the application to apply the changes.
Can I configure specific folders directly?
Yes. By using the location element in a configuration file that is located higher in the configuration hierarchy, you can configure the attributes of individual resources, such as the application directories under a Web site or application subdirectories. This is useful in hosting environments for specifying configuration settings in a machine-level configuration file that apply to individual Web sites. For more information, see How to: Configure Specific Folders Using Location Settings.
Can I lock a configuration setting so that a Web.config file that appears lower in the hierarchy cannot override it?
Yes. By setting the location element's Override attribute to false, you can lock a specific setting so that it does not inherit settings from below. For more information, see How to: Lock ASP.NET Configuration Settings.
How can I get programmatic access to ASP.NET configuration settings?
You can read, create, or modify configuration settings from within an ASP.NET application by using the ASP.NET management API. You can develop your own applications including Web applications, console applications, and scripts that use the management API.
How can I get programmatic access to IIS configuration settings?
You can use ADSI, WMI, or COM interfaces to configure IIS programmatically. For more information, see Using IIS Programmatic Administration.
How are ASP.NET configuration files secured against unauthorized access?
ASP.NET configures IIS to deny access to any user that requests access to the Machine.config or Web.config files.
What are the limitations when configuring ASP.NET by using the ASP.NET MMC snap-in?
The ASP.NET MMC snap-in allows you to set ASP.NET configuration at all levels, but on the local computer only. For more information, see ASP.NET MMC Snap-In.
Can I configure ASP.NET Web sites and applications remotely?
Yes. You can use the Web Site Administration Tool to configure remote Web sites and applications by using a Web browser. For more information, see Web Site Administration Tool.
Can I configure ASP.NET by directly editing the Machine.config and Web.config files?
Yes. You can use any text editor or XML editor to edit the ASP.NET configuration files directly. However, consider using one of the tools mentioned in the previous questions to edit ASP.NET configuration because those tools often ensure XML validation.
Can I configure ASP.NET by directly editing the IIS metabase file?
The IIS 6.0 metabase is stored in an XML-formatted file called Metabase.xml. You can configure IIS to allow the metabase to be edited directly, but not all of the ASP.NET configuration settings are available in the IIS metabase. It is best to configure ASP.NET features by using the ASP.NET configuration system. For more information, see Editing ASP.NET Configuration Files.
What tools can I use to edit the IIS metabase?
You can use the IIS Manager snap-in for the MMC. For information about common administrative tasks for ASP.NET developers, see ASP.NET and IIS Configuration.
Questions on Visual Web Developer
Can I run Web pages on a remote computer using ASP.NET Development Server?
Yes, you can create a file system Web application and specify a UNC pointing to another computer as the location for the files. When you run a page in Visual Web Developer, it starts up the ASP.NET Development Server locally, which in turn can read files from a remote computer.
Microsoft KnowledgeBase article 810886
When I try to run pages on a remote computer using the ASP.NET Development Server, I get an error that says the BIOS limit has been exceeded. What is the problem?
You might see this error if the remote computer is running Windows 2000 or Windows XP. If the remote computer is running Windows 2000, you can follow the instructions in Microsoft KnowledgeBase article 810886 to set the maximum number of concurrent connections to a higher number. If you are running Windows XP, you might be able to avoid this error by closing existing shared resources, including terminal server sessions, on the remote computer. (Windows XP is configured with a fixed number of maximum concurrent network requests.)
General ASP.NET Questions
What is ASP.NET?
ASP.NET is a server-side technology for creating dynamic, standards-based Web sites and services that are accessible across multiple platforms including mobile devices. It is part of the .NET-based environment; you can author applications in any .NET compatible language, including Visual Basic .NET, C#, and J#. Additionally, the entire .NET Framework class library is available to any ASP.NET application. Developers can easily access the benefits of these technologies, which include the managed common language runtime environment, type safety, inheritance, and so on.
Whats the difference between ASP and ASP.NET?
ASP (Active Server Pages) and ASP.NET are both server side technologies for building web sites and Web applications, but ASP.NET is not simply a new version of ASP. ASP.NET has been entirely re-architected to provide a highly productive programming experience based on the .NET Framework, and a robust infrastructure for building reliable and scalable web applications. For an overview of ASP.NET enhancements click here.
How do I get ASP.NET?
You can get ASP.NET by installing the Microsoft .NET Framework. The .NET Framework is available in either a redistributable or SDK format. See this overview to learn more and install the .NET Framework.
How much does ASP.NET cost?
ASP.NET is part of the Microsoft .NET Framework. The .NET Framework is a feature of Windows, and is available for download at no charge from this site. You can develop ASP.NET sites using a text editor, but if youre looking for a development tool please see Which development tools support ASP.NET?
What operating systems does ASP.NET run on?
ASP.NET runs on Windows Server 2000, Windows Server 2003, and Windows XP Professional. Windows XP Home is also supported for development only using Visual Web Developer Express Edition tool (which is available for download) or Visual Studio 2005.
Can I develop my ASP.NET pages in Notepad, or do I need to buy Visual Studio?
Yes, you can use any text editor to create ASP.NET pages. However, you may find yourself more productive if you use a dedicated tool, such as Visual Web Developer Express Edition or Visual Studio.
I've installed the .NET Framework, but ASP.NET doesn't seem to work. What can I do to fix it?
You must have IIS (Internet Information Services) installed before you install the .NET Framework. If you install IIS after you install the .NET Framework, you must also register the ASP.NET extensions with IIS. You can do this by running the aspnet_regiis executable from: %windows root directory%\Microsoft.NET\Framework\%version of the .NET Framework%\aspnet_regiis -r where %windows root directory% is the directory Windows is installed to (typically c:\windows or c:\winnt) and %version of the .NET Framework% is the version of the .NET Framework you have installed. The directory for .NET 1.0 is v1.0.3705, for 1.1 is v1.1.4322, and for 2.0 is v2.0.50727.
Where should I put the connection string to my database for my ASP.NET app?
Keep in mind that securing your connection string will prevent hackers from accessing information in your databases. For v1.x, the section titled Storing Database Connection Strings Securely from Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication outlines many good techniques for protecting this valuable resource. For v2.0, the walkthrough Encrypting Configuration Information Using Protected Configuration introduces Protected Configuration and the new connectionStrings configuration section as the preferred solution for storing connection string information in configuration files.
Which development tools support ASP.NET?
You can develop ASP.NET sites in any text editor, but Microsoft Visual Studio and Visual Web Developer Express Edition (available for download) provide rich support for the complete ASP.NET platform making development more productive and efficient. As well, Macromedia Dreamweaver MX and Borland C# Builder also offer ASP.NET development support.
Are there any pre-built applications or code samples available for ASP.NET?
The ASP.NET Visual Web Developer Starter Kits are sample applications available complete with source code to show you how to build real-world sites using ASP.NET using Visual Studio or Visual Web Developer Express Edition. You might also be interested in DotNetNuke, a free content management system built on ASP.NET. Lastly, there is CommunityServer, a platform for rapidly enabling online communities, which includes discussion forums, e-mail lists, newsgroups, blogs, file galleries, and more.
Where can I find web hosters that support ASP.NET?
Have a look at www.asp.net/hosters
General IIS Questions
This tip comes from the 11/23/2004 edition of the IISAnswers Newsletter. You can subscribe to the newsletter or find more information at http://www.iisanswers.com.
Viewing Custom Headers
Q: I have an IIS 6 Server Cluster. I'm trying to make a generic test page that will show me the cluster member I'm on. I figured a good way to do this is to assign a Custom Header Variable to IIS such as "Node:" with a value of "1" or "2" or "3," etc.
I've been on Google all morning and I can't figure out how to display the value. The value is added to the response object sent to the client and it seems to happen after the ASP script is completed so I can't do it server side. I haven't been able to find anything with client side JavaScript about viewing header information.
A: The custom http headers are meant for the client [browser], not for the ASP engine. In fact, from what I can tell, asp.dll or aspnet_isapi.dll doesn't have access to the custom header set up in IIS (except using ADSI/WMI, but that's different). It's not in the ServerVariables collection since the ServerVariables collection just contains what was received from the client.
Check out the bottom tip here: http://www.computerbooksonline.com/tips/asp6.asp
"As you may know, you can use the AddHeader method of the Response object to add custom http headers to your Web pages, but there's a "feature" you should be aware of when you do so. The ServerVariables collection returned by the Request object only contains headers sent from the browser to the server. Since your custom header was created on the server and then sent to the browser (the opposite direction), your header will never be added to the ServerVariables collection. You should be aware of this if you ever plan to interrogate the ServerVariables collection, expecting to find a custom header you created in this way. It will never be there, so such an approach simply won't work! "
Here is another good reference: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/iis/ ref_vbom_resomah.asp
The kicker is this:
"You can retrieve the header if a special client returns it to the server on the next request"
I caught Steve Schofield by IM and he gave me this information from the IIS help:
"You can use this property to send a custom HTTP header from the Web server to the client browser. Custom headers can be used to send instructions from the Web server to the client browser that are not yet supported in the current HTTP specification, such as newer HTTP headers that IIS may not inherently support at the time of the product's release. For example, you can use a custom HTTP header to allow the client browser to cache the page but prevent proxy servers from caching the page."
Both Steve and I set up some tests and confirmed this. A network capture confirms that the header is sent back to the client.
It's a matter of order of operation. The ISAPI Filters (which asp and asp.net run as) appear to be higher on list than when IIS appends the header. Basically IIS adds the header on the way "out," not "in."
Further on this, if the client [browser] sends a custom header, it needs to be prefixed with HTTP_ to retrieve it within ASP(.NET).
It appears from the Microsoft link above that it's possible to receive the header from the client and send back to the server on the 2nd page view. I tested using a POST and GET but neither appeared to work for me. I assume that it doesn't happen automatically with IE and would require a custom client tool to handle this.
JavaScript should be able to get this because JavaScript runs after IIS added the header.
So, in summary, HTTP custom headers can't be used within ASP for any type of logic. It's something used for the Client and not the Server.
asp.net,vb.net,c #,faq's,real time questions, dot net frame work,microsoft dot net,dot net tutorial, dot net certification,debugging,dot net tips,dot net programes,dot net lessons,dot net faq's,interview questions,ado.net,asp.net,Visual Basic.net,sql server microsoft,visual basic net,net applications & microsoft dot net architecture. Yellow pages,Gurgaon Yellow Pages,Education,Gurgaon Classifieds, Hotels in Gurgaon
Dot Net FAQ
Welcome
General Questions on ASP.NET 2.0
ASP.NET Session State FAQ
Basic use of Session in ASP.NET (C#):
STORE:
DataSet ds = GetDataSet(whatever parameters);
Session["mydataset")=ds;
RETRIEVE:
DataSet ds = (DataSet)Session["mydataset"];
Storage location
* InProc - session kept as live objects in web server (aspnet_wp.exe). Use "cookieless" configuration in web.config to "munge" the sessionId onto the URL (solves cookie/domain/path RFC problems too!)
* StateServer - session serialized and stored in memory in a separate process (aspnet_state.exe). State Server can run on another machine
* SQLServer - session serialized and stored in SQL server
Performance
* InProc - Fastest, but the more session data, the more memory is consumed on the web server, and that can affect performance.
* StateServer - When storing data of basic types (e.g. string, integer, etc), in one test environment it's 15% slower than InProc. However, the cost of serialization/deserialization can affect performance if you're storing lots
of objects. You have to do performance testing for your own scenario.
* SQLServer - When storing data of basic types (e.g. string, integer, etc), in one test environment it's 25% slower than InProc. Same warning about serialization as in StateServer.
Performance tips for Out-of-Proc (OOP) modes
If you're using OOP modes (State Server or SQL Server), one of your major cost is the serialization/deserialization of objects in your session state. ASP.NET performs the serialization/deserialization of certain "basic" types using an optimized internal method. "Basic" types include numeric types of all sizes (e.g. Int, Byte, Decimal, ... etc), String, DateTime, TimeSpan, Guid, IntPtr and UIntPtr.
If you have a session variable (e.g. an ArrayList object) that is not one of the "basic" types, ASP.NET will serialize/deserialize it using the BinaryFormatter, which is relatively slower.
For performance sake it is better to store all session state data using one of the "basic" types listed above. For example, if you want to store two things, Name and Address, in session state, you can either
(a) store them using two String session variables, or
(b) create a class with two String members, and store that class object in a session
variable. Performance wise, you should go with option (a).
Robustness
* InProc - Session state will be lost if the worker process (aspnet_wp.exe) recycles, or if the appdomain restarts. It's because session state is stored in the memory space of an appdomain. For details, see KB324772.
* StateServer - Solve the session state loss problem in InProc mode. Allows a webfarm to store session on a central server. Single point of failure at the State Server.
* SQLServer - Similar to StateServer. Moreover, session state data can survive a SQL server restart, and you can also take advantage of SQL server failover cluster, after you've followed instructions in KB 311029.
Caveats
InProc - It won't work in web garden mode, because in that mode multiple aspnet_wp.exe will be running on the same machine. Switch to StateServer or SQLServer when using web garden. Also Session_End event is supported only in InProc mode.
StateServer
* - In a web farm, make sure you have the same in all your web servers. See KB 313091 on how to do it.
* - Also, make sure your objects are serializable. See KB 312112 for details.
* - For session state to be maintained across different web servers in the web farm, the Application Path of the website (For example \LM\W3SVC\2) in the IIS Metabase should be identical in all the web servers in the web farm. See KB 325056 for details
SQLServer
- If you specify integrated security in the connection string (e.g. "trusted_connection=true", or "integrated security=sspi"), it won't work if you also turn on impersonation in asp.net. Unfortunately, this bug
isn't reported in KB yet. (There is a QFE fix for it.)
- Also, make sure your objects are serializable. See KB 312112 for details.
- For session state to be maintained across different web servers in the web farm, the Application Path of the website (For example \LM\W3SVC\2) in the IIS Metabase should be identical in all the web servers in the web farm.
See KB 325056 for details.
FAQ's:
Question list:
Q: Session states works on some web servers but not on others.
Q: Why isn't Session_End fired when I call Session_Abandon?
Q: Why are my Session variables lost frequently when using InProc mode?
Q: Why does the SessionID remain the same after the Session times out or abandoned?
Q: Why does the SessionID changes in every request?
Q: Can I share session state between ASP.NET and ASP pages?
Q: What kinds of object can I store in session state?
Q: How come Response.Redirect and Server.Transfer is not working in Session_End?
Q: Do I have a valid HttpContext in Session_End?
Q: How do I use session state with web services?
Q: I am writing my own HttpHandler. Why is session state not working?
Q: I am using a webfarm, and I lost session state when directed to some web servers.
Q: Why isn't session state availabe in the Application_OnAcquireRequestState (or other)
Q: If using "cookieless", how can I redirect from a HTTP page to an HTTPS page?
Q: What isn't Session available in my event handlerin global.asax?
Q: Does session state have a locking mechanism that serialize the access to state?
Answers:
Q: Session states works on some web servers but not on others.
A: Maybe machine name problem. See http://support.microsoft.com/default.aspx?scid=kb;EN-US;q316112 .
Q: Why isn't Session_End fired when I call Session_Abandon?
A: First of all, Session_End event is supported only in InProc mode. In order for Session_End to be fired, your session state has to exist first. That means you have to store some data in the session state and has completed at least one request.
Q: Why are my Session variables lost frequently when using InProc mode?
A: Probably because of application recycle. See http://support.microsoft.com/default.aspx?scid=kb;en-us;Q316148
Q: Why does the SessionID remain the same after the Session times out or abandoned?
A:Even though the session state expires after the indicated timeout period, the session ID lasts as long as the browser session. What this implies is that the same session ID can represent multiple sessions over time where the instance of the browser remain the same.
Q: Why does the SessionID changes in every request?
A: This may happen if your application has never stored anything in the session state. In this case, a new session state (with a new ID) is created in every request, but is never saved because it contains nothing.
However, there are two exceptions to this same session ID behavior:
- If the user has used the same browser instance to request another page that uses the session state, you will get the same session ID every time. For details, see "Why does the SessionID remain the same after the Session times out?"
- If the Session_OnStart event is used, ASP.NET will save the session state even when it is empty.
Q: Can I share session state between ASP.NET and ASP pages?
A: Yes! Here is our article on how to do this in either direction using two "intermediate" pages. And here is an article on how to do it with SQL Server.
Q: What kinds of object can I store in session state?
A: It depends on which mode you are using:
- If you are using InProc mode, objects stored in session state are actually live objects, and so you can store whatever object you have created.
- If you are using State Server or SQL Server mode, objects in the session state will be serialized and deserialized when a request is processed. So make sure your objects are serializable and their classes must be marked as so. If not, the session state will not be saved successfully. In v1, there is a bug which makes the problem happen unnoticed. See this KB for more info:
http://support.microsoft.com/directory/article.asp?ID=KB;EN-US;q312112
Q: How come Response.Redirect and Server.Transfer is not working in Session_End?
A: Session_End is fired internally by the server, based on an internal timer. Thus, there is no HttpRequest associted when that happens. That is why Response.Redirect or Server.Transferdoes not make sense and will not work.
Q: Do I have a valid HttpContext in Session_End?
A: No, because this event is not associated with any request.
Q: Will my session state be saved when my page hit an error?
No. Unless you call Server.ClearError in your exception handler.
Q: How do I use session state with web services?
A: The extra trick needed is on the caller side. You have to save and store the cookies used by the web service. See the MSDN documentation on HttpWebClientProtocol.CookieContainer property.
However, please note if you're using proxy object to call a web service from your page, the web service and your page cannot share the same session state due to architecture limitation.
This can be done if you call your web service through redirect.
Q: I am writing my own HttpHandler. Why is session state not working?
A: Your HttpHandler has to implement the "marker" interface IRequiresSessionState or IReadOnlySessionState in order to use session state.
Q: I am using a webfarm, and I lost session state when directed to some web servers.
A: For session state to be maintained across different web servers in the web farm, the Application Path of the website (For example \LM\W3SVC\2) in the IIS Metabase should be identical in all the web servers in the web farm.
See KB 325056 for details.
Q: Why isn't session state availabe in the Application_OnAcquireRequestState (or other)
event handler?
A: Session state is available only after the HttpApplication.AcquireRequestState event is called. For details, see: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconhandlingpublicevents.asp
Q: If using "cookieless", how can I redirect from a HTTP page to an HTTPS page?
A: Try this:
String originalUrl = "/fxtest3/sub/foo2.aspx";
String modifiedUrl = "https://localhost" + Response.ApplyAppPathModifier(originalUrl);
Response.Redirect(modifiedUrl);
NOTE: Fully qualified URLs in the response.redirect, server.transfer, and FORM action
tags cannot be used with cookiless sessions. Here is an example of a fully qualified
URL: http://www.eggheadcafe.com/default.asp More info here:
Q: What isn't Session available in my event handler in global.asax?
A: It depends on which event you're handling. Session is available only after AcquireRequestState event.
Q: Does session state have a locking mechanism that serialize the access to state?
Session state implements a reader/writer locking mechanism:
- A page (or frame) that has session state write access (e.g. <%@ Page EnableSessionState="True" %>) will hold a writer lock on the session until the request finishes.
- A page (or frame) that has session state read access (e.g. <%@ Page EnableSessionState="ReadOnly" %>) will hold a reader lock on the session until the request finishes.
- Reader lock will block a writer lock; Reader lock will NOT block reader lock; Writer lock will block all reader and writer lock.
- That's why if two frames both have session state write access, one frame has to wait for the other to finish first.
STORE:
DataSet ds = GetDataSet(whatever parameters);
Session["mydataset")=ds;
RETRIEVE:
DataSet ds = (DataSet)Session["mydataset"];
Storage location
* InProc - session kept as live objects in web server (aspnet_wp.exe). Use "cookieless" configuration in web.config to "munge" the sessionId onto the URL (solves cookie/domain/path RFC problems too!)
* StateServer - session serialized and stored in memory in a separate process (aspnet_state.exe). State Server can run on another machine
* SQLServer - session serialized and stored in SQL server
Performance
* InProc - Fastest, but the more session data, the more memory is consumed on the web server, and that can affect performance.
* StateServer - When storing data of basic types (e.g. string, integer, etc), in one test environment it's 15% slower than InProc. However, the cost of serialization/deserialization can affect performance if you're storing lots
of objects. You have to do performance testing for your own scenario.
* SQLServer - When storing data of basic types (e.g. string, integer, etc), in one test environment it's 25% slower than InProc. Same warning about serialization as in StateServer.
Performance tips for Out-of-Proc (OOP) modes
If you're using OOP modes (State Server or SQL Server), one of your major cost is the serialization/deserialization of objects in your session state. ASP.NET performs the serialization/deserialization of certain "basic" types using an optimized internal method. "Basic" types include numeric types of all sizes (e.g. Int, Byte, Decimal, ... etc), String, DateTime, TimeSpan, Guid, IntPtr and UIntPtr.
If you have a session variable (e.g. an ArrayList object) that is not one of the "basic" types, ASP.NET will serialize/deserialize it using the BinaryFormatter, which is relatively slower.
For performance sake it is better to store all session state data using one of the "basic" types listed above. For example, if you want to store two things, Name and Address, in session state, you can either
(a) store them using two String session variables, or
(b) create a class with two String members, and store that class object in a session
variable. Performance wise, you should go with option (a).
Robustness
* InProc - Session state will be lost if the worker process (aspnet_wp.exe) recycles, or if the appdomain restarts. It's because session state is stored in the memory space of an appdomain. For details, see KB324772.
* StateServer - Solve the session state loss problem in InProc mode. Allows a webfarm to store session on a central server. Single point of failure at the State Server.
* SQLServer - Similar to StateServer. Moreover, session state data can survive a SQL server restart, and you can also take advantage of SQL server failover cluster, after you've followed instructions in KB 311029.
Caveats
InProc - It won't work in web garden mode, because in that mode multiple aspnet_wp.exe will be running on the same machine. Switch to StateServer or SQLServer when using web garden. Also Session_End event is supported only in InProc mode.
StateServer
* - In a web farm, make sure you have the same
* - Also, make sure your objects are serializable. See KB 312112 for details.
* - For session state to be maintained across different web servers in the web farm, the Application Path of the website (For example \LM\W3SVC\2) in the IIS Metabase should be identical in all the web servers in the web farm. See KB 325056 for details
SQLServer
- If you specify integrated security in the connection string (e.g. "trusted_connection=true", or "integrated security=sspi"), it won't work if you also turn on impersonation in asp.net. Unfortunately, this bug
isn't reported in KB yet. (There is a QFE fix for it.)
- Also, make sure your objects are serializable. See KB 312112 for details.
- For session state to be maintained across different web servers in the web farm, the Application Path of the website (For example \LM\W3SVC\2) in the IIS Metabase should be identical in all the web servers in the web farm.
See KB 325056 for details.
FAQ's:
Question list:
Q: Session states works on some web servers but not on others.
Q: Why isn't Session_End fired when I call Session_Abandon?
Q: Why are my Session variables lost frequently when using InProc mode?
Q: Why does the SessionID remain the same after the Session times out or abandoned?
Q: Why does the SessionID changes in every request?
Q: Can I share session state between ASP.NET and ASP pages?
Q: What kinds of object can I store in session state?
Q: How come Response.Redirect and Server.Transfer is not working in Session_End?
Q: Do I have a valid HttpContext in Session_End?
Q: How do I use session state with web services?
Q: I am writing my own HttpHandler. Why is session state not working?
Q: I am using a webfarm, and I lost session state when directed to some web servers.
Q: Why isn't session state availabe in the Application_OnAcquireRequestState (or other)
Q: If using "cookieless", how can I redirect from a HTTP page to an HTTPS page?
Q: What isn't Session available in my event handlerin global.asax?
Q: Does session state have a locking mechanism that serialize the access to state?
Answers:
Q: Session states works on some web servers but not on others.
A: Maybe machine name problem. See http://support.microsoft.com/default.aspx?scid=kb;EN-US;q316112 .
Q: Why isn't Session_End fired when I call Session_Abandon?
A: First of all, Session_End event is supported only in InProc mode. In order for Session_End to be fired, your session state has to exist first. That means you have to store some data in the session state and has completed at least one request.
Q: Why are my Session variables lost frequently when using InProc mode?
A: Probably because of application recycle. See http://support.microsoft.com/default.aspx?scid=kb;en-us;Q316148
Q: Why does the SessionID remain the same after the Session times out or abandoned?
A:Even though the session state expires after the indicated timeout period, the session ID lasts as long as the browser session. What this implies is that the same session ID can represent multiple sessions over time where the instance of the browser remain the same.
Q: Why does the SessionID changes in every request?
A: This may happen if your application has never stored anything in the session state. In this case, a new session state (with a new ID) is created in every request, but is never saved because it contains nothing.
However, there are two exceptions to this same session ID behavior:
- If the user has used the same browser instance to request another page that uses the session state, you will get the same session ID every time. For details, see "Why does the SessionID remain the same after the Session times out?"
- If the Session_OnStart event is used, ASP.NET will save the session state even when it is empty.
Q: Can I share session state between ASP.NET and ASP pages?
A: Yes! Here is our article on how to do this in either direction using two "intermediate" pages. And here is an article on how to do it with SQL Server.
Q: What kinds of object can I store in session state?
A: It depends on which mode you are using:
- If you are using InProc mode, objects stored in session state are actually live objects, and so you can store whatever object you have created.
- If you are using State Server or SQL Server mode, objects in the session state will be serialized and deserialized when a request is processed. So make sure your objects are serializable and their classes must be marked as so. If not, the session state will not be saved successfully. In v1, there is a bug which makes the problem happen unnoticed. See this KB for more info:
http://support.microsoft.com/directory/article.asp?ID=KB;EN-US;q312112
Q: How come Response.Redirect and Server.Transfer is not working in Session_End?
A: Session_End is fired internally by the server, based on an internal timer. Thus, there is no HttpRequest associted when that happens. That is why Response.Redirect or Server.Transferdoes not make sense and will not work.
Q: Do I have a valid HttpContext in Session_End?
A: No, because this event is not associated with any request.
Q: Will my session state be saved when my page hit an error?
No. Unless you call Server.ClearError in your exception handler.
Q: How do I use session state with web services?
A: The extra trick needed is on the caller side. You have to save and store the cookies used by the web service. See the MSDN documentation on HttpWebClientProtocol.CookieContainer property.
However, please note if you're using proxy object to call a web service from your page, the web service and your page cannot share the same session state due to architecture limitation.
This can be done if you call your web service through redirect.
Q: I am writing my own HttpHandler. Why is session state not working?
A: Your HttpHandler has to implement the "marker" interface IRequiresSessionState or IReadOnlySessionState in order to use session state.
Q: I am using a webfarm, and I lost session state when directed to some web servers.
A: For session state to be maintained across different web servers in the web farm, the Application Path of the website (For example \LM\W3SVC\2) in the IIS Metabase should be identical in all the web servers in the web farm.
See KB 325056 for details.
Q: Why isn't session state availabe in the Application_OnAcquireRequestState (or other)
event handler?
A: Session state is available only after the HttpApplication.AcquireRequestState event is called. For details, see: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconhandlingpublicevents.asp
Q: If using "cookieless", how can I redirect from a HTTP page to an HTTPS page?
A: Try this:
String originalUrl = "/fxtest3/sub/foo2.aspx";
String modifiedUrl = "https://localhost" + Response.ApplyAppPathModifier(originalUrl);
Response.Redirect(modifiedUrl);
NOTE: Fully qualified URLs in the response.redirect, server.transfer, and FORM action
tags cannot be used with cookiless sessions. Here is an example of a fully qualified
URL: http://www.eggheadcafe.com/default.asp More info here:
Q: What isn't Session available in my event handler in global.asax?
A: It depends on which event you're handling. Session is available only after AcquireRequestState event.
Q: Does session state have a locking mechanism that serialize the access to state?
Session state implements a reader/writer locking mechanism:
- A page (or frame) that has session state write access (e.g. <%@ Page EnableSessionState="True" %>) will hold a writer lock on the session until the request finishes.
- A page (or frame) that has session state read access (e.g. <%@ Page EnableSessionState="ReadOnly" %>) will hold a reader lock on the session until the request finishes.
- Reader lock will block a writer lock; Reader lock will NOT block reader lock; Writer lock will block all reader and writer lock.
- That's why if two frames both have session state write access, one frame has to wait for the other to finish first.
BASIC
What is ASP.NET?
ASP.NET is a programming framework built on the common language runtime that can be used on a server to build powerful Web applications.
What is ASP.NET?
ASP.NET is a programming framework built on the common language runtime that can be used on a server to build powerful Web applications. ASP.NET offers several important advantages over previous Web development models:
* Enhanced Performance. ASP.NET is compiled common language runtime code running on the server. Unlike its interpreted predecessors, ASP.NET can take advantage of early binding, just-in-time compilation, native optimization, and caching services right out of the box. This amounts to dramatically better performance before you ever write a line of code.
* World-Class Tool Support. The ASP.NET framework is complemented by a rich toolbox and designer in the Visual Studio integrated development environment. WYSIWYG editing, drag-and-drop server controls, and automatic deployment are just a few of the features this powerful tool provides.
* Power and Flexibility. Because ASP.NET is based on the common language runtime, the power and flexibility of that entire platform is available to Web application developers. The .NET Framework class library, Messaging, and Data Access solutions are all seamlessly accessible from the Web. ASP.NET is also language-independent, so you can choose the language that best applies to your application or partition your application across many languages. Further, common language runtime interoperability guarantees that your existing investment in COM-based development is preserved when migrating to ASP.NET.
* Simplicity. ASP.NET makes it easy to perform common tasks, from simple form submission and client authentication to deployment and site configuration. For example, the ASP.NET page framework allows you to build user interfaces that cleanly separate application logic from presentation code and to handle events in a simple, Visual Basic - like forms processing model. Additionally, the common language runtime simplifies development, with managed code services such as automatic reference counting and garbage collection.
* Manageability. ASP.NET employs a text-based, hierarchical configuration system, which simplifies applying settings to your server environment and Web applications. Because configuration information is stored as plain text, new settings may be applied without the aid of local administration tools. This "zero local administration" philosophy extends to deploying ASP.NET Framework applications as well. An ASP.NET Framework application is deployed to a server simply by copying the necessary files to the server. No server restart is required, even to deploy or replace running compiled code.
* Scalability and Availability. ASP.NET has been designed with scalability in mind, with features specifically tailored to improve performance in clustered and multiprocessor environments. Further, processes are closely monitored and managed by the ASP.NET runtime, so that if one misbehaves (leaks, deadlocks), a new process can be created in its place, which helps keep your application constantly available to handle requests.
* Customizability and Extensibility. ASP.NET delivers a well-factored architecture that allows developers to "plug-in" their code at the appropriate level. In fact, it is possible to extend or replace any subcomponent of the ASP.NET runtime with your own custom-written component. Implementing custom authentication or state services has never been easier.
* Security. With built in Windows authentication and per-application configuration, you can be assured that your applications are secure.
Why does my ASP.NET file have multiple
This means that ASP.Net is not properly registered with IIS.
.Net framework provides an Administration utility that manages the installation and uninstallation of multiple versions of ASP.NET on a single machine. You can find the file in C:\WINNT\Microsoft.NET\Framework\v**\aspnet_regiis.exe
use the command: aspnet_regiis.exe -u ---> to uninstall current asp.net version.
use the command: aspnet_regiis.exe -i ---> to install current asp.net version.
For Windows Server 2003, you must use aspnet_regiis -i -enable
This is because of the "Web Service Extensions" feature in IIS 6
(if you install VS.NET or the framework without IIS installed, and then go back in and install IIS afterwards, you have to re-register so that ASP.NET 'hooks' into IIS properly."
How to find out what version of ASP.NET I am using on my machine?
VB.NET
Response.Write(System.Environment.Version.ToString() )
C#
Response.Write(System.Environment.Version.ToString() );
Is it possible to pass a querystring from an .asp page to aspx page?
Yes you can pass querystring from .asp to ASP.NET page .asp
<%response.redirect "webform1.aspx?id=11"%>
.aspx
VB.NET
Response.Write (Request("id").ToString ())
C#
Response.Write (Request["id"].ToString ());
What is a ViewState?
In classic ASP, when a form is submitted the form values are cleared. In some cases the form is submitted with huge information. In such cases if the server comes back with error, one has to re-enter correct information in the form. But submitting clears up all form values. This happens as the site does not maintain any state (ViewState).
In ASP .NET, when the form is submitted the form reappears in the browser with all form values. This is because ASP .NET maintains your ViewState. ViewState is a state management technique built in ASP.NET. Its purpose is to keep the state of controls during subsequent postbacks by the same user. The ViewState indicates the status of the page when submitted to the server. The status is defined through a hidden field placed on each page with a runat="server" control.
If you want to NOT maintain the ViewState, include the directive <%@ Page EnableViewState="false"%> at the top of an .aspx page If you do not want to maintain Viewstate for any control add the attribute EnableViewState="false" to any control.
Where can I get the details on Migration of existing projects using various technologies to ASP.NET?
Microsoft has designed Migration Assistants to help us convert existing pages and applications to ASP.NET. It does not make the conversion process completely automatic, but it will speed up project by automating some of the steps required for migration.
Below are the Code Migration Assistants
* ASP to ASP.NET Migration Assistant
* PHP to ASP.NET Migration Assistant
* JSP to ASP.NET Migration Assistant
What is the equivalent of date() and time() in ASP.NET?
VB.NET
System.DateTime.Now.ToShortDateString()
System.DateTime.Now.ToShortTimeString()
C#
System.DateTime.Now.ToShortDateString();
System.DateTime.Now.ToShortTimeString();
How to prevent a button from validating it's form?
Set the CauseValidation property of the button control to False
How to get the IP address of the host accessing my site?
VB.NET
Response.Write (Request.UserHostAddress.ToString ())
C#
Response.Write (Request.UserHostAddress.ToString ());
How to access the Parameters passed in via the URL?
Call the Request.QueryStringmethod passing in the key. The method will return the parameter value associated with that key. VB.NET
Request.QueryString("id")
C#
Request.QueryString["id"];
How to Set Focus to Web Form Controls By Using Client-Side Script?
How to catch the 404 error in my web application and provide more useful information?
In the global.asax Application_error Event write the following code
VB.NET
Dim ex As Exception = Server.GetLastError().GetBaseException()
If TypeOf ex Is System.IO.FileNotFoundException Then
'your code
'Response.Redirect("err404.aspx")
Else
'your code
End If
C#
Exception ex = Server.GetLastError().GetBaseException();
if (ex.GetType() == typeof(System.IO.FileNotFoundException))
{
//your code
Response.Redirect ("err404.aspx");
}
else
{
//your code
}
Is there a method similar to Response.Redirect that will send variables to the destination page other than using a query string or the post method?
Server.Transfer preserves the current page context, so that in the target page you can extract values and such. However, it can have side effects; because Server.Transfer doesnt' go through the browser, the browser doesn't update its history and if the user clicks Back, they go to the page previous to the source page.
Another way to pass values is to use something like a LinkButton. It posts back to the source page, where you can get the values you need, put them in Session, and then use Response.Redirect to transfer to the target page. (This does bounce off the browser.) In the target page you can read the Session values as required.
How to Compare time?
VB.NET
Dim t1 As String = DateTime.Parse("3:30 PM").ToString("t")
Dim t2 As String = DateTime.Now.ToString("t")
If DateTime.Compare(DateTime.Parse(t1), DateTime.Parse(t2)) < 0 Then
Response.Write(t1.ToString() & " is < than " & t2.ToString())
Else
Response.Write(t1.ToString() & " is > than " & t2.ToString())
End If
C#
string t1 = DateTime.Parse("3:30 PM").ToString("t");
string t2 = DateTime.Now.ToString("t");
if (DateTime.Compare(DateTime.Parse (t1), DateTime.Parse (t2)) < 0 )
{
Response.Write(t1.ToString() + " is < than " + t2.ToString());
}
else
{
Response.Write(t1.ToString() + " is > than " + t2.ToString());
}
What is the difference between src and Code-Behind?
Src attribute means you deploy the source code files and everything is compiled JIT (just-in-time) as needed. Many people prefer this since they don't have to manually worry about compiling and messing with dlls -- it just works. Of course, the source is now on the server, for anyone with access to the server -- but not just anyone on the web.
CodeBehind attribute doesn't really "do" anything, its just a helper for VS.NET to associate the code file with the aspx file. This is necessary since VS.NET automates the pre-compiling that is harder by hand, and therefore the Src attribute is also gone. Now there is only a dll to deploy, no source, so it is certainly better protected, although its always decompilable even then.
How to get URL without querystring?
VB.NET
Dim stringUri As String = "http://www.syncfusion.com/?id=1&auid=16"
Dim weburi As Uri = New Uri(stringUri)
Dim query As String = weburi.Query
Dim weburl As String = stringUri.Substring(0, stringUri.Length - query.Length)
Response.Write(weburl)
C#
string stringUri = "http://www.syncfusion.com/?id=1&auid=16";
Uri weburi = new Uri(stringUri);
string query = weburi.Query;
string weburl = stringUri.Substring(0, stringUri.Length - query.Length);
Response.Write (weburl);
What is the best way to output only time and not Date?
Use DateTime as follows VB.NET
Response.Write(DateTime.Now.ToString("hh:mm:ss"))
C#
Response.Write(DateTime.Now.ToString("hh:mm:ss"));
What is the difference between Absolute vs Relative URLs?
Absolute /Fully Qualified URLs:
* Contain all information necessary for the browser(or other client program) to locate the resource named in the URL
o This includes protocol moniker used( i.e http://, ftp://..etc..), Server's Domain name or IP address and the file path
o Absolute URL looks as http://localhost/syncfusion/page1.aspx
Relative URLs:
* Only provide information necessary to locate a resource relative to the current document(document relative) or current server or domain(root relative)
o Document relative URL - page1.aspx
o Root Relative URL - /syncfusion/Admin/pagelog.aspx
What is the difference between URL and URI?
A URL is the address of some resource on the Web, which means that normally you type the address into a browser and you get something back. There are other type of resources than Web pages, but that's the easiest conceptually. The browser goes out somewhere on the Internet and accesses something.
A URI is just a unique string that uniquely identifies something, commonly a namespace. Sometimes they look like a URL that you could type into the address bar of your Web browser, but it doesn't have to point to any physical resource on the Web. It is just a unique set of characters, that, in fact, don't even have to be unique.
URI is the more generic term, and a URL is a particular type of URI in that a URL has to uniquely identify some resource on the Web.
How to convert milliseconds into time?
VB.NET
dim ts as TimeSpan = TimeSpan.FromMilliseconds(10000)
Response.Write (ts.ToString () )
C#
TimeSpan ts = TimeSpan.FromMilliseconds(10000);
Response.Write (ts.ToString () );
How to validate that a string is a valid date?
VB.NET
Dim blnValid As Boolean = False
Try
DateTime.Parse(MyString)
blnValid = True
Catch
blnValid = False
End Try
C#
bool blnValid=false;
try
{
DateTime.Parse(MyString);
blnValid=true;
}
catch
{
blnValid=false;
}
What is the difference between Response.Redirect() and Server.Transfer().
Response.Redirect
* Transfers the page control to the other page, in other words it sends the request to the other page.
* Causes the client to navigate to the page you are redirecting to. In http terms it sends a 302 response to the client, and the client goes where it's told.
Server.Transfer
* Only transfers the execution to another page and during this you will see the URL of the old page since only execution is transferred to new page and not control.
* Occurs entirely on the server, no action is needed by the client
Sometimes for performance reasons, the server method is more desirable
What is the difference between Server.Transfer and Server.Execute?
* Server.Transfer is used to End the current weform and begin executing a new webform. This method works only when navigating to a Web Forms page (.aspx)
* Server.Execute is used to begin executing a new webform while still displaying the current web form. The contents of both forms are combined. This method works only when navigating to a webform page(.aspx)
How to format a Telephone number in the xxx-xxx-xxxx format?
VB.NET
Dim Telno As Double = Double.Parse(ds.Tables(0).Rows(0)("TelNo").ToString())
Response.Write(Telno.ToString("###-###-####"))
C#
double Telno= double.Parse(ds.Tables[0].Rows[0]["TelNo"].ToString());
Response.Write(Telno.ToString("###-###-####"));
How can we programmatically verify whether the UserName and Password is Correct?
The programmatic verification of username and password can be done by the below code by the Login1_Authenticate method
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
if((Login1.UserName=="User")&&(Login1.Password=="Password"))
{
Label1.Text="LogIn Successful";
}
else
{
Label1.Text="LogIn Failed - Try Again";
}
}
Development and Deployment Issues
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 ASP.NET on a single machine. You can find the file in C:\WINNT\Microsoft.NET\Framework\v**\aspnet_regiis.exe
use the command: aspnet_regiis.exe -u ---> to uninstall current asp.net version.
use the command: aspnet_regiis.exe -i ---> to install current asp.net version.
Where can we download IIS?
This is 1 of the most commonly asked question & since the release of Windows 2000, IIS is no longer available for download as it is part of the OS.
IIS 4 was the last version of IIS that was available for download. Since the advent of Windows 2000, IIS has been part of the OS & is NOT available for download.
OS Version - IIS Version
* Windows 2000 - IIS 5
* WindowsXP Pro - IIS 5.1
* Windows Server 2003 - IIS 6
How To Repair ASP.Net IIS Mapping After You Remove and Reinstall IIS?
To reassociate aspx file extensions with ASP.Net runtime, you'll have to run the utility aspnet_regiis.exe -i
Why do I get "HTTP 500" error (or "(DLL) initialization routine failed") in my browser?
This is because if you have the /3GB boot switch enabled, the ASP.NET worker process (Aspnet_wp.exe) does not start.
To create and set the "ASPNETENABLE3GB" environment variable as mentioned in the above article, right click MyComputer ->Properties->Advanced > Environment Variables > System variables > New.
Add the variable name in the top text box and the value in the lower textbox.
I have recently move my Web application from Windows 2k to Windows Server 2003. All works fine in Windows 2K but i am not able to view pages using Windows Server 2003?
You have to enable the ASP.NET in the Web Server Extensions list
From Start -> Settings -> Control Panel -> Administrative Tools -> double click IIS Manager.
Go to the Web Service Extensions tab, click Active Server Pages, then press the "Allow" button on the left.
Can I have VS.NET and the Visual Studio 6.0 installed on the same machine?
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.
How should I check whether IIS is installed or not?
To verify if IIS is installed, go to your 'Add or Remove Programs' utility in the Control panel and click on the 'Add/Remove Windows Components' in the side menu.
On XP Pro and below, you should see an item called "Internet Information Services (IIS)". If this is checked, IIS should be installed.
On Win2K3, you'll see "Application Server". If this is checked, select it and then click 'Details'. Another form should open which will contain "Internet Information Services (IIS)". If it is checked, IIS should be installed.
In Visual Studio .NET, how do I create a new ASP.NET application for an existing ASP.NET project?
First create an IIS application using the IIS MMC. Then in Visual Studio .NET, use the "New Project In Existing Folder" project template (at the end of the template list). It will first ask you for the project name (use the same one you created for the IIS application). Click OK button. Then enter in physical folder location.
Why do I get the error message "Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request."?
By default, ASP.NET runs its worker process (Aspnet_wp.exe) with a weak account (the local machine account, which is named ASPNET) to provide a more secure environment. On a domain controller or on a backup domain controller, all user accounts are domain accounts and are not local machine accounts. Therefore, Aspnet_wp.exe fails to start because it cannot find a local account named "localmachinename\ASPNET". To provide a valid user account on the domain controller, you must specify an explicit account in the section of the Machine.config file, or you must use the SYSTEM account.
In Visual Studio .NET, how do I create a new ASP.NET application which does not have a physical path under wwwroot?
You must first create an IIS application using the IIS MMC. Then in Visual Studio .NET, create a new ASP.NET application and give it the same name you used for the IIS application.
Why do I get the "Unable to find script library 'WebUIValidation.js'" error ?
When you install the .Net framework on your web server, it installs some script files (including the above) under the root folder (usually "C:\inetpub\wwwroot" if you do a default installation) . You can then find the above file at "C:\Inetpub\wwwroot\aspnet_client\system_web\1_1_4322", for example.
The above problem could happen if you reconfigured your web root directory to be a different one after you installed ASP.Net in your web server. If that is the case, then run 'aspnet_regiis -c' (utility is under %windir%\Microsoft.NET\Framework\v1.1.4322, for example) or copy over manually the above script files into a similar sub-directory below your current web root directory. Also, if you look at the error message in detail, you will notice where the file is supposed to be.
After installing .NET Framework SP1 the client side validations, or rather validator controls are not working?
The problem seems to be in the javascript file WebValidationUi.js in aspnet_client folder.The changes in that file prevent a page to be submitted. That could be the reason your javascript validations are not working. As a workaround, just copy the old WebValidateionUi.js over the new one.
How to Configure the ASP.NET Version to use for Each Application(developed using 1.0 or 1.1)?
To configure WebApp1 to use ASP.NET 1.0, follow these steps:
1. Click Start, and then click Run.
2. In the Open text box, type cmd, and then click OK.
3. At the command prompt, locate the following directory: WindowsDirectory\Microsoft.NET\Framework\v1.0.3705\
4. At the command prompt, type one of the following commands:
* To Install ASP.NET 1.0 recursively
aspnet_regiis -s W3SVC/1/ROOT/WebApp1
* To Install ASP.NET 1.0 non-recursively
aspnet_regiis -sn W3SVC/1/ROOT/WebApp1
To configure WebApp2 to use ASP.NET 1.1, follow these steps:
1. Click Start, and then click Run.
2. In the Open text box, type cmd, and then click OK.
3. At the command prompt, locate the following directory: WindowsDirectory\Microsoft.NET\Framework\v1.1.4322\
4. At the command prompt, type one of the following commands:
* To Install ASP.NET 1.1 recursively
aspnet_regiis -s W3SVC/1/ROOT/WebApp2
* To Install ASP.NET 1.1 non-recursively
aspnet_regiis -sn W3SVC/1/ROOT/WebApp2
How to Configure Different Versions of an ASP.NET Application Running on the Same Web Server?
Find the ASP.NET Version Used for the Application View the script map for an ASP.NET application to determine the version of ASP.NET that the application uses. To view the script map for an ASP.NET application, follow these steps:
1. Click Start, point to Programs, and then click Control Panel.
2. Double-click Administrative Tools, and then double-click Internet Information Services (IIS).
3. Expand local computer, expand Web Site, and then expand Default Web Site.
4. Locate the folder that contains the ASP.NET application.
5. Right-click the folder that contains the ASP.NET application, and then click Properties.
6. Click the Directory tab, and then click Configuration. The Application Configuration dialog box opens.
7. Click the Mappings tab, and then select an ASP.NET application extension, such as .asmx or .aspx. The Executable Path column of the dialog box lists the path to the ASP.NET ISAPI version that the application uses. By default, the ASP.NET ISAPI is installed in %WindowsDirectory%\Microsoft.NET\Framework\%versionNumber%. The version number in the path indicates the version number of the ASP.NET ISAPI that the application uses. The ASP.NET ISAPI version determines the version of the runtime that the application uses.
Use Aspnet_regiis.exe to Update the Script Map
To make it easier to reconfigure the script map for an ASP.NET application, each installation of the .NET Framework is associated with a version of the ASP.NET IIS Registration tool (Aspnet_regiis.exe). You can use this tool to remap an ASP.NET application to the ASP.NET ISAPI version associated with the tool.
Note Because Aspnet_regiis.exe is linked to a specific version of the .NET Framework, you must use the appropriate version of Aspnet_regiis.exe to reconfigure the script map for an ASP.NET application. Aspnet_regiis.exe only reconfigures the script map of an ASP.NET application to the ASP.NET ISAPI version associated with the tool
Configure ASP.NET 1.0 for the Application
When ASP.NET 1.1 is configured on the root Web site, follow these steps to configure ASP.NET 1.0 for an application:
1. Click Start, and then click Run. In the Open text box, type cmd, and then click OK.
2. At the command prompt, locate the following directory path:
%WindowsDirectory%\Microsoft.NET\Framework\v1.0.3705\
3. Type the following command to configure the ASP.NET 1.0 application in IIS:
aspnet_regiis -s w3svc/1/root/ApplicationName
To remove ASP.NET 1.0 from this application, repeat steps 1and 2, and then type the following command:
aspnet_regiis -k w3svc/1/root/ApplicationName
Configure ASP.NET 1.1 for the Application When ASP.NET 1.0 is configured on the root Web site, follow these steps to configure ASP.NET 1.1 to run an application:
1. Click Start, and then click Run. In the Open text box, type cmd, and then click OK.
2. At the command prompt, locate the following directory path:
%WindowsDirectory%\Microsoft.NET\Framework\v1.1.4322
3. If ASP.NET 1.1 is not already registered, type the following command to register it: aspnet_regiis -ir Note The -ir option registers ASP.NET 1.1 without updating the scripts in IIS.
4. Type the following to configure the ASP.NET 1.1 application in IIS:
aspnet_regiis -s w3svc/1/root/ApplicationName
To remove ASP.NET 1.1 from this application, repeat steps 1 and 2, and then type the following command:
aspnet_regiis -k w3svc/1/root/ApplicationName
Why do I get error message "Internet Explorer cannot download MyPage.aspx from MyWebSite.com ..."?
This happens for example, when you try to export data to excel from a datagrid.
The problem occurs if the server is using Secure Sockets Layer (SSL) and has added one or both of the following HTTP headers to the response message:
Pragma: no-cache
Cache-control: no-cache,max-age=0,must-revalidate
Why do I get error message "Unable to start debugging on the web server. The server does not support debugging of ASP.NET or ATL Server applications. ..."?
You would get this error if the application mappings for ASP.NET file name extensions (such as .aspx) are not configured correctly in Microsoft Internet Information Services (IIS).
To resolve this go to C:\Windows Directory\Microsoft.Net\Framework\Version and type aspnet_regiis -i to configure the required application mappings correctly
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 ASP.NET on a single machine. You can find the file in C:\WINNT\Microsoft.NET\Framework\v**\aspnet_regiis.exe
use the command: aspnet_regiis.exe -u ---> to uninstall current asp.net version.
use the command: aspnet_regiis.exe -i ---> to install current asp.net version.
Where can we download IIS?
This is 1 of the most commonly asked question & since the release of Windows 2000, IIS is no longer available for download as it is part of the OS.
IIS 4 was the last version of IIS that was available for download. Since the advent of Windows 2000, IIS has been part of the OS & is NOT available for download.
OS Version - IIS Version
* Windows 2000 - IIS 5
* WindowsXP Pro - IIS 5.1
* Windows Server 2003 - IIS 6
How To Repair ASP.Net IIS Mapping After You Remove and Reinstall IIS?
To reassociate aspx file extensions with ASP.Net runtime, you'll have to run the utility aspnet_regiis.exe -i
Why do I get "HTTP 500" error (or "(DLL) initialization routine failed") in my browser?
This is because if you have the /3GB boot switch enabled, the ASP.NET worker process (Aspnet_wp.exe) does not start.
To create and set the "ASPNETENABLE3GB" environment variable as mentioned in the above article, right click MyComputer ->Properties->Advanced > Environment Variables > System variables > New.
Add the variable name in the top text box and the value in the lower textbox.
I have recently move my Web application from Windows 2k to Windows Server 2003. All works fine in Windows 2K but i am not able to view pages using Windows Server 2003?
You have to enable the ASP.NET in the Web Server Extensions list
From Start -> Settings -> Control Panel -> Administrative Tools -> double click IIS Manager.
Go to the Web Service Extensions tab, click Active Server Pages, then press the "Allow" button on the left.
Can I have VS.NET and the Visual Studio 6.0 installed on the same machine?
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.
How should I check whether IIS is installed or not?
To verify if IIS is installed, go to your 'Add or Remove Programs' utility in the Control panel and click on the 'Add/Remove Windows Components' in the side menu.
On XP Pro and below, you should see an item called "Internet Information Services (IIS)". If this is checked, IIS should be installed.
On Win2K3, you'll see "Application Server". If this is checked, select it and then click 'Details'. Another form should open which will contain "Internet Information Services (IIS)". If it is checked, IIS should be installed.
In Visual Studio .NET, how do I create a new ASP.NET application for an existing ASP.NET project?
First create an IIS application using the IIS MMC. Then in Visual Studio .NET, use the "New Project In Existing Folder" project template (at the end of the template list). It will first ask you for the project name (use the same one you created for the IIS application). Click OK button. Then enter in physical folder location.
Why do I get the error message "Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request."?
By default, ASP.NET runs its worker process (Aspnet_wp.exe) with a weak account (the local machine account, which is named ASPNET) to provide a more secure environment. On a domain controller or on a backup domain controller, all user accounts are domain accounts and are not local machine accounts. Therefore, Aspnet_wp.exe fails to start because it cannot find a local account named "localmachinename\ASPNET". To provide a valid user account on the domain controller, you must specify an explicit account in the section of the Machine.config file, or you must use the SYSTEM account.
In Visual Studio .NET, how do I create a new ASP.NET application which does not have a physical path under wwwroot?
You must first create an IIS application using the IIS MMC. Then in Visual Studio .NET, create a new ASP.NET application and give it the same name you used for the IIS application.
Why do I get the "Unable to find script library 'WebUIValidation.js'" error ?
When you install the .Net framework on your web server, it installs some script files (including the above) under the root folder (usually "C:\inetpub\wwwroot" if you do a default installation) . You can then find the above file at "C:\Inetpub\wwwroot\aspnet_client\system_web\1_1_4322", for example.
The above problem could happen if you reconfigured your web root directory to be a different one after you installed ASP.Net in your web server. If that is the case, then run 'aspnet_regiis -c' (utility is under %windir%\Microsoft.NET\Framework\v1.1.4322, for example) or copy over manually the above script files into a similar sub-directory below your current web root directory. Also, if you look at the error message in detail, you will notice where the file is supposed to be.
After installing .NET Framework SP1 the client side validations, or rather validator controls are not working?
The problem seems to be in the javascript file WebValidationUi.js in aspnet_client folder.The changes in that file prevent a page to be submitted. That could be the reason your javascript validations are not working. As a workaround, just copy the old WebValidateionUi.js over the new one.
How to Configure the ASP.NET Version to use for Each Application(developed using 1.0 or 1.1)?
To configure WebApp1 to use ASP.NET 1.0, follow these steps:
1. Click Start, and then click Run.
2. In the Open text box, type cmd, and then click OK.
3. At the command prompt, locate the following directory: WindowsDirectory\Microsoft.NET\Framework\v1.0.3705\
4. At the command prompt, type one of the following commands:
* To Install ASP.NET 1.0 recursively
aspnet_regiis -s W3SVC/1/ROOT/WebApp1
* To Install ASP.NET 1.0 non-recursively
aspnet_regiis -sn W3SVC/1/ROOT/WebApp1
To configure WebApp2 to use ASP.NET 1.1, follow these steps:
1. Click Start, and then click Run.
2. In the Open text box, type cmd, and then click OK.
3. At the command prompt, locate the following directory: WindowsDirectory\Microsoft.NET\Framework\v1.1.4322\
4. At the command prompt, type one of the following commands:
* To Install ASP.NET 1.1 recursively
aspnet_regiis -s W3SVC/1/ROOT/WebApp2
* To Install ASP.NET 1.1 non-recursively
aspnet_regiis -sn W3SVC/1/ROOT/WebApp2
How to Configure Different Versions of an ASP.NET Application Running on the Same Web Server?
Find the ASP.NET Version Used for the Application View the script map for an ASP.NET application to determine the version of ASP.NET that the application uses. To view the script map for an ASP.NET application, follow these steps:
1. Click Start, point to Programs, and then click Control Panel.
2. Double-click Administrative Tools, and then double-click Internet Information Services (IIS).
3. Expand local computer, expand Web Site, and then expand Default Web Site.
4. Locate the folder that contains the ASP.NET application.
5. Right-click the folder that contains the ASP.NET application, and then click Properties.
6. Click the Directory tab, and then click Configuration. The Application Configuration dialog box opens.
7. Click the Mappings tab, and then select an ASP.NET application extension, such as .asmx or .aspx. The Executable Path column of the dialog box lists the path to the ASP.NET ISAPI version that the application uses. By default, the ASP.NET ISAPI is installed in %WindowsDirectory%\Microsoft.NET\Framework\%versionNumber%. The version number in the path indicates the version number of the ASP.NET ISAPI that the application uses. The ASP.NET ISAPI version determines the version of the runtime that the application uses.
Use Aspnet_regiis.exe to Update the Script Map
To make it easier to reconfigure the script map for an ASP.NET application, each installation of the .NET Framework is associated with a version of the ASP.NET IIS Registration tool (Aspnet_regiis.exe). You can use this tool to remap an ASP.NET application to the ASP.NET ISAPI version associated with the tool.
Note Because Aspnet_regiis.exe is linked to a specific version of the .NET Framework, you must use the appropriate version of Aspnet_regiis.exe to reconfigure the script map for an ASP.NET application. Aspnet_regiis.exe only reconfigures the script map of an ASP.NET application to the ASP.NET ISAPI version associated with the tool
Configure ASP.NET 1.0 for the Application
When ASP.NET 1.1 is configured on the root Web site, follow these steps to configure ASP.NET 1.0 for an application:
1. Click Start, and then click Run. In the Open text box, type cmd, and then click OK.
2. At the command prompt, locate the following directory path:
%WindowsDirectory%\Microsoft.NET\Framework\v1.0.3705\
3. Type the following command to configure the ASP.NET 1.0 application in IIS:
aspnet_regiis -s w3svc/1/root/ApplicationName
To remove ASP.NET 1.0 from this application, repeat steps 1and 2, and then type the following command:
aspnet_regiis -k w3svc/1/root/ApplicationName
Configure ASP.NET 1.1 for the Application When ASP.NET 1.0 is configured on the root Web site, follow these steps to configure ASP.NET 1.1 to run an application:
1. Click Start, and then click Run. In the Open text box, type cmd, and then click OK.
2. At the command prompt, locate the following directory path:
%WindowsDirectory%\Microsoft.NET\Framework\v1.1.4322
3. If ASP.NET 1.1 is not already registered, type the following command to register it: aspnet_regiis -ir Note The -ir option registers ASP.NET 1.1 without updating the scripts in IIS.
4. Type the following to configure the ASP.NET 1.1 application in IIS:
aspnet_regiis -s w3svc/1/root/ApplicationName
To remove ASP.NET 1.1 from this application, repeat steps 1 and 2, and then type the following command:
aspnet_regiis -k w3svc/1/root/ApplicationName
Why do I get error message "Internet Explorer cannot download MyPage.aspx from MyWebSite.com ..."?
This happens for example, when you try to export data to excel from a datagrid.
The problem occurs if the server is using Secure Sockets Layer (SSL) and has added one or both of the following HTTP headers to the response message:
Pragma: no-cache
Cache-control: no-cache,max-age=0,must-revalidate
Why do I get error message "Unable to start debugging on the web server. The server does not support debugging of ASP.NET or ATL Server applications. ..."?
You would get this error if the application mappings for ASP.NET file name extensions (such as .aspx) are not configured correctly in Microsoft Internet Information Services (IIS).
To resolve this go to C:\Windows Directory\Microsoft.Net\Framework\Version and type aspnet_regiis -i to configure the required application mappings correctly
Featured Dot Net Questions
Difference between Windows Service and Web Service
What is the difference between a Windows Service Application and a Web Service Application? Please don't hand in the definition from some text book... I'm looking for the functional difference.
Latest Answer: Web service is used to transfer the data over a network like internet using WSDL ( web service descriptive language) by using a protocol like SOAP(Simple Object Access Protocol) .Windows service is a long running program.windows ...
RE: Difference between Windows Service and Web Service
Points to consider:
1)Windows service is not a web based whereas the webservice is webbased
2)Windows service will start as windows will start whereas the webservice is located at remote location on the server,
3)Windows service can be seen in the windows administrative tools>>Services
4)Finally we can say that Windows services are used locally on the pc and the Web services are used on internet based web applications.
RE: Difference between Windows Service and Web Service
Basically a windows service will be created to handle the message from Message Queue..It will fulfil the functionalities like File System Watcher and other continious process in a windows Client/server.
Whereas the web service is used as a service for hadling the request from the different type of client. UI could be biult on any Language. Complete business logic, validation and Database operation would be available in web servie. So whenever a client access the web service via HTTP it will take the appropriate action.
RE: Difference between Windows Service and Web Service
Web service is used to transfer the data over a network like internet using WSDL ( web service descriptive language) by using a protocol like SOAP(Simple Object Access Protocol) .
Windows service is a long running program.
windows service run in the background of operating system .
They can be started manually or the programm can be set start automatically when the operating system starts.
They do not need any user intervention.
What are the limitations of XML serialization?
Latest Answer: XML serialization has some limitations. It converts public property values and fields, but does not encode type information. Also it does not encode private properties and fields, which requires binary serialization. Any class to be serialized to XML ...
Explain how the page is executed in ASP.NET ?
Latest Answer: An ASP.Net page consists of, at a minimum, a single .aspx file and can contain other files associated also with the page. The .aspx file is called the content file as it has the visual content of the page.When a browser requests a .aspx file from ...
What is Fixed statement in C#?
Latest Answer: The "fixed" statement prevents the garbage collector from relocating a movable variable.Eg:fixed ( int* p = &pt.x ){Â Â Â *p = 1; } ...
What is the difference between datagrid and gridview?
Latest Answer: Datagrid can be used in web also, the major differences are regarding the sorting, inserting which has been stated already.DataGrid can also be used in windows applications, but in earlier versions where datagrids were the only source i.e. ASP.NET 1.1, ...
Name the methods that are used to communicate with Web Services.
Latest Answer: Use the call object and call invoke() or invoke one way() ...
What is the difference between string class and stringbuilder class?
Latest Answer: String is immutable where as stringbuilder is mutable. That means: The value in a string can not be modified once it has been created. When you modify a string in your code, it actually creates a new string with the modified value and the string object ...
Difference between System.Reflection and System.Assembly?
Latest Answer: The System.Reflection namespace contains classes and interfaces that provide a managed view of loaded types, methods, and fields, with the ability to dynamically create and invoke types.System.Assembly contains the information about the assembly ...
What is a jitter and how many types of jitters are there?
Latest Answer: JIT is just in time complier.it categorized into three:1 Standard JIT : prefered in webApp-----on diamand2 Pre JIT : only one time------only use for window App3 Economic JIT : use in mobile App ...
What is delayed signing? How can we do a delayed signing for a dll which has to be shared?
Delay signing allows you to place a shared assembly in the GAC by signing the assembly with just the public key. This allows the assembly to be signed with the private key at a later stage, when the development process is complete and the component or assembly is ready to be deployed. This process enables developers to work with shared assemblies as if they were strongly named, and it secures the private key of the signature from being accessed at different stages of development
RE: What is delayed signing? How can we do a delayed s...
Delay signing is the process of adding strong name to the assembly at the later stage of development.
Signing an assembly means adding a strong name to the assembly.
As the strong name is added at the later stage due to security reasons it is called as delayed signing.
It is done by using the Namespace System.Reflection
This Namespace has got two attributes.
Assemblykeyfileattribute
AssemblyDelaySignAttribute
Tell me about ASP.Net Web Matrix?
This is a free ASP.NET development environment from Microsoft. As well as a GUI development environment, the download includes a simple web server that can be used instead of IIS to host ASP.NET apps. This opens up ASP.NET development to users of Windows XP Home Edition, which cannot run IIS.
What is Base Class Library?
base class library is collection of various classes from .net frame work, from which all base classes like System.object, System.collection, and Ado.net objects are derived.
all .net compatible languages use this library to build an application.
BaseClassLibrary + CLR results in .Net frame work.
Basic objects of Dot net environment?2. If you perform arithmatic operation on null value a. 0b.
1. Basic objects of Dot net environment?2. If you perform arithmatic operation on null value a. 0b. nullc. can't be determinedd. compilation error3. In c# keyword .net map to which .net data type.a. System.Int16b. System.Int32c. System.Int64d. System.Int1284. In sql-server give example for binary data type and non-binary data type5. page init, page load, page pre render, page unload - is this order correct otherwise give correct order.6. To redirect the page- should not round trip the page7.Expansion
Is .Net Platform independent ?
As you all know that in .net there are different compilers like for c#-csc,vb-vbc etc after your code is complied it will convert to MSIL code which is independent this MSIL code will goes to CLR & this CLR is platform dependent i.e for unix platform you should have unix type of CLR ,for windows like the same so we can say that .net code is platform independent.
Is .Net Platform independent ?
.NET is not platform independent .. to run .NET applications one needs to install .NET Framework .. and currently .NET Framework is supported by windows only .. till .NET Framework is not released for other OS officially .. till then .NET cannot be considered to be platform independent ..
There are certain 3rd party tools such as MONO to run ASP.NET on linux .. but that doesn't make .NET Platform independent.
What is the difference between a Windows Service Application and a Web Service Application? Please don't hand in the definition from some text book... I'm looking for the functional difference.
Latest Answer: Web service is used to transfer the data over a network like internet using WSDL ( web service descriptive language) by using a protocol like SOAP(Simple Object Access Protocol) .Windows service is a long running program.windows ...
RE: Difference between Windows Service and Web Service
Points to consider:
1)Windows service is not a web based whereas the webservice is webbased
2)Windows service will start as windows will start whereas the webservice is located at remote location on the server,
3)Windows service can be seen in the windows administrative tools>>Services
4)Finally we can say that Windows services are used locally on the pc and the Web services are used on internet based web applications.
RE: Difference between Windows Service and Web Service
Basically a windows service will be created to handle the message from Message Queue..It will fulfil the functionalities like File System Watcher and other continious process in a windows Client/server.
Whereas the web service is used as a service for hadling the request from the different type of client. UI could be biult on any Language. Complete business logic, validation and Database operation would be available in web servie. So whenever a client access the web service via HTTP it will take the appropriate action.
RE: Difference between Windows Service and Web Service
Web service is used to transfer the data over a network like internet using WSDL ( web service descriptive language) by using a protocol like SOAP(Simple Object Access Protocol) .
Windows service is a long running program.
windows service run in the background of operating system .
They can be started manually or the programm can be set start automatically when the operating system starts.
They do not need any user intervention.
What are the limitations of XML serialization?
Latest Answer: XML serialization has some limitations. It converts public property values and fields, but does not encode type information. Also it does not encode private properties and fields, which requires binary serialization. Any class to be serialized to XML ...
Explain how the page is executed in ASP.NET ?
Latest Answer: An ASP.Net page consists of, at a minimum, a single .aspx file and can contain other files associated also with the page. The .aspx file is called the content file as it has the visual content of the page.When a browser requests a .aspx file from ...
What is Fixed statement in C#?
Latest Answer: The "fixed" statement prevents the garbage collector from relocating a movable variable.Eg:fixed ( int* p = &pt.x ){Â Â Â *p = 1; } ...
What is the difference between datagrid and gridview?
Latest Answer: Datagrid can be used in web also, the major differences are regarding the sorting, inserting which has been stated already.DataGrid can also be used in windows applications, but in earlier versions where datagrids were the only source i.e. ASP.NET 1.1, ...
Name the methods that are used to communicate with Web Services.
Latest Answer: Use the call object and call invoke() or invoke one way() ...
What is the difference between string class and stringbuilder class?
Latest Answer: String is immutable where as stringbuilder is mutable. That means: The value in a string can not be modified once it has been created. When you modify a string in your code, it actually creates a new string with the modified value and the string object ...
Difference between System.Reflection and System.Assembly?
Latest Answer: The System.Reflection namespace contains classes and interfaces that provide a managed view of loaded types, methods, and fields, with the ability to dynamically create and invoke types.System.Assembly contains the information about the assembly ...
What is a jitter and how many types of jitters are there?
Latest Answer: JIT is just in time complier.it categorized into three:1 Standard JIT : prefered in webApp-----on diamand2 Pre JIT : only one time------only use for window App3 Economic JIT : use in mobile App ...
What is delayed signing? How can we do a delayed signing for a dll which has to be shared?
Delay signing allows you to place a shared assembly in the GAC by signing the assembly with just the public key. This allows the assembly to be signed with the private key at a later stage, when the development process is complete and the component or assembly is ready to be deployed. This process enables developers to work with shared assemblies as if they were strongly named, and it secures the private key of the signature from being accessed at different stages of development
RE: What is delayed signing? How can we do a delayed s...
Delay signing is the process of adding strong name to the assembly at the later stage of development.
Signing an assembly means adding a strong name to the assembly.
As the strong name is added at the later stage due to security reasons it is called as delayed signing.
It is done by using the Namespace System.Reflection
This Namespace has got two attributes.
Assemblykeyfileattribute
AssemblyDelaySignAttribute
Tell me about ASP.Net Web Matrix?
This is a free ASP.NET development environment from Microsoft. As well as a GUI development environment, the download includes a simple web server that can be used instead of IIS to host ASP.NET apps. This opens up ASP.NET development to users of Windows XP Home Edition, which cannot run IIS.
What is Base Class Library?
base class library is collection of various classes from .net frame work, from which all base classes like System.object, System.collection, and Ado.net objects are derived.
all .net compatible languages use this library to build an application.
BaseClassLibrary + CLR results in .Net frame work.
Basic objects of Dot net environment?2. If you perform arithmatic operation on null value a. 0b.
1. Basic objects of Dot net environment?2. If you perform arithmatic operation on null value a. 0b. nullc. can't be determinedd. compilation error3. In c# keyword .net map to which .net data type.a. System.Int16b. System.Int32c. System.Int64d. System.Int1284. In sql-server give example for binary data type and non-binary data type5. page init, page load, page pre render, page unload - is this order correct otherwise give correct order.6. To redirect the page- should not round trip the page7.Expansion
Is .Net Platform independent ?
As you all know that in .net there are different compilers like for c#-csc,vb-vbc etc after your code is complied it will convert to MSIL code which is independent this MSIL code will goes to CLR & this CLR is platform dependent i.e for unix platform you should have unix type of CLR ,for windows like the same so we can say that .net code is platform independent.
Is .Net Platform independent ?
.NET is not platform independent .. to run .NET applications one needs to install .NET Framework .. and currently .NET Framework is supported by windows only .. till .NET Framework is not released for other OS officially .. till then .NET cannot be considered to be platform independent ..
There are certain 3rd party tools such as MONO to run ASP.NET on linux .. but that doesn't make .NET Platform independent.
Subscribe to:
Posts (Atom)