Quick ASP.Net Button Question

Freetalk Master

New Member
Hi All,<BR><BR>I have just started ASp.Net and have a question that should be quite simple to solve.<BR><BR>I have a button (Button1) which when clicked goes to my index.aspx.vb page under the <BR><BR>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<BR> Response.Redirect("http://www.sky.com/news")<BR>End Sub<BR><BR>Which as you can see should (in my mind) re-route the browser to skynews website.<BR><BR>But it does not, it actually doesn't do anything. How would I go about doing something like this?<BR><BR>Thanks,<BR>Gavinthis helps cause I never tried .NET before but here goes nothing :)<BR><BR>----------------------------------------------------------------<BR><html><BR><script language="vb" runat="server"><BR><BR>Sub NewWebSite(Sender As Object, E As EventArgs)<BR> Response.Redirect "http://www.sky.com/news"<BR>End Sub<BR><BR></script><BR><body><BR><BR><form runat="server"><BR><BR>Press me <asp:button onclick="NewWebSite" text="Go to" runat="server"/><BR><BR></form><BR><BR></body><BR></html><BR>----------------------------------------------------------------<BR><BR><BR>Hope this helps!<BR>Sincerely<BR>Vlincedid you put runat=server in the form tag?<BR>and wouldnt it be easier just to use a normal hyperlink and not an asp: web control?
 
Back
Top