473,387 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Issues with navigating to previous page and keeping custom page properties available

Hi,

This might be a little odd but I need to implement a back/"return to
previous page" function from different pages within my asp.net
application. The page the back button on has a property that stores
an id value that the page i will be returning to will require to
display data. The entire application does not use querystrings, and
I don't want to use session variables to store this value.

The page also has controls that require validation (that a value
exists, numeric etc). If the back button is created and has
CausesValidation set to True, I obviously get validation errors.

If the back button has CausesValidation set to false, the property on
the page is automatically destroyed.

Is there a way to implement my back functionality without resorting to
querystring or session variables?

Cheers

Greg
Nov 19 '05 #1
3 1618
Have you tried the properties: CommandName and CommandArg on the button? For
example: CommandName="Back" and CommandArg= the ID. Then setup the OnCommand
event handler to intercept this click.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Greg Krzeszkowski" <gr***@infosecsolutions.com.au> wrote in message
news:eb**************************@posting.google.c om...
Hi,

This might be a little odd but I need to implement a back/"return to
previous page" function from different pages within my asp.net
application. The page the back button on has a property that stores
an id value that the page i will be returning to will require to
display data. The entire application does not use querystrings, and
I don't want to use session variables to store this value.

The page also has controls that require validation (that a value
exists, numeric etc). If the back button is created and has
CausesValidation set to True, I obviously get validation errors.

If the back button has CausesValidation set to false, the property on
the page is automatically destroyed.

Is there a way to implement my back functionality without resorting to
querystring or session variables?

Cheers

Greg

Nov 19 '05 #2
Hi Peter,

I've tried your suggestion - the validators still display, overriding
everything.

I did the following (just to confirm):

<asp:button id="btnBack" runat="server" CssClass="size60button"
Width="60px" Text="Back" CommandName="Back" CommandArgument="btnBack"
onCommand="CommandBtn_Click"></asp:button>
Sub CommandBtn_Click(ByVal sender As Object, ByVal e As
CommandEventArgs)
End Sub
Am I missing something?
"Peter Blum" <PL****@Blum.info> wrote in message news:<eF**************@TK2MSFTNGP15.phx.gbl>...
Have you tried the properties: CommandName and CommandArg on the button? For
example: CommandName="Back" and CommandArg= the ID. Then setup the OnCommand
event handler to intercept this click.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Greg Krzeszkowski" <gr***@infosecsolutions.com.au> wrote in message
news:eb**************************@posting.google.c om...
Hi,

This might be a little odd but I need to implement a back/"return to
previous page" function from different pages within my asp.net
application. The page the back button on has a property that stores
an id value that the page i will be returning to will require to
display data. The entire application does not use querystrings, and
I don't want to use session variables to store this value.

The page also has controls that require validation (that a value
exists, numeric etc). If the back button is created and has
CausesValidation set to True, I obviously get validation errors.

If the back button has CausesValidation set to false, the property on
the page is automatically destroyed.

Is there a way to implement my back functionality without resorting to
querystring or session variables?

Cheers

Greg

Nov 19 '05 #3
Greg, you omitted CausesValidation=false. You said you don't want to
validate.
Validation will not fire unless Page.Validate() is called. On buttons that
have CausesValidation=true, they internally call Page.Validate() just before
calling their Click event. Its actually called within their OnClick method.
All other times, you must call Page.Validate() yourself. So if its
validating, its due to the control having CausesValidation=true.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Greg Krzeszkowski" <gr***@infosecsolutions.com.au> wrote in message
news:eb**************************@posting.google.c om...
Hi Peter,

I've tried your suggestion - the validators still display, overriding
everything.

I did the following (just to confirm):

<asp:button id="btnBack" runat="server" CssClass="size60button"
Width="60px" Text="Back" CommandName="Back" CommandArgument="btnBack"
onCommand="CommandBtn_Click"></asp:button>
Sub CommandBtn_Click(ByVal sender As Object, ByVal e As
CommandEventArgs)
End Sub
Am I missing something?
"Peter Blum" <PL****@Blum.info> wrote in message
news:<eF**************@TK2MSFTNGP15.phx.gbl>...
Have you tried the properties: CommandName and CommandArg on the button?
For
example: CommandName="Back" and CommandArg= the ID. Then setup the
OnCommand
event handler to intercept this click.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Greg Krzeszkowski" <gr***@infosecsolutions.com.au> wrote in message
news:eb**************************@posting.google.c om...
> Hi,
>
> This might be a little odd but I need to implement a back/"return to
> previous page" function from different pages within my asp.net
> application. The page the back button on has a property that stores
> an id value that the page i will be returning to will require to
> display data. The entire application does not use querystrings, and
> I don't want to use session variables to store this value.
>
> The page also has controls that require validation (that a value
> exists, numeric etc). If the back button is created and has
> CausesValidation set to True, I obviously get validation errors.
>
> If the back button has CausesValidation set to false, the property on
> the page is automatically destroyed.
>
> Is there a way to implement my back functionality without resorting to
> querystring or session variables?
>
> Cheers
>
> Greg

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Earl Bonovich | last post by:
This is a repost from my question in the buildcontrol sub group. ---------------- I have created a composite custom control. It works fine, renders, all is good on that side. I am trying to...
1
by: MacDermott | last post by:
I created a report to print labels, and it created a custom page size for the report. When I opened the properties of the printer driver I could see it listed - as Custom. Then I had to change...
4
by: Raul M. Colon | last post by:
I have a web application and need to redirect to a another page. Is there any way to see the redirected page in a new page? (that's keeping the sending page visible) Thanks!!! Raul
1
by: Jason Zhou | last post by:
Hi, I have a question on how to get the previous url in custom error file. Here is what I am doing: If someone visit my website with a wrong file name or wrong directory name, IIS will...
10
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
1
by: JohnMOsborn | last post by:
I am designing an Access database that will use tab controls. Normally, you place different sets of fields on each page of the tab control – like Fields1-3 on Page 1, Fields 4-6 on Page 2, etc. In...
3
by: Richard | last post by:
I am new to XML so pardon my ignorance. I have an XML file that is used to layout an invoice from a program. The problem I am having is I need more data than the program puts out so is it possible...
3
by: =?Utf-8?B?TWFyYyBXb29sZnNvbg==?= | last post by:
Hi, I think this is a relatively simple problem, but it's starting to annoy me quite a bit. I have two issues with a custom Web Part that I have created, both related to property editing at run...
0
by: in10se | last post by:
I have a .NET 2.0 application that uses the WebBrowser control. Because all of my pages are generated dynamically, I am catching the Navigating event, cancelling it, and performing my own operations...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.