473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to find controls in repeater

hi
i want to find disable/readonly the controls( hyperlink and a button
in 2 different cols.). either in javascript or in codebehind.
thx
Jun 27 '08 #1
3 1416
On Apr 30, 3:14 pm, CreativeMind <aftab.pu...@gmail.comwrote:
hi
i want to find disable/readonly the controls( hyperlink and a button
in 2 different cols.). either in javascript or in codebehind.
thx
i tried to solve using the following code but hyperlink is not doing
well.
private void repDocuments_ItemDataBound(object sender,
System.Web.UI.WebControls.RepeaterItemEventArgs e){
if (Convert.ToInt32(Session["UserTypeId"]) != 1){
for (int i=0;i<repDocuments.Items.Count;i++){
Button myButton=
(Button)repDocuments.Items[i].FindControl("btnDelete");
if (myButton != null)
myButton.Enabled=false;
System.Web.UI.WebControls.HyperLink myLink=
(System.Web.UI.WebControls.HyperLink)repDocuments. Items[i].FindControl("LnkDownLoad");
if( myLink!=null)
myLink.Enabled=false;
}}}
thx
Jun 27 '08 #2

http://msdn.microsoft.com/en-us/libr...databound.aspx

http://www.google.com/search?hl=en&q...FindControl%22
TextBoxes will have to be "blurred".

You have enabled=false on the others.

Are those the only 2 control (types) you want to disable?


"CreativeMind" <af*********@gmail.comwrote in message
news:a1**********************************@m36g2000 hse.googlegroups.com...
hi
i want to find disable/readonly the controls( hyperlink and a button
in 2 different cols.). either in javascript or in codebehind.
thx

Jun 27 '08 #3
http://www.codeguru.com/csharp/.net/...le.php/c12065/


"CreativeMind" <af*********@gmail.comwrote in message
news:81**********************************@24g2000h sh.googlegroups.com...
On Apr 30, 3:14 pm, CreativeMind <aftab.pu...@gmail.comwrote:
>hi
i want to find disable/readonly the controls( hyperlink and a button
in 2 different cols.). either in javascript or in codebehind.
thx

i tried to solve using the following code but hyperlink is not doing
well.
private void repDocuments_ItemDataBound(object sender,
System.Web.UI.WebControls.RepeaterItemEventArgs e){
if (Convert.ToInt32(Session["UserTypeId"]) != 1){
for (int i=0;i<repDocuments.Items.Count;i++){
Button myButton=
(Button)repDocuments.Items[i].FindControl("btnDelete");
if (myButton != null)
myButton.Enabled=false;
System.Web.UI.WebControls.HyperLink myLink=
(System.Web.UI.WebControls.HyperLink)repDocuments. Items[i].FindControl("LnkDownLoad");
if( myLink!=null)
myLink.Enabled=false;
}}}
thx

Jun 27 '08 #4

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

Similar topics

1
by: Jax | last post by:
I am looking to populate web page with controls as a result of a database query. eg (pseudocode) <% foreach(Garment g in GetStuffFromDB()) { //add controls Response.Write("<asp:Button id =...
2
by: theComputer7 | last post by:
I cut down the code to make this half way understandable... I have read Data Grid girls caution about over use of dynamic controls. I truly believe what I am doing requires dynamically inserted...
8
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
1
by: Neil | last post by:
Hi, I have a repeater object which is bound to a dataset, the repeater has one item template which contains dropdowns, checklist, text boxes etc. After the repeater has rendered the user can...
4
by: huzz | last post by:
I am trying to access a DropDownList control inside a repeater using ItemCommand as shown below but for some reason i can't access the DropDownList. When i step through the debug i get <undefine...
14
by: Joe | last post by:
Hello All: I am trying to dynamically populate a web page with literal content and controls (textboxes and checkboxes (and eventually two buttons - the buttons do not appear in the code yet). I...
3
by: Iain Buchanan | last post by:
Moving this code below from v1.1 to 2.0... am now getting this bug... After I bind a repeater I move the repeater inside the placeholder using controls.add(), but when I do this, all the...
2
by: AC [MVP MOSS] | last post by:
I have a repeater with a header, footer, and item template. The item template is the only one with server controls (hyperlinks, labels, and a nested repeater). Within the top repeater, I'm handling...
1
by: Øyvind Isaksen | last post by:
I have a Repeater that dynamicly displayes some textboxes. Each Textbox has an ID like this (example): ID="10_20_textbox". The first number (10) describes what article this field is for, and the...
3
by: s.bussing | last post by:
Hi, I have been reading for hours now, but I'm still not able to solve my problem, though a lot of people are struggling with something similar. On my page I have a nested repeater. In the inner...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...

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.