473,624 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RadioButtonList Control

Hi,

If I have a radiobuttonlist control and have some items in them, is it
possible to hide one item depending on "situation" for eg: Users, Managers
log in and see the same radiobuttonlist control but if user logs in he
should not see item "Query 5" and if manager logs in he should
<asp:radiobutto nlist id="TaskRadioBu tton" runat="server" Width="440px"
Font-Size="X-Small" RepeatDirection ="Vertical" RepeatColumns=" 2">
<asp:ListItem Value="Query1" Selected="True" >Query
1</asp:ListItem>
<asp:ListItem Value="Query2"> Query 2</asp:ListItem>
<asp:ListItem Value="Query3"> Query 3</asp:ListItem>
<asp:ListItem Value="Query4"> Query 4</asp:ListItem>
<asp:ListItem Value="Query5"> Query 5</asp:ListItem>
</asp:radiobutton list>

I want to display the list Item "Query 5" only if a manager logs in... which
I check ofcourse..

How do i do it?

Thanks,
Stephen
Nov 19 '05 #1
1 2318
I suggest managing the list using vb.net (codebehind) by adding the list
items at runtime. When you get to the item you wish to hide, only add it if
the user is a manager.

Good luck!
Curt
"Stephen Noronha" <st********@hot mail.com> wrote in message
news:O6******** ******@tk2msftn gp13.phx.gbl...
Hi,

If I have a radiobuttonlist control and have some items in them, is it
possible to hide one item depending on "situation" for eg: Users, Managers
log in and see the same radiobuttonlist control but if user logs in he
should not see item "Query 5" and if manager logs in he should
<asp:radiobutto nlist id="TaskRadioBu tton" runat="server" Width="440px"
Font-Size="X-Small" RepeatDirection ="Vertical" RepeatColumns=" 2">
<asp:ListItem Value="Query1" Selected="True" >Query
1</asp:ListItem>
<asp:ListItem Value="Query2"> Query 2</asp:ListItem>
<asp:ListItem Value="Query3"> Query 3</asp:ListItem>
<asp:ListItem Value="Query4"> Query 4</asp:ListItem>
<asp:ListItem Value="Query5"> Query 5</asp:ListItem>
</asp:radiobutton list>

I want to display the list Item "Query 5" only if a manager logs in...
which
I check ofcourse..

How do i do it?

Thanks,
Stephen

Nov 19 '05 #2

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

Similar topics

2
8517
by: Mike S | last post by:
I am trying to use a RadioButtonList bound to a custom datasource to acomplish some user functionality. I want to add various onmouseover/onmouseout/onblur/onfocus events to each individual ListItem housed by the RadioButtonList; however, the rbl.Items.Attributes.Add( eventName, callFunction ) model does not work for this--I can only add attributes to the rbl object itself: Is there a built-in way to do this that I am missing (without...
6
7729
by: DotNetGruven | last post by:
I have a webform that has a DataGrid on it with a RadioButtonList in each row. It is a simple On & Off. When the User Clicks on either of the RadioButtons, I need to postback to the server and update the database. Here is the control containment hierarchy: ASP Page Static User Control // just provides a pretty border around
4
9650
by: Emil | last post by:
Can somebody tell me what would be the syntax for having an if statement and setting the selected index of a radiobuttonlist? This is my first project using ASP.net and I use C#. I have a repeater with like a table layout and in the last column I want to have three radio buttons (for each row in repeater). The value of the radio button should be calculated from a value from the dataset. How can I do that? When I try to use a variable...
5
6977
by: Øyvind Isaksen | last post by:
I'm making a page to update articles. When a radiobuttonlist is displayed, I want the stored value to be displayed as default (checked). Example: I use a procedure to display the RadioButtonList. An input to this procedure is the ID that is stored in the database. I want the radiobuttonlist to show the radiobutton with datavaluefield = savedID as checked when it is displayed.
2
4732
by: Michael Bohman | last post by:
Hi, i have a small problem with assigning a database value to a RadioButtonList control. On my form i have 3 user admin=1, premium=2 and basic=3, theese values is stored in an access database in a text string. My problem is that when i'm loading my form, it uses a repeater control for each user by the way, I can't find a way to assign either of these values to the RadioButtonList Control. I can read them from the database but i wan't the...
0
2042
by: Sudheer Aalla | last post by:
Hi, When I try to reference the radiobuttonlist control in edititemtemplate in ItemDataBound event of datalist control I am getting NULL reference. I am trying to pre select the yes/no button depending on the label text in item template. But I am able to get the value of lable control which is in itemtemplate. Is there anything else I am missing here??? public void DataListItems_ItemDataBound(object sender, DataListItemEventArgs e)
5
2684
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hallo, I have a radiobuttonlist control that is added on a custom Web User Control. This control has a property that exposes the SelectedIndex property of the embedded radiobuttonlist. When running this in IE, behaviour is as I would expect it. If I select an item and do a postback, the page remembers my selection when reloading, and the SelectedIndex property of my control returns the correct value.
0
1423
by: =?Utf-8?B?QW5keSBpbiBTb3V0aCBKZXJzZXk=?= | last post by:
I want to use a RadioButtonList Control(HTML) in a GridView control. I can see the RadioButtonList control with each row in the GridView with the code: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Question_id" DataSourceID="SqlDataSource1"> <Columns> <asp:BoundField DataField="q_Description"
6
2632
by: SAL | last post by:
hello, I'm using a radiobuttonlist in an updatepanel in an item template in a Gridview control. I'm populating the radiobuttonlist in the RowDataBound event. I have the control toolkit registered in the page and I've got code to get the selected value from it in the Radiobuttonlist_SelectedIndexChanged event. The code in there is: Protected Sub rblFMSValue_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
13
10709
by: tommymo | last post by:
Hi everyone I'm new to this site and the world of ASP.Net C# programming. I have been learning controls and integrating them with a SQL database. So far I have been able to move along and understand static controls. However I would like to move on to attempt to create some dynamic controls. So I set out to work with a radiobuttonlist questionnaire. I have a database and in that DB I have 2 tables one which holds the questions and the other...
0
8233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8675
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
8619
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
8474
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...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.