Showing posts with label pages. Show all posts
Showing posts with label pages. Show all posts

Thursday, March 29, 2012

Performance problem with multiple choice questions

I'm working with a website that presents a series of multiple choice
questions to users.
The problem at hand is that the pages with the questions take some time load
and the users are under a time limit to answer the questions.
Would you know if there is a way to "download" the question bitmaps to the
user's PC to some type of cache before the timer starts for the user?Hello Night,
It depends on what your timer is?
Is it possible to start timer for each page, (after page load) and stop it
when user press next?
If not than I read your data into asp.net Cache and build it, but the buildi
ng
can takes some time.
I'd rely on timer stop/start after page is loaded and deduct this time from
overal time allowed to user to answer on all questions
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
NA> I'm working with a website that presents a series of multiple choice
NA> questions to users.
NA>
NA> The problem at hand is that the pages with the questions take some
NA> time load and the users are under a time limit to answer the
NA> questions.
NA>
NA> Would you know if there is a way to "download" the question bitmaps
NA> to the user's PC to some type of cache before the timer starts for
NA> the user?
NA>

Monday, March 26, 2012

Performance tuning ASP.NET applications

I have an ASP.NET application where one of the pages has a Save button to allow the user to save their work. So I have a client running the application in Internet Explorer, a separate IIS server running IIS version 6 and a separate SQL Server 2000 server where the data is saved in a database.
Some users are experiencing major performance issues during the save process. I'm looking for any pointers to articles on the web which can help me analyze/determine where the bottlenecks are in the entire process, i.e. is it a client problem, IIS problem or SQL Server problem.
Any help on how to do this would be greatly appreciated!
Thanks!!

Here's a few online resources related to ASP.NET performance:
ASP.NET Performance Overview
Improving ASP.NET Performance
ASP.NET Performance
Getting Started - Enhancing Web Site Performance with Caching
Optimizing Performance in ASP.NET
Developing High-Performance ASP.NET Applications
Hope these links help.

-- Erik Reitan

ASP.NET User Education
This posting is provided "AS IS" with no warranties, and confers no rights.




Om Sri Sai Ram

Performance :
http://msdn.microsoft.com/practices/compcat/default.aspx?pull=/library/en-us/dnpag/html/scalenet.asp

Caching:
http://msdn.microsoft.com/practices/compcat/default.aspx?pull=/library/en-us/dnbda/html/cachingarch.asp
Thanks,
Ram

Saturday, March 24, 2012

Permission Issue

I am trying to test some aspx pages on my local system. The code requires a
"db" directory off the root of the web site. In my Inetpub/myproj I added
the directory but cannot figure out how to give the application authority to
write into that directory. I get the error:

System.UnauthorizedAccessException: Access to the path
"c:\inetpub\wwwroot\OfficeApp\db\judgedata.csv" is denied.

In the error information it says to grant ASP.NET write access to a file,
right-click the file in Explorer, choose "Properties" and select the
Security tab. There is no "Security" tab. I must be missing something here?
How do I set that directory to allow asp.net to write to it?

Wayne"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:uaqU3wViFHA.3568@.TK2MSFTNGP10.phx.gbl...

> Security tab. There is no "Security" tab. I must be missing something
> here?

Uncheck the "Use simple file sharing" (bottom option) in the "View" tab of
the "Folder Options" dialog.

John
Thanks for the suggestion but after doing that I still get the same error?

Wayne

"WJ" <JohnWebbs@.HotMail.Com> wrote in message
news:eTlcryWiFHA.1460@.tk2msftngp13.phx.gbl...
> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
> news:uaqU3wViFHA.3568@.TK2MSFTNGP10.phx.gbl...
>> Security tab. There is no "Security" tab. I must be missing something
>> here?
> Uncheck the "Use simple file sharing" (bottom option) in the "View" tab of
> the "Folder Options" dialog.
> John
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:OV5Ov3WiFHA.1148@.TK2MSFTNGP12.phx.gbl...

