Showing posts with label hii. Show all posts
Showing posts with label hii. Show all posts

Thursday, March 29, 2012

Performance questions

Hi

I have 2 different sites with the same aspnet code.
Both are running in their own app pool.

1st one is the important site and performance for this one is more important
than the second one.
Of course in the codes I have some customization routines.

One of those routine shows and assigns url for a hyperlink.
For the important (high traffic) site (site 1) I need to show that link and
for the 2nd site I need to hide that link.

Now the question is:
Should I make this hyperlink visible from the HTML part which will be
suitable for site 1 and hide it from codebehind in the second site?
Is there any performance difference doing the vise versa?

The following is the code I have now:
if (Site1)
{
hyperlink.NavigateUrl = "Default.aspx";
}
else
{
hyperlink.Visible = false;
}

However the following code looks nicer but will it give any performance hit
to site 1?
if (Site1)
{
hyperlink.NavigateUrl = "Default.aspx";
hyperlink.Visible = true;
}

Looking forward for your advise.
--

SevDer
http://www.sevder.com
A new source for .NET DevelopersI don't think this is kind of code would be the performance bottleneck.
Typically it is either related to database access, or complicated
calculations or processing in the code. Setting one property on a hyperlink
isn't going to make a difference.

"SevDer" <sevder@.newsgroup.nospamwrote in message
news:etavoPztGHA.4752@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

Hi
>
I have 2 different sites with the same aspnet code.
Both are running in their own app pool.
>
1st one is the important site and performance for this one is more
important than the second one.
Of course in the codes I have some customization routines.
>
One of those routine shows and assigns url for a hyperlink.
For the important (high traffic) site (site 1) I need to show that link
and for the 2nd site I need to hide that link.
>
Now the question is:
Should I make this hyperlink visible from the HTML part which will be
suitable for site 1 and hide it from codebehind in the second site?
Is there any performance difference doing the vise versa?
>
The following is the code I have now:
if (Site1)
{
hyperlink.NavigateUrl = "Default.aspx";
}
else
{
hyperlink.Visible = false;
}
>
However the following code looks nicer but will it give any performance
hit to site 1?
if (Site1)
{
hyperlink.NavigateUrl = "Default.aspx";
hyperlink.Visible = true;
}
>
Looking forward for your advise.
--
>
SevDer
http://www.sevder.com
A new source for .NET Developers
>
>
>


I don't think that either of these options will have much of an effect on performance... how often is this code called?

--
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
Hi,

I don't really have a problem with the performance and the difference
between them is may be 1/10000000 but I just want to know which one is
faster.
May be in the future this information may help me on 100 show or hide items
in one page where there are tremendous amount of hits to that page.

--

SevDer
http://www.sevder.com
A new source for .NET Developers

"Greg Collins [Microsoft MVP]" <gcollins_AT_msn_DOT_comwrote in message
news:%23Ydm2TztGHA.4456@.TK2MSFTNGP06.phx.gbl...
I don't think that either of these options will have much of an effect on
performance... how often is this code called?

--
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
Well, if you have to set 2 properties instead of 1, then setting 2 will take
longer.

But even with 100 of these controls, you aren't going to see a difference.
This is just changing a variable in an object. That variable is used when
it's time to generate the corresponding HTML. But by setting the property,
you are just changing some local variable to the object.

Again, unless you have tens of thousands of these, this isn't going to make
a difference. I would focus on more likely bottlenecks in terms of
performance.

"SevDer" <sevder@.newsgroup.nospamwrote in message
news:%23jry6iztGHA.4752@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hi,
>
I don't really have a problem with the performance and the difference
between them is may be 1/10000000 but I just want to know which one is
faster.
May be in the future this information may help me on 100 show or hide
items in one page where there are tremendous amount of hits to that page.
>
--
>
SevDer
http://www.sevder.com
A new source for .NET Developers
>
>
"Greg Collins [Microsoft MVP]" <gcollins_AT_msn_DOT_comwrote in message
news:%23Ydm2TztGHA.4456@.TK2MSFTNGP06.phx.gbl...
I don't think that either of these options will have much of an effect on
performance... how often is this code called?
>
--
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
>
>
>

