C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » ASP.NET/Web Applications »

Response.Redirect is not working?? Check out your form may be posted more than Once !!


Posted Date: 25 Jul 2004    Resource Type: Articles    Category: ASP.NET/Web Applications
Author: Phani KatakamMember Level: Bronze    
Rating: 1 out of 5Points: 5



introduction
I had encountered recently that Response.Redirect is not working on a button click.
I searched all the net articles.. which dint give me a clue. but luckily, I have found out the solution to my problem. Likes to share hope it may helps

Scenario>
I have a A.aspx page, one button 'Back', and another 'Save' buttons.
'Save' has some functionality, which is written in Server side event Save_Click(...)
Back should also have same functionality, but after the functionality done...it should go to B.aspx page. Both buttons are of submit kind of buttons.

First on client side, I have 'Save' functionality, for 'Back', I just set a hidden variable to maintain to set that its for back.. and simulated btnSave.click() on the javascript in Back_ClientClick() event.
On the server side, I check that hidden variable, if its from back, I wrote Response.Redirect('B.aspx' false).
PROBLEM: Response.Redirect was not going to B.aspx page..stays only at A.aspx.
OBSERVATIONThe back button after simulating save.click(), as it is a submit kind of button, it is posting again to the server..so we need to nullify double posting..(one by save.click and another back button usual submit behavior).. so in the Back_ClientClick() function after save.click() event, called return false, to nullify double submit.
GIST: If the Response.Redirect is not working, just check any button click is posting more than once..!!

Hope it helps...





Responses

Author: Vijay    03 Oct 2004Member Level: Bronze   Points : 0
Yes!! I am facing same problem. but I cannot understand what is the solution. Does this article says that if we use 2 forms in a page we will get this type of error ? But I am using only one form but I am facing this problem. I would be very thankfull if you give me clear solution.

Vijay


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: TabControl for ASP.Net
Previous Resource: Display Main Categories and Sub Categories
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET/Web Applications


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use