> Thanks for the suggestion but after doing that I still get the same error?

This only lets you use the "Security" tab on the Windows Explorer. To fix
the error (access denied), you must grant r/w access to the account that
runs your website to the database file where your data resides.

John
John;

Thanks for the clarification. I did that and gave ASP.NET full control of
that directory but it still gives the same error when the code attempts to
create a file in that directory?

Wayne

"WJ" <JohnWebbs@.HotMail.Com> wrote in message
news:Og0ICGXiFHA.3544@.TK2MSFTNGP15.phx.gbl...
> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
> news:OV5Ov3WiFHA.1148@.TK2MSFTNGP12.phx.gbl...
>> Thanks for the suggestion but after doing that I still get the same
>> error?
>>
> This only lets you use the "Security" tab on the Windows Explorer. To fix
> the error (access denied), you must grant r/w access to the account that
> runs your website to the database file where your data resides.
> John
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:%233bhDRXiFHA.3280@.TK2MSFTNGP10.phx.gbl...
> John;
> Thanks for the clarification. I did that and gave ASP.NET full control of
> that directory but it still gives the same error when the code attempts to
> create a file in that directory?

Check your local website (IIS/MMC) to find out what account is configured
for the web site, then grant FC to that account. Example: If you allow
"Anonymous" access to the web site, then the User Account box likely shows
"IUSR_YourPCName". Try that see what happens.

John
"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:%233bhDRXiFHA.3280@.TK2MSFTNGP10.phx.gbl...
> John;
> Thanks for the clarification. I did that and gave ASP.NET full control of
> that directory but it still gives the same error when the code attempts to
> create a file in that directory?

Check your local website (IIS/MMC) to find out what account is configured
for the web site, then grant FC to that account. Example: If you allow
"Anonymous" access to the web site, then the User Account box likely shows
"IUSR_YourPCName". Try that see what happens.

John
John;

Thanks for the continued help. I am not sure how to determine which account
is configured for the web site (I thought ASP.NET was always used by VSNET
projects?) I went to Control Panel/Administrative Tools/IIS and Properties
but I don't see how to determine the default user for a web site?

Wayne

"WJ" <JohnWebbs@.HotMail.Com> wrote in message
news:eJobGXXiFHA.3936@.TK2MSFTNGP10.phx.gbl...
> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
> news:%233bhDRXiFHA.3280@.TK2MSFTNGP10.phx.gbl...
>> John;
>>
>> Thanks for the clarification. I did that and gave ASP.NET full control of
>> that directory but it still gives the same error when the code attempts
>> to create a file in that directory?
>>
> Check your local website (IIS/MMC) to find out what account is configured
> for the web site, then grant FC to that account. Example: If you allow
> "Anonymous" access to the web site, then the User Account box likely shows
> "IUSR_YourPCName". Try that see what happens.
> John
Hi, Wayne.

This all boils down to giving the account ASP.NET is running
under, *whichever account that is* the necessary permissions.

If you have doubts about which account ASP.NET is running under,
just run this short script. It will identify ASP.NET's current identity.

identity.aspx
----
<%@. Page Language="VB" %>
<%@. Import NameSpace = System.Security.Principal %>
<script runat="server">
Sub Page_Load()
Dim tmp As String = WindowsIdentity.GetCurrent.Name()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>WindowsIdentity.GetCurrent.Name()</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
---

Hope this helps...

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================

"Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
news:uAtm5ffiFHA.3448@.TK2MSFTNGP12.phx.gbl...
> John;
> Thanks for the continued help. I am not sure how to determine which account is
> configured for the web site (I thought ASP.NET was always used by VSNET projects?) I
> went to Control Panel/Administrative Tools/IIS and Properties but I don't see how to
> determine the default user for a web site?
> Wayne
> "WJ" <JohnWebbs@.HotMail.Com> wrote in message
> news:eJobGXXiFHA.3936@.TK2MSFTNGP10.phx.gbl...
>>
>> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
>> news:%233bhDRXiFHA.3280@.TK2MSFTNGP10.phx.gbl...
>>> John;
>>>
>>> Thanks for the clarification. I did that and gave ASP.NET full control of that
>>> directory but it still gives the same error when the code attempts to create a file in
>>> that directory?
>>>
>>
>> Check your local website (IIS/MMC) to find out what account is configured for the web
>> site, then grant FC to that account. Example: If you allow "Anonymous" access to the
>> web site, then the User Account box likely shows "IUSR_YourPCName". Try that see what
>> happens.
>>
>> John
>>
>>
Juan;

Thanks for that page. That is a handy little tool to have. It revealed that
the account used is "myMachine/ASPNET" (no ".") I gave that FC but it still
gives me the erron on my local machine - it works fine on my real web site.

Wayne

"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:eVXEvCgiFHA.1444@.TK2MSFTNGP10.phx.gbl...
> Hi, Wayne.
> This all boils down to giving the account ASP.NET is running
> under, *whichever account that is* the necessary permissions.
> If you have doubts about which account ASP.NET is running under,
> just run this short script. It will identify ASP.NET's current identity.
> identity.aspx
> ----
> <%@. Page Language="VB" %>
> <%@. Import NameSpace = System.Security.Principal %>
> <script runat="server">
> Sub Page_Load()
> Dim tmp As String = WindowsIdentity.GetCurrent.Name()
> Label1.Text = tmp
> End Sub
> </script>
> <html>
> <head>
> <title>WindowsIdentity.GetCurrent.Name()</title>
> </head>
> <body>
> <form id="form1" runat="server">
> <div>
> <asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
> </div>
> </form>
> </body>
> </html>
> ---
> Hope this helps...
>
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Espaol
> Ven, y hablemos de ASP.NET...
> ======================
> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
> news:uAtm5ffiFHA.3448@.TK2MSFTNGP12.phx.gbl...
>> John;
>>
>> Thanks for the continued help. I am not sure how to determine which
>> account is configured for the web site (I thought ASP.NET was always used
>> by VSNET projects?) I went to Control Panel/Administrative Tools/IIS and
>> Properties but I don't see how to determine the default user for a web
>> site?
>>
>> Wayne
>>
>> "WJ" <JohnWebbs@.HotMail.Com> wrote in message
>> news:eJobGXXiFHA.3936@.TK2MSFTNGP10.phx.gbl...
>>>
>>> "Wayne Wengert" <wayneSKIPSPAM@.wengert.org> wrote in message
>>> news:%233bhDRXiFHA.3280@.TK2MSFTNGP10.phx.gbl...
>>>> John;
>>>>
>>>> Thanks for the clarification. I did that and gave ASP.NET full control
>>>> of that directory but it still gives the same error when the code
>>>> attempts to create a file in that directory?
>>>>
>>>
>>> Check your local website (IIS/MMC) to find out what account is
>>> configured for the web site, then grant FC to that account. Example: If
>>> you allow "Anonymous" access to the web site, then the User Account box
>>> likely shows "IUSR_YourPCName". Try that see what happens.
>>>
>>> John
>>>
>>>
>>
>>

Friday, March 16, 2012

Persist object

