Simple navigation problem

  • Thread starter Thread starter Ross Carter
  • Start date Start date
R

Ross Carter

I have the following code that was created automatically by dropping a
button onto a web form and setting the action property of the form

The form is called WebForm2.aspx

<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server" action="WebForm1.aspx">
<asp:Button id="submit" style="Z-INDEX: 101; LEFT: 296px; POSITION:
absolute; TOP: 104px" runat="server"
Text="Button"></asp:Button>
</form>
</body>

When I click the button the page navigates to itself(Webform2.aspx) whereas
I would expect webform1.aspx to be displayed.

I am new to this stuff but I believe that this worked in simple asp

Can anybody help please

Thanks in advance

Ross
 
Hi,

Put a onClick event on the button and write a subroutine for that event on the same page only.
Like

<Script Language="VB" runat="server">
Sub Submit_Click(sender As Object, e As System.EventArgs)
.......Do anything here
End Sub
</script>
<html>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server" action="WebForm1.aspx">
<asp:Button id="submit" style="Z-INDEX: 101; LEFT: 296px; POSITION:absolute; TOP: 104px" runat="server" Text="Button" onClick="Submit_Click"></asp:Button>
</form>
</body>

Hope this helps...

Regards,
Bhaskardeep Khaund
 
Thanks

The effect of my problem is that I cannot send a form to the next aspx page.

How can I send form data without using "?" parameters which show in the title bar

Ross
Hi,

Put a onClick event on the button and write a subroutine for that event on the same page only.
Like

<Script Language="VB" runat="server">
Sub Submit_Click(sender As Object, e As System.EventArgs)
.......Do anything here
End Sub
</script>
<html>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server" action="WebForm1.aspx">
<asp:Button id="submit" style="Z-INDEX: 101; LEFT: 296px; POSITION:absolute; TOP: 104px" runat="server" Text="Button" onClick="Submit_Click"></asp:Button>
</form>
</body>

Hope this helps...

Regards,
Bhaskardeep Khaund
 
I've worked it out

Server.Transfer("Confirm.aspx", True)







Hi,

Put a onClick event on the button and write a subroutine for that event on the same page only.
Like

<Script Language="VB" runat="server">
Sub Submit_Click(sender As Object, e As System.EventArgs)
.......Do anything here
End Sub
</script>
<html>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server" action="WebForm1.aspx">
<asp:Button id="submit" style="Z-INDEX: 101; LEFT: 296px; POSITION:absolute; TOP: 104px" runat="server" Text="Button" onClick="Submit_Click"></asp:Button>
</form>
</body>

Hope this helps...

Regards,
Bhaskardeep Khaund
 
Back
Top