473,473 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

dont know where this would fit

6 New Member
ok, i'm trying to get webform1 that has 10 pages to carry over the page index to webform2 so if someone one started on webform1 page 6 then went to webform2(detailview) click "cancel" to bring them back to webform1 page 6. if that makes any sense.

If u have not fig it out yet i am very very new to this. I am coding in C#.net.
any help would be godsend.
thanks
Jul 30 '07 #1
4 1004
Plater
7,872 Recognized Expert Expert
I would recomend using the Session object to keep track of the last page they were on. Then you can redirect back to it with you cancel button.
Jul 30 '07 #2
Duh
6 New Member
I would recomend using the Session object to keep track of the last page they were on. Then you can redirect back to it with you cancel button.
Thanks for the help, i pulled out a few books trying to figure out how to use a session object, but very very new to this, so could u look at the code i have so far and put me back on the right path. thanks.....

webform1
Expand|Select|Wrap|Line Numbers
  1. private void DataGrid1_PageIndexChanged(object source, system.Web.UI.WebControls.DataGridPageChangedEventArgs e)
  2. {
  3.      DataGrid1.CurrentPageIndex = e.NewPageIndex;
  4.     BindGrid(LoadData());
  5. }
  6.  
  7. private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e)
  8. {
  9.  
  10.   Session["PageNum"]= CurrentPageIndex;
  11. }
  12.  
webform2
Expand|Select|Wrap|Line Numbers
  1. private void cancelbtn_Click(object sender, System.EventArgs e)
  2. {
  3.       Response.Redirect("CaDisplay.aspx");
  4. }
Aug 7 '07 #3
Plater
7,872 Recognized Expert Expert
You want to keep track of the "page" that your dataview thing is on right?

These are what I use, you should be able to modify them as you need.
(gvCompletedSites is a DataGridView, but the paging should be the same for whatever object you're using)

Bind a function like this to the pageIndexChanging event
Expand|Select|Wrap|Line Numbers
  1. protected void gvCompletedSites_PageIndexChanging(object sender, GridViewPageEventArgs e)
  2.     {
  3.         gvCompletedSites.PageIndex = e.NewPageIndex;
  4.         gvCompletedSites.DataBind();
  5.         Session.Add("gvC", e.NewPageIndex.ToString());
  6.  
  7.     }
  8.  
Put something like this Inside your page_load function
Expand|Select|Wrap|Line Numbers
  1. DataSet csites = null;
  2. csites = GlobalManagerController.GetCompletedSites(mid, persontype);
  3. gvCompletedSites.DataSource = csites;
  4. try
  5.         {
  6.             if (Session["gvC"] != null)
  7.             {
  8.                 gvCompletedSites.PageIndex = int.Parse((string)Session["gvC"]);
  9.             }
  10.         }
  11.         catch (Exception ee)
  12.         {//ignore?
  13.  
  14.         }
  15.  
Aug 7 '07 #4
Duh
6 New Member
Thanks it work perfectly
Aug 8 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Farooq Khan | last post by:
hi, my development team has been assigned a project that involves writing our own Web service. i happen to be a C++ programmer, new to C#/ASP.net. i dont know where to begin with......any...
2
by: Pavel Novotny | last post by:
H I'm trying to import a | seperated text from string variable which represents a tabl with several fields, eg 6124079|PRIRUBA 11 DN250 PN6;CSN131160.0;11369.1;CSN131005.50|KS|11,100000|3437,...
19
by: Wouter | last post by:
Hi, I try to make when i send a <form> that he dont open a new window. Is there someone who know how i can make this whit javascript ? Greets Wouter
24
by: Jazper | last post by:
hi i have this problem. i made a class deverted by CRootItem with implementation of IDisposable-Interface. i made a test-funktion to test my Dispose-Method.... but when set a breakpoint in my...
1
by: Merrua | last post by:
I dont understand how to do this I created a dialog based project and that is fine for most of my programming project, but one dialog box is going to generate a graph, and as far as i know from...
2
by: tasiekk | last post by:
I have 1 lil problem. I make simple Win Forms app and i put there a tab control. There i make two pages. In each page i make 1 button. In tabpage1 button1 and in tabpage2 button2. And i make access...
16
by: NewToCPP | last post by:
I have seen at several places that C++ programmers writing for RealTime Embedded applications dont use Exception Handling. They dont like Throw/catch concept. WHY? Thanks.
0
by: arunavlp | last post by:
hi, I am new to .net , i am using VB.Net (Web form). I dont know how to pass parameters to stored function. Regards, Arun.S
2
by: hojjatnikan | last post by:
please help me this code 62EH&5gx0wiqoQFw is this name ( Belux) but i dont know how convert it i dont know the algorithm of this code plead help me
2
by: Tiruak | last post by:
Hi there. Thanks in advance for the people reading and trying to help. I'm very begginer using flash and action script, and I tryed to do this one navigation menu. Since I dont have experience...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.