.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

URL Rewriter causing a "500 Internal Server Error"

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :ASP.Net

Hi All-

I've set up URL Rewriting per Scott Guthrie's guidance (Scott's blog -  Approach 3: Using an HTTP module to perform extension-less url rewriting with IIS7)  and I'm using Url Rewriter.

OK, so it was a piece of cake to setup and everything runs perfectly on the dev server (cassini).  I was all excited and put it on the production server and it immediately choked -  the site won't even load and instead gives a "500 internal server error" 

Production server is a shared hosting environment running IIS 7 in integrated mode , ASP.net 3.5  and SSL.

I have another HTTP module installed called Security Switch , which I disabled to remove it from the equation.  I don't think that affects anything since it was already running fine on the dev server and prod server, but I'm not 100% sure and wanted to throw it out there if that helps diagnose.

I've followed the setup instructions precisely, triple checked everything in web.config and I can't figure out what I'm doing wrong.  I'm guessing it must be getting stuck in the IIS 7 pipeline somewhere.  I've read through all the installation docume

View Complete Post

More Related Resource Links

URL Rewriter.net - not working



I have a website that uses Querystrings to determine what content to show on a page. I would like to be able rewrite these URL's to become Search Engine Friendly URLs. So for example I would like to change http://www.website.co.uk/Company/Company/Conference.aspx?WebPage=ImportantDates to http://www.website.co.uk/Company/Company/Conference.aspx/ImportantDates.

I have been reading the following article by Scott Gu - http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx - who suggested using a HTTPModule such as URL Rewriter.net (http://urlrewriter.net/).

So I have done this and added the URLRewriter.dll file in my bin directory and altered the web.config (following Scott Gu's approach #2). However my URL's are not changing and I don't know what I am doing wrong. I have added the following in the web.config to try and change the URL's.


    <rewrite url="~/UKAIS/ConferenceWebPage.aspx?WebPage=(.+)$" to="~/UKAIS/ConferenceWebPage.aspx/$1" />

However my webpage URL remains with the ?WebPage querystring.

I am really stuck and any help would be very much appreciated.



Data Points: Deny Table Access to the Entity Framework Without Causing a Mutiny


Julie Lerman shows database administrators how to limit access to databases from the Entity Framework by allowing it to work only with views and stored procedures instead of tables-without impacting application code or alienating developers.

Julie Lerman

MSDN Magazine August 2010

Page.FindControl Causing Null Reference Exception


Hi guys,

I developed a page in VWD 2008 and it works perfectly locally, but when I deployed it on the server every Page.FindControl() call is causing the NullReference Exception "Object reference not set to an instance of an object. " Can anyone help me out? Code is below


Mike Marshall

            For i As Integer = 1 To 10
                If (CType(Page.FindControl("last_" & i), TextBox).Text.Length > 0) Or (CType(Page.FindControl("first_" & i), TextBox).Text.Length > 0) Or (CType(Page.FindControl("dob_" & i), TextBox).Text.Length > 0) Then
                    Dim person_entry(7) As String
                    person_entry(0) = info_list.Count - 1
                    person_entry(1) = CType(Page.FindControl("last_" & i), TextBox).Text
                    person_entry(2) = CType(Page.FindControl("first_" & i), TextBox).Text
                    person_entry(3) = CType(Page.FindControl("dob_" & i), TextBox).Text
                    person_entry(4) = CType(Page.FindControl("appear_" & i), TextBox).Text
                    person_entry(5) = CType(Page.FindControl("mental_" & i), TextBox).Text
                    person_entry(6) = CType(Page.FindControl("behave_" & i), TextB

JQuery causing problems with CustomGrid



I have a Jquery QuickSearch in my aspx page which sorts the data in my GridView(Custom Grid).QuickSearch is working fine,but when i sort the columns in the Custom Grid, the Footer row  is coming next to the header row before the items rows in the Grid. I just want the Footer row not to involve in the sorting. can anyone help me.

Thanks in Advance.

RDL Rendering (500 Internal Server) Error at Sharepoint Integrated Reporting Service


I have a serious problem that cannot be solved by googling around the keywords below:
sharepoint, moss 2007, reporting service, ssrs 2008, rendering, internal server error, ....

The error is;

"An error occurred during client rendering. The remote server returned an error: (500) Internal Server Error. "

Everything is O.K.;

* When I render the report from the REPORTSERVER (http://localhost/ReportServer)
* When the reports are scheduled to be sent by the reporting service (planned via MOSS 2007) 

But if I open (render) the RDL file from the sharepoint REPORTS LIBRARY interface, all of the reports fail with that internal error message above. 

It is weird also that parametrized reports are displayed without errors although the parameters are queried from a sql dataset. But I got the error when rendering the report after I've chosen a parameter  and order "apply/report"...

Possible causes how I met that error may be;

After I have installed (then uninstalled) AJAX extensions
After I have re-configured IIS Web Service Extensions list items

Possible solution alternatives I've found;

I've found a solution on MSDN replying a similar issue with an ideal cause of the error but an evreka answer but no sol

SharePoint Calendar Error: The "ListViewWebPart" Web Part appears to be causing a problem. Index was

In one specific SharePoint calendar, on one specific week in that calendar when we select the "more items" link in the monthly view (or the expand all option) we get the following error:
The "ListViewWebPart" Web Part appears to be causing a problem. Index was outside the bounds of the array.

Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator.
Troubleshoot issues with Windows SharePoint Services.

If we select a different week the expand and collapse works fine in that calendar.

causing 500 server error :(


So, I'm just learning ASP.NET with C#, but this code just makes the page display a "500 - server error page"

the webpage is here: hereswhereyourewrong.net/aspnettest.aspx

the code is as follows:

<%@ Page Language="C#" AutoEventWireup="true" %>
<!-- This program throws up an Error 500: Server Error -->
<!-- I'm not sure why, it compiles just fine. -->
<!-- The last time it was because I had asp:TextBox fields not in a form -->
<!-- but here I just don't know -->
    <head runat="server" >
        <title>ASP.NET With C# Test</title>
        <script runat="server">
            protected void Page_Load(object sender, EventArgs e)
                timeText.Text = DateTime.Now.ToString("MM-dd-yyyy HH:mm:ss");

            public void updateTime(object sender, EventArgs e)
                timeText.Text = DateTime.Now.ToString("MM-dd-yyyy HH:mm:ss");
        <div style="text-align: center;">
            <form runat="server" ID="timerForm">
                <asp:ScriptManager ID=

$.ajax post from asp.net page and __viewstate causing call to fail



Now I know that I won't be sending viewstate and eventvalidation in my ajax calls and that I will only want to send the actual form fields for efficiency purposes but I will need to know the answer to this question, to inform the more junior members of the team and my manager, so if anyone has any answers they are most welcome.

I have a simple form as follows

<form id="form1" runat="server"> 
<p>Field1: <

How to disable textbox causing validation?

Hello I was running into a strange problem: If I left a textbox blank (in some instances) the textbox would not give up the focus (I could not even close the form).  I learnt later that this was because the text in the textbox was causing validation to fail.  I would have to type in some value (Satisfy validation) before i could close the form. This is problematic for me and I don't want the textbox to behave this way (I do not awnt front end validation).  I desire to have validation done ONLY on the back end.     I thought that I could solve this problem by changing the 'CausesValidation' property in the textbox to false.  This worked!  However it introduced a new problem.  The binding no longer worked on the Textbox.  That is, whatever value I typed in the textbox would not make it to the data set. What is the correct way in solving this problem???  I want validation to be shut off however I still (obviously) need to keep binding in tact...      

XBAP causing IE crash?

Our application is a C# XBAP.  Near as I can tell, the problem we are running into seems to be within IE rather than our code, so I tried looking for an appropriate IE forum, but the best I could find was "Internet Explorer Extension Development" and I got no response there, so trying here instead. Our application consists of a main IE instance (which contains the XBAP).  From the C# code in this XBAP, we obtain a reference to the IHtmlWindow2 object.  From that, we periodically call .open(...) to launch various other dialogs of interest to the user.  These dialogs typically contain a fair amount of Javascript as well. Our users began reporting random crashes, some with IE7, some with IE8.  I have been able to recreate a similar crash on my development system (Windows 7, IE8, Visual Studio 2010). Upon crashing, no information is sent to Event Viewer, and nothing is caught by our C# Exception handling either - IE simply exits.  I had to attach a native debugger (rather than managed) to get anything on this.  The debugger gave me the following error: Unhandled exception at 0x61755473 (mshtml.dll) in iexplore.exe: 0xC0000005: Access violation reading location 0xfeeefeee.   The error is apparently occuring in a native thread with the following callstack:      mshtml.dll!CRunPtrBase::SetRun()  + 0x3a b

.net 3.5 in conjunction with CRM 4.0 email router adding code to subject line of emails causing spam

We use CRM 4.0, which is using .net framework 3.5 SP 1.  Emails sent out of CRM go through and email router and the subject line of these emails is getting "=?us-ascii?Q? added to the beginning of the subject line and "?= added to the end of the subject line. This is causing a large amount of our emails getting spammed. I was told by the CRM support that this is an issue with .net 3.5 and won't be fixed until .net 4.0, which CRM won't support for another year.  Is there not a .net 3.5 patch that can address this?

Getting the exact page causing an error using Server.GetLastError

Using vb.net/asp.net 2005.in the global.asax page in the application error page I am getting the exception information as follows: Dim CurrentException As Exception = Server.GetLastError() Dim ErrorDetails As String = CurrentException.Message.ToString & "<br><br>" & CurrentException.ToString() To find out when there are any exceptions when users are using the system, then the ErrorDetails are being auto-emailed to members on the IT team to help in troubleshooting.The problem is this:  I want to find out what page is the user is on when the exception happens, sometimes the stacktrace does not list the aspx page.  Does anyone know how to get this information?thanksMC

Rewriter http module problem in IIS 7

I had this problem a few months ago however this time I cannot seem to fix it.The module uses redirection rules read from a database to redirect non-exisistant pages.  However I get resource cannot be found errors in IIS 7.IIRC the last time I simply set the application pool to classic and the redirecting worked.  I assumed doing this again would fix the problem. However it doesn't.  When I change the application pool for the site to  ASP.NET v4.0 Classic I get this error "Handler "PageHandlerFactory-ISAPI-4.0_32bit" has a bad module "IsapiModule" in its module list".The project has recently been upgraded to use v4 of the framework (it was v2 previously). What should I be looking at to try and solve this problem.

Today() Function including timezone causing issues in Analysis Services

I'm using Reporting Services 2008 R2 connecting to Analysis Services. I've used this same code without issues before (pre R2), just wondering whether it is an RS, AS, Server or some other issue entirely. I have a report with a datetime parameter @vdtmDate (I use this so the user has the date picker instead of a drop down list of dates) with default =DateAdd(DateInterval.Day, -1, Today()) Then in the MDX for the dataset, I use the following to build the filter. SET [Today] as STRTOSET('[Calendar].[Reporting Week].[Day].&[' + VBA.FORMAT(VBA.CDATE(@vdtmDate),'yyyyMMdd') + ']') The issue I'm having is when the report runs with the default parameters, the value passed to Analysis Services includes the timezone which causes the query to process for the previous day to that selected. When the user runs the report manually (ie just pressing the view report button straight after the initial report load) the date passes without the timezone and returns the correct information. Example, running the report today (3rd September), the default parameter passes the value (info from profiler)         <Parameter>           <Name>vdtmDate</Name>           <Value xsi:type="xsd:dateTime">2010-09-02T00:00:00+

Recent upgrade to .NET4 causing problem

with Win7 Pro version of Windows Mobile Device Center.  After the upgrade I now get a warning message that says "to run this application you must first install one of the following versions of the .NET framework: v4.0.30319 Contact your application publisher about obtaining the appropriate version of the .NET framework" After exhaustively searching the MS website I decided to try these forums to try to get help with this problem.  Could someone help me out with this issue and/or point me in the right direction? Thanks in advance.

ListSearchExtender causing double postback when alert() or confirm() is called within PageRequestMan

This is a weird one.   I'm trying to implement a confirmation dialog before an async postback.  The idea is to use the JavaScript confirm() function to allow the user to cancel the postback.  I'm implementing it this way because my page has a bunch of different controls that might trigger an async postback inside an UpdatePanel.  Some of these are Ajax Control Toolkit controls like the ComboBox.  Rather than trying to trap the DOM event that triggers postback for each of these controls, it's easier to write one function and attach it to the client side initializeRequest event of the PageRequestManager, calling set_Cancel(true) or abortPostBack() if the user does not confirm.  This function can also be a central place to undo any changes if the user does not confirm.The problem is that the act of popping up the confirm dialog causes the UpdatePanel to postback twice, but only when the triggering control is a DropDownList (with AutoPostBack enabled, of course) with a ListSearchExtender.  If I replace the confirm() with alert(), the same thing happens.  If I comment out the alert, the problem goes away.  Below is a stripped-down page to reproduce the issue.  (I tested with IE 8/FF 3.5, and also tried both the new ASP.NET Ajax Library Beta 0911 and the old AJAX Control Toolkit Version 3.0.30930.)<%@ Page Language

MVVM - race condition causing image to not display

Hi, We are using MVVM pattern at work for a window that fetches data from a web service and then displays the data. The data is displayed in tabs where each tab displays a title (string) and a chart (image). There are four tabs and whatever tab that is selected to be displayed first fails to display the image. The title gets displayed and this happens asyncrhonously so you will see no title and then when NotifyPropertyChanged fires you see the title but not the image. All the tabs that are not displayed by default work as expected and show the image. And you can change which tab is not displayed and the new tab that is displayed by default will also fail to show the image. Any help greatly appreciated. Code Getting Data The code as it is shown below works. However whenever I try and use the ThreadPool to GetNineMonthsOptionData the image for that tab doesn't display. Another interesting thing is that if I use the thread pool and then put a Thread.Sleep(2000) call right after it works. So there seems to be a race condition at work here. public void LoadOption(string symbol) { _symbol = symbol; // TODO: Team A - Change to use background thread for ninemonth data also and determine // if dispatching is necessary GetNineMonthsOptionData(); //ThreadPool.QueueUserWorkItem( // (o) => // { // GetNineMonthsOptionDa
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend