Client-script changes not reflecing

Discussion in 'ASP .Net Web Controls' started by Uma, Feb 19, 2004.

  1. Uma

    Uma Guest

    hi,

    I am trying to create Custom Web Control using two HtmlSelect and HtmlButton
    (Add and Remove). When the user select item from left to right using Add or
    Remove the page should not refresh... So, I wrote a javascript routine.
    which works fine. But when I am trying to read the values of dynamically
    added values from the HtmlSelect... It is not available and SelectedIndex is
    set to -1. I don't understand this....

    anybody please help me.

    Thanks
    Uma
     
    Uma, Feb 19, 2004
    #1
    1. Advertising

  2. hi Uma,
    how are you reading the items from the htmlselect control ? Are you doing
    this client side or are you trying to get his value on the server. I assume
    on the server and you are right. This will always end up blank because you
    are using the html control whereas to the dropdownlist web control. The
    differences are immense one being that webcontrols maintain state via
    viewstate which is saved into the page and then read again after a postback.
    If you still want to use your html control then manually store the value
    into viewstate, but then, why not just use a web control whereas to an html
    control ;P


    "Uma" <> wrote in message
    news:...
    > hi,
    >
    > I am trying to create Custom Web Control using two HtmlSelect and

    HtmlButton
    > (Add and Remove). When the user select item from left to right using Add

    or
    > Remove the page should not refresh... So, I wrote a javascript routine.
    > which works fine. But when I am trying to read the values of dynamically
    > added values from the HtmlSelect... It is not available and SelectedIndex

    is
    > set to -1. I don't understand this....
    >
    > anybody please help me.
    >
    > Thanks
    > Uma
    >
    >
    >
    >
    >
     
    Alessandro Zifiglio, Feb 19, 2004
    #2
    1. Advertising

  3. view state stores the value in a hidden field actually, so your still better
    off using a web control ;)


    "Uma" <> wrote in message
    news:...
    > Hi Alessandro,
    >
    > Got it...
    >
    > HtmlInputHidden and Page.Request.Form("xxx") did the trick....
    >
    >
    > thanks for trying.
    >
    > Many thanks
    > - Uma
    >
    > "Alessandro Zifiglio" <> wrote in
    > message news:jc2Zb.9054$...
    > > hi Uma,
    > > how are you reading the items from the htmlselect control ? Are you

    doing
    > > this client side or are you trying to get his value on the server. I

    > assume
    > > on the server and you are right. This will always end up blank because

    you
    > > are using the html control whereas to the dropdownlist web control. The
    > > differences are immense one being that webcontrols maintain state via
    > > viewstate which is saved into the page and then read again after a

    > postback.
    > > If you still want to use your html control then manually store the value
    > > into viewstate, but then, why not just use a web control whereas to an

    > html
    > > control ;P
    > >
    > >
    > > "Uma" <> wrote in message
    > > news:...
    > > > hi,
    > > >
    > > > I am trying to create Custom Web Control using two HtmlSelect and

    > > HtmlButton
    > > > (Add and Remove). When the user select item from left to right using

    Add
    > > or
    > > > Remove the page should not refresh... So, I wrote a javascript

    routine.
    > > > which works fine. But when I am trying to read the values of

    dynamically
    > > > added values from the HtmlSelect... It is not available and

    > SelectedIndex
    > > is
    > > > set to -1. I don't understand this....
    > > >
    > > > anybody please help me.
    > > >
    > > > Thanks
    > > > Uma
    > > >
    > > >
    > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Alessandro Zifiglio, Feb 19, 2004
    #3
  4. Uma

    Uma Guest

    Hi Alessandro,

    Got it...

    HtmlInputHidden and Page.Request.Form("xxx") did the trick....


    thanks for trying.

    Many thanks
    - Uma

    "Alessandro Zifiglio" <> wrote in
    message news:jc2Zb.9054$...
    > hi Uma,
    > how are you reading the items from the htmlselect control ? Are you doing
    > this client side or are you trying to get his value on the server. I

    assume
    > on the server and you are right. This will always end up blank because you
    > are using the html control whereas to the dropdownlist web control. The
    > differences are immense one being that webcontrols maintain state via
    > viewstate which is saved into the page and then read again after a

    postback.
    > If you still want to use your html control then manually store the value
    > into viewstate, but then, why not just use a web control whereas to an

    html
    > control ;P
    >
    >
    > "Uma" <> wrote in message
    > news:...
    > > hi,
    > >
    > > I am trying to create Custom Web Control using two HtmlSelect and

    > HtmlButton
    > > (Add and Remove). When the user select item from left to right using Add

    > or
    > > Remove the page should not refresh... So, I wrote a javascript routine.
    > > which works fine. But when I am trying to read the values of dynamically
    > > added values from the HtmlSelect... It is not available and

    SelectedIndex
    > is
    > > set to -1. I don't understand this....
    > >
    > > anybody please help me.
    > >
    > > Thanks
    > > Uma
    > >
    > >
    > >
    > >
    > >

    >
    >
     
    Uma, Feb 19, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U3Jpbmk=?=

    Client Side changes not refecting server side label

    =?Utf-8?B?U3Jpbmk=?=, Feb 19, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    738
    =?Utf-8?B?YWpheA==?=
    Feb 21, 2004
  2. =?Utf-8?B?cGF0cmlja2RyZA==?=

    Client side changes not reflected in page

    =?Utf-8?B?cGF0cmlja2RyZA==?=, Feb 1, 2007, in forum: ASP .Net
    Replies:
    24
    Views:
    1,079
    =?Utf-8?B?cGF0cmlja2RyZA==?=
    Mar 28, 2007
  3. chandru
    Replies:
    1
    Views:
    659
    bruce barker
    Jul 20, 2007
  4. Bruce
    Replies:
    6
    Views:
    276
    Nick Craig-Wood
    Oct 8, 2007
  5. Ziyad Makki

    Changes made on client do not apear on server.

    Ziyad Makki, Feb 4, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    137
    Ziyad Makki
    Feb 4, 2005
Loading...

Share This Page