Performance Testing -WAS

Hi

I am trying to test an ASP .NET application using Microsoft test tool WAS.

There is an option called client as part of the WAS tool. The documentation says that I need to give the ip address of the client machines from which the testing will be done..

Cant I just use one client machine and test my application and simulate cuoncurrent users for a single machine itself?

Thanks
KalpaFor realistic performance testing, it's also recommended that you run the stress testing tool from a separate machine other than the Web server. The actual request generator can be fairly resource intensive while generating the Web requests and this overhead can affect performance of the Web site under max loads. However, even though the documentation states two machines are a requirement you can certainly run WAS on the same machine as the Web server, but don't expect 100% accurate results especially when you're testing at the top end load for the hardware you're running on.

Reference:
http://www.west-wind.com/presentations/webstress/webstress.htm

Monday, March 26, 2012

Performing Asynchronous operation

Hi
I have 2 operations to perform one is to upload data and the second is
to generate report. Both take huge time(more than 20 mins and I believe
by that time session would have expired) and hence has to be done
asynchronously.
For uploading data, user will click start button and the asynchronous
operation has to start immediately.
For report generation, user will enter a time when the report has to be
generated(wend date time) and press start button. The asynchronous
operation should start only at this designated time.
How can I do the above 2 operations?
Thanks
rjn
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!You need to read up on threading or use an asynchronous web service for your
first problem. Check out http://www.15seconds.com/issue/031124.htm.
For the second item, you don't say what your system is. If SQL Server, pop
the date and time into a field that can be scanned by a SQL Agent Job every
ten minutes or so. When the record is within ten minutes of the current
time, fire off a stored procedure.
If not SQL, you could achieve something similar using a file and Windows
Scheduler.
"RJN" <rjn@.yahoo.com> wrote in message
news:%23TA15ehrEHA.2000@.tk2msftngp13.phx.gbl...
> Hi
> I have 2 operations to perform one is to upload data and the second is
> to generate report. Both take huge time(more than 20 mins and I believe
> by that time session would have expired) and hence has to be done
> asynchronously.
> For uploading data, user will click start button and the asynchronous
> operation has to start immediately.
> For report generation, user will enter a time when the report has to be
> generated(wend date time) and press start button. The asynchronous
> operation should start only at this designated time.
> How can I do the above 2 operations?
> Thanks
> rjn
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!

Performing Asynchronous operation

Hi

I have 2 operations to perform one is to upload data and the second is
to generate report. Both take huge time(more than 20 mins and I believe
by that time session would have expired) and hence has to be done
asynchronously.

For uploading data, user will click start button and the asynchronous
operation has to start immediately.

For report generation, user will enter a time when the report has to be
generated(weekend date time) and press start button. The asynchronous
operation should start only at this designated time.

How can I do the above 2 operations?

Thanks

rjn

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!You need to read up on threading or use an asynchronous web service for your
first problem. Check out http://www.15seconds.com/issue/031124.htm.

For the second item, you don't say what your system is. If SQL Server, pop
the date and time into a field that can be scanned by a SQL Agent Job every
ten minutes or so. When the record is within ten minutes of the current
time, fire off a stored procedure.

If not SQL, you could achieve something similar using a file and Windows
Scheduler.

"RJN" <rjn@.yahoo.com> wrote in message
news:%23TA15ehrEHA.2000@.tk2msftngp13.phx.gbl...
> Hi
> I have 2 operations to perform one is to upload data and the second is
> to generate report. Both take huge time(more than 20 mins and I believe
> by that time session would have expired) and hence has to be done
> asynchronously.
> For uploading data, user will click start button and the asynchronous
> operation has to start immediately.
> For report generation, user will enter a time when the report has to be
> generated(weekend date time) and press start button. The asynchronous
> operation should start only at this designated time.
> How can I do the above 2 operations?
> Thanks
> rjn
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

Saturday, March 24, 2012

Permission problem

