Showing posts with label exist. Show all posts
Showing posts with label exist. Show all posts

Saturday, March 31, 2012

The Basics

Hi,

I am very new to ASP. I am trying to make a secure site and I have some general questions.

Does the HttpSessionState object exist in the client's browser oron the IIS server? I assume that it must exist on the server or else itwouldn't really be any different than a cookie. Is this correct?In what order do events occur on the server when an HTTP requestis made. I am assuming that the request is made, the server gets theclients cookies, the server checks the web.config file, then the serverexecutes any necessary scripts and returns a webpage. Is this correct?Is there a nice tutorial about modifying the web.config file? Forexample, a tutorial which teaches people which XML tags do what in it?
Thanks a lot,

P10001.Session is on the server
2. there are a few more steps than that - search on asp.net lifecycle - though .Net isn't a script technolgy - morecorrect to say server creates objects- performs sub and functions - then renders html page
3.http://www.sitepoint.com/article/web-config-file-demystified
Thanks a lot.
Okay, the lifecycle does give me a lot of information that I am lookingfor, but it doesn't really mention (at least the pages which I readdidn't mention) when web.config is accessed in order to determineauthenication info etc. So I am still missing some important steps inthe lifecycle of a request.

The web.config link was also very helpful but I still don't know when the server uses it.

Thursday, March 22, 2012

The file exist but cant delete on server (c#)

Hi all, have an c# page that allows users to uploaded files to the server. I was hoping to also hoping to allow users to delete files aswell. I have the following code, but it dose no delete the file, even though it can find the file (the response.write outputs). Here is my code:

if(File.Exists(sPhysicalPath + @dotnet.itags.org."\" + sOrgFileName)){
Response.Write("delete");
File.Delete(sPhysicalPath + @dotnet.itags.org."" + sOrgFileName);
}

Any suggestions appreciated.

Thanks,

Hi,

by default, and for security reasons, ASP.NET doesn't have the privileges to perform IO actions like deleting a file. You can create a new windows user account that has the same privileges as the ASP.NET account and augment it with the needed privileges to delete certain files on the disk. After that you can impersonate your application with that new account by setting, in the web.config of your application, the<identity impersonate="true" userName="yournewaccount" />

Grz, Kris.

The file web.sitemap required by XmlSiteMapProvider does not exist.

hi,

Ive seen a post above the subject in my search on the forum. My XMLFile1 has the following data in it which I copied from the thread. Now if im on a virtual directory what shall I put as sitemap and how shall I connect the sitemap with the xml file please

<?xml version="1.0" encoding="utf-8" ?>

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

<siteMapNode url="Default.aspx" title="Geekpedia" description="Home Page of Geekpedia.com ">

<siteMapNode url="Register.aspx" title="Registration" description="Register a new account." />

<siteMapNode url="SignIn.aspx" title="Sign-In" description="Sign-in into your existing account." />

</siteMapNode>

</siteMap><bump>
Get your XmlDataSource to point to XmlFile1.xml. (The datafile property)

The file web.sitemap required by XmlSiteMapProvider does not exist.

in my website i have a treeview control connected to sitemap.

I get the error

The file web.sitemap required by XmlSiteMapProvider does not exist.

but i have the file web.sitemap in my website.

Here is my code in my masterpage

<asp:SiteMapDataSourceID="SiteMapDataSource1"runat="server"/>

and my web.config

<configuration>
<system.web>
<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
</httpHandlers>
<customErrors mode="Off"/>
<compilation debug="true"/></system.web>
<appSettings/>
<connectionStrings>
<add name="estagiosConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\meusite\estagios\estagios.mdb" providerName="System.Data.OleDb"/>
</connectionStrings>
<system.web>

</system.web>
</configuration>

in my computer it works fine, but in my web site it doesn't

Any help?

Thank you

found the problem

The file web.sitemap has to be in my website root(strange or maybe not) bu now all my links are wrong.


Hi,

Based on my understanding, when you use the SiteMapPath and SiteMapDataSource controls generate navigation UI. When you run it, the links that are in the SiteMapPath are wrong. If I have misunderstood you, please feel free to let me know.

The Url attribute can indicate avirtual path that corresponds to a page in your application. It can also contain paths to pages in other applications, or URLs that point at completely different web sites. So please make sure that the links that in the web.sitemap are correct.

For more information, seehttp://quickstarts.asp.net/QuickStartv20/aspnet/doc/navigation/sitenavcontrols.aspx.


I hope this helps.