473,795 Members | 3,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

adding a value to Session object

Hi guys,

I'm using Javascript to dynamically add to a dropdown values like
for ( i=0; i<tv.length; i++ ) {
selectDDAvisCtr l.options[i] = new Option(tv[i], tv[i]);
}

and I use

document.getEle mentById("ddAvi s").options[document.getEle mentById('ddAvi s').selectedInd ex].innerHTML;

to access the value of the selected dropdown in Javascript...

now, How can I get the value using ASP.NET 2.0?

the dropdown tag is:
<asp:DropDownLi st ID="ddAvis" runat="server" CssClass="wizar dFormDD" />

I tried:
ddAvis.Selected Value
ddAvis.Text
ddAvis.SelectIn dex
ddAvis.SelectIt em

but none can get the selected value in the dropdown:

http://filterqueen.brinkster.net/new...sers/test.aspx

Please, fell free to change the DropDown with the values 1 to 4 and click
get ddAvis values so you can see that ASP.NET can retrieve the number with
no problems, but if you click the button add new numbers 2 DropDown, I'll
insert the number from 11 to 14 in the dropdownlist and you can navigate
with it, you can also see that I can event get that value in Javascript in
the function show() but if you click get ddAvis values you see that I can't
retrieve any correct number.

--

Bruno Alexandre
(a Portuguese in Københanv, Danmark)


Jun 27 '06 #1
2 1591
Bruno Alexandre wrote:
Hi guys,

I'm using Javascript to dynamically add to a dropdown values like
for ( i=0; i<tv.length; i++ ) {
selectDDAvisCtr l.options[i] = new Option(tv[i], tv[i]);
}

and I use

document.getEle mentById("ddAvi s").options[document.getEle mentById('ddAvi s').selectedInd ex].innerHTML;

to access the value of the selected dropdown in Javascript...

now, How can I get the value using ASP.NET 2.0?

the dropdown tag is:
<asp:DropDownLi st ID="ddAvis" runat="server" CssClass="wizar dFormDD" />

I tried:
ddAvis.Selected Value
ddAvis.Text
ddAvis.SelectIn dex
ddAvis.SelectIt em

but none can get the selected value in the dropdown:

http://filterqueen.brinkster.net/new...sers/test.aspx

Please, fell free to change the DropDown with the values 1 to 4 and click
get ddAvis values so you can see that ASP.NET can retrieve the number with
no problems, but if you click the button add new numbers 2 DropDown, I'll
insert the number from 11 to 14 in the dropdownlist and you can navigate
with it, you can also see that I can event get that value in Javascript in
the function show() but if you click get ddAvis values you see that I can't
retrieve any correct number.

--

Bruno Alexandre
(a Portuguese in Københanv, Danmark)


The answer to your question is the forms collection
Request.Form.It em("ddAvis")

This will give you a comma separated list of selected items (i.e the
actual values POSTed by the HTML form)

Having said that... Are you certain you have picked the best way to do
whatever it is you wish to do?
Your list will be recreated at the server side with the original
definition on every postback, any changes to the list made at the
client side will be lost.

-- a --
PS: Your javascript does not work with firefox

Jun 27 '06 #2
Hi...

I do not need that information, this is the 1st step of a Loan Application
Form, and the user never get to this page again unless he/she wants to apply
again.

the final work is here if you want to see:

http://filterqueen.brinkster.net/new...ion_Start.aspx

--

Bruno Alexandre
(a Portuguese in Københanv, Danmark)
"addup" <ad*****@gmail. com> escreveu na mensagem
news:11******** **************@ 75g2000cwc.goog legroups.com...
Bruno Alexandre wrote:
Hi guys,

I'm using Javascript to dynamically add to a dropdown values like
for ( i=0; i<tv.length; i++ ) {
selectDDAvisCtr l.options[i] = new Option(tv[i], tv[i]);
}

and I use

document.getEle mentById("ddAvi s").options[document.getEle mentById('ddAvi s').selectedInd ex].innerHTML;

to access the value of the selected dropdown in Javascript...

now, How can I get the value using ASP.NET 2.0?

the dropdown tag is:
<asp:DropDownLi st ID="ddAvis" runat="server" CssClass="wizar dFormDD" />

I tried:
ddAvis.Selected Value
ddAvis.Text
ddAvis.SelectIn dex
ddAvis.SelectIt em

but none can get the selected value in the dropdown:

http://filterqueen.brinkster.net/new...sers/test.aspx

Please, fell free to change the DropDown with the values 1 to 4 and click
get ddAvis values so you can see that ASP.NET can retrieve the number with
no problems, but if you click the button add new numbers 2 DropDown, I'll
insert the number from 11 to 14 in the dropdownlist and you can navigate
with it, you can also see that I can event get that value in Javascript in
the function show() but if you click get ddAvis values you see that I
can't
retrieve any correct number.

--

Bruno Alexandre
(a Portuguese in Københanv, Danmark)


The answer to your question is the forms collection
Request.Form.It em("ddAvis")

This will give you a comma separated list of selected items (i.e the
actual values POSTed by the HTML form)

Having said that... Are you certain you have picked the best way to do
whatever it is you wish to do?
Your list will be recreated at the server side with the original
definition on every postback, any changes to the list made at the
client side will be lost.

-- a --
PS: Your javascript does not work with firefox
Jun 28 '06 #3

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

Similar topics

3
4886
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that the best method? Do you have a sample of how to do this?
4
1602
by: Sandeep | last post by:
Hi I am doing one thing in my website ,actually i want to add controls dynamically to a web form and want to access the elements but when i postback the form,and access that control, it gives error Object reference not set to an instance of an object. ************************************************************************ ************************************************************************** Public Class index2 Inherits...
2
1918
by: Tomek R. | last post by:
Hello ! I've got weird problem when adding new datagrid item. Here is the situation: my grid dgDeps is binded to DepartmentList arraylist, stored in Session between round-trips.. To add new item I press buttton with ibNewDep_Click event. After that the grid is in edit state and I can modify new item, it has some text, set as default - "<nowy wydzia³>". But - this is the weirdness - when I add some text following the default value
0
2406
by: Luis Esteban Valencia | last post by:
Hello I wrote a program with code behind in C# to add row into table dynamically and the program worked very well in .Net Framework 1.1. When I run this program in .Net Framework 2.0 beta version, the program is not working as in version 1.1. So what is the problem? Microsoft declared that the version 2.0 is fully backward support, but it is not. Is that the problem with 2.0 version? I find out the problem in version 2.0. After...
3
2346
by: Ankit Aneja | last post by:
I have a strange situation and I have no idea how to solve this. Its a Recruitment Search Page,in the Admin Page, for every button click event the Admin Person has to create a checkbox on the users page. So whenever the Admin person comes to know about the new category in the market he will be adding as different Sub-Categories for example ABAP, BDC etc..etc.. on every click event as Checkboxes. And these controls(checkboxes) should remain...
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10436
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.