i have a shared function as called in vb.net or static function in C# that is declared like this
now the function is running the jquery from the server side, this works well now i want to call this function from the client side inside a nested table in a listview like this
'Run JQuery using this
Public Shared Function runjQueryCode(ByVal jsCodetoRun As String, ByVal Page As Page)
Dim requestSM As ScriptManager = ScriptManager.GetCurrent(Page)
If requestSM IsNot Nothing AndAlso requestSM.IsInAsyncPostBack Then
ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), Guid.NewGuid().ToString(), getjQueryCode(jsCodetoRun), True)
Page.ClientScript.RegisterClientScriptBlock(GetType(Page), Guid.NewGuid().ToString(), getjQueryCode(jsCodetoRun), True)
Now i have two Questions. the first one is my function accept the JQuery string and the reference to the page. Well i can do this on the server side and i am able to do this nicely , but i want to do it on the client side
<div id="Div2" runat="server" %>'
<a href="#" onclick=' <%# clsFunctions.runjQueryCode("$('#basic-modal-ontent').modal()", this) %>'></a>
<img src="../../Imgs/Linkquestionare.png" border="0"/></a></div>
The following is content that i want to pass to the function as the first argument. /
and as you can see, i tried to pass "this" trying to get the reference to the page.
1) in would like to pass that string in the function as my first argument
2) i want to pass the page reference to the function as my second parameter.