Hi everyone,
I need help here , It seems I missed something , when page loaded , the modal activated , and I cannot do anything .
I need to activate it (Modal ) only on some events , not all post back events.
Please help .
Thanks in advance :)
below is my code :
<pre> <style type="text/css">
.menu
{
font-weight: 700;
}
.menu
{
font-family: Arial;
}
.menu
{
font-size: medium;
}
.style1
{
color: #FFFFFF;
}
.auto-style1 {
color: #FFFFFF;
font-size: large;
}
</style>
<style type="text/css">
.modal {
position: fixed;
top: 0;
left: 0;
background-color: black;
z-index: 99;
opacity: 0.8;
filter: alpha(opacity=80);
-moz-opacity: 0.8;
min-height: 100%;
width: 100%;
}
.loading {
font-family: Arial;
font-size: 10pt;
border: 5px solid #67CFF5;
width: 200px;
height: 100px;
display: none;
position: fixed;
background-color: White;
z-index: 999;
}
</style>
<pre> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
function ShowProgress() {
setTimeout(function () {
var modal = $('<div />');
modal.addClass("modal");
$('body').append(modal);
var loading = $(".loading");
loading.show();
var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0);
var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0);
loading.css({ top: top, left: left });
}, 200);
}
$('form').live("submit", function () {
ShowProgress();
});
</script>
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If IsPostBack = False Then
Dim script As String = "$(document).ready(function () { $('[id*=bttAdd]').click(); });"
Page.ClientScript.RegisterStartupScript(Me.GetType(), "load", script, True)
End If
End Sub
What I have tried:
I tried removing these lines in page load event :
If IsPostBack = False Then
Dim script As String = "$(document).ready(function () { $('[id*=bttAdd]').click(); });"
Page.ClientScript.RegisterStartupScript(Me.GetType(), "load", script, True)
End If
after that all postback event fire modal .