.NET Web Site Gets Recompiled When Renaming Or Deleting A Folder Inside?
Apr 23, 2010
I develop a simple file manager inside an ASP.NET Web site (not web application). I notice that every time I rename or delete a folder, the site gets recompiled - i.e. the very next web request after delete or rename operation takes considerably much time to execute.
It's only true for folders, not for files.Why does this occur?
P.S. I use WebDev server (Cassini), haven't tested in on IIS yet.
UPDATE: The same disaster happens with ASP.NET MVC Web Applications :(
UPDATE 2: Here are similar discussions:
http://stackoverflow.com/questions/271944/storing-temporary-user-files-in-aspnet-in-medium-trust
http://stackoverflow.com/questions/2248825/asp-net-restarts-when-a-folder-is-created-renamed-or-deleted
View 2 Replies
Similar Messages:
Jul 22, 2013
I was using the VisualTreeHelper trying to locate a textBlock inside the datagrid columnHeaders. I have just learnt that : "The Header object of the DataGridColumn is actually the visible header of that column, whatever you set it to be. DataGridColumn is not part of the Visual Tree so there is not direct way to access the DataGridColumnHeader for it (we can't even be sure it exists yet)... " This has set me back by a couple of days. I tried to convert the suggested code to vb.net in order to use it but I don't seem to get it right. The code in c# is :
Code:
ataGridColumnHeader headerObj = GetColumnHeaderFromColumn(column);
private DataGridColumnHeader GetColumnHeaderFromColumn(DataGridColumn column)
{
// dataGrid is the name of your DataGrid. In this case Name="dataGrid"
List<DataGridColumnHeader> columnHeaders = GetVisualChildCollection<DataGridColumnHeader>(dataGrid);
[Code] ...
How to apply it in my scenario shown below. I want to access in order to rename the textblock 'columnHeaderName'. How can I do this?
Code:
<Datagrid>
<Datagrid.Columns>
<DatagridTemplateColumn Header="header1" Width="100">
<DatagridTemplateColumn.HeaderTemplate>
[Code] ....
View 1 Replies
Nov 3, 2010
new to asp.net I'm trying to dynamically delete a folder so far I have this code
[Code]....
This works well when there are no files or folders in the directory. But if the directory is not empty then I get an error. How can I delete all the files and folders within that directory
View 1 Replies
Jul 14, 2010
i have an a web app where i have a .cs file and .aspx file ..I have a function called display which calls the .cs file and use the static connecting sting to display data.I have a log folder which is just used by update function.No connecting with display.
The app runs completely fine when nothing is being done.But when i delete the log foler manually and press refresh button (which calls the display method) then the static string value is set to null.It seems very wierd.I kept a break point at the .cs file declared static varaible.Its declared in class so its value is for the whole class.
public class mon
{
static string constr;
[code]...
It works completely fine (i mean not clearing the constr) until i delete a folder in the MONWeb1 directory.So what happens is that i delete a folder and when i press refresh button which instiante the class vairable.
It comes here.
public class mon
{
static string constr;
& makes it null .. (i had a watch on that variable).This is really very odd.
View 2 Replies
Jan 29, 2011
I have a simple photo album. I have some catories in db and corresponding folders. For example, when user creates a category called "Asp Net" in db then a folder called "AspNet" is created. Then user can upload photo and all photos are displayed as thumbnail. No photo is saved in db, they are directly saved lets say AspNet folder. I just fetch filelist from intended folder and list them. However I want user to be able to update category name or delete it. To keep consistency, corresponding folder should be updated or deleted. But when I try it throws exception: Access to the path 'xxxxx" is denied.
View 1 Replies
Sep 20, 2010
I have a class file stored in the app code folder. A certain page that I want to access is inside its own folder within the root and it is using the namespace within the class file in the app code folder. How do I tell the application where the file is? I'm sure I could put the code in a file inside my folder, but I'd rather not have duplicate code in two different files... unless there is a way to make a reference of some type.
View 1 Replies
Mar 16, 2011
I write a simple web site in asp.net. In one page i want to delete a folder of web root. When i delete it folder, the all session in project is changed to null. I write a post in this forum. Here is the adress of it post: ([URL]) Some pepole answer me to change the session state mode to StateServer. In default the session state mode is Inproc, and i changed the session state mode to stateServer.but when i changed the session to stateserver this error is appear in application eventlog after two day and my web site dont working in iis. This error is like this:
Event Type:
Warning
Event Source:
ASP.NET 2.0.50727.0
Event Category:
Web Event
Event ID:
1310
Date:
3/12/2011
Time:
1:27:55 PM
User:
N/A
Computer:
WIN2003-00A346F
Description:
Event code: 3009
Event message: Unable to make the session state request to the session state server. Details: last phase='Sending request to the state
server', error code=0x80072749, size of outgoing data=0
Event time: 3/12/2011 1:27:55 PM
Event time (UTC): 3/12/2011 8:57:55 AM
Event ID: a5c8bfd16f74429e820989e8ce8082d0
Event sequence: 10
Event occurrence: 1
Event detail code: 50016
Application information:
Application domain: /LM/W3SVC/1547208020/Root-1-129443938731955000
Trust level: Full
Application Virtual Path: /
Application Path: C:InetpubwwwrootClishareClishare
Machine name: WIN2003-00A346F
Process information:
Process ID: 1276
Process name: aspnet_wp.exe
Account name: WIN2003-00A346FASPNET
Exception information:
Exception type: HttpException
Exception message: Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesaspnet_stateParametersAllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.
Request information:
Request URL: [URL]
Request path: /main/home.aspx
User host address: 64.79.69.155
User:
Is authenticated: False
Authentication Type:
Thread account name: WIN2003-00A346FASPNET
Thread information:
Thread ID: 1
Thread account name: WIN2003-00A346FASPNET
Is impersonating: False
Stack trace: Custom event details: For more information, see Help and Support Center at [URL]. When i reset ASP.NET State service, the problem is fixed, but after one or two days, this problem apears again. What's the problem and how can i fix it? And how can i delete a folder in asp.net without the session is lost?
View 1 Replies
Sep 27, 2010
I have a repeater which binds a set of data. Within this repeater is a column with various controls for updating, deleting, etc. These are image buttons which fire an onclick event such as "DeleteRecord". All this does is fire a stored procedure, passing in the ID of the record to delete from the CommandArgument of the object.
This works wonderfully... except for one rather huge problem. Once you delete a record, if you refresh the page, the record where the first deleted record used to be gets deleted. For instance... if I have 4 records
1 Record1
2 Record2
3 Record3
4 Record4
and I delete record 2... The page reloads with (which is fine):
1 Record1
3 Record3
4 Record4
...if I then hit refresh...
1 Record1
4 Record4
I assume this is because the erroneously deleted object (record3) is now in the same hierarchical place as the old object used to be and .net therefore doesn't know the difference, the page refreshes and fires the onlick event, grabbing out the command argument of the new object and deletes based on the ID as obtained from the commandargument of the new object. This is obviously a huge problem, if a client did this it would destroy data erroneously and I'm at a loss here. Is there any way to stop this from happening? I'm not sure if there is a better way to go about doing things or not. If there isn't, I need some sort of way to tell the page not to execute the event or to cross reference the ID of the object that is intended for deletion against the object itself...
Code below for convenience...
EDIT Wrapped a LinkButton around it because I have some jquery code in here as well which stops the page execution to wait for user confirmation. Pressing "ok" continues page execution.
<asp:LinkButton ID="oDeleteLink" CssClass="oDeleteIcon" CommandName="Delete" CommandArgument='<%# Eval("iAccountID") %>' runat="server">
<asp:ImageButton ImageUrl="/files/system/icons/trash-steel-16.png" ToolTip="Delete This Account" AlternateText="Delete" ID="oDeleteIcon" runat="server" />
</asp:LinkButton>
protected void oAccounts_ItemCommand(Object Sender, RepeaterCommandEventArgs e) {
if (e.CommandName == "Delete") {
int ID = e.CommandArgument.ToString().Numeric();
db.SPs.SpDeleteAccount(ID).Execute();
UI.Confirm(uiBroadcast, "Account has been deleted", "300px");
BindAccounts();
}
}
View 2 Replies
Feb 7, 2011
Environment: Windows 2008 R2 x64 [IIS7.5]
irectoryInfo("D:MySecretFolder")
I get thrown the following error.
'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed
Application pool is using NetworkService account as its identity and I have given that account full rights on that folder.
View 2 Replies
Jan 26, 2011
I have a .net website that I've built but here's the catch - when it's deployed I don't know whether it will be deployed to the root of the site or to a sub folder of a larger site (and it needs to be able to move around between places)
And - here's the important bit - we will have zero access to IIS on the live server so this just has to run straight away.
So far I've managed to find work arounds for things like paths to resources but I now need to use a 3rd party component (.dll).
Normally this would go in the bin folder and, if I run my site in the root of the website it works fine but, as soon as we move the site to a sub folder, the reference to the 3rd party component wont work.
Now - I know normally you'd suggest creating a virtual directory under IIS but remember - I HAVE NO ACCESS TO IIS.
So - is there a way to still use 3rd party components in my project and have my project all run in a sub folder of a website?
And no - I can't move just the bin folder to the root of the site - it all has to sit within its own folder.
View 2 Replies
Mar 22, 2010
I'm new to ASP.NET MVC and i want to create a class to contain site wide functions for my application.what is the best practice to do this?
where should i create the class ? in what folder?should i create a new folder?
edited:I need a function that return base uri, and it have be available to call from any controller.A date formatting function, or any other simple logic , but is going to be used repetitively
View 2 Replies
Apr 15, 2010
Am having the same scenario.. AM creating dynamic text box and remove button row by row. if i click the remove button then the particular row will be removed.. for validation purpose , i renamed the controls after deleting the row.. if i have 3 rows and if i delete the 2nd row then after deletion i'll rename th rows to 1 and 2.. its working.. but as the row 2 is in view state its still displying the contents of row 2 though it binds the row3 details.. how to remove the particular row and renaming accordingly..
View 1 Replies
Mar 14, 2011
i am sending mails in asp.net via my hos eHostPros.but recepients receive main inside their junk folder.
View 4 Replies
Aug 18, 2010
I've got webform routing setup on my asp.net webforms 3.5sp1 project. I would like to have the files for the site in a directory called content including the home page as I would like to run multiple sites using the same system. In MVC there is a blank default page and the home page is in a folder called home. I can't seem to replicate this behaviour using web form routing but would like to. The blank page is always hit first. the route handler is hit second - it recognises that the request is for the home page and sets up the routing page but is not used. the route handler code is simple:
public string VirtualPath { get; private set; }
public IHttpHandler GetHttpHandler(RequestContext
requestContext)
{
string file = requestContext.RouteData.GetRequiredString("File");
string id = requestContext.RouteData.GetRequiredString("Id");
string queryString = "?menuid=" + id;
VirtualPath = "~/" + file;
HttpContext.Current.RewritePath(
string.Concat(
VirtualPath,
queryString));
var page = BuildManager.CreateInstanceFromVirtualPath
(VirtualPath, typeof(Page)) as IHttpHandler;
return page;
}
Is there anyway I can do this?
Update
Here is my global.asax route code:
public static void RegisterRoutes(RouteCollection routes)
{
Domain.RepositoryFactory repo = new RepositoryFactory();
foreach (var x in repo.MenuRepository.GetAllEnabledGetMenus())
{
if (string.IsNullOrEmpty(x.Url))
{
//add default
System.Web.Routing.RouteTable.Routes.Add(
new Route("Default.aspx",
new RouteValueDictionary(new { File = x.FileName,
Id = x.Id.ToString() }),
new CoreRouteHandler()));
}
else
{
string url = x.Url;
if(x.Url.StartsWith("/"))
{
url = url.Remove(0, 1);
}
System.Web.Routing.RouteTable.Routes.Add(
new System.Web.Routing.Route(url,
new RouteValueDictionary(new {File = x.FileName,
Id = x.Id.ToString()}),
new CoreRouteHandler()));
}
}
}
View 2 Replies
Mar 8, 2011
I have my main web site pages in the Root folder. I have several other pages in a subfolder below the Root folder. When I launch a web page that is in the sub folder it does not correctly render the page. For example it loses the gif image that needs to be on every page. Is there something I need to add to the pages in the sub folder or do I need to set the path differently to the master page? Currently it looks like this;
[Code]....
This works for the web pages in the Root folder.
View 6 Replies
Jan 10, 2010
Can it be done? I tried renaming it once, and kept getting errors after that, something about authorization. I changed the Name of the DB, and the Name in the connection string in web.config, but didn't work.
View 5 Replies
Nov 30, 2010
I don't know much about the .Net environment, so my first idea was to just write a console app that scans the folder for new content, and then emails alerts out. Then put the .exe as a scheduled task on the server, executing every few minutes. This seems pretty archaic to me though. Is there a more elegant way to do this for my website?
View 3 Replies
Dec 5, 2010
Is it possible to disable Visual Studio (2010) query renaming feature? For example, when I "SELECT * FROM table_name" VS will rename my query to SELECT id, name, type, inspectedBy, inspectedDate FROM table_name"
View 1 Replies
Dec 8, 2010
[code]....
I have a folder named mycss and inside the css.Nothing goes green on the page(errors).
But the textbox is not changing appearance.
Note that the css works correctly if i create it inside the default.aspx page, "Style1" css file is with capital S, if it makes a difference.
View 18 Replies
Feb 9, 2011
I am trying to implement Url routing in asp.net 4.0. I just a created a small test application. I am trying to browse the pages kept inside the folder. It works fine when i am running in Visual studio..but when i hosted the application in IIS7 then it showed an error.
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
The code i used is. (i am using master page too.)
protected void Application_Start(object sender, EventArgs e)
{
CustomRouteTable(RouteTable.Routes);
}
void CustomRouteTable(RouteCollection routes)
{
routes.MapPageRoute("Telugu", "Movie/Telugu", "~/Telugu/Telugu.aspx");
}
in my default.aspx page i kept a button and on click of the button i wrote.
protected void btnTelugu_Click(object sender, ImageClickEventArgs e)
{
Response.RedirectToRoute("Telugu");
}
View 1 Replies
May 11, 2010
I have a tab control with details about a user. I want to use javascript to change some visuals. It works fine if the control affected are not in the tab container, but as soon as I have the controls in the container it won't work as the tab control renames all it's child controls to something like this: <input name="TabContainer1$TabPanel1$Txt_Name" type="text" id="TabContainer1_TabPanel1_Txt_Name" />
It should be: <input name="Txt_Name" type="text" id="Txt_Name" />
Now my javascript won't work as it can't find the controls. I did try doing this: document.getElementById('<%= Txt_Make.ClientID %>') But then I this error "The Controls collection cannot be modified because the control contains code blocks (i.e.<% ... %>)."
I just need to know how to stop the Tab Container from renaiming the controls, please? I am still searching, but I'm also runnign out of time.
View 2 Replies
Jun 3, 2010
How can i get other controls on my webpages (eg. Forms, Gridviews, TextBox, DDL's, etc...) to STOP rendering dynamically generated ID's from the AJAX Control Toolkit?
I have been able to successfully download and implement the AJAX Control Toolkit MENU within my .master page using an XML sitemap data source as well as changing the CSS properties to suit my layout and design. It now renders the page (in Source View) with the more robust HTML UL, LI tags, etc....
However when i add a new Gridview into the Content of a new page (using my master page), the View Source shows the Form ID & GridView ID has been dynamically changed which i'm sure is because of the AJAX Control Toolkit.
2 Examples:
1) FORM:
a) VWD Code View:
<form id="form1" runat="server">
b) However, page preview View Source changes to:
<form name="aspnetform" id="aspnetform" lang="en-au">
2) GRIDVIEW:
a) VWD Code View:
<asp:Gridview ID="GridView1" .......
b) However, page preview View Source changes to:
<table id="ct100_ContentPlaceHolder1_GridView1" ......>
Am i supposed to remove something from my AJAX Control Toolkit to stop other controls rendering new ID's?
As the ID's and names change when the page is rendered i cannot CSS Stlye items, use code behind with my standard names. I get errors saying the Objects are NULL as they cannot be identified.
View 4 Replies
Mar 24, 2011
Is the Content folder the root folder? I mean does http://localhost/ point to Content or is it something else?
I have a file named dummyIcon.png inside Content/images/temp folder. How do I locate it from my domain layer (which is a Code Library project)? What is the best practice of displaying images in ASP.NET MVC? Should I store a path to the image in the database (which I personally prefer), or do I save a byte array and return it to the view?
View 3 Replies
Apr 19, 2010
I would like to ask some help from you guys on how do i do this problem. I'm using asp.net and my problem is on getting the list of filename inside the folder. Is there a function on this? I tried this on console apps there's a function like GetFileName. Hope somebody could help me on this.
View 1 Replies
May 14, 2010
How to search for files inside nested folders?
View 7 Replies