how to find controls in repeater

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CreativeMind

    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
  • CreativeMind

    #2
    Re: how to find controls in repeater

    On Apr 30, 3:14 pm, CreativeMind <aftab.pu...@gm ail.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_It emDataBound(obj ect sender,
    System.Web.UI.W ebControls.Repe aterItemEventAr gs e){
    if (Convert.ToInt3 2(Session["UserTypeId "]) != 1){
    for (int i=0;i<repDocume nts.Items.Count ;i++){
    Button myButton=
    (Button)repDocu ments.Items[i].FindControl("b tnDelete");
    if (myButton != null)
    myButton.Enable d=false;
    System.Web.UI.W ebControls.Hype rLink myLink=
    (System.Web.UI. WebControls.Hyp erLink)repDocum ents.Items[i].FindControl("L nkDownLoad");
    if( myLink!=null)
    myLink.Enabled= false;
    }}}
    thx

    Comment

    • sloan

      #3
      Re: how to find controls in repeater







      TextBoxes will have to be "blurred".

      You have enabled=false on the others.

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




      "CreativeMi nd" <aftab.pucit@gm ail.comwrote in message
      news:a1140c48-3cc8-47fb-b335-709d61caa299@m3 6g2000hse.googl egroups.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

      Comment

      • sloan

        #4
        Re: how to find controls in repeater






        "CreativeMi nd" <aftab.pucit@gm ail.comwrote in message
        news:81ecc7ad-5b6b-4853-9508-b0207ca34c55@24 g2000hsh.google groups.com...
        On Apr 30, 3:14 pm, CreativeMind <aftab.pu...@gm ail.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_It emDataBound(obj ect sender,
        System.Web.UI.W ebControls.Repe aterItemEventAr gs e){
        if (Convert.ToInt3 2(Session["UserTypeId "]) != 1){
        for (int i=0;i<repDocume nts.Items.Count ;i++){
        Button myButton=
        (Button)repDocu ments.Items[i].FindControl("b tnDelete");
        if (myButton != null)
        myButton.Enable d=false;
        System.Web.UI.W ebControls.Hype rLink myLink=
        (System.Web.UI. WebControls.Hyp erLink)repDocum ents.Items[i].FindControl("L nkDownLoad");
        if( myLink!=null)
        myLink.Enabled= false;
        }}}
        thx

        Comment

        Working...