Click here to Skip to main content
15,921,646 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can you please tell me C# code to go next page :(( :(( :((


C#
private void btnnext_Click(object sender, EventArgs e)
        {

        }
Posted
Updated 17-Sep-10 20:07pm
v7
Comments
Sunasara Imdadhusen 17-Sep-10 8:20am    
Using Window or Web application?
aayu 17-Sep-10 8:26am    
window
#realJSOP 17-Sep-10 8:28am    
There's no way we can answer this question in its current configuration.
Smithers-Jones 18-Sep-10 8:55am    
"aare but y?" - It's not talk-like-a-pirate-day yet.

First of all i'm not stupid (Your question Title is crazy) :)

Answers

In Design,

Use Anchor Tag assign value to href property.

<a href="http://www.codeproject.com">Go to Codeproject</a>


In code behind,

Use Response.Redirect or Server.Transfer

Response.Redirect("home.aspx");
Server.Transfer("home.aspx");
 
Share this answer
 
v2
Hi Aarti,

You can not load page inside form in windows, but you can open form (page) from one form (page).

In MDI case:
C#
childForm = new frmReports();
                   childForm.MdiParent = this;
                   childForm.Show();
                   childForm.Focus();


Please do let me know, if you have any doubt.

Please provide Vote if this would be helpful to you.

Thanks,
Imdadhusen
 
Share this answer
 
Comments
aayu 17-Sep-10 8:36am    
nope
Hi Aarti,

I think this would be helpful.

C#
private void btnNext_Click(object sender, EventArgs e)
{
    //First hide the open form     
    this.Hide();
    //Now open the new form 
    System.Windows.Forms.Form frm = new SBSysHome();
    frm.Show();
}


Please do let me know, if you have any doubt.

Please provide Vote if this would be helpful to you.

Thanks,
Imdadhusen
 
Share this answer
 
C#
private void btnnext_Click(object sender, EventArgs e)
       {
           frmmeas f = new frmmeas();
           frmproduct f1 = new frmproduct();
           f.Hide();
           f1.Show();

       }



I Have worte in this format but i am not happy and the forms are not getting hide what i do?????????? :(( :(( :(( :((
 
Share this answer
 
Comments
Lantei 17-Sep-10 12:35pm    
Why are you creating the instance of the other form you are trying to hide inside btnnext_click, you're limiting its scope..also make your question clear..Nobody seems to get what you really want to do!
aayu 18-Sep-10 2:06am    
actually i want that if person click to the next button then first form should get close and second form should get open. the same thing we can do in VB but i want to do this in C# window application. I have even try Response.Redirect and Server.Transfer but its not happening don't know why?

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