.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to Javascript download one time not every Session speed performance

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :ASP.Net
my Side when open every time javascript file download i want only one time download not every time for web site speed performanceHow to Javascript download one time not every Session speed performance

View Complete Post

More Related Resource Links

how to check one time java script file download not every session

how to check one time java script file download not every session

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.

Session time out earlyer with in 5 min.


In my live site session time out with in 5 min only.how can i get the default i.e 20 min time . below webconfig file give below

<?xml version="1.0"?>
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, &#xA;        System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, &#xA;        PublicKeyToken=31bf3856ad364e35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, &#xA;        System.Web.Extensions, Ver

Speed: NGen Revs Up Your Performance with Powerful New Features


In the .NET Framework 2.0, NGen has been greatly improved and offers a number of compelling new features to make it easier and faster to deploy high-performance managed applications. This article introduces some of these new features and explains how and when you should use NGen to improve the performance of your apps.

Reid Wilkes

MSDN Magazine April 2005

Session Time


Dear All,

My page is logging out in 20 minutes. I want my page should not be logged out for 60 mins.

Please suggest how to do this


Session variable in Javascript

Hi, I had tried to use a Session variable in Javascript which are placed in the Header html. but got no luck. In my Init function, I intended to read the username value from database and place it in the session variable["username"].Then the username can be utilized in the second line of code shown as below. <script type="text/javascript"> //load session variable into "username" here. Sys.Application.add_load(Init); </script> <script type="text/javascript" src="http://api.art.com/api?service=api&v=3.1.9&user=<%=(string)Session["username"]%>"></script>Here are the code inside the Init:function Init () { WebService.GetAuthentication(getAuthenticationOnSuccess, getAuthenticationOnFailed); } function getAuthentication() { WebService.GetAuthentication(getAuthenticationOnSuccess, getAuthenticationOnFailed); } function getAuthenticationOnSuccess(result, context) { if(result) { getQueryStringInfo(); } } function getAuthenticationOnFailed(error) { showError(error); } Please help.Cheers,  

getting Session Variable using Javascript

Hey Forumers,I have been trying to get this javascript to work, but it seems it doesn't display my image.<script type="text/javascript">function getAvatar(){    var currentUser = <%=Session("UserName")%>    $('himg_something').src = "~/ProfileImage/" + currentUser + "/avatar.jpg"}    </script>himg_somthing is the img tag as follows:<img id="himg_something" alt="Avatar" src="~/ProfileImage/Image1.bmp" onload="getAvatar()"/>What I am basically trying to achieve is to display the user's avatar based on the session variable in code behind, but I cannot seem to get it to work. Thanks in advanceZeph

CPU Performance over time

Hello trying to get a hold of my cpu useage at 15min intervals starting from 00:00 then 00:15 then 00:30 and so on until 23:45 Cribed this off the interveb which gives it every minute but this is too detailed! DECLARE @ts_now bigint = (SELECT cpu_ticks/(cpu_ticks/ms_ticks)FROM sys.dm_os_sys_info); SELECT TOP(30) SQLProcessUtilization AS [SQL Server Process CPU Utilization],                SystemIdle AS [System Idle Process],                100 - SystemIdle - SQLProcessUtilization AS [Other Process CPU Utilization],                DATEADD(ms, -1 * (@ts_now - [timestamp]), GETDATE()) AS [Event Time] FROM (       SELECT record.value('(./Record/@id)[1]', 'int') AS record_id,             record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int')             AS [SystemIdle],             record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]',             'int')

Performance - page is being loaded for the first time vs SubSequent Request

Hello, I have some serious performance Issues with  Windows controls loading first time on IE Browser then subsequent request's. When ever i open Browser first time , mywebsite takes 7 seconds to load, but on subsequent request  without closing browser it loads with-in 2 seconds.I Knew IIS on first time it re-compiles the process and for subsequent request's  it wont perform and it cahches .I'm looking for better  options to improve performance,  when ever  first time reqest's  comes to web server. On IIS 7  Server,I was using both Dynamic and Static compression enabled.Also,On application pool ,I set "ShutDown Time(Limit)" and "Startup Time(Limit") to 90 (seconds).Here is web.config i disable below to improve performance issues.   <trace enabled="false" pageOutput="false" />    <compilation debug="false"/>   Here is the Server Configuration Windows 2008 ServerIIS 7 64   bit Upto Date patches..Net Framework  2.0,3.0,3.5   Need   inputs to improve performance when user call website for  first time...

