locked
Fire a new event in aspx from ScriptControl control RRS feed

  • Question

  • User-251787895 posted

    Hi all

    I need raising some new Event like OnRowDataBound from my CustomGrid. and use my control in ASPX form like this:

    <MohajerCC:Grid ID="Grid1" runat="server" AutoGenerateColumns="true" onRowDataBound="return onRowDataBound()">    
    </MohajerCC:Grid>

    and in <script> blocked using this
    function onRowDataBound()
    {

    }

    Best Regards,
    Mohammad

    Friday, August 5, 2011 9:40 AM

Answers

  • User3866881 posted

    Hello again:)

    Why don't you just define a customized event?

    For more about event's defination, see:http://msdn.microsoft.com/en-us/library/aa645739(v=vs.71).aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 8, 2011 10:27 PM
  • User-16411453 posted

    I think Javascript on responds to simple events like click and blurr, you can google javascript events that you can bind to. If it's not listed, then you have to go server side and add a handler for C#, I gave you a vb sample, which wil not work, but should give you an idea of what your looking for.

    To access a server side function, you have to add a handler

    AddHandler .Click, Addressof onRowDataBound_Click

    Protected Sub onRowDataBound_Click(event args here)

    End Sub

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 17, 2011 12:29 AM

All replies

  • User3866881 posted

    Hello again:)

    Why don't you just define a customized event?

    For more about event's defination, see:http://msdn.microsoft.com/en-us/library/aa645739(v=vs.71).aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 8, 2011 10:27 PM
  • User-251787895 posted

    Hello ;-)

    I need JS Event.

    Mohammad.

    Tuesday, August 9, 2011 2:36 AM
  • User3866881 posted

    I need JS Event.

    Sorry I didn't understand....

    Would you mind offering me a detailled example similar to yoru problem....

    Thx again

    Tuesday, August 9, 2011 2:42 AM
  • User1957418580 posted

    Remember, "onRowDataBound" is a SERVER-side event, so client-side javascript cannot be used here.  Can you explain what you mean by "JS"?

    Wednesday, August 10, 2011 7:26 AM
  • User-16411453 posted

    I think Javascript on responds to simple events like click and blurr, you can google javascript events that you can bind to. If it's not listed, then you have to go server side and add a handler for C#, I gave you a vb sample, which wil not work, but should give you an idea of what your looking for.

    To access a server side function, you have to add a handler

    AddHandler .Click, Addressof onRowDataBound_Click

    Protected Sub onRowDataBound_Click(event args here)

    End Sub

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 17, 2011 12:29 AM