System.Threading.ThreadAbortException
Nogen som kender den ovennævnte exception ? Den får jeg hvis jeg prøver at tilgå min egen side med server.tranfsfer trigget af et button click. Har googlet lidt, men har endnu ikke fundet noget forståelig (for mig) forklaring på fenomænet.Hvordan kan jeg pege på den samme side uden denne exception ?
Jeg har lavet en lille testside med fejlen i :
aspx siden
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="Admin_test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Roster.mdb"
SelectCommand="SELECT [SlotID], [SlotStart] FROM [Slots]" ConflictDetection="CompareAllValues" DeleteCommand="DELETE FROM [Slots] WHERE [SlotID] = ? AND [SlotStart] = ?" InsertCommand="INSERT INTO [Slots] ([SlotID], [SlotStart]) VALUES (?, ?)" OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE [Slots] SET [SlotStart] = ? WHERE [SlotID] = ? AND [SlotStart] = ?">
<DeleteParameters>
<asp:Parameter Name="original_SlotID" Type="Int32" />
<asp:Parameter Name="original_SlotStart" Type="DateTime" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="SlotStart" Type="DateTime" />
<asp:Parameter Name="original_SlotID" Type="Int32" />
<asp:Parameter Name="original_SlotStart" Type="DateTime" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="SlotID" Type="Int32" />
<asp:Parameter Name="SlotStart" Type="DateTime" />
</InsertParameters>
</asp:AccessDataSource>
</div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="SlotID"
DataSourceID="AccessDataSource1">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="SlotID" HeaderText="SlotID" InsertVisible="False" ReadOnly="True"
SortExpression="SlotID" />
<asp:TemplateField HeaderText="SlotStart" SortExpression="SlotStart">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("SlotStart") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("SlotStart","{0:d}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</body>
</html>
aspx.vb siden :
Partial Class Admin_test
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
' Server.Transfer("~/Admin/test.aspx")
Response.Redirect("test.aspx")
End Sub
End Class
Jeg får følgende fejlmeddelelser nårr jeg klikker på Button1:
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code