Change text of link button based on selected value of dropDownList

This is a discussion on Change text of link button based on selected value of dropDownList within the DOTNET forums in Framework and Interface Programming category; I have a dropDownList and a LinkButton. The LinkButton's text needs to reflect the selected item in the dropDownList. So, when Subscribe is selected in the dropDownList, the LinkButton's text needs to also be "Subscribe". Also, if the dropDownList's selected item is Unsubscribe, the LinkButton's text needs to be "Unsubscribe". This needs to happen without a page postback or reload. How do I do this?...

Go Back   Application Development Forum > Framework and Interface Programming > DOTNET

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-08-2008, 08:02 AM
Andy B
Guest
 
Default Change text of link button based on selected value of dropDownList

I have a dropDownList and a LinkButton. The LinkButton's text needs to
reflect the selected item in the dropDownList. So, when Subscribe is
selected in the dropDownList, the LinkButton's text needs to also be
"Subscribe". Also, if the dropDownList's selected item is Unsubscribe, the
LinkButton's text needs to be "Unsubscribe". This needs to happen without a
page postback or reload. How do I do this?



Reply With Quote
  #2  
Old 09-08-2008, 09:52 AM
Eliyahu Goldin
Guest
 
Default Re: Change text of link button based on selected value of dropDownList

You can do it client-side in javascript. You will need to view the source
for the page, locate the controls in interest in html, and figure out what
client events to handle. It may be trivial or not so depending on where on
the page the controls are.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Andy B" <a_borka@sbcglobal.net> wrote in message
news:uIqgPraEJHA.1460@TK2MSFTNGP03.phx.gbl...
>I have a dropDownList and a LinkButton. The LinkButton's text needs to
>reflect the selected item in the dropDownList. So, when Subscribe is
>selected in the dropDownList, the LinkButton's text needs to also be
>"Subscribe". Also, if the dropDownList's selected item is Unsubscribe, the
>LinkButton's text needs to be "Unsubscribe". This needs to happen without a
>page postback or reload. How do I do this?
>
>
>



Reply With Quote
  #3  
Old 09-08-2008, 11:57 AM
Andy B
Guest
 
Default Re: Change text of link button based on selected value of dropDownList

Cant you use ajax for something like this?


"Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldDinN@mMvVpPsS.org> wrote in
message news:utP5kpbEJHA.616@TK2MSFTNGP06.phx.gbl...
> You can do it client-side in javascript. You will need to view the source
> for the page, locate the controls in interest in html, and figure out what
> client events to handle. It may be trivial or not so depending on where on
> the page the controls are.
>
> --
> Eliyahu Goldin,
> Software Developer
> Microsoft MVP [ASP.NET]
> http://msmvps.com/blogs/egoldin
> http://usableasp.net
>
>
> "Andy B" <a_borka@sbcglobal.net> wrote in message
> news:uIqgPraEJHA.1460@TK2MSFTNGP03.phx.gbl...
>>I have a dropDownList and a LinkButton. The LinkButton's text needs to
>>reflect the selected item in the dropDownList. So, when Subscribe is
>>selected in the dropDownList, the LinkButton's text needs to also be
>>"Subscribe". Also, if the dropDownList's selected item is Unsubscribe, the
>>LinkButton's text needs to be "Unsubscribe". This needs to happen without
>>a page postback or reload. How do I do this?
>>
>>
>>

>
>



Reply With Quote
  #4  
Old 09-08-2008, 02:42 PM
Eliyahu Goldin
Guest
 
Default Re: Change text of link button based on selected value of dropDownList

Sure, it will be much simpler. Put the controls in the same UpdatePanel and
handle server-side SelectedIndexChanged event.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


"Andy B" <a_borka@sbcglobal.net> wrote in message
news:uKjCKucEJHA.2072@TK2MSFTNGP04.phx.gbl...
> Cant you use ajax for something like this?
>
>
> "Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldDinN@mMvVpPsS.org> wrote in
> message news:utP5kpbEJHA.616@TK2MSFTNGP06.phx.gbl...
>> You can do it client-side in javascript. You will need to view the source
>> for the page, locate the controls in interest in html, and figure out
>> what client events to handle. It may be trivial or not so depending on
>> where on the page the controls are.
>>
>> --
>> Eliyahu Goldin,
>> Software Developer
>> Microsoft MVP [ASP.NET]
>> http://msmvps.com/blogs/egoldin
>> http://usableasp.net
>>
>>
>> "Andy B" <a_borka@sbcglobal.net> wrote in message
>> news:uIqgPraEJHA.1460@TK2MSFTNGP03.phx.gbl...
>>>I have a dropDownList and a LinkButton. The LinkButton's text needs to
>>>reflect the selected item in the dropDownList. So, when Subscribe is
>>>selected in the dropDownList, the LinkButton's text needs to also be
>>>"Subscribe". Also, if the dropDownList's selected item is Unsubscribe,
>>>the LinkButton's text needs to be "Unsubscribe". This needs to happen
>>>without a page postback or reload. How do I do this?
>>>
>>>
>>>

>>
>>

>
>


Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 06:53 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.