Problem adding an attribute to button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jay123
    New Member
    • Sep 2008
    • 121

    Problem adding an attribute to button

    Hello,
    I have a page, divided into 3 section. Left Menu, Middle and Right Menu.

    Left Menu data comes from control, Middle Menu data is sorted on a page and Right Menu links also depends upon page to page so they are set on a page itself as

    Code:
    Dim button As LinkButton = New LinkButton()
            button.Text = "imarket agency list"
            AddHandler button.Click, AddressOf abc
            button.Attributes.Add("class", "rightmenu")
            button.Attributes.Add("causesvalidation", "false")
            RightMenu.Controls.Add(button)
    As seen above, i am trying to create a linkbutton and trying to add it to RightMenu. My problem is how can i get this button to ignore validation. i.e. Whenever i click on this linkbutton(whic h comes on right menu), validation fires if something is not valid on that page. I thought adding attribute of 'causesvalidati on' as 'false' would work as 'class' but it doesn't.

    Am i missing something here or is their any another way to implement this.

    Regards
    Jay
  • jay123
    New Member
    • Sep 2008
    • 121

    #2
    Code:
    button.CausesValidation = False

    Comment

    Working...