Just nu i M3-nätverket
Jump to content
KarlGunnar

Wait Modal

Recommended Posts


Jag försöker lägga in en "Wait Dialog" i form av en progress-bar.
I "Button1.ClientScript" har jag vid frågetecknen provat med olika
alternativ, men har inte fått det att fungera.
Jag undrar om det är någon som kan hjälpa mig att lösa detta problem?


Sub Page_Load(Source As Object, E As EventArgs)
If Not Page.IsPostBack Then
Button1.ClientScript.RegisterStartupScript(Me.GetType(),"???","???",true);
End If
End Sub

<script type="text/javascript">
var myApp;
myApp = myApp || (function () {
var pleaseWaitDiv = $('<div class="modal hide" id="pleaseWaitDialog" data-backdrop="static" data-keyboard="false"><div class="modal-header"><h1>Processing...</h1></div><div class="modal-body"><div class="progress progress-striped active"><div class="bar" style="width: 100%;"></div></div></div></div>');
return {
showPleaseWait: function() {
pleaseWaitDiv.modal();
},
hidePleaseWait: function () {
pleaseWaitDiv.modal('hide');
},

};
})();
</script>

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True" />

<div class="modal hide" id="pleaseWaitDialog">
<div class="modal-header">
<h1>Vänta.....</h1>
</div>
<div class="modal-body">
<div class="progress progress-striped active">
<div class="bar" style="width: 100%;"></div>
</div>
</div>
</div>

<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
</form>


Share this post


Link to post
Share on other sites

Det där ser ut som ASP.NET Webforms. Då tror jag du vill använda OnClientClick på din knapp

 <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" OnClientClick="myapp.showPleaseWait()" />

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×