question

CoreyFleig-6304 avatar image
0 Votes"
CoreyFleig-6304 asked AlbertKallal-4360 commented

how to use codebehind instead of "Back" button

I have a one-page web app, with a submit button. When the button is clicked on, some parts of the page will change (header, grid information).
I'd like to write some code where an end user can click on a header (like the page title using <h1>) and it would act the same as the "back" button.

Is that possible?

dotnet-aspnet-webpages
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

CoreyFleig-6304 avatar image
0 Votes"
CoreyFleig-6304 answered AlbertKallal-4360 commented

I've attached an image that shows the code. I hope that helps you. I just couldn't get this box to accept regular text.
115148-code-image.jpg



code-image.jpg (110.2 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you kindly - yes it does give me some ideas. I wound up grabbing the referring URL on first page load (is postback = false) - saving that value in ViewState. And then the back button in code behind could simply navigate back based on that saved referring URL.

0 Votes 0 ·
CoreyFleig-6304 avatar image
0 Votes"
CoreyFleig-6304 answered CoreyFleig-6304 edited

Albert,

I'm trying to add my code, but I get an error message saying I don't have permissions!!!!

I've tried several times to add comments and code, but it just won't allow it. Maybe it's because the code snippet has double quotes? Or
something I'm unaware of?

I'll convert my answer into an image and attach it that way. I hope that works...

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

CoreyFleig-6304 avatar image
0 Votes"
CoreyFleig-6304 answered AlbertKallal-4360 commented

I found an answer - no need to answer. Sorry about this.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Well, you could share that one line of code with us! - Don't worry, but I was a wee bit curious as to how you did this!
(I need to do the same!).

Regards,
Albert D. Kallal (Access MVP 2003-2017)
Edmonton, Alberta Canada

0 Votes 0 ·