Jquery - Block UI When Postback?

Mar 4, 2011

how to block UI when postback from buttons in form or in updatepanel and show "processing...". after return postback unblock UI.may be jquery plugin?

View 1 Replies


Similar Messages:

Javascript - How To Retain Script Block On A Partial Postback

Nov 20, 2010

This is a problem I'm facing in a webapp I'm currently working on. So instead of cluttering the question with unrelated code, I recreated the problem in an isolated, simplified webapp that only demonstrates this issue.

I have a web user control with just this as its content:

<% if (ShowAlertScript)
{ %>
<script type="text/javascript">
function AlertMe()
{
alert('Hello World!');
}
</script>
<% } %>
<input type="button" onclick="AlertMe()" value="Say Hello" />

And its codebehind has nothing more than the boolean definition of ShowAlertScript. This represents a control I have in the big webapp that has two modes: input mode, and display mode. When in input mode, it has a large javascript block that is only useful then; it does some cool stuff to help the user input the info.The way this control is laid out in the big picture is as follows:

<asp:ScriptManager runat="server" />
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:MultiView ActiveViewIndex="0" runat="server" ID="mvw">
<asp:View runat="server">
<asp:Button runat="server" ID="btnSwitch"
OnClick="btnSwitch_Click" Text="Switch" />
</asp:View>
<asp:View runat="server">
<uc:MyInputControl runat="server" ID="micInput" ShowAlertScript="true" />
</asp:View>
</asp:MultiView>
</ContentTemplate>
</asp:UpdatePanel>

When you click btnSwitch, it simply switches to the second view with the user control. Notice how I have the ShowAlertScript already initialized to true. The potential output is that since I'm "showing the alert script" within the user control, the AlertMe() function will execute when you click the input-button element, because it's written out according to the inline if statement.