Hello all,
I'm in need of some brainstormin help!
We have an object that we use in a number of places, both by User Controls
and Pages. This object is loaded everytime we need to use the piece of
functionality.
Example:
The user logs in and the object is loaded, the user then clicks a link to do
a task and again the object is loaded again.
What is the best way to persist the object? Session, cookie etc as it will
be used alot as the user uses the app.
Also, what are people thoughts about this, and it there any patterns that
may help?
Thanks all,
JonJon,
If it is an aspx or html page and is called with the same parameters or
without any parameters, it will be cached on the client side and will open
very fast. You will have to tell us more about the nature of the object to
hear other suggestions.
Eliyahu
"Jon" <Jon@.discussions.microsoft.com> wrote in message
news:7472A3B1-1802-4EB5-8E5D-BAC04F26185D@.microsoft.com...
> Hello all,
> I'm in need of some brainstormin help!
> We have an object that we use in a number of places, both by User Controls
> and Pages. This object is loaded everytime we need to use the piece of
> functionality.
> Example:
> The user logs in and the object is loaded, the user then clicks a link to
do
> a task and again the object is loaded again.
> What is the best way to persist the object? Session, cookie etc as it will
> be used alot as the user uses the app.
> Also, what are people thoughts about this, and it there any patterns that
> may help?
> Thanks all,
> Jon
Some ramblings,
if the object is loaded from server side state then I suggest making
all your pages (and controls?) extend from a base class (that you
create), this class would extend from System.web.UI.Page,
This class could load the object and set a property, which the derived
classes could access.
If the object is not to big then I'd recomend doing this each page
load, caching the object brings in added complexity,
If its a big object (or static for all users) then cache it, use the
session for user based objects and cache for static objects
In my experience though its best to load the object with each page
request
Eliyahu,
The object is data that is a collection class that we loop through to
create a tree (like Windows). This tree is not only used for navigation, but
also used in UserControls to help the user when carrying out some action,
like copying a file, specifying where to place a file etc.
The data help in the collection class rarely changes, but when we use it, we
always reload it and we were just thinking if that would be a performance
drag?
Thanks,
Jon
"Eliyahu Goldin" wrote:

> Jon,
> If it is an aspx or html page and is called with the same parameters or
> without any parameters, it will be cached on the client side and will open
> very fast. You will have to tell us more about the nature of the object to
> hear other suggestions.
> Eliyahu
> "Jon" <Jon@.discussions.microsoft.com> wrote in message
> news:7472A3B1-1802-4EB5-8E5D-BAC04F26185D@.microsoft.com...
> do
>
>
Jon,
If the collection is specific to a user session, the best place is the
session.
If it is application-wide, meaning it is the same for all users, a public
static variable will be good. You can also use application's Cache if you
want to be able to control the way how the object persists.
Eliyahu
"Jon" <Jon@.discussions.microsoft.com> wrote in message
news:1BE9F76D-8B0A-4A21-B65A-54057D8E4BE7@.microsoft.com...
> Eliyahu,
> The object is data that is a collection class that we loop through to
> create a tree (like Windows). This tree is not only used for navigation,
but
> also used in UserControls to help the user when carrying out some action,
> like copying a file, specifying where to place a file etc.
> The data help in the collection class rarely changes, but when we use it,
we
> always reload it and we were just thinking if that would be a performance
> drag?
> Thanks,
> Jon
> "Eliyahu Goldin" wrote:
>
open
to
Controls
to
will
that

Persist object

Hello all,

I'm in need of some brainstormin help!

We have an object that we use in a number of places, both by User Controls
and Pages. This object is loaded everytime we need to use the piece of
functionality.

Example:

The user logs in and the object is loaded, the user then clicks a link to do
a task and again the object is loaded again.

What is the best way to persist the object? Session, cookie etc as it will
be used alot as the user uses the app.

Also, what are people thoughts about this, and it there any patterns that
may help?

Thanks all,

JonJon,

If it is an aspx or html page and is called with the same parameters or
without any parameters, it will be cached on the client side and will open
very fast. You will have to tell us more about the nature of the object to
hear other suggestions.

Eliyahu

"Jon" <Jon@.discussions.microsoft.com> wrote in message
news:7472A3B1-1802-4EB5-8E5D-BAC04F26185D@.microsoft.com...
> Hello all,
> I'm in need of some brainstormin help!
> We have an object that we use in a number of places, both by User Controls
> and Pages. This object is loaded everytime we need to use the piece of
> functionality.
> Example:
> The user logs in and the object is loaded, the user then clicks a link to
do
> a task and again the object is loaded again.
> What is the best way to persist the object? Session, cookie etc as it will
> be used alot as the user uses the app.
> Also, what are people thoughts about this, and it there any patterns that
> may help?
> Thanks all,
> Jon
Some ramblings,

