Calling a Shared function from the Client side

Posted by Vuyiswamb under jQuery on 1/27/2012 | Points: 10 | Views : 1753 | Status : [Member] [MVP] [Administrator] | Replies : 0
Good Day

i have a shared function as called in or static function in C# that is declared 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)
End If
End Function

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

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

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

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.


Thank you for posting at Dotnetfunda


(No response found.)

Login to post response