updatePanel set async type request - updatepanel

How set Type UpdatePanel To Async.
for this User that Continue work to page.

It's hard to understand well your question because of a lack of information, but did you know an update panel is asynchronous itself?
UpdatePanel is an ASP.NET AJAX control that lets some part of your page to be partially-rendered, meaning it can be updated without a full-postback.
If you want to do other asynchronous things, you may need to use more than an UpdatePanel, or leverage ASP.NET Callback API, or just use jQuery/AJAX.
Perhaps you've a single update panel that updates the entire page... If this is true, why you'd want to use UpdatePanel? :)

Related

Adding ASP.NET Server Side Controls Dynamically Like as Javascript

I have a simple aspx page.
In this page I want to add dynamically dropdownlist-textbox pairs that represent key-value pairs. But I dont know how much it is when page loading.
So I must add these controls to page dynamically(in runtime)
If I add these controls in codebehind 2 problems arise :
Page is reloaded in every appending because of autopostback. It couses blink.
Whenever page reloads, previous appending disappear.
If I add these controls in client-side(javascript) :
Controls cannot be reachable in codebehind(because no runat=server) so validation steps open to user(I think validation steps must operate in codebehind othervise this is an integrity problem).
What would be true approach about this problem ? Could give example ?
If you want to avoid the blink(page reload) you have to go for adding the control dynamically into your form using JavaScript.
Controls cannot be reachable in codebehind(because no runat=server)
This statement is not correct, you can always access your form control at server side using Request.Form collection. Check here for more details. You will be required to iterate over the contents of this collection to get the values.
I think validation steps must operate in codebehind othervise this is
an integrity problem
Validation you need to do by yourself before performing any operation. You might required to write some custom validation logic.

How do I automate tab selection on a website

Here is the website I am trying to access. I dont want the default tab (Day) though, I want to select the Season tab
https://www.eex.com/en/market-data/power/futures/uk-financial-futures#!/2017/05/23
The link appears to be exactly the same whichever tab is chose making differentiation impossible as far as I can tell.
Any help on this would be much appreciated, using whichever programming method and language is appropriate.
Kind Regards
Barry Walsh
The URL does not change since this is an ajax request, which you can see from MarketDataTableAController's getPageData function. You can read about them here https://developer.mozilla.org/en-US/docs/AJAX/Getting_Started
Ive inspected your html and you seem to be using angular. On further inpection you can see that the tabs have ng-click="setActiveTab(tab)" attribute on them. So whenever user clicks, this function gets executed. It is a matter of using this function with the appropriate tab object to get the content to change. You for example could put setActiveTab(tab) into your controller init method since setActiveTab() calls the forementioned getPageData() function to update the page.
Also the tab you are looking for is page.tabs[5] ($parent.page.tabs[5] if referring from TabController) since this is the tab with the label of season. Pass that to setActiveTab() and it should show you the season instead.
However this might not be a good solution since the tab array ordering might change. Then you would need to loop over all objects in page.tabs and see if tab.label === "Season" and pass that in the function instead or better yet use the $filter service provided by angular which would look more cleaner.
Your code source also seems to be minimized and its not very easy to read.

Why does ddl 'onchange' event not appear in intellisense?

I was working out a problem with a ddl trying to get a message box to popup when the item changed. You can read about that here >>>
How to Popup Alert() from asp:DropDownList OnSelectedIndexChanged?
The working answer shows me to use the onchange event but then I'm working in VS2010 this event does not appear in the intellisense dropdown. However if I type it in anyway it works fine.
For this, you need to understand how the thing works....when you change the value of a input element, onchange event gets triggered on the browser, so the browser looks for a way to handle it. So when you put the onchange event specified for the element it gets called.
Now, ASP.NET OnSelectedIndexChanged uses the same functionality(logically saying) to POST the page to the server. From there, the ASP.NET runtime triggers the function you wrote in the codebehind file and returns you the result. Now, if you really don't require any operation that can only happen on the server, you don't need to use the server functionality, instead you can do it in javascript.
On the other hand, if you want something that happens on server: like some database get, you are supposed to use the OnSelectedIndexChanged event.
And if you use the OnSelectedIndexChanged event, you can still call some javascript functions from there.
Page.ClientScript.RegisterClientScriptBlock(typeof(string),"myScript","alert('HI')",true);
To answer your question about intellisense, onchange is a event of input types, and in aspx pages, i guess you are using <asp:..> tags, which does not have the same event - thus visual studio does not show it in the intellisense. But when you put it, it gets assigned to the HTML markups, which is interpreted correctly by the browser.
PROS and CONS
onchange works on your browser, so it is lot faster than the server-side code. On the other hand, we had an issue once that the browsers has the capability to restrict pop-ups. So if you want some really important message to be shown, it is better to use the Server-Side event and the RegisterClientScriptBlock function.
Hope it helps.

