Friday, July 10, 2015

How to solve Server Application Unavailable asp.net

 " Server Application Unavailable. "

To fix this create a new App Pool user  and get web site to use this new pool user instead of the default one.

this is a quick and easy thing to try, if you get this error.

I suspect it was caused by another developer deploying a web site to this same IIS server, also using the default App Pool user, but their app used a different version of ASP.Net.

How to use ConfigurationManager to load config from an arbitrary location

The code goes as follows .

//Path to your config file

System.Configuration.ConfigurationFileMap 
fileMap = new 
ConfigurationFileMap(strConfigPath); 




System.Configuration.Configuration configuration = System.Configuration.ConfigurationManager.OpenMappedMachineConfiguration(fileMap);


This  is the better solution which unit tests against a configuration file and want to parse a specific file . So try this out

Monday, July 6, 2015

What are cookies?


Cookies are small files that are created in system memory of the client or browser client (if temporary). It is used to address the state which I have already discussed in my article ViewState. We can store small pieces of information in a client system and use it when needed. The most interesting thing is that it works with the user clearly. It can easily be used everywhere in your web application. Cookies store information in plain text format.

 If a web application uses cookies, the server sends cookies and store client browser. The browser then returns the cookie to the server the next time the page is requested. The most common examples of using a cookie to be stored user information, user preferences, remember password option, etc. Cookies have many advantages and disadvantages. I will come to this later, but first, I'll take a look at how the cookies are started.

How to create a Paragraph using Html Generic Control in asp.net

The code is so simple.

You can have any element instead of "p".

HtmlGenericControl para = new HtmlGenericControl ( "p" );

Happy Coding

How to add application pool on iis 7 in Asp.NET 4

For do this follow the following instructions

1) open command window in your windows 7 environment

2) type the following command

cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\

3)Again type

aspnet_regiis.exe -ir

4)Close the DOS and re-open your start menu

5) right click Computer then select Manage

6)Expand Services and Applications

7)Select Internet Information Services

8)Then there have a new applet within the content window exclusively for IIS.

9)Expand out your computer and locate the Application Pools node, and select it. (You should now see ASP.NET v4.0 listed)

10)Expand out your Sites node and locate the site you want to modify (select it)

11)To the right you'll notice Basic Settings... just below the Edit Site text. Click this, and a new window should appear

12)Select the .NET 4 AppPool using the Select... button and click ok.

13)Restart the site

Thats all


How to retrieve the current page URL in asp.net

To do this using the coding window you can write the following code
Request.Url.AbsoluteUri
This will give you the absolute url of the current page you are in.
There is another method to to do this thing
if you need the  parts between http : // and .xxx ,you can use as follow
string url = Request.Url.Host;

Cheers!!!

Well come to all




I am Rajitha Anuradha. I am Asp.net wep developer.. I have years of experience in the field. SO my effort is to help you for overcome your asp.net problems..Lets go!!!