Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 5th, 2007, 08:06 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default drop down problem

in my page there are two option in drop down list (Hard Coded), based on option selected in dropdown button related data displayed in gridview.

In gridview i have a hyperlink field for view details which redirected page to next page and in next page details are listed.

In my details page i have link "Back" which redirected to main page where drop down and all are listed. everything is working fine.
But
when i comeback to main page with clicking of back button always first option is selected in drop down. no matter whatever option was there in dropdown.

Now i want when user click on view details if drop down have first option then when again i come back first option should be there and if drop down have second option then when again i come back second option should be there.
please suggest.


thanks......
__________________
thanks......
 
Old December 6th, 2007, 02:06 AM
Authorized User
 
Join Date: Jan 2007
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aliirfan84
Default

Dear,

If u redirect from any of ur page to another, it loses all of its values and can't be retained. When u r clicking 'Back' button u r redirecting to ur homepage and it loads all of its contents as in initial page load.

Anyway, U can cope ur task by following to methods(1st one is most appropriate, easy and efficient).

1) Write function in .aspx file like below:

        <script language=javascript type="text/javascript">
        function GoBack()
        {
            window.history.back();
        }
       </script>

   On page load of new page add attribute of 'Back' button for onclick.

2) Other way is to pass DDL value as QueryString and retain back this value when back button is clicked.

Please do inform me if it is helpful.


Regards,
Ali Irfan
 
Old December 7th, 2007, 12:14 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

well your second option i can use to pass value in query string. i cannot use first as i donot want to retain value in case of back button. i think i write wrong in my post - Back mean i put a link button here and when user click on it, it redirects to previous page.
is now there are more options available.

thanks......





Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop-down problem in Ajax deeptisingh20 Ajax 6 July 27th, 2007 08:34 AM
Drop Down List problem tgnishant ASP.NET 2.0 Basics 1 March 12th, 2007 08:10 AM
problem in selecting the item from drop down list swati_joshi ASP.NET 1.0 and 1.1 Basics 1 March 27th, 2006 01:24 AM
Chapter 8 - Drop Down Box problem Juggernaught BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 2 March 14th, 2006 07:47 AM
Problem with Drop down list praveen_haridas ASP.NET 1.0 and 1.1 Basics 3 January 26th, 2006 05:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.