I’m using the PageSlide plugin. I added a form to the div#modal, ASP label and a button.
However, the button just doesn’t fire a postback event upon click.
HTML:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="js/jquery-1.8.3.min.js" type="text/javascript"></script>
<link href="css/jquery.pageslide.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<script src="js/jquery.pageslide.min.js" type="text/javascript"></script>
<a href="#modal" class="second">Show</a>
<div id="modal" style="display: none">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><br />
<asp:Button ID="Button1" runat="server" Text="Submit" OnClick="Button1_Click"/>
</div>
<p><a href="javascript:$.pageslide.close()">Close</a></p>
<script>
$(".second").pageslide({ direction: "left", modal: true });
</script>
</form>
Code-behind:
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "Its Working";
}
Can anyone please tell me what’s wrong? Thanks in advance. 🙂
In my opinion, the reason for such behavior is because plugin clones modal div and use cloned content to show modal popup. Thus, the
Button1doesn’t placed in form anymore and doesn’t causes postback on click. Try to setUseSubmitBehavior="false"button’s property. This way postback should be fired via javascript instead of defaulr submit button’s behavior