I have the following as part of my aspx page:
<uc:ComposerDetails ID="cmpDetails" runat="server" />
<tr>
<td colspan="2">
<asp:Button ID="btnStoreComposer" runat="server" Text="Next Stage" />
</td>
</tr>
I then have the function:
Protected Sub btnStoreComposer_Click(ByV
al sender As Object, ByVal e As System.EventArgs) Handles btnStoreComposer.Click
Try
If Not cmpDetails Is Nothing Then
Session("ComposerUserContr
ol") = cmpDetails
End If
Response.Redirect("Registr
ationRecip
ient.aspx"
)
Catch ex As Exception
Dim audit As New DataAccess
audit.AuditError(ex.ToStri
ng)
End Try
End Sub
which gets called on the button click.
To fire the error i enter some html into one of the textboxes in the usercontrol.
When clicking the button i am getting the error:
A potentially dangerous Request.Form value was detected from the client (ctl00$ContentPlaceHolder1
$cmpDetail
s$txtEmail
="<br/>").
Description: Request Validation has detected a potentially dangerous client etc etc
which I would expect, but this isnt being caught in my try catch, why is this error not firing my try catch, instead it is displaying this error page?
Start Free Trial