Hi
I am trying to download the PDF files from my webserver using ASP.Net.
All my files are stored at F Drive on webserver. Like this F:\Main
Folder\Sub Folder\user folder\files\File1.pdf
I am impersonating the domain user account and downloading the file, It
seems the impersonate is got success.
If I gave full control to that user folder, its allowing me to download the
file.
BUT, If I gave read&execute permisson to that folder, its asking me the
windows username and password window for dowload the file.
My client doesn't need that windows checking. we already given the read &
execute permission to that folder, then why its asking the windows user name
and password window?
any idea please.
thanks
balaIs it possible that a temporary file is being created somewhere and that is
demanding greater permissions?
Ken
"Bala" <Bala@.discussions.microsoft.com> wrote in message
news:04A524B8-2287-4659-BDD7-1AFB3A9C48A9@.microsoft.com...
> Hi
> I am trying to download the PDF files from my webserver using ASP.Net.
> All my files are stored at F Drive on webserver. Like this F:\Main
> Folder\Sub Folder\user folder\files\File1.pdf
> I am impersonating the domain user account and downloading the file, It
> seems the impersonate is got success.
> If I gave full control to that user folder, its allowing me to download
> the
> file.
> BUT, If I gave read&execute permisson to that folder, its asking me the
> windows username and password window for dowload the file.
> My client doesn't need that windows checking. we already given the read &
> execute permission to that folder, then why its asking the windows user
> name
> and password window?
> any idea please.
> thanks
> bala
>
seems like good idea, But there is no other way to solve this problem?
Thanks
bala
"Ken Cox [Microsoft MVP]" wrote:

> Is it possible that a temporary file is being created somewhere and that i
s
> demanding greater permissions?
> Ken
> "Bala" <Bala@.discussions.microsoft.com> wrote in message
> news:04A524B8-2287-4659-BDD7-1AFB3A9C48A9@.microsoft.com...
>
>

Permission problem

Hi

I am trying to download the PDF files from my webserver using ASP.Net.

All my files are stored at F Drive on webserver. Like this F:\Main
Folder\Sub Folder\user folder\files\File1.pdf

I am impersonating the domain user account and downloading the file, It
seems the impersonate is got success.

If I gave full control to that user folder, its allowing me to download the
file.

BUT, If I gave read&execute permisson to that folder, its asking me the
windows username and password window for dowload the file.

My client doesn't need that windows checking. we already given the read &
execute permission to that folder, then why its asking the windows user name
and password window?

any idea please.

thanks
balaIs it possible that a temporary file is being created somewhere and that is
demanding greater permissions?

Ken

"Bala" <Bala@.discussions.microsoft.com> wrote in message
news:04A524B8-2287-4659-BDD7-1AFB3A9C48A9@.microsoft.com...
> Hi
> I am trying to download the PDF files from my webserver using ASP.Net.
> All my files are stored at F Drive on webserver. Like this F:\Main
> Folder\Sub Folder\user folder\files\File1.pdf
> I am impersonating the domain user account and downloading the file, It
> seems the impersonate is got success.
> If I gave full control to that user folder, its allowing me to download
> the
> file.
> BUT, If I gave read&execute permisson to that folder, its asking me the
> windows username and password window for dowload the file.
> My client doesn't need that windows checking. we already given the read &
> execute permission to that folder, then why its asking the windows user
> name
> and password window?
> any idea please.
> thanks
> bala
seems like good idea, But there is no other way to solve this problem?

Thanks
bala

"Ken Cox [Microsoft MVP]" wrote:

> Is it possible that a temporary file is being created somewhere and that is
> demanding greater permissions?
> Ken
> "Bala" <Bala@.discussions.microsoft.com> wrote in message
> news:04A524B8-2287-4659-BDD7-1AFB3A9C48A9@.microsoft.com...
> > Hi
> > I am trying to download the PDF files from my webserver using ASP.Net.
> > All my files are stored at F Drive on webserver. Like this F:\Main
> > Folder\Sub Folder\user folder\files\File1.pdf
> > I am impersonating the domain user account and downloading the file, It
> > seems the impersonate is got success.
> > If I gave full control to that user folder, its allowing me to download
> > the
> > file.
> > BUT, If I gave read&execute permisson to that folder, its asking me the
> > windows username and password window for dowload the file.
> > My client doesn't need that windows checking. we already given the read &
> > execute permission to that folder, then why its asking the windows user
> > name
> > and password window?
> > any idea please.
> > thanks
> > bala
>

