Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. GetPostBackClientHyperlink in datagrid in ascx file

GetPostBackClientHyperlink in datagrid in ascx file

Scheduled Pinned Locked Moved ASP.NET
helpsysadminsecurityquestionworkspace
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jhyn
    wrote on last edited by
    #1

    hello everyone... i added GetPostBackClientHyperlink in ItemDataBound in ascx file and this is the code

    Dim button As LinkButton = CType(e.Item.Cells(9).Controls(1), LinkButton)
    If Not (button Is Nothing) Then
    e.Item.Attributes("onclick") =
    Page.ClientScript.GetPostBackClientHyperlink(button, "")
    End If

    and i got this error: Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation. please help how can i rid at this error :(( thanks in advance...

    jyn

    B 1 Reply Last reply
    0
    • J jhyn

      hello everyone... i added GetPostBackClientHyperlink in ItemDataBound in ascx file and this is the code

      Dim button As LinkButton = CType(e.Item.Cells(9).Controls(1), LinkButton)
      If Not (button Is Nothing) Then
      e.Item.Attributes("onclick") =
      Page.ClientScript.GetPostBackClientHyperlink(button, "")
      End If

      and i got this error: Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation. please help how can i rid at this error :(( thanks in advance...

      jyn

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      did you use AJAX on the page?

      Cheers!! Brij

      J 1 Reply Last reply
      0
      • B Brij

        did you use AJAX on the page?

        Cheers!! Brij

        J Offline
        J Offline
        jhyn
        wrote on last edited by
        #3

        thanks for your reply.. no, i didn't. i just added the above codes then when i click the grid, i got that error.

        jyn

        B 1 Reply Last reply
        0
        • J jhyn

          thanks for your reply.. no, i didn't. i just added the above codes then when i click the grid, i got that error.

          jyn

          B Offline
          B Offline
          Brij
          wrote on last edited by
          #4

          put EnableEventValidation as EnableEventValidation="false".

          Cheers!! Brij

          J 1 Reply Last reply
          0
          • B Brij

            put EnableEventValidation as EnableEventValidation="false".

            Cheers!! Brij

            J Offline
            J Offline
            jhyn
            wrote on last edited by
            #5

            but EnableEventValidation is for aspx file only.. im using ascx file :(

            jyn

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups