Click here to Skip to main content
15,886,078 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i have a aspx page named as test1.aspx and in that page contains select Button . and that button has some process happing while clicking the click button. in the Test1.aspx page body unload i written some function. in the Body unload i am nativagating some other page(page name : Test2.aspx). How to call the Save Button Event before Transfering the Test2.aspx page

Here i written Code like this in java scripts

document.getElementById('select').click();
var URL = 'Test2.aspx'                        
parent.document.title = 'Test2';
parent.document.getElementById('iContent').src = URL;


Thanks
Dhana
Posted
Updated 20-Apr-11 19:55pm
v7

1 solution

If I understand your question well,

You can do it this way -

Have a single button, say 'Save'. Attach a click event to the button. On the server side, save the required information in this event and then navigate to the required page using Server.Transfer or Resposne.Redirect (if you need to navigate to another website).

The code will be something like this -
XML
<asp:Button ID="btnSave" runat="server" Text="Submit" OnClick="btnSubmit_Click" />

C#
protected void btnSave_Click(object sender, EventArgs e)
{
    //save data here
    Server.Transfer("Test2.aspx"); //or use Response.Redirect depending on your requirement.
}


Hope this helps!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900