0

I try to make postpackurl in code behind so that I can send the code but my issue is when I click the button its keep it in the same page .

my question is how I can make the postbackurl directly go to next page?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Ahmed Almahmeed
  • 97
  • 2
  • 15

3 Answers3

0

Use

response.redirect("frmdefault.aspx") 

in your button click code.

ProgramFOX
  • 6,131
  • 11
  • 45
  • 51
Indranil.Bharambe
  • 1,462
  • 3
  • 14
  • 25
  • this code is note useful i try it but not post the form content in other page i use button.postbackurl = "pagename.aspx" i use it with form that have text box and dropbox and i will post it in the page that accept only post method – Ahmed Almahmeed Nov 29 '13 at 19:17
0

Asp.net Button Has property named postbackurl which you can set postbackurl:

<asp:button id="Button2"
  text="Post value to another page" 
  postbackurl="Button.PostBackUrlPage2cs.aspx" 
  runat="Server">
</asp:button>
Seyed Morteza Mousavi
  • 6,855
  • 8
  • 43
  • 69
  • this code is note useful i try it but not post the form content in other page i use button.postbackurl = "pagename.aspx" i use it with form that have text box and dropbox and i will post it in the page that accept only post method – Ahmed Almahmeed Nov 29 '13 at 19:18
0

In the ASPX file add the below Script:-

<script type="text/javascript">
function SomeMethod() {
    window.location.reload("nextpage.aspx");
    return false;
 }
</script>

<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return SomeMethod();"/>

When the user clicks on the button1 the nextpage.aspx page will be executed and no postback will happen on the current page

user2526236
  • 1,538
  • 2
  • 15
  • 29
  • this code is note useful i try it but not post the form content in other page i use button.postbackurl = "pagename.aspx" i use it with form that have text box and dropbox and i will post it in the page that accept only post method – Ahmed Almahmeed Nov 29 '13 at 19:19