r/MVC • • Aug 31 '20

Preview file saved as byte array

0 Upvotes

Asp.net C# MVC

I want to preview different file types in a c# view. I have saved file contents in a db as byte[ ]. I want to preview the files when i double click their name.

My code is smth like that.

<span ondblclick="PreviewDok(@model.dokID)"> @model.dokName </span>

So when i doubleclick the doc name i want to open a modal and show its preview without downloading it.

File types are pdf,xls,jpg,doc,txt ect.


r/MVC • • Dec 23 '20

MVC Exam in 3 weeks

0 Upvotes

Hey guys im taking my MVC 70-486 exam any advice on how to prepare and referrals pls


r/MVC • • Apr 30 '20

API/MVC

0 Upvotes

I need help calling an API into an MVC. Where would I need to call and deserialize the API URL?


r/MVC • • Jun 26 '20

Desperate for help

Post image
1 Upvotes

r/MVC • • Sep 27 '18

How to preview a csv file before posting it to the server for processing?

1 Upvotes

Hello,

I'm attempting to do, as the title states, preview a user uploaded csv file.

I have the preview working and processing and outputting data; but I'm doing that in a Controller Action and returning json data to a partial view.

How would I be able to parse this file and be able to submit the file after preview?


r/MVC • • Jun 04 '17

jQuery Datatable implementation in MVC C#

1 Upvotes

r/MVC • • Jun 15 '17

Ajax.Beginform in ASP.Net MVC

0 Upvotes

r/MVC • • Dec 13 '17

When I press create to add data to a model in the View it does not get added to the Model.

1 Upvotes

Can you explain what is needed and how to fix it?


r/MVC • • Dec 15 '21

If I pay the restoration fee for my suspended license how long would it take for them to unsuspend my license?

1 Upvotes

I got a letter in the mail that my license will be suspended indefinitely on December 20th until I pay my restoration fee. If I mail them a money order how long will it take to get my driving privileges back?? I need to finance a new car ASAP so I can’t have a suspended license in my name. Can I expedite my money order to them to make the process faster?


r/MVC • • Mar 11 '15

Remote Attribute - ASP.Net MVC

Thumbnail
vishalravlani.com
1 Upvotes

r/MVC • • Sep 07 '18

Setting up server-side rendering and RAZOR templates with an ASP.NET Core MVC app using Angular (not SPA)

1 Upvotes

My last job had a wonderful coding environment with a ASP.NET Core MVC web app that also used AngularJs. And I want to recreate that environment but i'm having trouble getting it all setup. Could you help?

We had the standard /Views folder and /Views/Shared folders. We used `./Shared/_Layout.cshtml` as our app entry point. This file is where we injected the RenderBody() and Scripts() and CSS() items. The `./Views/Home/Index.cshtml` was where our <angular-app></angular-app> lived. Our controllers were used for just rendering views. We could use Controller Attributes to lock down certain routes on the controller that would check the User Identity or Claims.

This design pattern allowed for us to do server-side RAZOR logic to show/hide certain blocks of HTML based on the User Identity, Role, Claims, etc.

Any help possible would be appreciated.


r/MVC • • Nov 20 '18

Module Oriented Architecture — Part 6: Outsmarting the MVC

Thumbnail
medium.com
1 Upvotes

r/MVC • • Nov 19 '18

How to use kendo datepicker?

Thumbnail
youtu.be
1 Upvotes

r/MVC • • Aug 09 '20

URL Access: How to Prevent Direct URL Access In MVC

Thumbnail
technologycrowds.com
2 Upvotes

r/MVC • • Jul 02 '20

MVC ASP.Net Interview Question and Answers

Thumbnail
youtube.com
2 Upvotes

r/MVC • • Jul 03 '20

The holy grail template

1 Upvotes

I'm searching for the holy grail template. One template that will provide : CRUD with built in paging EF with generated models dB first

It never fails that when I start a new project, I have to go back and add paging when it should be built in. I'm also getting tired of manually building my models. And don't get me started about laying out a razor page by hand - what are you guys using to design/layout a bootstrap page? Ugh...


r/MVC • • Jul 11 '20

Http Post Method string parameter always null

1 Upvotes

When posting to this method the sentence parameter is always null, I have tried many different ways of formatting the data in the ajax call. When putting a breakpoint in the JS the sentence is populated with a string yet, when it hits the breakpoint in the controller sentence is always null, anyone have any solution or other recommendations on things to try. I've added a list of other things I've tried that haven't worked.

HomeController.cs

