Showing posts with label coding. Show all posts
Showing posts with label coding. Show all posts

Saturday, March 24, 2012

Permission to write a file

Hi all
I'm coding a Web application which requires to write an XML file into a
folder. I'm wondering other than account Everyone which else I can set
permission so that my application can have the rights to write the file.You have to set permissions on the user that asp.net is working on.
By default it is ASPNET
Regards
Martin
"Hai Nguyen" <haiaggie@.neo.tamu.edu> wrote in message
news:ueILnPGVEHA.1048@.tk2msftngp13.phx.gbl...
> Hi all
> I'm coding a Web application which requires to write an XML file into a
> folder. I'm wondering other than account Everyone which else I can set
> permission so that my application can have the rights to write the file.
>
>

Permission to write a file

Hi all

I'm coding a Web application which requires to write an XML file into a
folder. I'm wondering other than account Everyone which else I can set
permission so that my application can have the rights to write the file.You have to set permissions on the user that asp.net is working on.
By default it is ASPNET

Regards
Martin

"Hai Nguyen" <haiaggie@.neo.tamu.edu> wrote in message
news:ueILnPGVEHA.1048@.tk2msftngp13.phx.gbl...
> Hi all
> I'm coding a Web application which requires to write an XML file into a
> folder. I'm wondering other than account Everyone which else I can set
> permission so that my application can have the rights to write the file.
>

Friday, March 16, 2012

Persist Variable values

I've run into what seems to be an issue with persisting state. I'm new
to ASP.NET but have been using C# for a while now. I'm coding a
button_click method in the .cs file for a web page and trying to track
the number of times the button has been clicked.
The issue is, everytime the button is clicked, the page seems to
reload and I'm losing the variable value that I'm using to keep track
of the number of times the button is clicked. i couldn't find a
propert setting
I'm guessing the easiest way would be to add the code into a script
section of the client side code, but what about using a browser other
than IE? Would the data still get refreshed when the button is
clicked? I get the feeling these are some of the fundemental questions
in web apps.
Thanks for any suggestions.Do you want to track it specific to each user's session or the number of
times it is clicked 'application' -wide?
This has two very different implications. If you want to track per session,
in order to persist the value postback-to-postback, you can record it in the
Session object, a database using the caller's session key, xml file, etc...
and refresh (re-read) it each postback. You could perform this write
operation in the button's OnClick event.
If you want to track it for the application as a whole, you can store it in
the Application object but be aware that this will reset whenever the
application is restarted if you don't write it to persistent storage.
Some other options include cookies, writing the value to the ViewState or
hidden form fields but I'm an advocate of the other approach as it doesn't
depend on the user to keep cookies alive or store what you consider to be
important on the user's browser.
"Looch" wrote:

> I've run into what seems to be an issue with persisting state. I'm new
> to ASP.NET but have been using C# for a while now. I'm coding a
> button_click method in the .cs file for a web page and trying to track
> the number of times the button has been clicked.
> The issue is, everytime the button is clicked, the page seems to
> reload and I'm losing the variable value that I'm using to keep track
> of the number of times the button is clicked. i couldn't find a
> propert setting
> I'm guessing the easiest way would be to add the code into a script
> section of the client side code, but what about using a browser other
> than IE? Would the data still get refreshed when the button is
> clicked? I get the feeling these are some of the fundemental questions
> in web apps.
> Thanks for any suggestions.
>
Thanks for the explanation, that definitely clears it up for me!
Thanks again.