Wednesday, March 21, 2012

Permissions Problem

Hi

I have created a facility to allow the user to upload an
image file to the webserver. When the user creates the
image for the first time i.e. the image does not exist
within the directory everything works fine. The problem
occurs if my ASP.NET dll tries to delete the file or
overwrite it?

I assume my app will be using the ASPNET account and I
have ensured that this account has full control over the
directories in question etc.

Anyone any thoughts?

Thanks in advance

AndyWhat is the error?

--
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Andy" <andy@.thecodeclinic.net> wrote in message
news:0e7c01c3b42b$a2d2c020$a501280a@.phx.gbl...
> Hi
> I have created a facility to allow the user to upload an
> image file to the webserver. When the user creates the
> image for the first time i.e. the image does not exist
> within the directory everything works fine. The problem
> occurs if my ASP.NET dll tries to delete the file or
> overwrite it?
> I assume my app will be using the ASPNET account and I
> have ensured that this account has full control over the
> directories in question etc.
> Anyone any thoughts?
> Thanks in advance
> Andy
Whoops!

I have since restarted IIS as well but to no avail??

this is the error generated:-

Source:
CodeClinic.RestWebPort.BusLogic.Image.Save

Exception:
Access to the
path "E:\Inetpub\Poachers\library\dishes\dish_8.jpg" is
denied.

Trace:
at System.IO.__Error.WinIOError(Int32 errorCode,
String str)
at System.IO.FileStream..ctor(String path, FileMode
mode, FileAccess access, FileShare share, Int32
bufferSize, Boolean useAsync, String msgPath, Boolean
bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode
mode)
at System.Web.HttpPostedFile.SaveAs(String filename)
at CodeClinic.RestWebPort.BusLogic.Image.Save(String
file, HtmlInputFile uploadedfile)

>--Original Message--
>What is the error?
>--
>Kevin Spencer
>..Net Developer
>Microsoft MVP
>Big things are made up
>of lots of little things.
>"Andy" <andy@.thecodeclinic.net> wrote in message
>news:0e7c01c3b42b$a2d2c020$a501280a@.phx.gbl...
>> Hi
>>
>> I have created a facility to allow the user to upload
an
>> image file to the webserver. When the user creates the
>> image for the first time i.e. the image does not exist
>> within the directory everything works fine. The problem
>> occurs if my ASP.NET dll tries to delete the file or
>> overwrite it?
>>
>> I assume my app will be using the ASPNET account and I
>> have ensured that this account has full control over
the
>> directories in question etc.
>>
>> Anyone any thoughts?
>>
>> Thanks in advance
>>
>> Andy
>
>.
SORTED!

It seems that under Windows 2003 the process is NOT
running under the ASPNET account but a NETWORK SERVICES
account?

However if this is the case how is it writing the first
file upload successfully to the directory?

weird!

It is now working though, which is nice ;-)

>--Original Message--
>What is the error?
>--
>Kevin Spencer
>..Net Developer
>Microsoft MVP
>Big things are made up
>of lots of little things.
>"Andy" <andy@.thecodeclinic.net> wrote in message
>news:0e7c01c3b42b$a2d2c020$a501280a@.phx.gbl...
>> Hi
>>
>> I have created a facility to allow the user to upload
an
>> image file to the webserver. When the user creates the
>> image for the first time i.e. the image does not exist
>> within the directory everything works fine. The problem
>> occurs if my ASP.NET dll tries to delete the file or
>> overwrite it?
>>
>> I assume my app will be using the ASPNET account and I
>> have ensured that this account has full control over
the
>> directories in question etc.
>>
>> Anyone any thoughts?
>>
>> Thanks in advance
>>
>> Andy
>
>.
There are only 2 possible reasons why your app might be denied access to the
file:

1. It doesn't have the necessary permission
2. The file is in use by an application and locked.

You can easily determine whetyher it's number 2 or not. If you can delete
the file and the app cannot, the problem is number 1. When a file is locked,
even the Administrator group can't delete it.

