1

I am using below code in .js file using asp.net from page1.aspx page

Form1.action = "testpage.aspx"; Form1.submit();

When the form is submitted the IsPostBack is always True when it's redirected to "textpage.aspx"

Is there any things which i am missing here?

Ramachandra
  • 39
  • 1
  • 5
  • 1
    This seems like correct behaviour. You're submitting (posting) the form, so IsPostBack *should* be true. – rmorrin Mar 03 '15 at 09:28

1 Answers1

1

You are submitting a form. That's what postback exactly is.

Redirect would be e.g.:

window.location.href = 'testpage.aspx';

EDIT: It's not clear from your post whether the testpage.aspx is the same page as the one containing the submitted form. If you want to avoid postback then you'll have to build a querystring, attach it to the URL and perform a redirect. Then you can access the parameters using Request.Params.

Community
  • 1
  • 1
rocky
  • 7,506
  • 3
  • 33
  • 48
  • Thanks for your reply. The Problem using window.location.href is there are many hidden and form variable which i need in the next redirected page. Which i will not be getting if i use window.location.href. – Ramachandra Mar 03 '15 at 09:47