MVC :: Making A File Link
Nov 1, 2010making a file link
View 5 Repliesmaking a file link
View 5 Repliesok i have a file link not in the vs 2010 project .basically i have a list page in which i want to show the files, one file each for different organization. how can i make a link to that xml file which exists outside the project
View 1 RepliesI have a database table column consisting of text URLs [URL] In my LINQ-to-SQL-driven gridview, I want to make this a clickable link programmatically, with differing link text (e.g. "Link text"). I'm getting close but am missing some key concept. Here's the core of the .vb codebehind:
Dim dctx As New ResourceMod.ResourceModDALDataContext
Dim eleResObj = From eleRes In dctx.Resources Where eleRes.Type = "url" Select siteurl = eleRes.Website
GridView1.DataSource = eleResObj
GridView1.DataBind()
This displays the raw URL in the gridview (i.e. non-clickable). I've experimented with adding an explicit hyperlink column a la [URL](setting AutoGenerateColumns false etc.), but haven't yet figured out how to assign the asp:hyperlink Text and NavigateUrl fields with the anonymous-type object eleResObj. Using a field construct such as Text='<%# Eval("siteurl") %>' isn't working, presumably a scope issue. Is a LinqDataSource needed in this case, and if so, how would that affect the original LINQ query?
I have a gridview setup and have the select button enabled. I also have a gridview that doesnt have a select button enabled..
On them both, if its possible, i would like to make the row itself selectable instead of just enabling the select button.
How can i make a downlandable file links in asp.net mvc for downloading the files.Also how can i show the file as thumbnail in my page in asp.net mvc.
View 4 RepliesFor my project(in asp.net) i wrote near 1000 lines of c# code for one asp.net page.It includes so many functions.The problem is,it is going complicated while i am writing more codes on one page.How can i make multiple c# files for one asp.net page?? I tried by adding new class in VS2008.But calling a function from one file to other is making error(item is not present in current file).How can i do that??
View 6 RepliesI need to make a backup copy of a file on a remote server. The backup will remain in the same directory on that server. The problem I am having is that the file is large and it appears to be copying it back to the server the code is running on and is taking too much time. Is there a way to make a copy of the file in place without it being sent across the network?
View 4 RepliesMy goal is to take some form inputs and prompt the user to download a summary of everything once a certain button is clicked. I have no need for the file once it is downloaded and so I'd like to have a solution where the data is streamed directly to the user. My current solution doesn't even prompt the user for a download. Can anyone point out what I'm doing wrong?
I've got it wrapped as a webmethod and so I needed to add a definition of the _Default page class so I could access certain things.
[Code]....
this wasn't mentioned earlier but the webmethod is being called by an AJAX request!
i am coding fr taking databse backup frm my asp.net web application
i get the backfile in .bak form. how do i zip it. make it in zip form
How do I upload a file on the web server and save the link of the file in a database?
View 3 Repliesi have created basic .aspx files .one is login.aspx and registration.aspx...Now in my solution explorer i also added class file i.e StudentInfo.cs and wrote some properties in it...now my question is
1. i want to connect Studentinfo.cs class to my login.aspx.cs...So that i can call the methods in Studentinfo.cs..how to do it?
when I reference a assembly. It's reference gets added to the project file in my case ( ABC.csproj)
Also when I take a look at the web.config file there is a section called <assemblies>. And lot of assemblies are added there.
What is the difference between link to the assemblies in the Project file and the assemblies in the web.config file?
I want a view to contain an <a> link to an .htm file stored in another View folder. When I try this I get a "resource not found" error:
[Code]....
Where should I place .htm files in the ASP MVC project. And what does the URL string that references those pages look like?
I'm new to asp.net and got stuck on page 124-126(Build ur own asp.net web site.). I just cannot link the Ads.xml to the AdRotator file.
View 16 Repliesi m developing one job portal!there i have one modal pop and user details in that pop up..i have one link there, where i have displayed the filename.(in the link).
View 2 RepliesI just want to know how can I put a file downloadable link on aspx web page. I mean if I want to put a audio file to download which I have in a folder on server, how can a link could refer to that file, for the user to download it or listen online?
View 3 RepliesI have an html page which contains link to open pdf file. however this link opens in adobe reader when i click on it. I have set target property to blank. but it doesnt work either. I want to open this pdf file in new tab in the same window.
View 6 RepliesI have a requirement where i need to open excel file from system using link
i build link from code <a href="path fo file">
but this does not work from aspx page
if i put same thing in seperate html page nd run it works fine
I am saving different file formats as varbinary in a SQL Server 2005. The web application is VS 2005 using VB.
How can I put a link in a page to the file saved in the database?
I have a web application which consists of many aspx pages ... one of them shows a grid with rows that can be exported to a file via button click. This works fine. Now I want to have that feature which allows a user to access an external link to this page (or another) and to export to a file and download. I dont need any information on the page, just the file download. How could I do this also including security features like encryption?
View 2 RepliesI am able to upload a file to the server into a folder structure. but when I try to link to the file, the image path in the code is giving a strange url.
It should be something like
<a id="GridView1_ctl02_HyperLink1"
href="../MyFiles/1.jpg">HyperLink</a>
but instead its coming back as
<a id="GridView1_ctl02_HyperLink1"
href="../MyFiles/%3C%25#%20Eval(%22filename%22)%20%25%3E">HyperLink</a>
I am using this code to link to the button - which I'm sure is causing the problem
<asp:HyperLink
ID="HyperLink1"
NavigateUrl='~/MyFiles/<%# Eval("filename") %>'
runat="server">HyperLink</asp:HyperLink>
How can I create a link when it is clicked, it plays the audio.
I have a speex file on the server and my browser has the latest adobe flush-based player.
I have a web service that takes an XML string for input and saves the XML to a file. The filename is created from the date and time and a random number generator. The program also edits the XML as it processes, and there can be errors. When there's an error, I create an email which describes the error and then repeats the XML in the body of the email. I am using another web service written in-house to send the email.
I want to include in the email a link to the filename I saved. What is the best way to do this? I think I need to use HTML, but there's an html flag I pass to the email web service which needs to be false. When it was true, the XML wasn't formatting.
I have some information I am pulling from my db into a table. Can anyone direct me to a tutorial that shows how to dynamically create a file and allow a user to download that file with the table contents. All this must be dynamic.
View 2 RepliesFollowing on from my previous question...
The following code creates log files on a web server:
private void LogMessage(Message msg)
{
using (StreamWriter sw = File.AppendText(_logDirectory + DateTime.Now.ToString("yyyyMMddHH") + ".txt"))
{
sw.WriteLine(msg.ToString());
}
}
The log files are linked to from an admin page on the web site:
foreach (FileInfo file in logDir.GetFiles())
{
Response.Write("<a href='http:// .... /Logs/" + file.Name + "'>" + file.Name + "</a>");
}
I'm getting the problem that after someone looks at one of the log files from the link, that log file stops being written to.