Hi eveyone, i start using AJAX (with asp.net 2.0 and vb) and i have a problem :
if i don't decleare my function GetDataPanel as shared ajax don't find it (no error but simply don't reach the function in debug mode).
- Why does my GetDataPanel function need to be "shared" ?
- There's a way to don't have to declare my function as shared ? (or a way to have access to my control and function in my web form from a shared function ???)
Expected result : get the text from a textbox in my webform from my GetDataPanel function
Here is the code i use to call this function
'This button call the javascript
<input id="Button1" type="button" name="button1" value="OK" onClick="updateDateKey();" />
'My javascript
function updateDateKey() {
var behavior = $find('dpe');
if (behavior) {
behavior.populate();
}
}
'My AJAX control
<cc1:DynamicPopulateExtender ID="dpe" ClearContentsDuringUpdate="true" ServiceMethod="GetDataPanel" runat="server" TargetControlID="Panel1">
</cc1:DynamicPopulateExtender>
'VB Function called from the ajax control
<System.Web.Services.WebMethod()> _
Public Shared Function GetDataPanel() As String
Return TextBox1.Text
End Function
Thanks a lot
DanyBoy