Asynchronous view call in backbone.js when model is updated

I'm trying to make a demo application for practicing backbone.js.
In my app architecture I first designed the model and inside it wrote a code for parsing a JSON file and storing those records in localStorage and then populating model's attribute hotelsdata with the first 10 records of localStorage.
And then whenever I'm calling the backbone.view.extend() I'm fetching the data from model object.
Now, what I want to do is whenever my model is updated my view must also be updated from the new values in the model. I've already tried
model.on('change',function())
trigger but when I'm calling the view.render() method on the change event my page is being updated, but during the period of adding of records on the page my scroll is not working.
So, can anyone please suggest some way in which I can call that view.render() method asynchronously so that my page's scroll would not be affected during the pressing time of view.render().
In short when my view is being updated the scrolling of the page must work.
I think you have a problem of, how we can call it?, brutal render :)..
I should see your render() method to confirm it, but I think in your render you are removing from the DOM a big portion of the page and then recreating it again. This could cause your scroll to messup. And there is not any asynchronous behavior that can help you.
You should recreate the subelements of your View one by one to have a sweet scroll feeling.
(Show us your render() method if I'm completely confuse)

Creating "are you sure?" popup window by using html only

Assume I have a html from, and it contain some submit type. I want to create a "are you sure" popup window that will appear when user click submit button.
My question is that is there any way to create it by using "only" html, not using javascript or any other?
HTML only is possible, but not without a postback
Scenario that could work without javascript:
You have your form with submit button
User clicks (and submits) the form
You display another form with are you sure? form (that contains Yes and No buttons as well as hidden fields of the first form that will make it possible to do the action required on the original data
functionality that executes the action and goes back to whatever required.
This would be completely Javascript free, but it would require several postbacks.
This kind of thing is usually done on the client with a Javascript confirm() function (here's a simple example) or lately with a more user friendly modal dialog provided by many different client libraries or their plugins.
When to choose the script free version?
If you know your clients are going to be very basic ones (ie. vast majority of your users will access your application using clients like Opera Mini that's not able to run scripts at all). But in all other cases it's much better to do this using Javascript. It will be faster, easier to develop and much more user friendly. Not to mention that it will put less strain on your server as well since certain parts will execute on the client without the need of any server processing.
No, there isn't. Despite of the new features in HTML 5, HTML is still a markup language, not a programming language. In order to express dynamic behavior (such as an "are you sure?" box), you need to use a programming language.
Javascript would be the most obvious choice for this, but you could also do it with frameworks that can get you around writing Javascript by hand (for example ASP.NET).
Edit: Actually it appears that it would theoretically possible to do this with without Javascript or other frameworks. As I just learned, HTML 5 + CSS 3 seems to be turing complete. But this is hardly relevant to this question.
It's possible to ask for a confirmation, but it will not be in a "popup window". The creation of the "popup window" requires javascript/other language.
It will be:
Request (first form)
POST
Response (confirmation form)
POST
Response (outcome message)
You can create a form with all hidden elements containing the data from the first form and a "Yes" and "No" button below the "Are you sure?" text. You can use PHP sessions to avoid the hidden form elements. If there is a lot of data or confidential data or you do not want to re-validate the data from the second form, use sessions. Make sure you validate the data from either form before using it.
I know I'm like .. 10 years late. But for anyone still wondering I thought I could be of some help!
What I did for this exact problem was make sure I had multiple "divs" in my code. For me specifically, I had two main ones.
First, one whose id="main", and another whose id="popup" with the 'visible' property initially set to 'false' for the popup div.
Then, on whichever event you're looking for (button click for example) you'll simply set main.Visible = false and popup.Visible = true, then you could have more buttons in your popup (yes, no, cancel, confirm, etc.) which do the exact same thing, but in reverse!
The most important thing to make sure of is that you have the 'runat="server"' property in your divs so that you can access them in your CS code
Hope this was helpful! :)