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

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

ASP.NET 2.0 Causing IE8 To Reload Once Closed

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :ASP.Net


I am using asp.net 2.0 with Windows 7 and IE8.  I am also using the IIS on the same laptop as the server.  I create a web page and when I run it, it browses fine.   The problem is when I close the page either by clicking on the cancel button or the 'X' in the upper right hand corner, the page reloads.  I have to close it again.  This is very annoying!

However, when I run the debugger the page closes once and no reload happens.

Anyone know how to stop the page from reloading once I close it?  Any help would be appreciated.

Best regards,

Michael O'Brien

View Complete Post

More Related Resource Links

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

Patterns in Practice: The Open Closed Principle


Extending an existing codebase can be as productive and frustration-free as writing all new code when you employ the Open Closed Principle. We'll show you how.

Jeremy Miller

MSDN Magazine June 2008

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.

The underlying connection was closed: An unexpected error occurred on a send.


I am consuming a third party web service wsdl using my .net aps.net page. And I am getting following error message. Cannt get to resolve it. Its working on my machine but not in my development machine. I have installed the certificate also in certificates on that machine. Can somone please help.?

Error -->  The underlying connection was closed: An unexpected error occurred on a send.





Linq2Sql error: "Invalid attempt to call Read when reader is closed."


I've read up on this error from other posts and on other sites, but haven't found a solid resolution to the issue yet. My setup is as follows:

I have a RepositoryBase class that fields certain db calls that all repositories need to perform. In one such call, "GetSecurityGroup", it works most of the time, but will seemingly at random throw an exception with the error "Invalid attempt to call Read when reader is closed." All other Repository classes inherit from this one, and they all use the same DataContext object, which I understand isn't thread safe. Since there could be multiple calls to the DataContext object on the same page, perhaps one is using the DataContext when the next tries to do so. I'm not sure. What can I do to ensure this doesn't happen?

An existing connection was forcibly closed by the remote host


I get this message when I try to launch a report (.rdl) from Windows Sharepoint 2007.  I have followed the steps to integrate SQL 2005 SP2 with Sharepoint 2007.  I can launch the report by navigating to "http://server:880/reportserver/.."  I am using a shared datasource that I created within sharepoint.  Any help would be appreciated.

A connection that was expected to be kept alive was closed by the server.


When  i want to Call http://BDCRWSS/_vti_bin/BdcAdminService.svc Bdc AdminService in SharePoint Foundation  2010

the binding i use:

    <binding name="BasicHttpBinding_BusinessDataCatalogSharedService"
      closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00"
      sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false"
      hostNameComparisonMode="StrongWildcard" maxBufferSize="999999"
      maxBufferPoolSize="9999999" maxReceivedMessageSize="999999"
      messageEncoding="Mtom" textEncoding="utf-8" transferMode="Buffered"
     <readerQuotas maxDepth="99" maxStringContentLength="999999" maxArrayLength="999999"
       maxBytesPerRead="999999" maxNameTableCharCount="999999" />
     <security mode="TransportCredentialOnly">
      <transport clientCredentialType="Ntlm" proxyCredentialType="None"
       <extendedProtectionPolicy policyEnforcement="Never" />
      <message clientCredentialType="Use

Refresh Parent on Pop Up Closed


This has probably been answered before but I was looking at some various posts but the needs I am trying to meet just don't see to work.

So here is the scenario:

User clicks the button and a javascript I have registered opens a pop up window and passes a query string

User then is presented with a gridview with a selection to make (the selection event is triggered again through javascript and mouseover event)

The data is updated in the table for the data being displayed in the parent which is all fine

When the page is done with this it closes and refreshes the parent


Now the problem:

All of this works fine up until the point that I close the window and after playing around with different snippets I have come across I just can't get the thing to refresh the parent properly because when I do the refresh I need to pass the current querystring as follows:

        Dim cScript As String
        cScript = "<script language='javascript'> opener.location.href = 'Workstations.aspx?ClientID=' & MyGUID & '&AddNew=' & 'False' & '&WksID=' & WksID'; </script>"
        Page.ClientScript.RegisterStartupScript(Me.GetType(), "parentwindow", cScript)

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: <

There is already an open DataReader associated with this Command which must be closed first.


when i insert record

There is already an open DataReader associated with this Command which must be closed first.

help me.

SqlConnection conn = new SqlConnection(@"Data Source=Localhost\SQLEXPRESS;Initial Catalog=StudentDetails;Integrated Security=True");

SqlCommand cmd2 = new SqlCommand();
SqlCommand cmd1 = new SqlCommand();

if (conn.State == ConnectionState.Closed)

cmd2 = new SqlCommand("Select * from UserInfo where Standard", conn);
            SqlDataReader dr1 = cmd2.ExecuteReader();
            string stu, par,std,sec,roll;
            par = "";
            stu = "";
            std = "";

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

How to get a non-closed tag with regular expressions

Use regular expression to filter following html fragment:<html><img href="***"><b><img href="***" /></html>Expected match result:<img href="***"><b>How to write the pattern? thanks in advance!

Is it possible to response SMS automatically in ASP.net when website or web application is closed?

Dear friends, In my problem statement user sends a SMS to GSM Server by mobile phone and the website or web application will return an answer even they be not opened. Is it possible to response SMS automatically in ASP.net when website or web application is closed? Thanks for your help Mahyar
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