Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fullsite redirect from mobile version

Status
Not open for further replies.

berkshirea

Technical User
Mar 22, 2009
97
GB
Hi Folks,

I have 2 aspx pages in VB. 1st page is the full version, the 2nd page is the mobile devices version...both are working fine. The only problem I've got is, I'd like to have a link to the full website from the mobile version, but then since I've got a redirect on the full version, it just goes straight back to the mobile version. I tried putting additional URL parameter on the link but doesn't seem to work.

Can you please give me some advice? Thanks
 
post some code on what you've tried. We do exactly that, send a querystring parameter and this way we don't redirect back to the mobile site.
 
Hi jbenson001,

Below is the code I'm working on. When I added the code in red color, it still redirects to the mobile version.

code on full_version.aspx
Code:
<script runat="server" language="VB">
    Public  Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    [COLOR=#EF2929] If Request.QueryString("fullversion") = "true" Then
	 Response.Redirect("full_version.aspx")
	 else[/color] if Request.Browser("IsMobileDevice") = "true" .... Then
	 Response.Redirect("mobile_version.aspx")
       End If
     End Sub	
</script>

link on the mobile_version.aspx going to the full version:
Code:
<a href="full_version.aspx?&fullversion=true">full version here</a>

Thanks for any advice.



 
Im sorry... I forgot to include the id.

Code:
<script runat="server" language="VB">
    Public  Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
     [COLOR=#EF2929]If Request.QueryString("fullversion") = "true" Then
	 Response.Redirect("full_version.aspx?id="&Request.QueryString("id")[COLOR=#FCE94F][/color])
	 else[/color] if Request.Browser("IsMobileDevice") = "true" .... Then
	 Response.Redirect("mobile_version.aspx?id="&Request.QueryString("id"))
       End If
     End Sub	
</script>


where id is dynamic
Code:
<a href="full_version.aspx?[COLOR=#EF2929]id=123[/color]&fullversion=true">full version here</a>
 
Have you tried debugging? Stop on the line that gets the querystring value and see what the value is, if any.
 
Yes, I tried to write on the page the value of the querystring and it says true.

I don't know why it's not redirecting to the full site.
 
no, don't use response.write, use the debugger and put your script in the code-behind. Don't mix code with HTML markup
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top