How to implement style sheet on mvc razor file upload control - asp.net-mvc

I am new in MVC and I have to implement style on mvc razor control actually I want to hide a file upload control and open file upload control on button click I am using razor file upload control

Asssuming your upload control is called fileselector, try this...
$('#fileSelector').click();

Related

File in Upload control not persisting on Submit button in MVC

Recently, I was asked this question:
When using a file upload control in ASP.Net MVC, why is the selected file not persisting on Submit button click? It does shows up in control when user selects it from hard drive. Other controls of that form are persisting on submit button click, but not this file upload control.
I replied it had got to with Ajax. I am new to Web technologies. Was my answer correct?
It appears, I need to place the file upload control outside of UpdatePanel of Ajax, remaining controls like textboxes, button can go inside UpdatePanel so that their validation takes place. Another option would be to use hidden field for preserving the file value

Download pages as PDF In MVC3 Razor

I have a MVC3, Razor engine application having 8 different views(.cshtml).I have these pages for users to enter personal details and other things.I have a requirement to download the content of all these 8 pages(.cshtml) as shown in browser in a button click as a single PDF file and save it.The pages(.cshtml) contains controls like dropdownbox,calender,radio button etc.Some of the contents in the views are loaded from models.
You can try using synchronised pechkin which is available as a nuget package.
This works on html so you can use a templating engine like RazorGenerator to convert Razor views to html.

.Net MVC file upload control in modal popup and save using $.post

I an trying to upload file using modal popup. I couldn't get uploaded file in controller.
I placed file upload control in model popup and used $.post to save that file.
Please suggest me your thoughts, It's possible or not?
Thanks!
No, out of the box $.post cannot be used to upload files. You could use some of the available file upload plugins such as jQuery.form or Blueimp file upload.

When creating custom content editor (Editor tab) in sitecore, what the format of URL should be if I have desired aspx page in another VS project

When creating custom item editor in Sitecore(Editor tab), only required field is the Url, which will point to the .aspx page. Where this .aspx page should be added and what URL should I type. I've created a web application in Visual Studio and an aspx page with the desired functionality in it. This web application isn't related with my sitecore project. How to specify the URL to this page. Or should I add this page somewhere to sitecore project? Thanks in advance.
Go to core database, then in content editor go to /sitecore/content/Applications/Content Editor/Editors item. Create new folder item here if you like and inside create new item with this template: /sitecore/templates/Sitecore Client/Content editor/Editor (you can copy any existing editor item into your folder). You can set header, icon and Url (any url, absolute e.g. http://stackoverflow.com or relative e.g. /sitecore/shell/Applications/Media/Media Folder.aspx).
Now go to master database and set this editor in Editors field (inside template or specific content item)
I think you should move your Page.aspx inside sitecore project (in layout folder or custom one)
then url should be /layouts/Page.aspx

MVC - Opening an asp.net page from the controller

I don't know if this is possible.
Can I have a mvc controller open a popup asp.net page? The asp.net page is within the mvc application, it's basically to run a crystal report viewer.
What happens just now is the mvc view loads and lists reports, then when a report is clicked it launches and exports to pdf. We now want this embedded in a web page instead of exporting to pdf(for various reasons one being no local download of the pdf report).
So sfter reading up i came across the solution to use a folder within the mvc app and use a webform in there. Now I'm trying to find how to open the .aspx pop-up from the controller where the report viewing is initiated.
Does that make any sense.
Any links/help is appreciated
Controllers in ASP.NET MVC are not supposed to open popups. You could do this using javascript inside the view. The window.open javascript function could be helpful:
window.open('/report.aspx', 'report');

Resources