I have a web site application and i need my web site to allow user to download a setup file from my web site how can i do this ?
I Asp.net2.0 _ C#.
Place the file somewhere within your website and make a link to it:
Click here to download
If a simple links does not work, please update your question with a description of the problem you are facing. You might have to configure your web server to serve files of type MSI or EXE (whatever your installer is packaged as).
Related
I have a basic question so apologies in advanced but I have been googling for hours and not been able to find the answer. I made an ASP.NET Core Razor Pages app and deployed it to a folder (which is in a network, it's basically our staging environment) and now need to know how to access the index page in the URL. I followed this doc on how to publish the app into a folder: https://learn.microsoft.com/en-us/dotnet/core/deploying/deploy-with-vs?tabs=vs156 (I chose the Self-contained deployment without third-party dependencies option) but now how do I access the index file?
For example if this is the URL: https://testing.com/FolderName
And the app is in the 'FolderName' folder what do I need to follow up next in the URL to open the app? Inside the FolderName folder there is wwwroot folder, appsettings.Development, appsettings, the .exe, a .pdb, and a web.config. So how do I access the app in the web? I also tried copy/pasting the files and navigating to index.cshtml but didn't work either.
Any help would be greatly appreciated. Thanks guys.
Razor Pages are not routed based on the file system (like PHP).
You start the Web server (by opening the exe) and navigate to the URL where the Web server tells you it's serving the app (in the terminal you should see a line that says "Listening on https://your_url:port...").
The index should be the first thing you see when you navigate there.
I have a web site that is created in visual studio 2010 through: File > New > Web site (it is not a Web Project).
I want to publish a release version of my web site but there is no 'Release' mode in VS and there is no possibility to add 'Release' mode through Build > Configuration manager.
How can I publish a release version of my web site ??(I can not convert my web site to a Web Project)
Thank you very mush for your reply.
When you have a website project and your using VS 2010 then somewhere amongst the menu options in the menubar across the top should be an option caled COPY WEBSITE (I think its in the website menu).
So you click WEBSITE > COPY WEBSITE then you will see a new tab appear very similar to an FTP kind of interface, with your LOCAL files on the left and the remmote server hosting on the right.
You could use either FTP or Direct upload but the very last time I could only use it via FTP.
(Of course this may be a personal issue and not affect anyone else).
It goes without saying that if you dontr have a server to upload your website to then it can not be "released" as you called it.
Usually the server or hosting is either on your own server or on a remote (Paid for) server with a service provider.
With reference to the photo below....
Area-1 is where you enter the FTP or HTTP address of the server where you will upload te files.
Loacl-Files This shows your completed website files
Remote-Files This shows the files on the server
Controls These button are used to upload or download files to and from the server
Note that you must have an FTP username and password to use FTP/HTTP transfer,
Some hosts may prefer you to use your admin account username and password.
Hope this helps point you in the right direction
I have a question about hiding or encoding the source code on a server which runs IIS.
At the moment the source code is available and visible for all users who are logged into the server where the IIS Server is running.
Is there a way to hide the Code (encode) with Visual Studio or any other software?
I think the aspx (or *.html) web site code can not be encoded but (for example) the *.vb code sites should be able to encode.
You can simply Publish the website
Build Menu => Publish Web Site
So the code behind files (*.aspx.cs) will get converted to dll(Bin/*.dll) file.
Refer this: Walkthrough: Publishing a Web Site
When you are ready to put your project live make sure that you.
Publish it.
When you publish it that you tell it to compile your code into a single library or code behind files.
If you want to protect your html as well then you should not select to make the site updateable.
These steps will protect your code but as for your web.config file you will need to look at some other articles on securing its info.
If you can, I would recommend ensuring that only the authorized people have access to the server and/or the code base running on the server. If that is the case then you should be ok.
Go to Build menu---> Click on Publish the Website.
then a folder get created on the base folder. and the encoded files are available there. That can be upload to the FTP account, then third party can't see the source code with the browser.
This may be the wrong place but this is new to me. I did some ASP.NET programming in VS.NET awhile ago and I always did debug in the menu to run and test the site and I always noticed that it compiled ... now I have someone having asking me to work on their ASP.NET website and my question is (new to this type of hosting) do I just edit the files and then upload them via FTP or do I have to ask the host to do a compile or something?
I'm assuming you have developed a project in Visual Studio.
If this is a Web Site and not a Web Application:
Right click the project (not the solution) in the Solution Explorer.
Click "Publish Web Site"
Set the local location of where you want the Web Site published to.
Take the local copy and upload it to your web root of your hosting provider
If this is a Web Application, check to see if the hosting provider has a .axd service extension for "One-Click Publishing". If the provider does not have this feature:
Right click the project (not the solution) in the Solution Explorer.
Click "Publish..."
Change the Publish method to "File System"
Set the Target Location and click Publish
Take the local copy and upload it to your web root of your hosting provider
With Web Applications you also have the ability to upload via FTP, which if you have all of the FTP information at hand it should be easy enough.
I am using a 3rd party component which creates settings files based on hard-coded file paths i.e. they are compiled into the DLL e.g.
%APPDATA%\Vendor\Settings.ini
I have created a few console/service applications that use this and work very well. However, I am now trying to use a similar approach via my ASP.NET MVC web application and the settings file never seems to write out!
Usually if the application is running under my acconut for example the file would be written to somewhere like:
C:\Documents and Settings\James\Application Data\Vendor\Settings.ini
So I thought if the website AppPool was running under the same account the file would be saved to the same place....However, it never appears. The account is an admin account running under Windows server 2003.
Any ideas?
Thanks.
Have you checked to see if the settings file is created in the App_Data folder in the web application? If not, could you put an existing settings file there and see if it uses it?
It's not about the webpool account, it's about guest user's account.
Go to the properties of your site in IIS, Directory Security and in the anonymous access click on the Edit button, there you'll see wich account is been used when someone access your site.
Couldn't find a solution to this, so I decided to develop a local WCF service (which would create the settings file in the correct directory path) and just accessed it via my web application.