MrTung wrote:
you can try get url for MyPage.ascx:
string current_page = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "this is controlKey - null if View.ascx","mid"+ModuleId.ToString())
and in $.ajax url: <%= current_page%>
hi Tung i followed ur way like =
in page load code behind method i get the current url this way and assign to a control -
string current_page = Globals.NavigateURL(PortalSettings.ActiveTab.TabID,"", "mid" + ModuleId.ToString());
subCommentButton.Text = current_page;
also added method to call in code behind -
[WebMethod]
public static string GetDate(int jewellerId, string locale)
{
//System.Threading.Thread.Sleep(2000);
return jewellerId.ToString() + locale;
}
then in view.ascx page i call the AjaxTest function on button click below -
function AjaxTest() {
var test= $("#<%= subCommentButton.ClientID %>").val(); //getting the url
est);
$.ajax({
type: "POST",
url: test+"/GetDate",
data: '{ "jewellerId":"' + 123 + '", "locale":"c#" }',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
// Replace the div's content with the page method's return.
$("#show").text(msg.d);
msg.d);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
extStatus);
}
});
}
But i get error alert !!! plz help what's wrong??