If the problem is number 1, re-check your permissions. And remember that
Deny permission always overrides Grant. In other words, if you have granted
the user permission, and somewhere else that permission is explicitly
denied, the permission is not granted.

You may also want to make sure that the account you think ASP.Net is running
under is indeed the account it is running under. To do this, just open up
Task Manger, check the Processes tab. The user account under which your
ASP.Net worker process is running will be displayed.

--
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Andy" <andy@.thecodeclinic.net> wrote in message
news:115701c3b431$a6b765a0$a301280a@.phx.gbl...
> Whoops!
> I have since restarted IIS as well but to no avail??
> this is the error generated:-
> Source:
> CodeClinic.RestWebPort.BusLogic.Image.Save
> Exception:
> Access to the
> path "E:\Inetpub\Poachers\library\dishes\dish_8.jpg" is
> denied.
> Trace:
> at System.IO.__Error.WinIOError(Int32 errorCode,
> String str)
> at System.IO.FileStream..ctor(String path, FileMode
> mode, FileAccess access, FileShare share, Int32
> bufferSize, Boolean useAsync, String msgPath, Boolean
> bFromProxy)
> at System.IO.FileStream..ctor(String path, FileMode
> mode)
> at System.Web.HttpPostedFile.SaveAs(String filename)
> at CodeClinic.RestWebPort.BusLogic.Image.Save(String
> file, HtmlInputFile uploadedfile)
>
> >--Original Message--
> >What is the error?
> >--
> >Kevin Spencer
> >..Net Developer
> >Microsoft MVP
> >Big things are made up
> >of lots of little things.
> >"Andy" <andy@.thecodeclinic.net> wrote in message
> >news:0e7c01c3b42b$a2d2c020$a501280a@.phx.gbl...
> >> Hi
> >>
> >> I have created a facility to allow the user to upload
> an
> >> image file to the webserver. When the user creates the
> >> image for the first time i.e. the image does not exist
> >> within the directory everything works fine. The problem
> >> occurs if my ASP.NET dll tries to delete the file or
> >> overwrite it?
> >>
> >> I assume my app will be using the ASPNET account and I
> >> have ensured that this account has full control over
> the
> >> directories in question etc.
> >>
> >> Anyone any thoughts?
> >>
> >> Thanks in advance
> >>
> >> Andy
> >.
Hi Andy,

Thank you for posting to the MSDN newsgroups.

I am glad to know that the problem is resolved. You are right that the
default account is the Network_Service account in Windows 2003 Server (IIS
6). If you want to change the account, please refer to the following
article.

INFO: Implementing Impersonation in an ASP.NET Application
http://support.microsoft.com/defaul...kb;en-us;306158

If you have any more concerns, please feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Thanks guys :-)

>--Original Message--
>Hi Andy,
>Thank you for posting to the MSDN newsgroups.
>I am glad to know that the problem is resolved. You are
right that the
>default account is the Network_Service account in
Windows 2003 Server (IIS
>6). If you want to change the account, please refer to
the following
>article.
>INFO: Implementing Impersonation in an ASP.NET
Application
>http://support.microsoft.com/default.aspx?scid=kb;en-
us;306158
>If you have any more concerns, please feel free to let
me know.
>Best regards,
>Jacob Yang
>Microsoft Online Partner Support
>Get Secure! C www.microsoft.com/security
>This posting is provided "as is" with no warranties and
confers no rights.
>.

Friday, March 16, 2012

persistent cookies

Hi

I could not understand FWIW persistent cookies checkbox
I was logged in, cookie was already recorded but after closing and opening browser I'm still being redirected to sigin.aspx page

any help would be appreciated

Is it possible to post your Login Code where the cookie is being made ?

sure, thanks
// Create a new ticket used for authentication
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
1, // Ticket version
Username.Value, // Username associated with ticket
DateTime.Now, // Date/time issued
DateTime.Now.AddMinutes(30), // Date/time to expire
true, // "true" for a persistent user cookie
reader.GetString(0), // User-data, in this case the roles
FormsAuthentication.FormsCookiePath);// Path cookie valid for
Also I'm doing this into login button event handler:
...
FormsAuthentication.SetAuthCookie(txtUsername.Text, checkRemember.Checked);
...