Monday, March 26, 2012
Performing issues
What is faster to IIS, a Code Behind file or a In Code aspx file?
When we call for a Class like dim f as new MyClass if it's a big class,
will it take longer to run? or the IIS only access the funcions that we call
inside the class when we call it?
Thanks
Bruno Alexandre
Kbenhavn, Danmark
"a portuguese in Denmark"An ASPX file is parsed at run-time to MSIL, which is then compiled to a
native image. A DLL is MSIL, so it takes fewer operations to compile it to a
native image. Of course, caching mechanisms make most of that moot, as the
resources are no continually being re-compiled.
HTH,
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
If the Truth hurts, wear it.
"Bruno Alexandre" <bruno.in.dk@.gmail.com> wrote in message
news:uL60f$E6GHA.3508@.TK2MSFTNGP06.phx.gbl...
> Hi guys,
> What is faster to IIS, a Code Behind file or a In Code aspx file?
> When we call for a Class like dim f as new MyClass if it's a big class,
> will it take longer to run? or the IIS only access the funcions that we
> call inside the class when we call it?
> Thanks
> --
> Bruno Alexandre
> Kbenhavn, Danmark
> "a portuguese in Denmark"
>
>
Hi Kevin,
but I'm not talking about DLL, only VB files (classes) and having the code
in the same page or separete one.
I dont thing that the IIS will take my hole site and put it in diferent
DLL's (there is an option in framework 2.0 that we can do that into one DLL)
but this is not my point.
Bruno Alexandre
Kbenhavn, Danmark
"a portuguese in Denmark"
"Kevin Spencer" <uce@.ftc.gov> escreveu na mensagem
news:uhr08DH6GHA.3508@.TK2MSFTNGP06.phx.gbl...
> An ASPX file is parsed at run-time to MSIL, which is then compiled to a
> native image. A DLL is MSIL, so it takes fewer operations to compile it to
> a native image. Of course, caching mechanisms make most of that moot, as
> the resources are no continually being re-compiled.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> Software Composer
> http://unclechutney.blogspot.com
> If the Truth hurts, wear it.
> "Bruno Alexandre" <bruno.in.dk@.gmail.com> wrote in message
> news:uL60f$E6GHA.3508@.TK2MSFTNGP06.phx.gbl...
>
Performing issues
What is faster to IIS, a Code Behind file or a In Code aspx file?
When we call for a Class like dim f as new MyClass if it's a big class,
will it take longer to run? or the IIS only access the funcions that we call
inside the class when we call it?
Thanks
--
Bruno Alexandre
Kbenhavn, Danmark
"a portuguese in Denmark"An ASPX file is parsed at run-time to MSIL, which is then compiled to a
native image. A DLL is MSIL, so it takes fewer operations to compile it to a
native image. Of course, caching mechanisms make most of that moot, as the
resources are no continually being re-compiled.
--
HTH,
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
If the Truth hurts, wear it.
"Bruno Alexandre" <bruno.in.dk@.gmail.comwrote in message
news:uL60f$E6GHA.3508@.TK2MSFTNGP06.phx.gbl...
Quote:
Originally Posted by
Hi guys,
>
What is faster to IIS, a Code Behind file or a In Code aspx file?
>
When we call for a Class like dim f as new MyClass if it's a big class,
will it take longer to run? or the IIS only access the funcions that we
call inside the class when we call it?
>
Thanks
>
--
>
Bruno Alexandre
Kbenhavn, Danmark
>
"a portuguese in Denmark"
>
>
>
>
Hi Kevin,
but I'm not talking about DLL, only VB files (classes) and having the code
in the same page or separete one.
I dont thing that the IIS will take my hole site and put it in diferent
DLL's (there is an option in framework 2.0 that we can do that into one DLL)
but this is not my point.
--
Bruno Alexandre
Kbenhavn, Danmark
"a portuguese in Denmark"
"Kevin Spencer" <uce@.ftc.govescreveu na mensagem
news:uhr08DH6GHA.3508@.TK2MSFTNGP06.phx.gbl...
Quote:
Originally Posted by
An ASPX file is parsed at run-time to MSIL, which is then compiled to a
native image. A DLL is MSIL, so it takes fewer operations to compile it to
a native image. Of course, caching mechanisms make most of that moot, as
the resources are no continually being re-compiled.
>
--
HTH,
>
Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com
>
If the Truth hurts, wear it.
>
"Bruno Alexandre" <bruno.in.dk@.gmail.comwrote in message
news:uL60f$E6GHA.3508@.TK2MSFTNGP06.phx.gbl...
Quote:
Originally Posted by
>Hi guys,
>>
>What is faster to IIS, a Code Behind file or a In Code aspx file?
>>
>When we call for a Class like dim f as new MyClass if it's a big class,
>will it take longer to run? or the IIS only access the funcions that we
>call inside the class when we call it?
>>
>Thanks
>>
>--
>>
>Bruno Alexandre
>Kbenhavn, Danmark
>>
>"a portuguese in Denmark"
>>
>>
>>
>>
>
>
Saturday, March 24, 2012
Permission Issue
"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
>>>
>>>
>>
>>
Wednesday, March 21, 2012
Permissions issue running .aspx files...
Server cannot access application directory "C:\Inetpub\www". The directory does not exist or is not accessible because of security settings.
Now of course the directory exists, and the permissions were (and remain) set properly for my other .asp files to run, just not the .aspx files I create with WebMatrix. All my googling indicates I have to set the permissions for an ASPNET user, which apparently 2003 doesn't use; NETWORK SERVICES runs stuff, but as that's not a user per se, I don't know how to "give it rights" so I'm at a loss.
I gave full rights (just to test, I set these back after) for the IUSER, IWAM, and IIS_WPG users, and no soup. I also have a user OWS_xxxxxxx_admin which is described as "MIcrosoft SharePoint role 'admin' for web..." but that also didn't do it. Here's why I definitely think it's a rights issue: I gave "Everybody" full rights and then my page loads. Here's the kicker though; I took away "Everybody" and gave just "Doman Users" full rights, and it doesn't work. So the impression I get is that it's trying to use a username to run scripts that doesn't exist in my domain... as if the user was somehow 'lost'.
I've also heard mention of a machine.cfg file which has the username in it to use for running scripts, but I do not appear to have such a file. Is that normal on 2k3?
Any help would be appreciated. My next resort is going to be to backup my www, and uninstall and reinstall IIS, which I would like to avoid, as my plethora of other web projects are all working. Thanks!!Update: I was wrong about the machine.cfg file, because I had the wrong extension, I see now that it's machine.config. However, I followed a knowledge base article which said to create a weak user, give it log on as a batch rights, and then add it to the machine.config file and reboot. Still no soup.
Um, bump? Anybody have any ideas? I'm still stuck on this, and haven't found anything else in my research.
Thanks in advance!
JazzGilbert wrote:
C:\Inetpub\www". The directory does not exist or is not accessible because of security settings
Who is listed on the security tab for WWW?
FYI I am also on 2003 server with AD
Have you configured the directory as an application and have you configured the web service extenstions for asp.net xxxxx
Is aspx listed in Virtual or Home Directory Tab: Configuration...:Mappings Tab:Application extensions for your application subdirectoy?
Ok, on the WWW folder under Security, I've got the following:
ASPUser with Full Rights (I created this user per the KB article)
IIS_WPG with Read & Execute
the Internet Guest Account (IUSR_machinename) with Read & Execute
the Launch IIS Process Account (IWAM_machinename) with Read & Execute
I've tried, one at a time, giving them full control, that didn't make a difference.
Maybe that's the issue, (configuring the directory as an app) because all I did was create a folder in my WWW and made sure it had the same rights as the WWW folder.
As far as extensions, I am able to run notepad created .asp files. It's the .aspx file I created in WebMatrix that fails. I think I have the right services setup, but here's a screenshot.
http://www.abeyantdestiny.com/services.gif
I think you need to create an app on the directory tab of the folder.
Also check to see which application pool is selected. It should be "ASP.NET"
Then check the identity being used by that pool.
Also to test that is has nothing to do with webmatrix... take a extreamly simple html page that you know already works on your web page and simply change the extenstion from .html to .aspx
If it works then it is webmatrix that is causing the problem if it doesn't then it is a server config issuse.
Also I can perhaps send some screen shots of my config if you need. If desired then send an private email using this site and include your email address.
Friday, March 16, 2012
Persist Page Location
o scroll down a little to see them all. Incidentally the last control is a t
able control which allows you to add a new row dynamically upon clicking a l
ink button.
Because link button fires a postback, which is what is needed in order to ad
d the next row to the table it brings the user back to the top of the page a
fterwards.
I want the user to be back where they clicked on the link button at the bott
om of the page. I recall there is a setting or some easy way to do this but
for the life of me can not remember. Any help would be great!
-DemetriOn 8/4/2004 10:45 AM, Demetri wrote:
> I have an aspx page which has many controls. Just enough to cause the user
to scroll down a little to see them all. Incidentally the last control is a
table control which allows you to add a new row dynamically upon clicking a
link button.
> Because link button fires a postback, which is what is needed in order to
add the next row to the table it brings the user back to the top of the page
afterwards.
> I want the user to be back where they clicked on the link button at the bo
ttom of the page. I recall there is a setting or some easy way to do this bu
t for the life of me can not remember. Any help would be great!
>
SmartNavigation was the way to overcome some of this 'page viewing
state' problems in the browser, but I've heard it's buggy.
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Hi Demetri,
Have a look at Scott Guthrie's TechEd 2003 Black Belt Web Forms presentation
(http://www.scottgu.com) he coveres this scenario, under the title
"scrolling and postback".
Hope this helps,
Michael
This posting is provided "AS IS" with no warranties, and confers no rights.
"Demetri" <Demetri@.discussions.microsoft.com> wrote in message
news:54F55A7E-B548-402A-BCF4-1DBFDD5FF9BE@.microsoft.com...
>I have an aspx page which has many controls. Just enough to cause the user
>to scroll down a little to see them all. Incidentally the last control is a
>table control which allows you to add a new row dynamically upon clicking a
>link button.
> Because link button fires a postback, which is what is needed in order to
> add the next row to the table it brings the user back to the top of the
> page afterwards.
> I want the user to be back where they clicked on the link button at the
> bottom of the page. I recall there is a setting or some easy way to do
> this but for the life of me can not remember. Any help would be great!
> --
> -Demetri
persistence of variables in an aspx page...
private string userid;
// ...
public void Page_Load(..)
{
userid = Request.QueryString["ID"];
}
and the user does some input on the web form and then submits the page, will the "userid" variable still contain the data I put in it during the Page_Load method? If so, does that work for all objects (like DataSets, etc.)? If not, will I have to put the "userid" data into a session variable instead?Request.QueryString["ID"] will persist across all postbacks, but the userID variable will not. You'll need to reload that variable each time, or put it in viewstate the first time.
I was just using the querystring as an example; I realize that particular value will persist, but that fact is negligable in the overall scope of my question. Regardless, you answered it. If I put such variables in ViewState, how long will they remain there? Will they be destroyed when the page is closed? Can I store larger objects in viewstate, such as DataSets? Thanks!
The viewstate remains for the life of the page, so, unstill it's navigated away from.
You could certainly put a dataset in there, but I wouldn't recommend it. Viewstate is stored as a hidden form field on the page, so, you'd be serializing kilobytes of additional data and sending it to the client as payload.
Ah, I completely forgot about that. You're absolutely right. Guess I'll have to find another way around it. Thanks!