If you are complex issue in PHP and you do not have debugger install or do not want to use debugger, there is an easy way to troubleshoot your code.
Place die(); function right at the point where you want to troublesheet/example values. The program will stop at that point and you see your values.
Example of Using Die
You have a query that is returning unsuspected result. There is no way you can debug the code directly or you can’t output the content because the page redirects. In this case use die();
$query = "select * from mytable where id='$id'";
The execution will stop at this point and you can examine your query.
My IIS was working perfectly on Windows 7 fine but I after I ran some manual command stopping http service, I began to get this error
Cannot start service W3SVC on computer
When I restared the PC, ISS started perfectly fine. The problem was gone. Note that logging the user outdid not fix the problem, restart was required.
This is connection string to your local database in visual studio
<add name="MySqlConnection" providerName="System.Data.SqlClient" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" />
Note that this .mdf file does not have a database inside. It is simply data inside the mdf file. Copy the above connection as it is in web.config file.
Visual Studio 2008 still rocks which comes bundled with Crystal Reports and Site Configuration if you really want to build an application with roles. Visual Studio 2015 is out and Visual Studio 2013 is commonly used every but both do not have Crystal Reports and they do not come with site configuration.
It is hard to find AjaxToolKit for Visual Studio 2008 so I will provide the links here and provide a quick tutorial so it goes smoothly for you.
- Download Ajax for Visual studio 2008 from Codeplex. This will download AjaxControlToolkit-Framework3.5
- Unzip it. I had to build this locally to create AjaxControlToolkit.DLL. You can download this DLL AjaxControlToolkitif it works for you. All you need is this DLL.
- Create a folder in the project “Ajax”, copy this DLL there
- Right click “Standar Toolbox” header and click “Add Tab”. Name this Ajax Controls.
- Right click on the new tab, click “Choose items” then Click browse button, and point to your local Ajax folder. Select the AjaxControlToolkit.DLL. Click OK. All controls should be added!
To test your code, create default.asp page and copy and past the following. This should popup the following Ajax Calender dialog.
<form id="form1" runat="server">
<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</cc1:ToolkitScriptManager><a href="http://hammadk.com/wp-content/uploads/2015/11/ajax-calender.png"><img src="http://hammadk.com/wp-content/uploads/2015/11/ajax-calender.png" alt="ajax calender" width="280" height="303" class="aligncenter size-full wp-image-3074" /></a>
<asp:Label ID="Label1" runat="server" Text="Date"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1">
Hope this tutorial helps someone.
I could not open database files that were crated in Visual Studio 2008 after I created roles in the application. The App_Data file does not expand as it should bee. There is no other option in menu available to review the data.
The solution is, go to “Server Explorer” TAB. If not not already seen, enable it from view menu. Click the Add database icon. The following dialog will popup. Select “the database file option”
In Solution explorer, right click on the App_Data folder and select open in Explorer. Copy the path and past it the previous step after you press ok and then browse button.
This should connect your local asp.net files in Visual Studio. Right click on the table and select “show table data”
CSS in your ASP.NET them nay not apply when you include your theme files if they are in the wrong location. Not that when you add App_theme folder, each skin must sit in their own folders. Do not create skin files direct in the them_folder. Create sub-folders and then create you skin, CSS files etc.
If you get this error in IIS, “Network Access Message: The website cannot be found”, the error could be misleading. The print print of the error says
Error Code 11004: Host not found
Background: This error indicates that the gateway could not find the IP address of the website you are trying to access, possibly due to lack of information in the DNS server.
Date: 11/17/2015 8:31:55 AM [GMT]
Source: DNS error
This problem could simply be because you are using proxy server and your site is not available because it does not exist on proxy server. To fix this issue in FireFox, go to options > Advance > Network > setting and include your site name (in my case test) in the “Do not use proxy for and you problem should go away!
This is a two step process.
- Download Ajax Toolkit
- Add Ajax Controls to Toolbox
Install ASP Ajax Toolkit
In Visual Studio 2013, go to tools > Library Package Manager > Package Manager Console and issue the following command in the white area
PM > Install-Package AjaxControlToolkit
Give it a minute or two, this will install AjaxControlToolKit into your current project.You should be able to see AjaxControlToolKit under reference in your project. I would advise to create a project rather than website so every thing is smooth.
Add Ajax Controls
At this point you have Ajax installed in your project but you do not see Ajax Controls in your toolbox. To fix that, right click on the Standard Toolbox and click Add. Give a name such as “Ajax Controls”. Right click on “Ajax Controls” and select choose items.
To find the path of the ajaxcontrols toolkit, click on reference and select AjaxControlToolkit, select properties. Note down the path and copy it. In the previous step, select browse and past this url. It will load all ajax controls. Make sure to select OK at the end.
Now all controls should appear in the “Ajax Controls” toolbox.
It is possible that not all controls are loaded in the ajaxtoolbox. In my case TabContainer was there but TabPanel was not there. TabPanel was actuall accessible in code and was working find but was not visible in the toolbox. To test your ajax, you can simply copy and past the following. Three TABS should show on the page.
Download Windows 7 Service Pack 1 directly from Microsoft. Here is the link
Once you click the red “Download button”, you will see a bunch of downlaod files with checkbox next to it. Select
windows6.1-KB976932-X64.exe (903.2 MB)
for Windows 7 64 bit and you should all set!
HP 1010 Printer is not install able in Windows 7 because it is old and is not supported any more. The drivers that may be there also do not work. Fortunately, you can install HP 1010 in Windows 7 without any drivers. Follow these steps.
1. Go to control Panel, Printers and then Add Printer
2. Select “Add Local”
3. In the port select Use “DOT4_001 (Generic IEEE xxxxx) click next
4. In this dialog, select HP and then scroll down to where you see “HP Laserjet 3055 PCL5”.
5. Click next and install the driver. Print out the test page.
You do not need to download any drivers for it. If you do not see this printer, click update drivers in Step 4 to update printers drivers from Windows.