I have a gridview which is pulling data from sql server2005. Now i have five pdf or jpg files in a folder in my website directory. There urls are stored in sql table like this
myfileuploads/Picture5.jpg
Now i have an itemtemplate in templatefield in gridview
I want that the above url should be displayed in itemtemplate and whenevr user click on this link, related file should be open
When you use ASP.NET web site (instead of web application model) and add reference to an assembly from local folder, Visual Studio, it seems, understands that this local assembly is also in GAC and so does NOT copy this assembly to bin folder (as it does with non-GAC assemblies), but simply adds new record in web.config file.
Why such a behaviour? Is it possible to force copy to bin folder (I need this since .dll is not on target environment)? I can add assembly to bin folder as file and it will work, but in this case bin folder contents will be in source control, which is not good.
As virutal directory points to physical path of the application, so if the IIS root directory is C:inetpubwwwroot and the application is stored at D:websites, than we need to create a virtual directory but if the application content is placed at C:inetpubwwwroot, then why still need to create virtual directory.
I have a asp.net website in the IIS which is available on internet as www.xyz.com now I have been asked to prepare another website which will be accessed via www.xyz.com/abc.
For this, do I need to create a virtual directory under the website folder XYZ in IIS? or is there any other way to achieve this.
I have my web application in which I have paste some of WebPages which is referencing to some DLL which was earlier in Bin Folder but when I move to my solution I am getting error of
Error 1 The type or namespace name 'MyDummyBinDLL' could not be found (are you missing a using directive or an assembly reference?) F:WebProjectsProbingTestProbingTestGlobalPlus.UI.ClientWebLinkMyWebLinkHomePage.aspx.cs 13 7 GlobalPlus.UI.Client
I have trouble getting a custom ObjectDataSource for an asp:ListView control to work. I have the class for the DataSource in the App_Code directory of the web application (as required by the asp:ListView control).
using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.Data; using System.Data.Common; using System.Web; using System.DirectoryServices;........
As soon as I add using System.DirectoryServices; the page crashes with this message:
Compiler Error Message: CS0234: The type or namespace name 'DirectoryServices' does not exist in the namespace 'System' (are you missing an assembly reference?) Without the usage of System.DirectoryServices the page loads without problems.
The reference is there, it is working in classes outside the App_Code directory.
I am working on my test project for my web service, and my problem is that, my web service uses a folder (within the folder there are crystal reports template).
How can I copy it to test porject?
I've tried to copy the folder to various directories such as bin, bin/debug, obj, rootDir etc, but none of them works
I have done a small active directory application and it is working fine in my testing environment. However, When I put it on the production server, it is throwing following erroMain Error: Logon failure: unknown user name or bad password.Stack Trace :[DirectoryServicesCOMException (0x8007052e): Logon failure: unknown user name or bad password.
As with other posts recently dealing with httphandlers and streaming(which have been reolved so far) we store video files outside of the site directory.. so my question is that each record has a path stored with the physical like e:storagevideosvid123.avi and so on..
is there any way to validate that the video actual exists before i try playing it? I mean in the table the record could have the path, but as exceptions already came up that the actual video is not in that location or for that matter a invalid path that maybe is no longer available on the server.. i want to play a generic video clip in its place..
I have used Directory class and always dealt with paths within the site, but i need to venture out of the site and check the actual server for the path, if it exists then check if the file exists, if not display my video, if it does then play the actual video.
I am doing a project, In that i have to store some content in excel file and should have to save as sample.xls. If the file is already Exists, then have to store sample1.xls and again if it is exists, then sample2.xls...like that.... How in c# code.
Actually, I have developed an Website. In that, one page contains a message text field, If a user typed some text & clicked save button, that content should be store in excel file and save in different name with sequence series..
i tried adding reference of system.windows.forms dll to my web site. But it is not getting added. If i add a reference of a dll of another project inside the assembly that gets added. Is it not possible to add reference of a system dll in website?
We have a web site that sits on a DotNetNuke platform and all of our coded modules are written in VB.Net for consistency. However, we have been sent a web page that works as a link and it is written in C# and references a cs file in its App_Code folder. If we try and load this into our website we get an error saying that it is not written in VB we then tried converting the homepage to VB but the reference folder is very complex and written in C#. Can we load the reference file even though it is C# and reference it using VB code. The current all is OurRemService RemService = New OurRemService(); where OurRemService is a file in the App_Code folder in the web page folder. The only other way around this is for us to set it up in IIS as a virtual directory and reference it directly but we would prefer to integrate it into our website.
Our web reference does not seem to be defined in web.config of the website that consumes it. I found that there is a configuration file called "Reference.map" in the "Web References" folder that looks editable, but when I edit them nothing happens. I even renamed the WSDL file in the folder to see if it would get a new one. It did not.
Do I have to do a build just to change the URL of a referenced Web Service?
I was running it directly from Visual studio which resulted in this error :) I can clearly see the images when I run it directly from IIS!
I've created a website under IIS and have successfuly pointed it to my project. The path to my project under IIS is:
[URL]
I, then created a virtual directory under website cartoon named cartoon_images but it creates it under localhost:36011/cartoon_images/ instead of localhost:36011/cartoon/cartoon_images/
As you can see, virtual directory is under the website "cartoon" but I can't access it as cartoon/cartoon_images/
I'll need to give links to this virtual folder but I can't do it in this case if I'm not mistaken.
I have a ascx file and dbml linq file. i need to write c# script inside the ascx file, for that i need to use .dbml file. I dnt know how to reference it in my ascx file
I am seeing temp files created in my wesite directory. The files are attributed to a page that I load from a txt file for more info. I beleive when I user clicks on the more info link and I read the textfile into the page it creates the temp file named somthing like this moreinfo.aspx~RF1630b1e.TMP does anyone know a way to clean these up other than a manual task? below is the code I use to read in the txt file
<script language="vb" runat="server"> Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Dim strURLNAme As String Dim MyFileName As String strURLNAme = Request.QueryString("AdultInfo") ' Response.Write(strURLNAme) If strURLNAme = "adult" Then MyFileName = "AdultMoreInfo.txt" ElseIf strURLNAme = "kids" Then MyFileName = "KidsMoreInfo.txt" End If 'Open a file for reading Dim FILENAME As String = Server.MapPath(MyFileName) 'read the file Dim objStreamReader As StreamReader objStreamReader = File.OpenText(FILENAME) 'read the entire file into a string Dim contents As String = objStreamReader.ReadToEnd() Me.lblNicerOutput.Attributes.CssStyle.Add("text-align", "Left") 'We may wish to replace carraige returns with <br>s lblNicerOutput.Text = contents '.Replace(vbCrLf, "<br>") objStreamReader.Close() End Sub </script>
Can you point me to a url for the proper directory structure to create for a new website?I can create a website project and add class library projects to the solution to create a fully functional website.My grey area is that I need to zip up the web site solution and hand it over to the client.I'd like to make sure that I hand over a solution with the most proper directory structure.I'll run you through a scenario:
1. Select File > New > Web Site > ASP.NET Web Site from the main menu 2. Save with a path of C:ProjectsTestWebSite 3. Right-click the solution in VS and select Add > New Project > Class Library 4. The new class library is added with an automatic path of C:ProjectsTestWebSite (2)MyClassLib1
It seems like there should be a way to create a better structure for this but I'm just not following the correct process. Can you point me to a url with instructions for managing a proper structure for this?
I have an ASP.NET MVC application for which I store uploaded content files in a virtual directory. This virtual directory is directly underneath my MVC website in IIS. My problem is that the virtual directory allows anonymous access. Anyone, logged in or not, can type in a public URL to my virtual directory and read the files in it. Is it possible to configure IIS (or something else) in a way that forces any requests to this virtual directory to run an authentication/authorization routine before allowing access?
Is this something I can configure in my website's web.config, or does the request never hit any server side code in this case? If it never hits server side code (and feeds the request directly to IIS), how can I change my implementation to require my site to authenticate/authorize and then serve my file.
upload files to my website, but I won't to save it to the same folder where my website is on any given server. I also want to read these files with code.How do I get the directory of the local folder in which my website files are?
i am currently trying to make a website for my internship , my assignement is to make a login procedure using date and passwords from the active directory, i'm using visual web developer 2008 express edition to make this website, does annyone know how i could get the names , functions and passwords of the users from the active directory?