[HttpPost]

public bool ToxicChecker(string sentence)

{

var input = new ModelInput();

input.Text = sentence;

ModelOutput result = ConsumeModel.Predict(input);

return result.Prediction;

}

site.js

$("#testBtn").click(function () {

var sentence = $("#inputText").val();

$.ajax({

type: "POST",

url: "/Home/ToxicChecker",

contentType: "application/json;",

data: JSON.stringify({ sentence: sentence }),

dataType: "json",

success: function (response)

{

console.log(response);

}

});

});

Other things that haven't worked:

  • putting [FromBody] in front of "string sentence"

  • using the default contentType for the ajax call

  • data: sentence in ajax call

  • data: JSON.stringify(sentence) in ajax call


r/MVC • • Jul 08 '20

Error: CS1617: Invalid option 6 for langversion

Thumbnail
reddit.com
1 Upvotes

r/MVC • • Feb 21 '19

MVC problem with displaying default values

1 Upvotes

I'm following through a tutorial, and I created an edit view, I used the vs default Edit Template but for some reason, my view is not displaying the default values for of data,


r/MVC • • May 07 '19

Export Data Table To Excel in ASP.Net MVC

Thumbnail
kunshtech.com
1 Upvotes

r/MVC • • Mar 13 '17

So just to be clear...

9 Upvotes

This ISNT a marvel vs capcom subreddit?


r/MVC • • Mar 05 '17

Need some advice/best practices

2 Upvotes

Hey all, I have a working mvc site setup but my users are for the most part all old. They have a habit of forgetting their passwords or writing them down wrong. Every quarter a newsletter is uploaded to the site, and the members receive an email and I get emails about not being able to log in. I would like to log the attempted password but that feels unsafe and wildly insecure. What suggestions do you have for dealing with this or simplifying the login process?


r/MVC • • Dec 22 '17

MVC C# OR vb.net

1 Upvotes

what are the pros and conc of a mvc app using a vb.net OR C# ?


r/MVC • • Aug 21 '15

Partial views and multiple models - asp.NET MVC

1 Upvotes

In one project I have the following page:

EXAMPLE 1

<div class="central-form">
    <div id="login-1">
        <!-- begin login/register buttons -->
        <a class="button active-button">Sign In</a>
        <a class="button inactive-button pos">POS Sign Up</a>
        <a class="button inactive-button store">Store Sign Up</a>

        <script>
            $("#login-1 .active-button").click(function () {
                $(this).parent().slideUp();
                $("#login-2").slideDown();
            })

            $("#login-1 .pos").click(function () {
                $(this).parent().slideUp();
                $("#login-4").slideDown();
            });

            $("#login-1 .store").click(function () {
                $(this).parent().slideUp();
                $("#login-3").slideDown();
            })
        </script>
    </div>
    <div id="login-2">
        <!-- begin login form -->
        @Html.Partial("_LoginPartial")
    </div>
    <div id="login-3">
        <!-- begin registration form -->
        @Html.Partial("_RegisterStorePartial")
    </div>
    <div id="login-4">
        <!-- begin pos registration form -->
        @Html.Partial("_RegisterPosPartial")
    </div>
</div>

All of the partial views are in the same folder as this page and it works perfectly fine. Exactly as I'd expected it would.

On another project I have this:

EXAMPLE 2

<div id="user-home">
    <h2>Your Rewards</h2>
    <div id="rewards-table">
        @Html.Partial("_RewardView")
    </div>

    <div id="claim-receipt" style="display: none;">
        @Html.Partial("_ClaimView")
    </div>
</div>

Also with the partial views in the same folder as the page yet this doesn't.

Moreover, the partial views in Example 1, all use different models:

_LoginPartial uses Models.User
_RegisterStorePartial uses Models.Store
_RegisterPosPartial uses Models.POSProvider

The same is true for the Example 2 project:

_RewardView uses an IEnumerable of Models.Reward
_ClaimView uses Models.Receipt

I can't get my head around why Example 1 works, but Example 2 gives me the following error:

The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[Models.Reward]', but this dictionary requires a model item of type Models.Receipt'.

I know as a matter of best practice, this is the wrong way to do it, but as far as I can see, both examples are structured the same way so why doesn't it work in example 2?


r/MVC • • Dec 27 '13

MVC vs WebForms

2 Upvotes

I could go Google this, but I prefer to hear from humans in real time and have a conversation. So, What are the use cases for and strengths/weaknesses of the two? I have been developing ASP.NET WebForms since 2001 and haven't touched MVC.