PC Review


Reply
Thread Tools Rate Thread

Change text of link button based on selected value of dropDownList

 
 
Andy B
Guest
Posts: n/a
 
      8th Sep 2008
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
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      8th Sep 2008
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
 
Andy B
Guest
Posts: n/a
 
      8th Sep 2008
Cant you use ajax for something like this?


"Eliyahu Goldin" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>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
 
Eliyahu Goldin
Guest
Posts: n/a
 
      8th Sep 2008
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Cant you use ajax for something like this?
>
>
> "Eliyahu Goldin" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>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
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to link selected value of a dropdownlist to right field? Ben Microsoft ASP .NET 1 5th Sep 2009 06:19 PM
DropDownList not giving the selected item when a Button is clicked... please help newbie... Julius Mong Microsoft ASP .NET 1 21st Dec 2005 10:08 AM
change dropdownlist selected index with javascript Antonio Microsoft ASP .NET 1 9th Aug 2005 02:47 PM
Change Paypal button for a text link... =?Utf-8?B?YWxmcmVkbw==?= Microsoft Frontpage 1 10th Jul 2004 08:17 AM
ASP.net example needed - loading a DropDownList based on value selected on another DDL Keith-Earl Microsoft ASP .NET 1 30th Mar 2004 02:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:08 AM.