Connecting Tech Pros Worldwide Forums | Help | Site Map

Help Needed for Going Back to Previous page

Newbie
 
Join Date: Oct 2008
Posts: 31
#1: Nov 20 '08
friends,
i have a problem in going back to previous page in my application.. since i want that to happen in the if else statement i cannot incorporate JS. please help me .. i am trying this for very long tym.. the reason s i am using dynamic textboxes in multiview,..and i wanna validate them b4 changing view.. here s piece of my code..please teme whr can i place code to go to prev step of the step in the page and what ll be the code..


Expand|Select|Wrap|Line Numbers
  1.  
  2.                                     For count = 0 To textbox1.text
  3.                                         wtsum += CDec(dynamictxtbox(count).Text)
  4.                                     Next
  5.                               If wtsum = 1 Then
  6.                                     do the calculations 
  7.                                   MultiView1.SetActiveView(View4)
  8.                                 else                          
  9.                                     MsgBox("error")
  10.  ' i want code which must goto previous step after user clicks on ok in msgbox
  11.                               end if
  12.  

please help me .. im struggling with this for few days to get a solution

kenobewan's Avatar
Moderator
 
Join Date: Dec 2006
Posts: 4,745
#2: Nov 20 '08

re: Help Needed for Going Back to Previous page


Actually you can use JS, try register client script.
Newbie
 
Join Date: Oct 2008
Posts: 31
#3: Nov 20 '08

re: Help Needed for Going Back to Previous page


Quote:

Originally Posted by kenobewan

Actually you can use JS, try register client script.

please help me out with this im kinda lost.. this s the last step in my application.. how to register client script. . and what will be the code and should i place it in button in the same place i marked or somewhr else.. i used

Expand|Select|Wrap|Line Numbers
  1. Button13.Attributes.Add("OnClick", "javascript:history.go(-1)") 
in the else part after the msgbox but its not going one step back.. pls teme what should i try..
Newbie
 
Join Date: Oct 2008
Posts: 31
#4: Nov 20 '08

re: Help Needed for Going Back to Previous page


thank u very much for ur reply.. i googled bot registering client script and got the solution.. m happy tat my application s completed n works well :) the code i used to go 1 step back in that page is

Expand|Select|Wrap|Line Numbers
  1. Page.RegisterStartupScript("goBack", "<script type=""text/javascript"" language=""javascript"">window.history.go(-1);</script>")
my 1st successful proj. thanks everybody 4helpin me for my questions
Reply