Groups | Blog | Home
all groups > asp.net building controls > january 2004 >

asp.net building controls : Server.Transfer in ASP.NET - weired problem


Nedu N
1/20/2004 11:43:59 AM
Hi All,

I am facing a typical problem in my .NET application with the pop-up script
messages. The thing is that its working fine when i run on my development
machine but not running in expected manner when i move it to Prod
environment. Please have a look at the following code snippet...

//Page name - Add.aspx

private void Page_Load(object sender, System.EventArgs e)

{

//Page load goes here --

}

private void Submit_Click(object sender, System.EventArgs e)

{


// PopUp1

if (row exists with the kay say 'ABC' in database)

{

Response.Write("<script> alert('ABCD already exists!!');</script>");

}

else

{

//code to add the row with 'ABCD' goes here

// PopUp2

Response.Write("<script> alert('ABCD added successfully!!');</script>");


//Redirected to the same page

Server.Transfer("Add.aspx");

}

}

---------

Here the problem is that when i run thei code on my dev server, while adding
the row with ABCD, it gets added succesfully and give the popup saying 'ABCD
added succesfully' and if i try to add the same row again then i get the
'ABCD already exists' message. But when i moved this dll to production box
and it is not giving me the same result. What happens while adding row with
ABCD(by clicking submit button) it adds the row and gives 'ABCD added
sucessfully' and followed by it gives 'ABCD already exists' message also. I
see that the Submit_Click procedure being triggered twice on prodution box.

The dev version in VSNET - 2003 and PORD one is higher version than this
one. Is there any poblem in Server.Transfer while redirecting to the same
page? But it works fine on Test machine. Unfortunately i am not able to
debug on the production box, since i have moved only the dll and the aspx
pages to production box.

Thanks


v-schang NO[at]SPAM online.microsoft.com
1/21/2004 6:25:33 AM
Hi Nedu,


Thank you for posting here. I'm currently reviewing the issue and find that
this is a duplicated one with another in the ASP.NET
queue. I've updated you in that thread. Please feel free to followup in
that one. Thanks.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



AddThis Social Bookmark Button