I have a site that access its images in a subfolder under the site root. I am checking for the file existance using he FileExist method of the FileInfo class like this -
Dim fi As FileInfo = New FileInfo(MapPath(img.ImageUrl)) If fi.Exists Then
What I want to implement is saving the images under different domain in order to make images available to other copies of this site. Problem is when I try to FileInfo(http address) I am getting an error saying "URI formats are not supported."How can I get FileInfo to work with URI ? is there a workaround ?
I have a detailsview which uploads 4 files and uses the objectcontainerdatasource. However, what I would like to do is once I got my files from the fileupload object is to cast it to FileInfo type.At the moment I can get hold of the files via detailsview but this is where I need help; as I have four files to upload, I want to save them to either an array, collection or list of type FileUpload or FileInfo (preferably FileInfo) along with two other properties and then to pass these values to a method that saves these files to a temporary location. This brings me to my next problem. In the method that saves the files to a temporay location, whilst I can do this with FileUpload, I want to return from this method the new file path location as a FileInfo type in order to use this in another method.
still really new to this, so I apologize if I explain my problem poorly. I'll do my best.I used this method to add an "active" class to my main navigation on another site. Now I'm using it to change the background image for a div based on the current page.Problem is, it's not working in this case. When I view the source I just see the tag sitting sitting there like it wasn't compiled:
My reqirment is, I have to search for .doc file which have a string "java" inside the file. Like we use to search in Windows search na under (Search within the file). I did something to get the files now i wanna know how to read in to those files and get the rite file?
I want to capture fileInfo files in specific folder on FTPServer.here I want file Info like fileName, creationTime, LastModifiedtime, extension etc before downloading them.I want to run validate machanism before downloading files from the FTPServer.But I am unable to get FileInfo from files residing on FTP Server.
I have a fileUpload in my webform and I want to take the selected file and put it in a fileInfo type propertie, but I get type error in the conversion.I have a table with a BLOB type field (Oracle) and I need save this file directly in the table, not in the pc. I'm not finding the proper type to make this conversion and/or atribution to save the user sended file.How can i make this conversion possible to save the file in the table?
i have a method that creates a thumbnail image from a fileinfo object thats an image.
so basically my method takes a FileInfo as a paramter, creates a nwe image, saves it and actually returns the FileInfo (no idea why - it doesn't really need to)
I want to delete the Fileinfo object (aka the file in the temp storage directory) after the image has been created but when i try to run fi.Delete() i get an error saying it can't because its being used by another process.
whats the solution to this? is it possible to delete this file in the same thread or am i going to have to create a service that runs on a schedule and cleans this folder.
What about creating a new fileinfo pointing to the current fileinfo and deleteing that?
I have two folders in my asp.net web application in which I create new folders programmaticaly. The entire solution is under VSS source control. I was not able to manipulate these two folders programmably. For that, I gave {MACHINE}ASPNET user account full control over these two folders. Still, the "access denied to the path" error was coming. I saw that these entire folders were marked readonly. I tried to uncheck Readonly from explorer but not successfull, readonly check does not get removed. Also, if I copy files using method, the destinationn copied file becomes readonly. I have also tried File.SetAttributes (path,FileAttributes.Normal); but no success. How can I make the copied file not READONLY?
i set up Log4Net in a project, with the Log4Net.config file in "App_Data/config/Log4Net.config", and called the XmlConfigurator.Configure function with the following:
[Code]....
However, I the config file to be available in multiple projects, so moved it out to a solution folder (config/Log4Net.config).
Back in my MVC project, I added the config file as a linked file (and also set it to a "embedded" resource and "copy always" for the heck of it)
However I got no idea how the previous "var configfile = new FileInfo("????")" should read.
Tried it with and without Server.MapPath, using "Log4Net.config", "/Log4Net.config", "~/Log4Net.config", etc. No luck.
My guess it's because this Log4Net.config is not an actual file, but just linked.
I have created a crystal following your article which url is
[URL]
It is working fine on local machine but when i upload it on the server it is not working. Crystal Report is showing but data is not showing in the crystal report.
I am working on a multi-language web site. It is half English and half Portuguese. I have created forms that have portuguese values in it. These forms work perfectly on my desktop. I'm using Cassini as the development server. When I move them over to IIS, they are not loading properly. The text comes up all weird looking. I am declaring the culture in the page attribute: Culture="pt-BR"
I am a new to WCF. I have written ajax to use a web service before, but on this project I am trying to use ajax to WCF.After I build the project and wcf using ajax, I receive the return successfully. But, 10 or more minutes later I don't get a return, the ajax calls the error function, and the fiddler returns nothing.
If I rebuild the project without any source modifying, I receive the return successfully again.
I have a form with mulptile panels hidden behind others. It is impossible to edit them in design mode without moving them to the side so that all panels are visible, so that is what I do. I use JavaScript to position the panels during runtime, but it is an innefecient way to do it.
Is there a way to make a panel or layer visible or invisible while working in design mode, kind of like autocad works
I have a web form and I am using __eventargument to initialize Session variables on page postback. The code work fines in IE7 and IE8 compatibility mode. But when I switch to IE8 standard mode, __eventargument returns me an empty string.
What can I do to make sure all values are returned in __eventargument?
I am an asp.net newbie and encountered problem with postback. I have created a web form and put some web controls and set their AutoPostBack property to True.
Some of the controls are listbox, checkbox. However, the SelectedIndexChanged and OnCheckChanged do not fire automatically when an item is selected from the listbox for example or when the checkbox is checked. I noticed that the commands I put in the SelectedIndexChanged and OnCheckChanged is only fired when a button is clicked.
e.g. The code below that sets the text of a label is being fired only when a button is clicked even if the autopostback property of the listbox is set to TRUE.
I just tried to implement Uploadify on my website using this guide: [URL].....
I followed every step of the guide, but when I try to access the page with the upload the following script runs, but the FileUpload stays a plain old FileUpload.
<script type = "text/javascript"> $(window).load( function () { $("#<%=FileUpload.ClientID %>").fileUpload({ 'uploader': 'scripts/uploadify.swf',
I have the following problem. While continuously developing my web site, at the certain point I found out that a postback stopped working on different pages of the web application. Examples are links in LoginView control (master page), radio button lists (content pages), etc.
I can found t he function in a page source
<script type="text/javascript"> //<![CDATA[ var theForm = document.forms['aspnetForm']; if (!theForm) { theForm = document.aspnetForm; } function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
[CODE]
I can click the links or controls and it simply does nothing. It is the same like having AutoPostBack set to False.
Not a long ago it was working properly but it most likely started with one of changes I made to the application but I am not able to find what I did wrong. The problem is not browser dependent and the behaviour is the same on Win 7, XP and Win Server 2008.
I am clicking one linkbutton to check the validators clientside in the panels. This works well in IE, but not in Firefox. When I click the button, it does not even hit the validateLength function
i download a css theme and i want use it in my website but i have some problem with menu in this theme menu use ListItem:
[Code]....
and the style for the menu id is:
[Code]....
but when i use a horizontal menu in my masterpage and set the rendering mode to list it's not working like the sample that i have. is there something that i have to change?