If you run this code I gave you so far as is, it will not work. The browser will say it can't see the AlertMe() function; it's undefined as far as it knows. But if you take out the UpdatePanel (or disable the ScriptManager's partial rendering), it will work just fine on a full postback when you click btnSwitch.

I want it to work on a partial postback, because this whole thing is a small piece compared to the rest of the page, and I don't want to do a full postback every time they switch views. Apparently, the ScriptManager doesn't even bother re-rendering the ascx file for possible changes. Either the ScriptManager is not smart enough, or there is an option I'm missing to let it render the <script> so I can invoke its methods on the client side. A potential answer someone might suggest is "why don't you take out the javascript, put it in its own .js file, and have the page reference it so it's available to the control?"
That won't really work with me, because the script block does some initialization and modification that pertain to that single control instance, not to all others on the page.

In turn, you might also be concerned that if I have more than one instance of the control, I end up with copies of the same script. Not really; there will only be ONE input mode of this control in a page at any given time, it's just that I have those two modes in two separate views and I let the user switch between them.

View 2 Replies

Web Forms :: Button Click Triggers HTML Table Refreshed Even Put Within Postback Block?

Aug 6, 2010

I'm reading an invoice dataset and building a html table with checkboxes and textboxes in it, and I put that code in a postback = false block, then i got a button and a literal. The button click will loop through the html table checkboxes to calculate a total and assign it to the literal and display it. I got everything working except one thing, every time i click the button, the html table refreshes and lost all the value in textboxes....even though I put the html building block in the postback = false block,it seems like it still won't preserve the values in the textboxes once there's a button click...Anybody knows a solution to that? I want the textboxes keep what values are there.

Here is the code part:

[code]....

View 4 Replies

JQuery :: Uframe Postback Button Control Getting Postback The Page Even The Client Side Method Call Also?

Jan 28, 2011

iam using the Jquery Uframe with asp.net project.Iam getting a postback problem here.

In side the uframe ,button control getting postback the page even the client side method call also.

i tried with the Html button Control also by setting the type="submit" ,iam facing the same problem.

And I got very limited reference about the uframe(codeflex,codeProject).

View 6 Replies

Popup After Updatepanel Postback Is Blocked By Popup Block?

Oct 20, 2010

I make a polling and want to popup the result immediately by window.open function after partial postback (updatepanel). But the popup is blocked by popup blocker. How can I fix it?

Here is my code:

[code]....

View 1 Replies

Web Forms :: Menu Item Block / Master Page That Has Block Around The Text When The Page Is First Run?

Jan 29, 2011

I have menu item on my master page that has block around the text when the page is first run. I wrote in the css on the link and visited property to change the color to match the image color that it is on. When a menu item is clicked the color changes to the right color. How do I get it to the right color on when the page first opens or is there a way to get rid of the block or make it transperant?

View 1 Replies

JQuery :: Jquery CollapsePanel Save State When PostBack?

Aug 3, 2010

l have a jquery Collapse Panel in UpdatePanel.When I PostBack.I want some Panel Remember its state is expand or collapsed.

Here my code in Jquery and How Can I Improve it !

[Code]....

My HTML Code :

[Code]....

View 1 Replies

To Reach A Variable From A Different Code-block Expression Than The Block Where The Variable Was Declared ?

Oct 25, 2010

I have 2 separate code-block asp.Net expressions in an aspx markup, with an html content between (span element in the example below). In the first code-block, there is "i" as an increment variable for the for loop.Then the code-block is cut with an html content.And another code-block expression is opened but as I see I can reach the "i" variable which was declared in the previous code-block.

So, how asp.net handles -compiles- the pieces of code-block experrions declared in the mark up? Does it check the semi-colons and generates some anonymous methods which will end up with many calls to Response.Write in the last place?
<p>
<%for (int i = 0; i < 30; i++)
{

[code]....

View 2 Replies

Jquery Postback Maintains Same Tab After Postback?

Jan 27, 2010

I'm using jquery tab and following js method, how and what can i modify it to maintain state of tab between postbacks? (This resets tabs to first tab after page_load)

[Code]....

View 1 Replies

MVC :: Postback In 2 Using JQuery Dialog UI?

Nov 24, 2010

postback in 2 using jQuery dialog UI?

[Code]....

[Code]....

[Code]....

View 9 Replies

How To Do Postback Javascript Jquery

Mar 30, 2011

<asp:Button ID="btn" OnClientClick="if(confirm_delete()){
/* post back*/
}else{
return false;
};" OnClick="btnDelete_Click" runat="server" Text="delete"/>

I have this code but I cant do postback for it, im not sure how to?

is it:

<script type="text/javascript">
function CallServer() {
__doPostBack('not sure what goes here','or here');
}
</script>

[Code]....

View 4 Replies

Jquery Tab Selection On Postback?

Jun 25, 2010

I have an asp.net page with some JQuery tabs. Everything works ok.I added a dropdownlist in one of the tabs, that causes a postback. After the postback I want the same tab to be selected.I initialize the tabs as:

<script type="text/javascript">
$(document).ready(function() {
var $myTabs = $(".tabsDiv").tabs();
</script>

Then, on the PageLoad event, I inject a script to select the tab:

Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "TabSelect", "$myTabs.tabs('select', 1);", true);

For some reason this doesn't work. The script is running but the tabs are not selected.Is it because the RegisterClientScriptBlock places the script in the bottom of the page and, for some reason, it runs too late?

View 2 Replies

JQuery :: Show Ui Dialog On Postback?

Dec 28, 2010

What's a good way to show an jquery ui dialog on postback ?

1. Create the whole div in on the server and populate an asp literal control and fire the required javascript (but when).

2. Use hidden fields for your values inside the div, fire the required javascript (but when).

3. Someone has another viable solution for me ?

View 3 Replies

Stop Postback After Using JQuery Dialog?

Dec 6, 2010

I have a JQuery Dialog that is opened when a button is clicked. The first time around, it should do a postback, but when the dialog closes and I click the refresh button of the broswer, it sends the data again and duplicates the data I just entered. Should I add a return false somewhere so it doesn't postback when the dialog is closed. Here is the script:

[code]....

View 3 Replies

Apply Css For Elements Even After Postback-jquery?

Sep 11, 2010

I have many hrefs(with dynamic Ids) in my asp.net app that have the same CssClass=MyClass.

I want these button to be hidden with a condition.

I used the .ready

$(document).ready(function() {
if(condition)
$('.MyClass').css("display","none");
});

the problem is docuement.ready doesn't execut when there is a poctback. Postback==>Button visible.normal as i've put the code in .ready. Is there a way to persist the code:$('.MyClass').css("display","none"); I tried to apply .live() on button load,but it doesn't work.

View 2 Replies

JQuery :: How To Prevent Postback For Dropdown

Feb 8, 2011

In dropdown when i select value(not text) "0" it should not go for postback,

to do this i am using e.preventDefault();

if i select other than "0" it has to go postback.

but,it is always going for postback ,the e.preventDefault(); is not working.

How can i achieve this in jquery?

return false; is also not working.

i am sure that i am selecting the value "0", i checked it by using alert();

View 3 Replies

JQuery UI Dialog With Usercontrol And Postback?

Mar 31, 2011

I have a jQuery UI dialog which has a usercontrol in it, which I get by .load of the page it is in. It is a simple calculator.You pick several numbers and then click a button, a postback happens and finally you get the result in to two lables.When I click the button inside the dialog, the postback happens and I see the result in the original page, not the dialog.

View 1 Replies

MVC :: Updating A Listbox Without Postback With Jquery?

Feb 15, 2011

I have a listbox in my view:

@Html.ListBoxFor(m => Model.Runtimes, new SelectList(Model.Runtimes, "Id", "Runtime"))and when I access the page all the runtimes in the model are displayed as expected. I also have a button in my view with a jQuery function attached to it: btnIntermediate.click(function () { timer.addIntermediate(function (runtime) { url = "/Timer/SaveRuntime/?runtime=" + runtime; $.get(url); }); });It saves the runtimes to the model. My problem is how to update my Listbox with the new entry in the model without triggering a postback(since it will stop my timer)?I'm

View 1 Replies

JQuery :: Cancel Postback With JConfirm?

Jun 21, 2010

have a problem with the command jConfirm ..

View 1 Replies

C# - JQuery Is Not Working After Partial Postback?

Aug 25, 2010

I have this jquery functions below in external file. So after partial postback jquery is not working. I need to load jquery from server side on partial postback.

can someone show me what I need to call in this code and how to load jquery

[Code].....

View 2 Replies

JQuery :: Remember Tag State Through Postback?

Dec 16, 2010

I'm trying to make a div tag retain its state through postback. here's my code

[Code]....

What happensis this: If you click the "toggle" button div tag id sub3 will display. If you click different button div tag blah will display. If you click refresh then both the toggle and different div tags disappear.

What I want to happen is to have the div tags to be in the state they were before the user clicks on the refresh button.The refresh button can do anything to make this happen but I need the div tags to save their state through postback.

View 5 Replies

Some JQuery/ To Add The Item Into The Collection Without Having Full Postback?

Jan 29, 2010

I have never done jquery and need some assistance/advice on something I am trying to do.I basically have an ASP.NET MVC Application.
What I want to do is, asynchronously be able to do a partial postback when a button is pressed.It's a simple application that should add items and retrieve existing items from an IEnumberable<T> collection.

so, when a button is pressed, it should be able to add the item into the collection on the ASP.NET site without having to do a full postback.

View 8 Replies

How To Trigger A Postback Using JQuery Droppable Plugin

May 11, 2010

This is my script for the draggable and droppable

<script type="text/javascript">
$(function() {
$(".Source li").draggable({

[code]...

Now I want to access the value of the "TxtItemId" control in the code-behind through a postback. How do I go about doing this ? BTW, this is for a scenario where a person will drag an item from a panel into a shopping cart and I need to capture the Id of the dropped item and trigger a postback after the drop to update the quantity of that item in the cart.

View 2 Replies

C# - Calling JQuery Function From Code Behind After Postback?

Feb 22, 2011

I m trying to call a JQuery .click funtion after page postback from code behind. I m using ASP.NET with C#.

View 2 Replies

Textbox With Jquery Ui Datepicker Value Lost When Doing A Postback?

Mar 10, 2011

I've got an application that uses jquery ui datepicker on an asp.net textbox control.The control is working as intended, but I've noticed that when you postback from a server call (via submit button), the entered value gets lost in the application.Was wondering if you all have experienced this? And what measures that you have to do to prevent this?Here is my code:HTML:

<asp:TextBox runat="server" ID="txtCallsMadeFrom" class="field" EnableViewState="true">

JQuery:

var callsMadeFromId = '#<%=txtCallsMadeFrom.ClientID %>';
jQuery(callsMadeFromId).datepicker({ showOn: "button", buttonImage: "../images/calendar.gif", altFormat: 'dd/mm/yy', buttonImageOnly: true, onSelect: function () { } });

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved