473,386 Members | 1,754 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,386 software developers and data experts.

Sessions or ViewState

I am looking for a way to be able to retain or continue with the results of a selection made from another drop down list.

The scenario...
I have at least two DropDownLists.

One(ddl1) feeds the other ddl2). The problem is that the first run goes fine but not thereafter.

Also, interestingly, I feed a textbox with the same result from ddl1 ad it gets updated each time I make a new selection in ddl1, but not ddl2. I realize this si a postback issue or something to do with ViewState.

I am looking to see how to implement a viewState variable, what to use in the ViewState definition, where to implement it and how to retrieve it. I am currently using only a code behind and not N-Layer. So I would imagine some place like the App_Code folder would be the place to start with. Your guidance is appreciated. ...Unchartered territory!!
Oct 4 '07 #1
3 1344
jhardman
3,406 Expert 2GB
If a textbox in the same form is getting the right data, but the dropdown box isn't, then I believe the question is one of syntax and you don't have to get into the App_code folder. What is the syntax of the code that works for the textbox and not for the select?

Jared
Oct 4 '07 #2
If a textbox in the same form is getting the right data, but the dropdown box isn't, then I believe the question is one of syntax and you don't have to get into the App_code folder. What is the syntax of the code that works for the textbox and not for the select?

Jared
One reason the textbox is responding is because the textbox, by default implements the IPostBackDataHandler interface which can handle postbacks. But other web controls don't implement this. I realize that this is the inherent problem with text box responding to such situations better than other more flexible controls. But I don't know how to get them to work with the IPostBackDataHandler, kowing this is a PostBack issue.
Oct 5 '07 #3
One reason the textbox is responding is because the textbox, by default implements the IPostBackDataHandler interface which can handle postbacks. But other web controls don't implement this. I realize that this is the inherent problem with text box responding to such situations better than other more flexible controls. But I don't know how to get them to work with the IPostBackDataHandler, kowing this is a PostBack issue.
Solved!

Two issues took care of it...
1. Deleted"If Not IsPostback"

2. Cleared the DDL before populating the next set from the "Parent" ddl selection.
Oct 6 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: John Kirksey | last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter...
8
by: Ben | last post by:
Hi there I am writing a C# application that is making multiple POST requests to an ASP.NET page. I would like to take advantage of ASP.NET sessions to store some data on the server side. Where do...
10
by: Anthony Williams | last post by:
Hi gang, This one looks like a bug :o( As you may or may not know, setting session management in web.config to use cookieless sessions causes the ASP.NET runtime to munge a session ID into...
3
by: Alexander Widera | last post by:
hi, i have the following problem in the following code: Basket basket = (Basket) Session; if (basket.isEmpty) { ........... }
10
by: newbie | last post by:
My application_end event in global.asax is not working as-is. In order to debug, I want to call it from another file, say debug.aspx through a button, e.g. "end application". How do I call...
6
by: hitendra15 | last post by:
Hi I have created web user control which has Repeater control and Linkbutton in ItemTemplate of repeater control, following is the code for this control On first load it runs fine but when...
13
Frinavale
by: Frinavale | last post by:
One of the most fundamental topics in web design is understanding how to pass information collected on one web page to another web page. There are many different ways you could do this: Cookies,...
1
by: hawks26 | last post by:
Hi, I'm new to Asp.net. can any one tell me what is viewstate and how to use this concept in program. plz give a demo example. Regards, Sam
4
by: tshad | last post by:
How do you deal with sessions on IE7? Each tab seems to share the same session? This is a real problem as a person could go to the site, leave the site open and open another page and be still...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.