469,331 Members | 1,912 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,331 developers. It's quick & easy.

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 2060

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
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
1 post views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.