473,406 Members | 2,549 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,406 software developers and data experts.

dropdown - javascript - to server - postback

I created two dropdownlists, one of them is filled up through javascript
because i did not want to create to much datatransfer since the content of
that list depends on what is selected in the first dropdown...

By javascript I can retrieve the selected value and put it in a hidden
field, so that ASP.NET recognizes the value, but after clicking the submit,
the value is lost...

somebody knows what can be done about it...
Nov 19 '05 #1
2 970
You need tomake sure that the Hidden filed has a runat="server" attribute.
If you do this then I believe the value will not be lost . It should
maintain its value during postbacks assuming you have ViewState on.

"Boonaap" <Bo*****@discussions.microsoft.com> wrote in message
news:29**********************************@microsof t.com...
I created two dropdownlists, one of them is filled up through javascript
because i did not want to create to much datatransfer since the content of
that list depends on what is selected in the first dropdown...

By javascript I can retrieve the selected value and put it in a hidden
field, so that ASP.NET recognizes the value, but after clicking the
submit,
the value is lost...

somebody knows what can be done about it...

Nov 19 '05 #2
it didn't work with a hidden field
but I created a textbox with a css style "display:none"
effect is much the same...

tx anyway...

"jo*****@driver.net" wrote:
You need tomake sure that the Hidden filed has a runat="server" attribute.
If you do this then I believe the value will not be lost . It should
maintain its value during postbacks assuming you have ViewState on.

"Boonaap" <Bo*****@discussions.microsoft.com> wrote in message
news:29**********************************@microsof t.com...
I created two dropdownlists, one of them is filled up through javascript
because i did not want to create to much datatransfer since the content of
that list depends on what is selected in the first dropdown...

By javascript I can retrieve the selected value and put it in a hidden
field, so that ASP.NET recognizes the value, but after clicking the
submit,
the value is lost...

somebody knows what can be done about it...


Nov 19 '05 #3

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

Similar topics

3
by: Jim Mitchell | last post by:
My Goal is to have a dropdown (DL2) filled from the selectIndexChange event of a primary dropdown (DL1). These are picklists that will be selected frequently. Can someone recommend a strategy...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
3
by: Jon | last post by:
I am using cascading dropdowns, where the selection in one determines what fills another. In regular ASP I simply loaded a giant dataset into javascript array and when you clicked on one dropdown,...
1
by: Ed Chiu | last post by:
Hi, I have 2 dropdown lists on an ASP.Net page, the first is a list of states of US, the second is City list. When user selects a state, the web page does a postback, create a DB connection and...
4
by: Dica | last post by:
i've got a dropdown list with various options added to it. i want to add a button that allows the user to "Add New Option' which should create a blank row on the dropdown list and allow the user to...
1
by: Stuart Shay | last post by:
Hello All: I hava a ASP.NET Web Page where I want to change the visibility of a Dropdown, I want to avoid using Postback since the selection of the Dropdown choices is always the same. The Code...
2
by: Milsnips | last post by:
Hi there, I'm using VS.NET 2003, (.NET 1.1.4322) - I've got dropdown list with about 10 items in it on a web page. On 2 of the items i'd like the autopostback to occur, whereas if the user...
2
by: Brian | last post by:
Hi, All, I have two dropdown lists in itemtemplate in a datagrid. for example, dropA and dropB. also, for the dropdown, I set < Runat="server" AutoPostBack="True" OnSelectedIndexChanged="some...
2
Frinavale
by: Frinavale | last post by:
JavaScript in ASP.NET Using JavaScript in ASP.NET pages can make your application seem to work faster and prevent unnecessary calls to the server. JavaScript can be used to perform client-side...
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: 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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.