|
I am seeing the alert textbox, but my progress bar does not increment, can anyone tell me what I've done wrong? The static value does work.
Thanks
<asp:FileUpload ID="thefile" runat="server" onchange="readURL(this);fill_out_filesize(this.files[0].size);progressBar();" itemid="thefile" value="thefile" Width="347px" />
function progressBar() {
alert("test");
var variable = 1;
var result = 0;
do {
result = ++variable
$("#progressbar").progressbar({
value: result
});
sleepFor(2000);
} while (true);
}
function sleepFor(sleepDuration) {
var now = new Date().getTime();
while (new Date().getTime() < now + sleepDuration) { }
}
|
|
|
|
|
This is exactly what I want, only I am not sure how to implement into my code and where? I've tried and done so unsuccessfully because it is still not working
Edit fiddle - JSFiddle[^]
|
|
|
|
|
<h2>Dynamic Progress Bar</h2>
<div class="w3-progress-container">
<div id="myBar" class="w3-progressbar w3-green" style="width:1%"></div>
</div>
<br>
<button class="w3-btn w3-dark-grey" onclick="move()">Click Me</button>
<script>
function move() {
var elem = document.getElementById("myBar");
var width = 1;
var id = setInterval(frame, 10);
function frame() {
if (width >= 100) {
clearInterval(id);
} else {
width++;
elem.style.width = width + '%';
}
}
}
</script>
trust mauchaza #facebook
|
|
|
|
|
Hi Exports,
I have an asp.net 2.0 application, which is very slow in performance. we have triggered the issue down the line, we are surprised with issue. The application used lot of database operations and respective stored procedure have lot of complicated business logic, but the stored procedure won't take much time to execute on SSMS(SQL Server) but when we access same stored procedure through the application it take huge time. please suggest me how i can resolve the time consuming problem.
|
|
|
|
|
There are lots of good suggestions in this article[^] for you to try.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Are you sure it is the sql that is taking longer? If you are displaying results into a grid and have lots of results I'll bet the slowdown has nothing to do with SQL but is actually the browser trying to render all that html. This is a common problem.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hey
SQL query works on very efficient manner, my stored procedure won't take more than 2sec to execute, but the issue with application
|
|
|
|
|
VishwaKL wrote: , but the issue with application That's what I was saying. You're probably trying to display too much data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hello,
I am getting error while navigating to a asp page using,
WebBrowser1.Navigate "http://www.website.com/serial.aspx"
as
"An error has occured in the script of this page"
Error: "Webform_Postbackoption" is undefined
How to solve this error ?
|
|
|
|
|
You can't. The error is on the website you're trying to navigate to, and needs to be fixed by the people who wrote that site.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming wrote: needs to be fixed by the people who wrote that site Sorry for not mentioning. The website which I am navigating is belongs to me.
|
|
|
|
|
|
how to make a client side chatin in mvc4..pls help..i have tried this as server side..bt need to client side..
|
|
|
|
|
It will take a ton of code to do it. Can you ask a more specific question?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I have one page in my VS 2013 VB.NET Web App project that doesn't open in IIS Express, giving the above compiler error message.
The funny thing is that the page works fine if the file size of the .ASPX file is 263,113 bytes, but causes the error if it is ONE BYTE LARGER! But the 'one byte' must be in the Javascript, not in the HTML or anywhere else. It can be in a javascript comment. Add the byte, the page doesn't work -- giving the compile error. Remove the one extra byte and it works fine.
Event Viewer describes the error as: Event ID: 1310 Qualifier: 32768
Source: ASP.NET 4.0.30319.0
I can move the page to my test server and it runs fine. It only happens in IIS Express when debugging in VS 2013.
If anyone has a clue, please let me know! I really don't want to be running 'regular' IIS here on my development machine, but will if push comes to shove! My Web App is quite large and uses lots of AJAX. I have larger pages that do the same sort of AJAX which work without fail.
|
|
|
|
|
That error code, more frequently quoted in hex as 0x80070008 , means "not enough storage". From what I can see, it usually means you're running short on memory.
Try splitting the page up into user controls, and moving any script or style blocks to external files.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks for this advice! While developing a page like this I like having all its script and style right there in front of me so I don't have to go hunting around, but if this is causing a problem I'll gladly move as much as possible into external files.
For now I've worked around the problem by removing all superfluous comments and reducing the javascript by generalizing and reusing some of the 'heavier' functions. But I still have lots of code to write here, so I'll hit the limit again at some point!
BTW: How does one convert an error code like 2147024888 into HEX 0x80070008 -- which actually does return useful stuff in the Google?
|
|
|
|
|
Stevens wrote: How does one convert an error code like 2147024888 into HEX 0x80070008
It's actually -2147024888 - the sign is important. And I tend to cheat and use the "Programmer" mode in the Windows calculator.
Alternatively, you can do it in code:
Console.WriteLine("{0:X}", -2147024888);
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Ha ha, works for me! Thanks!
|
|
|
|
|
I have an Intranet application and have developed a training video where I would like to have the users be able to view it.
I found the following code to have the Media Player embedded on my page ..
<embed id='embed1' runat="server" name='mediaPlayer' type='application/x-mplayer2'
pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' displaysize='4'
autosize='-1' bgcolor='darkblue' showcontrols='true' showtracker='-1' showdisplay='0'
showstatusbar='-1' videoborder3d='-1' width='1024' height='768' designtimesp='5311' loop='false' />
In the Code Behind, I set the source for the video as follows:
embed1.Attributes.Add("src", Server.MapPath("~\Videos\" & sVideoName))
Everything works fine if I execute it within the Visual Studio 2015 environment, but when I deploy it to my IIS 7.5 (Win 2008R2) web server, nothing is displayed and no errors are listed.
I must be missing something on the IIS side. But what?
Thanks in advance.
|
|
|
|
|
Check in IIS if .mp4 is defined in the mime types for the app.
|
|
|
|
|
I am working on an asp .net application that is having a lot of performance issues. This application is a pre-ajax application. When the application is first displayed a default.html page loads and redirects the application to the primary asp page using JavaScript as shown below:
<script>
Handle = window.open('WebForm1.aspx','','width=300px,height=200px');
Window.opener = handle;
Handle.focus();
</script>
Now in the newly opened WebForm1.aspx page an asp:GridView is defined that opens a new asp page when a row is doubled clicked. The way this is handled is in the GridView’s RowDataBound event the follow command is added to the e.Row.Attributes value as below:
e.Row.Attributes.Add(“ondblclick”, “window.location=’WebForm2.aspx?id=” + view.DataKeys[e.Row.RowIndex].value + “’”);
Now, looking at how the application is designed and written using both the JavaScript window.opener and window.location methods could this be a primary source of the performance issues and if so is there a better way at implementing the functionality?
|
|
|
|
|
Most popup blockers are going to block your onload script. And why are you restricting the user to such a tiny window?
It would be much better to use:
location.assign('WebForm1.aspx');
That way, the page opens in the current window / tab, and doesn't get blocked.
Alternatively, remove the landing page, and set WebForm1.aspx as your default document.
Since you're using the RowDataBound events, you can retrieve the ID directly from the row's DataItem , rather than using the DataKeys collection:
protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
e.Row.Attributes.Add("ondblclick", DataBinder.Eval(e.Row.DataItem, "ID", "location.assign('WebForm2.aspx?id={0}');"));
}
Alternatively, you could store the ID in a data- attribute on the row, and use JavaScript to wire up an event handler on the parent grid:
protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
e.Row.Attributes.Add("data-id", DataBinder.Eval(e.Row.DataItem, "ID", "{0}"));
}
$("#GridId").on("dblclick", "tr[data-id]", function(){
var id = $(this).data("id");
location.assign("WebForm2.aspx?id=" + id);
});
The performance issues are most likely related to loading the data from your database. However, you would need to profile your code to determine precisely where the bottleneck is.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
First, the page size is persented differently but I was just using the sizes displayed as an example. This is actually how the open command size is defined:
handle = window.open('WebForm1.aspx','SecSys', 'resizable=1,top=0,height=' + (window.screen.availHeight - 35) + 'width=' + (window.screen.availwidth - 10));
Now, from what you are saying you do not believe that the use of JavaScript to redirect to the different asp pages is an issue. Is this correct?
modified 21-Jun-16 15:24pm.
|
|
|
|
|
Using JavaScript to load other pages is unlikely to cause any performance problems.
I still think you'd be better off using location.assign instead of window.open . Displaying a splash page and then trying to open the real site in a new window will just annoy your users - especially as they'll have to turn off their popup blocker to use it!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|