There is an image button in master page. There is a method for onclick button in code behind. I want to call that by using jquery.
I want to do it by using <asp:ImageButton> . I am not using only a button. I want to call the web method through jquery.
//this is my image button.
<asp:ImageButton runat="server" ID="ImageButton1" ImageUrl="~/img/icon50.png" Width="20" Height="20" meta:resourcekey="ImageButton1" />
//This is my method in code behind.
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
var re = Request.UrlReferrer.AbsolutePath;
string valueId = "";
if (re == "w1/")
{
valueId = System.Configuration.ConfigurationManager.AppSettings["h"].ToString().Split('=')[1];
}
else if (re == "w2/")
{
valueId = System.Configuration.ConfigurationManager.AppSettings["f"].ToString().Split('=')[1];
}
else if (re == "w3/")
{
valueId = System.Configuration.ConfigurationManager.AppSettings["l"].ToString().Split('=')[1];
}
string Lang = ddlLanguage.SelectedValue;
var Url = System.Configuration.ConfigurationManager.AppSettings["_URL"];
string queryString = (Url + "?parm=" + valueId + "&PostNm=" + Lang + "");
var screenWidth = Request.Browser.ScreenPixelsWidth;
string scriptString = "window.open('" + queryString + "','customWindow',' width=500, height= 790, top=0, left = 5000, AddressBar=No,status=no,directories=no,menubar=no,toolbar=no,scrollbars=no, location=no,resizable=false,titlebar=no' );";
Page.ClientScript.RegisterStartupScript(this.GetType(), "pop", scriptString, true);
}