if the object is loaded from server side state then I suggest making
all your pages (and controls?) extend from a base class (that you
create), this class would extend from System.web.UI.Page,

This class could load the object and set a property, which the derived
classes could access.

If the object is not to big then I'd recomend doing this each page
load, caching the object brings in added complexity,

If its a big object (or static for all users) then cache it, use the
session for user based objects and cache for static objects

In my experience though its best to load the object with each page
request
Eliyahu,

The object is data that is a collection class that we loop through to
create a tree (like Windows). This tree is not only used for navigation, but
also used in UserControls to help the user when carrying out some action,
like copying a file, specifying where to place a file etc.

The data help in the collection class rarely changes, but when we use it, we
always reload it and we were just thinking if that would be a performance
drag?

Thanks,

Jon

"Eliyahu Goldin" wrote:

> Jon,
> If it is an aspx or html page and is called with the same parameters or
> without any parameters, it will be cached on the client side and will open
> very fast. You will have to tell us more about the nature of the object to
> hear other suggestions.
> Eliyahu
> "Jon" <Jon@.discussions.microsoft.com> wrote in message
> news:7472A3B1-1802-4EB5-8E5D-BAC04F26185D@.microsoft.com...
> > Hello all,
> > I'm in need of some brainstormin help!
> > We have an object that we use in a number of places, both by User Controls
> > and Pages. This object is loaded everytime we need to use the piece of
> > functionality.
> > Example:
> > The user logs in and the object is loaded, the user then clicks a link to
> do
> > a task and again the object is loaded again.
> > What is the best way to persist the object? Session, cookie etc as it will
> > be used alot as the user uses the app.
> > Also, what are people thoughts about this, and it there any patterns that
> > may help?
> > Thanks all,
> > Jon
>
Jon,

If the collection is specific to a user session, the best place is the
session.

If it is application-wide, meaning it is the same for all users, a public
static variable will be good. You can also use application's Cache if you
want to be able to control the way how the object persists.

Eliyahu

"Jon" <Jon@.discussions.microsoft.com> wrote in message
news:1BE9F76D-8B0A-4A21-B65A-54057D8E4BE7@.microsoft.com...
> Eliyahu,
> The object is data that is a collection class that we loop through to
> create a tree (like Windows). This tree is not only used for navigation,
but
> also used in UserControls to help the user when carrying out some action,
> like copying a file, specifying where to place a file etc.
> The data help in the collection class rarely changes, but when we use it,
we
> always reload it and we were just thinking if that would be a performance
> drag?
> Thanks,
> Jon
> "Eliyahu Goldin" wrote:
> > Jon,
> > If it is an aspx or html page and is called with the same parameters or
> > without any parameters, it will be cached on the client side and will
open
> > very fast. You will have to tell us more about the nature of the object
to
> > hear other suggestions.
> > Eliyahu
> > "Jon" <Jon@.discussions.microsoft.com> wrote in message
> > news:7472A3B1-1802-4EB5-8E5D-BAC04F26185D@.microsoft.com...
> > > Hello all,
> > > > I'm in need of some brainstormin help!
> > > > We have an object that we use in a number of places, both by User
Controls
> > > and Pages. This object is loaded everytime we need to use the piece of
> > > functionality.
> > > > Example:
> > > > The user logs in and the object is loaded, the user then clicks a link
to
> > do
> > > a task and again the object is loaded again.
> > > > What is the best way to persist the object? Session, cookie etc as it
will
> > > be used alot as the user uses the app.
> > > > Also, what are people thoughts about this, and it there any patterns
that
> > > may help?
> > > > Thanks all,
> > > > Jon