472,133 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,133 software developers and data experts.

response.redirect and master pages

I have the following code in a Master Page code behind as a link (ADA is a class I dim for this page):
Expand|Select|Wrap|Line Numbers
  1.   Protected Sub selectOrg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles selectOrg.Click
  2.     'navigation bar
  3.  
  4.     ADA.SmartRedirect("AnnaChooseContact.aspx?retain=true")
  5.   End Sub
In the ADA class which inherits from System.Web.UI.Page I have:
Expand|Select|Wrap|Line Numbers
  1.   Public Function SmartURL(ByVal Destination As String) As String
  2.     If (Destination.IndexOf("?") = -1) Then
  3.       Return Destination & "?InstanceId=" & InstanceId
  4.     Else
  5.       Return Destination & "&InstanceId=" & InstanceId
  6.     End If
  7.   End Function
  8.  
  9.   Public Sub SmartRedirect(ByVal Destination As String)
  10.     Response.Redirect(SmartURL(Destination))
  11.   End Sub
I still get a "Response is not available in this context." error when attempting to perform the Response.Redirect line.

Any ideas why? Does Master Pages have "issues" with this sort of thing?

Thanks!
James
Sep 20 '07 #1
0 2104

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Sam | last post: by
1 post views Thread by Paul Turley | last post: by
3 posts views Thread by Raterus | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.