0

EDIT
We are finding a bit more out. Turns out that if you go to the site regularly it doesn't work, but if you manually type /default.aspx on the address bar the functionality works fine.

We are working at deploying a new site and are stuck at the first step on the site.
Essentially the user fills in 1 textbox and hits save which redirects them to the next page. This is the Project Name.

Locally in Dev everything works fine. We think the databases are exactly the same. However, on the production server when a user clicks the Save button the form just posts back and no new record is inserted and no redirect happens.

The code for the same is pretty straightforward and at this point we haven't even implemented error handling at all so if something went wrong we'd expect to see some sort of error.
The biggest point of confusion has to do with the fact that no new record is inserted in the database.

Can anyone think of reasons something like this would happen? I can tell you that between the Page Load and Save Button of this page (which are the only 2 pieces of code in place right now) there are absolutely no If statements, Switch statements, For loops, nothing at all. It is just a straight flow from the page to the database to the redirect.

The relevant code:

var progress_layer = new b_Progress();
var business_layer = new Projects();
var project = Project.CreateProject(0);
project.ProjectName = txtProjectName.Text;
project.Description = txtProjectDescription.Text;

int id = business_layer.AddProjectAndApplicationInfo(project); // THIS IS WHERE IT SHOULD SAVE
theSession.ProjectID = id;
var steps = progress_layer.GetStepsForProject(id);

progress_layer.CompleteStep(id, steps[0].Seq);

if (steps.Count() >= 2)
    Response.Redirect(steps[1].URL);
James P. Wright
  • 8,991
  • 23
  • 79
  • 142
  • You'll get a better answer if we don't have to guess what your code looks like. – John Saunders Aug 31 '11 at 03:04
  • Well, you could always start by doing a Response.Write(""); Before you call the business_layer to confirm that your page is actually receiving the post data. – kiddailey Aug 31 '11 at 03:19

2 Answers2

2

You'll need to go through a few troubleshooting steps because there are a lot of variables at play here (well, at least I don't have your source so there are many variables in my own mind).

I think you should take some time and download Fiddler2. Use it to watch the HTTP traffic on your dev environment and compare it with your prod environment.

Also make sure that your web.configs are reasonably similar. Be careful of cross domain problems and be careful about XSS (ASP.NET by default will knock back a postback if it thinks a value looks like XSS).

It'd be nice to have more info such as the code for that "next" button.

saille
  • 9,014
  • 5
  • 45
  • 57
Kias
  • 841
  • 9
  • 22
  • Definitely agree - way too many variables, and a web debugger like Fiddler2 will tell you exactly whats going on in the HTTP world, which will either point out the problem or at least narrow it down a lot. – saille Aug 31 '11 at 05:25
0

I just had this exact situation with a site I am developing. The culprit in my case was a incorrect URL rewrite, which was essentially wiping out any posted form data.

Can you post any code?

kiddailey
  • 3,302
  • 3
  • 22
  • 23