1. Select the site from IIS
2. Click "Error pages"
3. Select the error for which you want more details
4. Right click then "Edit feature settings"
5. Select detailed errors
Don't forget to reset after debugging.
Tuesday, November 9, 2010
IIS 7.0 / 7.5 : How to switch between the 32-bit versions and the 64-bit version of ASP.NET 2.0 on a 64-bit version of Windows
Basically, go into your IIS 7 manager console, find the application pool your app is running in, right-click on it, go to Advanced Settings, and change the Enable 32-bit Applications setting to true.
Now restart IIS.
Now restart IIS.
Tuesday, November 2, 2010
JQuery selector for checked CheckBoxes in a repeater
<div class="checkGroup">
<asp:Repeater ID="list" OnItemDataBound="OnPopulate" runat="server">
<ItemTemplate>
<asp:CheckBox ID="checkBox" runat="server" />
</ItemTemplate>
</asp:Repeater>
</div>
This will return all checked checkbox :
$(".checkGroup INPUT[type='checkbox']:checked")
<asp:Repeater ID="list" OnItemDataBound="OnPopulate" runat="server">
<ItemTemplate>
<asp:CheckBox ID="checkBox" runat="server" />
</ItemTemplate>
</asp:Repeater>
</div>
This will return all checked checkbox :
$(".checkGroup INPUT[type='checkbox']:checked")
Monday, July 5, 2010
Simulate Form Post with HttpRequest
string postData = "Email=test@email.be";
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
byte[] data = encoding.GetBytes(postData);
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create("http://www.posturl.com");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
System.IO.Stream newStream = request.GetRequestStream();
newStream.Write(data, 0, data.Length);
newStream.Close();
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
byte[] data = encoding.GetBytes(postData);
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create("http://www.posturl.com");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = data.Length;
System.IO.Stream newStream = request.GetRequestStream();
newStream.Write(data, 0, data.Length);
newStream.Close();
Tuesday, June 1, 2010
Solve conflict between JQuery and third party plugins
I recently had a problem with JQuery-UI (tabs) and JQuery Tools (scrollable) on a same page.
We can read on the web that this could be solved by generating a custom JQuery Tools script without tabs feature because the problem would be due to the fact that both script contains tabs feature. For me, that didn't solve the problem.
I solve my problem with the following method :
<html>
<head>
/* First include the third party script (example) */
<script type="text/javascript" src="js/jquery.tools.min.js"></script>
/* Then include JQuery and JQuery UI */
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.min.js"></script>
</head>
<body>
<script type="text/javascript">
$.noConflict();
jQuery(document).ready(function($)
{
// Code that uses jQuery's $ can follow here.
...
});
// Code that uses other library's $ can follow here.
$(function()
{
...
});
</script>
</body>
</_html>
We can read on the web that this could be solved by generating a custom JQuery Tools script without tabs feature because the problem would be due to the fact that both script contains tabs feature. For me, that didn't solve the problem.
I solve my problem with the following method :
<html>
<head>
/* First include the third party script (example) */
<script type="text/javascript" src="js/jquery.tools.min.js"></script>
/* Then include JQuery and JQuery UI */
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.min.js"></script>
</head>
<body>
<script type="text/javascript">
$.noConflict();
jQuery(document).ready(function($)
{
// Code that uses jQuery's $ can follow here.
...
});
// Code that uses other library's $ can follow here.
$(function()
{
...
});
</script>
</body>
</_html>
Monday, May 10, 2010
Fix the GroupName bug in FrameWork .NET with RadioButton in a repeater
Javascript method to add (From ASPX page)
function SetUniqueRadioButton(nameregex, current)
{
re = new RegExp(nameregex);
for(i = 0; i < document.forms[0].elements.length; i++)
{
elm = document.forms[0].elements[i]
if (elm.type == 'radio')
{
if (re.test(elm.name))
{
elm.checked = false;
}
}
}
current.checked = true;
}
Event to add to the RadioButton (from Code Behind)
coregValue.Attributes["onclick"] = "SetUniqueRadioButton('repeaterID.*GroupName', this);";
function SetUniqueRadioButton(nameregex, current)
{
re = new RegExp(nameregex);
for(i = 0; i < document.forms[0].elements.length; i++)
{
elm = document.forms[0].elements[i]
if (elm.type == 'radio')
{
if (re.test(elm.name))
{
elm.checked = false;
}
}
}
current.checked = true;
}
Event to add to the RadioButton (from Code Behind)
coregValue.Attributes["onclick"] = "SetUniqueRadioButton('repeaterID.*GroupName', this);";
Monday, May 3, 2010
Increase debugging time with IIS 7
When you are debugging, IIS will not service any other requests until you are done stepping through your code. That includes the "ping" request that IIS sends to itself. Since IIS doesn't hear back from itself, it decides to shut itself down, which promptly terminates your debugging.
The solution is to increase the Ping Maximum Response Time in the application pool settings from its default value of 90 seconds. Set it to something high enough that will give you enough time to debug your code (like maybe 300 seconds).
Microsoft has a long-winded write-up here, or you can just look at the pretty picture.
--
Edit: Others have suggested setting "Ping Enabled" to false. There are several reasons why I prefer to keep it in place, just with a larger interval, but the most important is that you will (most likely) have worker processing pinging enabled on production, and you should strive to develop and debug under a configuration that is as close to production as possible. If you do NOT have ping enabled on production, then by all means disable it locally as well.
The solution is to increase the Ping Maximum Response Time in the application pool settings from its default value of 90 seconds. Set it to something high enough that will give you enough time to debug your code (like maybe 300 seconds).
Microsoft has a long-winded write-up here, or you can just look at the pretty picture.
--
Edit: Others have suggested setting "Ping Enabled" to false. There are several reasons why I prefer to keep it in place, just with a larger interval, but the most important is that you will (most likely) have worker processing pinging enabled on production, and you should strive to develop and debug under a configuration that is as close to production as possible. If you do NOT have ping enabled on production, then by all means disable it locally as well.
Subscribe to:
Posts (Atom)