Tuesday, December 21, 2010

IIS 7 Send Erros to Browsers for Remote Request

ctricaud:

Thanks for theses informations but I have this problem: the 500 error message is shwon despite the fact I used all these parameters. This is the 500 error message and note the message which is set in the script error message tag.

The problem is not in IE since on another server I have the good messages.

Why does the 500 page is shown and not the message?

I had the same problems and the answer is here: http://forums.iis.net/t/1157908.aspx Quoted:
Leo Tang - MSFT:

Hi,

Please check the httpErrors setting(IIS Manager->Click your website->Click Error Pages->Click Edit feature Settings… on the Actions panel). If you are using a remote client, make sure the errorMode is set to “Detailed”. Otherwise, you can set the errorMode to “DetailedLocalOnly”.

Wednesday, June 16, 2010

Enable Network Trace

<system.diagnostics>
<sources>
<source name="System.Net" tracemode="includehex" maxdatasize="1024">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
<source name="System.Net.Sockets">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
<source name="System.Net.Cache">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
</sources>
<switches>
<add name="System.Net" value="Verbose"/>
<add name="System.Net.Sockets" value="Verbose"/>
<add name="System.Net.Cache" value="Verbose"/>
</switches>
<sharedListeners>
<add name="System.Net"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="network.log"
/>
</sharedListeners>
<trace autoflush="true"/>
</system.diagnostics>

Tuesday, May 11, 2010

Word Wrap for no space text in GridView

Solution that works for me in IE 8 & Mozilla 3.6+:

http://community.sgdotnet.org/blogs/chuawenching/archive/2007/03/22/ASP.NET-2.0-Autowrapping-in-GridView--_2D00_-Is-that-possible_3F00_.aspx

Thursday, March 18, 2010

Button that prevents multiple clicks


private void BuildClickOnceButton(WebControl ctl)
{
System.Text.StringBuilder sbValid = new System.Text.StringBuilder();
sbValid.Append("if (typeof(Page_ClientValidate) == 'function') { ");
sbValid.Append("if (Page_ClientValidate() == false) { return false; }} ");
sbValid.Append(ctl.ClientID + ".value = 'Please wait...';");
sbValid.Append(ctl.ClientID + ".disabled = true;");
//GetPostBackEventReference obtains a reference to a client-side script function that causes
//the server to post back to the page.
sbValid.Append(ClientScript.GetPostBackEventReference(ctl, ""));
sbValid.Append(";");
ctl.Attributes.Add("onclick", sbValid.ToString());
}