Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > show hide image button

Reply
Thread Tools

show hide image button

 
 
TJS
Guest
Posts: n/a
 
      11-08-2003
I want to change visiblity of an image button based upon user selection in a
drop list
using sub below but it is not making the image visibility change when the
droplist selection changes,
what is missing ?????

....

Sub dropUsersSelInxChng(s As Object, e As EventArgs)
if allUsers.SelectedItem.Value = "1" then
Imagebutton2.Visible="False"
else
Imagebutton2.Visible="True"
end if
End Sub

....

<aspropDownList OnSelectedIndexChanged="dropUsersSelInxChng"
id="allUsers" runat="server" DataTextField="Email"
DataValueField="UserID"></aspropDownList>

<asp:ImageButton id="Imagebutton2" Visible="true"
onclick="DeleteUser_Click" runat="server" ImageUrl="~/images/delete.gif"
AlternateText="Delete this user"></asp:ImageButton>


 
Reply With Quote
 
 
 
 
Jos
Guest
Posts: n/a
 
      11-09-2003
TJS wrote:
> I want to change visiblity of an image button based upon user
> selection in a drop list
> using sub below but it is not making the image visibility change when
> the droplist selection changes,
> what is missing ?????
>
> ...
>
> Sub dropUsersSelInxChng(s As Object, e As EventArgs)
> if allUsers.SelectedItem.Value = "1" then
> Imagebutton2.Visible="False"
> else
> Imagebutton2.Visible="True"
> end if
> End Sub
>
> ...
>
> <aspropDownList OnSelectedIndexChanged="dropUsersSelInxChng"
> id="allUsers" runat="server" DataTextField="Email"
> DataValueField="UserID"></aspropDownList>
>
> <asp:ImageButton id="Imagebutton2" Visible="true"
> onclick="DeleteUser_Click" runat="server"
> ImageUrl="~/images/delete.gif" AlternateText="Delete this
> user"></asp:ImageButton>


Set AutoPostback="True" for the DropDownList.

--

Jos Branders


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
show hide divs - show last state upon reload/post ll Javascript 2 05-01-2008 12:15 PM
How to hide and show a button after executing javascript function Mic ASP .Net 5 08-31-2007 07:14 PM
Show Details/Hide Details link button =?Utf-8?B?Sm9l?= ASP .Net 1 03-13-2006 04:51 PM
Image Button and Show/Hide Panel Shapper ASP .Net 4 09-21-2005 09:16 PM
Button won't fire after show/hide div dje ASP .Net 5 12-02-2004 12:49 AM



Advertisments