Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking 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 Basics 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
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 20th, 2007, 10:30 AM
Authorized User
 
Join Date: Mar 2007
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Pass QueryString to DDL then run refresh

Hi,

I have passed a Query String parameter from Page 1 DDL (dropdownlist) to Page 2 DDL, which I have done using the code below and calling it from the 'OnDataBound' property of the Page 2 DDL.

The problem is that a datalist control is dependant on the Page 2 DDL, which doesn't get populated until the user changes it again.

How can I force a page refresh / post based on the parameter provided in the Page 2 DDL?

(I do not wish to have the datalist based on the querysting, because I want the user to have further option to change the Page 2 DDL)

Any help is appreciated.


using System;

public partial class _Searchlocal : System.Web.UI.Page
{
string CountyIDFilterQS;

public void CountyIDGet (Object sender, EventArgs e) {
             {

CountyIDFilterQS = Page.Request.QueryString["CountyIDFilter"];
CountyIDSelection.SelectedIndex = CountyIDSelection.Items.IndexOf(CountyIDSelection. Items.FindByValue(CountyIDFilterQS));

}


  }


}
Kind Regards,

Lee
Reply With Quote
  #2 (permalink)  
Old March 20th, 2007, 10:34 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

If i understand you correctly just set the DDLs Autopostback property to true.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
Reply With Quote
  #3 (permalink)  
Old March 20th, 2007, 10:49 AM
Authorized User
 
Join Date: Mar 2007
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yeah I tried that but it didn't work.

Actually I've just found another cheat. On the 2nd DDL I will base the submit button to redirect back to the same page and change the QueryString. Then I can base the datalist on the querystrings after all.

If anyone has any other ideas I would appreciate a response.



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can selectedvalue of DDL make other DDL visibl hertendreef ASP.NET 2.0 Professional 4 May 20th, 2008 04:38 PM
Unable to pass Query to report at run time jdaulagar VB Databases Basics 0 November 14th, 2006 08:07 PM
How do I pass URL to querystring? Shawn Mohan .NET Web Services 0 June 28th, 2006 12:33 AM
how to pass a value in querystring lian_a Classic ASP Basics 1 July 9th, 2004 03:21 AM
How to pass plus (+) character in querystring marjorin Classic ASP Professional 4 October 31st, 2003 04:40 AM



All times are GMT -4. The time now is 05:15 AM.


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