Setting a session variable OR passing along information in Javascript

Hello, Form1 needs to send information to Form 2. Form2  opens in it's own window and is sized smaller. I need to send information to Form2 in order to set parameters in the query in Form2. At first I was just going to use an asp button control and load up some session variables, then I remembered that in order to have the next screen (Form2) open in its own window and be able to size it, I had to use an input type="Button" and use Javascript to open the new window like this:<script type="text/javascript"> function open_win() { window.open("/Accounts/Form2.aspx","_blank","toolbar=no, location=yes, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=1000, height=500"); } </script> But by doing this, I don't know how to pass the information along I need for Form2. How can I pass variable information to Form2?  The data comes from two textboxes on Form1: txtStartDate and txtEndDate. Thank you. 

Performance of XBAP in .NET 4 degrades after a long idle time.


A few of my clients are using XBAP application running over .net 4 client profile in IE8. The operating system they use is windows XP (service pack 2 or 3) on all their machines. We've had no issues during install of the .net framework or our XBAP application but many of them are complaining that after keeping the xbap open for a long time their computer begins to slow down considerably. This specially happens when program is left open without using it for some time. On my own development system which is a windows 7 machine with full .net framework installed i haven't experienced such issue.

I checked for resource usage of the application but there is no significant increase in memory usage. The CPU consumption however becomes quite high, which I suspect is the reason for degradation of performance during these episodes. If this was a single case i would have ignored it for some glitch on their system but this is happening on many machines and I suspect this has got something to do with .net framework on xp machines.

I don't see any reason for why this should be happening. Is there any documented bug, report related to this ? Are there any compatibility issues of .net 4 with other common programs running in xp?  Do you have any idea on why this could be happening ? What kind of data should i provide you s

Session time out alert box and redirect login page


Dear all,

Now I am using Form authentication for my website. 

It is something like that below. But if I left the website without using it for quite some time and when I used it back, it is redirected to the login page. 

The one I want to know is that it is because of session expire or cookies expire. And if it is session expired, I want to show the alert box and redirect to the login page. And one more thing is that if the user keeps on using the website, I want to extend the session expire time. If you do not mind, I want to have some references for this scenario. Thank you so much.


If myUser.IsValidUser(txtUserName.Text.Trim, txtPassword.Text.Trim) = True Then

ASP.NET session variables, do you need to save each time?


Anytime you change the object variable that is already assigned to a session variable, do you need to "re-save" the variable back into the session variable or does it do it automatically?

For example:

// abc is an object of some random type

Session["abc"] = abc;  // initial declaration of session variable.

abc.a=1;  // updated abc.a field after a button_click event

Session["abc"] = abc;   // resave the new field value of 'a' back into the session variable 'abc'.

Or does the session variable already keep track of all changes made to the object and saves automatically?


download a page lose authentication/session state


Hi All,

I have an issue of keeping the authentication and session state on a downloaded page, on the same website.

I have 2 pages, page 1 will download page 2, using the following code:

Page 1 code:

System.Net.WebClient webClient = new System.Net.WebClient();
byte[] buffer = webClient.DownloadData("http://www.mywebsite.co.uk/page2.aspx");
return Encoding.UTF8.GetString(buffer);

but the authentication is lost, so i needed to re-login in page 2 by writing auto login code myself.
But then the session is lost, so the session variables set in page 1 cannot be share to page 2, and vice versa.

Ideally, i needed page 2 to keep the authentication and session state when i call webClient.DownloadData()

Is there a way to do this?
Many thanks!

Best time to save "structure" session variable


I have a structure that groups a number of fields together that I want to use to retain values between different web pages. My plan was to transfer the structure to a session variable and retrieve it as each page loads. In theory each of the different fields could be stored in and retrieved from separate session variables but the structure approach seemed more elegant.

I was initially assuming I would be a "sensible time" (e.g. specific event) when I could consistently save the structure content to the session variable but I realise that I may be on the wrong track and that it may be necessary to transfer to the session variable to the structure each time one of the individual field values is updated as there is no way of determining when the user is about to move to another page.

Is there a solution to this or a better approach?

getting time and date from datetime field in javascript


Hello guys, I need to get hours from the difference between two datetime fields. I wrote the javascript which will get the date from datetime field.

But its not getting the correct time that entered on date time field. Its defaultly getting the current time on my system.

So do you guys have any idea. How to get time from date time fields. and how calculate hours between two datetime fields using javascript.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend