[Gambas-user] How to load a new page on gb.web by code

T Lee Davidson t.lee.davidson at gmail.com
Tue Sep 19 00:53:22 CEST 2023


On 9/18/23 17:03, Mayost Sharon wrote:
> Hello
> 
> Further to the discussion:
> https://lists.gambas-basic.org/pipermail/user/2023-September/080147.html
> 
> 
> I have another new question
> 
> I am trying to load the page:
> Website1
> 
> When I put in:
> First name = G
> Surname = B
> 
> I want to load the single webpage1 page without the first page
> 
> But it loads me Webpage1 along with the first page
> 
> An example is attached
> 
> Thank you

Try putting the logic at the very top of Main.webpage (before any HTML) instead of in Main.class:
[code]
<%
   If Request.Post.Fields.Count > 0 Then
     gb_fname = Request.Post["fname"]
     gb_lname = Request.Post["lname"]
     gb_warning = True

     If UCase(gb_fname) = "G" And UCase(gb_lname) = "B" Then
         ' I want To load the single webpage1 page without the first page
         Response.Redirect("Webpage1.webpage")
         Quit
     Endif
   Endif
%>
[/code]

I can't verify that this actually works because the Debug Browser appears to be caching the response and won't always pick up 
code changes. I first tried redirecting to localhost:8080 which worked, but now the application won't redirect to any other 
location.


-- 
Lee



More information about the User mailing list