Reputation: 1022
I am using java script click event to call one server function to assign some session values. But this java script is only calling in the Onclick event of the Anchor tag. this redirecting to other pages.
<a onclick="javascript:SetSession();" href="Some other page">
<asp:Button runat="server" ID="ButtonId" Style="display: none;" OnClick="SetSession" />
Then the Javascript function is
function SetSession()
{
var y = some values;
$("#hiddenfield").val(y);
document.getElementById("ButtonId").click();
}
Then the C# code is like
protected void SetSession(object sender, EventArgs e)
{
Session["SessionName"] = this.HiddenField.Value;
}
Its working fine in all browsers except Chrome. Even it is not calling the Button.Click() Server function In chrome ! I need the same functions. AnyOne Know the solution for chrome ?
Upvotes: 0
Views: 1371