how to find controls in repeater

C

CreativeMind

hi
i want to find disable/readonly the controls( hyperlink and a button
in 2 different cols.). either in javascript or in codebehind.
thx
 
C

CreativeMind

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.FindControl("btnDelete");
if (myButton != null)
myButton.Enabled=false;
System.Web.UI.WebControls.HyperLink myLink=
(System.Web.UI.WebControls.HyperLink)repDocuments.Items.FindControl("LnkDownLoad");
if( myLink!=null)
myLink.Enabled=false;
}}}
thx
 
S

sloan

http://www.codeguru.com/csharp/.net/net_asp/tutorials/article.php/c12065/




CreativeMind said:
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.FindControl("btnDelete");
if (myButton != null)
myButton.Enabled=false;
System.Web.UI.WebControls.HyperLink myLink=
(System.Web.UI.WebControls.HyperLink)repDocuments.Items.FindControl("LnkDownLoad");
if( myLink!=null)
myLink.Enabled=false;
}}}
thx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top