Category Archives: C# - Page 2

Accessing Server variable from your aspx[designer] page

If you want to access any server variable from you designer[*.aspx] page. Use Following steps to do so: Create a variable with public nature on your code[*.cs] page on designer page use to show /print the same on page or …

Read more »

Create Web Reference with dynamic nature from web config

When You add a web reference to your ASP.NET website, there is one key automatically gets added in app-settings section of your application’s web Config. To control it further[on production environment], You need to change value of this key only. …

Read more »

Calling a stored procedure from ASP.NET c# website/application

Hello All, To call a stored procedure you need to set CommandType property of SQLCommand to CommandType.StoredProcedure. Following is the sample code for the same:- Any ?’s, Please let me know. Thanks.

Creating SQL connection in ASP.NET C#

If you want to perform database operations from your ASP.NET website/application, Please use below code to connect and perform operations: Please share your queries…if any ?

remove Debug=True while deploying ASP.NET web application to server

Please make sure to remove Debug=True while deploying ASP.NET web application to server, It increases performance of application in a significant manner.

Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module…

This error comes due to one of following reasons: You haven’t installed ASP.NET services on your IIS server. You haven’t  registered your .NET Framework  on your IIS Server. Solution:  To solve the issue try to repair the .net framework 4[whatever …

Read more »

Cannot use a leading .. to exit above the top directory

This error means some where in code your are using path which is targeting above root directory. Example: if you used “../images/img.png” on any Page/form which is on root folder of your website. Solution: Do not use ../xxxxx.xxx  for  pages/Forms …

Read more »

Margin=auto not working in IE[internet explorer]

Today while I was working on designing one page, I faced an issue that margin=auto was not working on my page. FIxes are as following: [Solution]: Add Transitional DocType on the top of your webpage.  <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML …

Read more »

Debugging ASP.NET website from remote/client machine

Please opt following steps to debug An ASP.NET website from a remote/client instance. define/create your breakpoints on the code which you want to debug. go to tools>attachprocess. select process named as w3wp.exe [if there are more than one w3wp.exe processes, …

Read more »

Running web service test forms on remote web servers in ASP.net

ASP.NET’s default mode does not allow you to access web service test form from remote/Client machines. Loading your ASMX page from a remote machine will show the following text under the Test section: “The test form is only available for requests …

Read more »