Subscribe: Web Forms
http://forums.asp.net/rss.aspx?ForumID=18
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
data  facebook  files  form  function  https  ipv  microsoft  model  mvc  net  new  page  repeater  reporting  val  var 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Web Forms

All Forums



All Forums



Last Build Date: Sat, 24 Feb 2018 14:34:17 -0800

 



For Sale Brand New Canon EOS 5D Mark III Digital SLR Camera Body

2018-02-24T22:14:59.137-08:00

Product Information
The Canon EOS 5D Mark IV is a high-quality digital SLR camera with an outstanding picture resolution of 30.4 megapixels. This pack includes the camera body only, which features a sleek, black design with a 3.2" LCD screen. It is powered by a lithium-ion battery and supports USB wired connectivity with external devices. The camera also records HD video with a maximum resolution of 4096 x 2160p.

Contact : limpaliza@hotmail.com

Canon EOS 5D Mark III Digital SLR Camera Body
22.3 megapixel full-frame sensor
61-point AF
Full-frame
6 fps continuous shooting
ISO 100–25,600 sensitivity, expandable to ISO 102,400
Full-HD video with manual control
14-bit DIGIC 5+ processor
Weather sealing
8.11cm (3.2-inch) 1,040,000-dot screen
HDR mode
Headphone output


Contact : limpaliza@hotmail.com




Data Anotations doesn't work

2018-02-06T14:47:55.883-08:00

Hi I registered the unobstrusive validation in a function: function MostrarConfirmacionMotivo(idControl, success) { var controlMotivo = $("#motivo_" + idControl); if (controlMotivo.length) { controlMotivo.val(''); } if (formControl) { formControl.resetForm(); } $("#formMotivo_" + idControl).data("validator", null); formControl = $("#formMotivo_" + idControl).validate(default_validate(function () { if (controlMotivo.length) { success(controlMotivo.val()); } else { success(); } $('#' + idControl).modal('hide'); })); $('#' + idControl).modal('show'); } The value of : default_validate function default_validate(handler, validateHidden) { var defaults = { highlight: function (element) { $("input").removeClass("error-message"); $("textarea").removeClass("error-message"); $("select").removeClass("error-message"); }, errorClass: "error-message", submitHandler: handler }; if (validateHidden) { defaults.ignore = []; } return defaults; } The problem is that the validation doesn't work: The view is: @using Rep.Traserep.Presentation.Web.Strings; @model Rep.Traserep.Presentation.Web.Models.ModelModalMensaje @{ ViewBag.ModalId = Model.IdModal; ViewBag.ModalTitle = Model.TituloModal; ViewBag.ModalSize = ""; Layout = "~/Views/Shared/_LayoutModal.cshtml"; }
@Model.Mensaje
@if (!string.IsNullOrEmpty(Model.Advertencia)) {
@Model.Advertencia
} @if (Model.Motivo) { using (Html.BeginForm("AnularSolicitud", "Solicitud", FormMethod.Post, new { id = "formMotivo_" + Model.IdModal })) {
Motivo @Html.TextAreaFor(x => x.ContenidoMotivo, new { id = "motivo_" + Model.IdModal, @class = "form-control", maxlength = "500" }) @Html.ValidationMessageFor(x => x.ContenidoMotivo, null, new { @style = "color: red" })
} } @if (!string.IsNullOrEmpty(Model.Confirmacion)) {
@Model.Confirmacion
} @section modalFooter { } The model with data anotations is: using Rep.Traserep.Presentation.Web.Strings; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; namespace Rep.Traserep.Presentation.Web.Models {     public class ModelModalMensaje     {         public string IdModal { get; set; }         public string TituloModal { get; [...]



How to save image path in database and save image in specific folder of project.NET core

2018-02-24T20:06:20.1-08:00

[HttpPost] [ValidateAntiForgeryToken] public async Task Create(Employee emp) { if (ModelState.IsValid) { var files = HttpContext.Request.Form.Files; foreach (var Image in files) { if (Image != null && Image.Length > 0) { var file = Image; //There is an error here var uploads = Path.Combine(_appEnvironment.WebRootPath, "uploads\\img"); if (file.Length > 0) { var fileName = Guid.NewGuid().ToString().Replace("-", "") + Path.GetExtension(file.FileName); using (var fileStream = new FileStream(Path.Combine(uploads, fileName), FileMode.Create)) { await file.CopyToAsync(fileStream); emp.BookPic = fileName; } } } } _context.Add(emp); await _context.SaveChangesAsync(); return RedirectToAction("Index"); } else { var errors = ModelState.Values.SelectMany(v => v.Errors); } return View(emp); } when i save image, image save successfully in database, but it takes full image path like this C:\Users\VIZO\Desktop\employee.jpg i dont want like this, i need to save image path something like this ~images\employee.jpg. The other problem is image doesnt saving in specific folder of project, i need to save image in this path of my project  uploads\\img [...]



Image hosting?

2018-02-24T19:08:09.91-08:00

Why do I have to go through the hassle of uploading and hosting my files on external sites like Imgur? I have used Imgur for hosting my screenshots for my very thread on this forum. I will try to keep these files online for as long as possible, but I don't plan on keeping these files forever. They clutter up my private space on Imgur and I have the extra work of keeping them organized in albums and adding new images to the appropriate album and copy and pasting the direct links to the files.

Is there any chance you could start hosting your own image files and other type of file attachments? Imgur is excellent for screenshots, that's why it's used by sites like Stack Overflow. Maybe you could get a professional account with them and use their API to upload and host the image files over at Imgur? Another benefit of Imgur is that it's very easy to quickly create thumbnails and galleries with just a few edits in the original post.




Asp.net portal home page is not displaying properly

2018-02-06T12:47:58.11-08:00

Hi Team,

Home page of ASP.Net portal is not displaying properly in IE as well as in Chrome. The page has been scattered here and there.

Please let me know if i need to update in browser settings.

Thanks,

Saran




URL Result generated by Url action

2018-02-21T16:43:22.793-08:00

I read that the following code:

Url.Action("someaction", "somecontroller", new { id = "123" })

Generates:

/somecontroller/someaction/123

I am using this approach to make an image clickable so a controller/action is fired but what I see is that the result is:

/somecontroller/someaction?id=123

Although I am getting the parameter value, I would like the URL to be shown as the first option. How can this result be achieved?

Respectfully,
Jorge Maldonado




How to sign in with Facebook account in an ASP.NET MVC project?

2018-02-24T16:09:21.31-08:00

Hi!

So I follow the official guide on creating an ASP.NET MVC project and enabling Facebook authentication, by Rick Anderson of Microsoft. I am able to authenticate with Facebook, but I still can't sign in. The problem seems to be that I do not get the registration form when I authenticate for the first time.

  1. I create a new ASP.NET MVC project.
  2. I enable individual user accounts.
  3. I update OWIN from 3.0.1 to 4.0.0.
  4. I add RequireHttps attribute to the Home controller.
  5. I enable SSL.
  6. I copy the HTTPS URL and paste it in as the project URL.
  7. I create a new Facebook app, add Facebook Login (OAuth) and configure it for my localhost app.
  8. I enable the UseFacebookAuthentication method and add my app ID and app secret.

The problem seems to be that I do not get the registration form when I authenticate for the first time. So when I click on the Facebook sign in button, the URL changes from https://localhost:44333/Account/Login to https://localhost:44333/Account/Login#_=_ and no registration form is displayed.

What am I missing?

Updating OWIN

(image)

(image)

(image)

Enabling SSL

(image)

(image)

(image)

Adding API key and authenticating

(image)

(image)

(image)

(image)

FYI

If you are a frustrated ASP.NET beginner like myself, and you stumbled across this post in search for answers, please make note that the guide I linked to above is 2 years, 11 months and 20 days old at the time of this writing. It's amazing how fast things get outdated. One thing you need to do that's not mentioned in the guide is that you need to provide a valid redirect URI. I believe this is a new requirement for OAuth 2.0. If you fail to do that, you will run into the problem you see below when you try to authenticate.

(image)

All you really need to do is add the local HTTPS address for your app as you see below.

(image)




The definition of this report is not valid or is not supported by this version of Reporting Services. The report definition may have been created with a later version of Reporting Services

2018-02-24T18:19:15.553-08:00

Hi

I created a blank reportviewer in Visual Studio 2017 but after I added a control I received the error:

ReportProcessingException: The definition of this report is not valid or does not support this version of Reporting Services. The report definition may have been created with a later version of Reporting Services, or it may contain content that is not in the correct format or that is not valid according to the Reporting Services schemas. Details: The report definition has an invalid destination namespace 'http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition' that can not be updated.

I don't know the configuration to avoid this error.

The unique solution was found in this link..

https://stackoverflow.com/questions/36272514/the-report-definition-has-an-invalid-target-namespace-rsinvalidreportdefinition

But I don't understand this behavior.

In other words... Visual Studio changed:

<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
 with this code after I edited the report:





Bootstrap not working anymore

2018-02-23T13:49:54.86-08:00

Hi

I have an out of the box MVC application which I just started. I added a new view, now Bootstrap isn't working on the whole project.

The new view is simply a blank view template.

Any Ideas?

(image)




core 2.0 sample page with register login: mailkit instead sendgrid possible?

2018-02-23T22:00:27.7-08:00

Hello guys,

i am using the core 2.0 registration / login / logout sample page. 

https://docs.microsoft.com/en-us/aspnet/identity/overview/features-api/account-confirmation-and-password-recovery-with-aspnet-identity

Now i try to figure out how to replace sendgrid with mailkit or SMTP (as far as i know microsoft recommends Mailkit).

I am not able to make him send anything is causing headache!

has anybody hints or tutorials how to get this working?




Simple Question

2018-02-24T15:40:56.49-08:00

Just started trying MVC/MVVM. My modifed version from VS2017 seems to work fine - and comes up as 

( http://localhost:62850/) .

But once I leave VS environment I dont know how to launch it ...

If I publish the site ( using folder ) to a test web server under a folder ( call it IPV)  I see lots of folders.. but I dont see any index.html etc

What is the address of the site ?,,, I am using the true folder address,,,,, but  there's no index.html....

There are  some folders with views with .cshtml  and just as an experiment tried ( none worked )

.....Ipv/Views/ipv/IPV.cshtml   ( should have been my starting view ) 

Also tried ...   Ipv/Views/ipv/home/index.cshtml    

Whats the key here ??    Does simply calling http;//companyTestserver/FolderPaths/IPV supposed to engage the site ?   I tried that and nothing happened just said it could not display the directory,

Note : the page where I hoped to start ..

@using IPV.ViewModelLayer
@model IPViewModel
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}




etc

I noticed from the Getting sstarted pages that Razor pages should start with @page but none of the views with .cshtml start with @page

Also noticed ( https://docs.microsoft.com/en-us/aspnet/core/mvc/razor-pages/?tabs=visual-studio ) that the discussion on URL and file location maps to Pages/index.cshtml

But the MVC ( and I am still on Windows 7 for 2 more months  so not using .CORE for development ) doesnt have pages folders rather VIEWS... but that will still suggest that the IIS must be configured to recognize IPV as a site ....   Is that correct ?  I cannot load it as folder in an existing site and call it like other HTML pages ?

Thanks !!!




Where is my post?

2018-02-24T17:47:33.61-08:00

I made a post, but I can no longer find it.

Original URL: https://forums.asp.net/post/6193980.aspx

"Sorry

This thread has no approved posts. Please refresh if it should."

Where is it? Has it been deleted?

If I use the URL above I can see the post/thread/notsurewhat, as you see below.

(image)

But why is the title listed twice? If I navigate to the MVC forum...

https://forums.asp.net/1146.aspx/1?MVC

I can not see it.

(image)

And if I refresh the page in my browser that still displays the post with the URL...

https://forums.asp.net/t/2136867.aspx?How+to+sign+in+with+Facebook+account+in+an+ASP+NET+MVC+project+

I get the "sorry" message.




Use if statement of repeater in repeater

2018-02-24T16:51:48.667-08:00

I have 2 nested repeaters. I can't use the eval on the first repater in the second repeater if statement. I want to compare Repeater1 Eval and Repeater2 Eval in the Repeater2 ItemTemplate. How can I do that? Thank you for help. Here's an example:



    
        
        <% if (Repeater1Eval == Repeater2Eval) { %>
                //Show Something
        <% } else { %>
                //Show Something
        <% } %>
        
    




Extract Multi Image from a field in SQL

2018-02-24T14:19:06.937-08:00

I have a task to extract multiple image from a single field in SQL. It has another field that show how many images in Image field. 

(image)

Any idea how to extract and save this image to local folder?
I have a code to save a single image, but failed to save multi image into multi file.




FineUploader data

2018-02-24T16:02:07.527-08:00

Hi Community. I apologize in advance if this is a repeat question, but I've been searching around and haven't been able to find any answers.

I'm trying to get write Controller (in asp.net core) code to handle my fineuploader requests but it keeps failing to see the request data. Here is my uploader config in the view page:

var uploader = new qq.FineUploader({
            element: document.getElementById("uploader"),
            request: {
                endpoint: '@Url.Action("AddAttachment", "Util")',
                customHeaders: {
                    "RequestVerificationToken": '@GetAntiXsrfRequestToken()',
                    "Content-Type": 'application/json'
                }
            },

And here is my controller code - not alot for now, I just literally want to see some data getting sent.
public JsonResult AddAttachment([FromForm] Object o){
         //var x = HttpContext.Request;
         //return Json(x);
         if(o == null){
             return Json("no data");
         }else{
             return Json(o);
         }
    }

and her is what I see fineuploader sending to the server via the network tab in the chrome devtools:
------WebKitFormBoundarySQwYoYovQOkoFU1f
Content-Disposition: form-data; name="test"

876
------WebKitFormBoundarySQwYoYovQOkoFU1f
Content-Disposition: form-data; name="qquuid"

9ba04b80-b3d8-4e2d-8068-792dd77253bd
------WebKitFormBoundarySQwYoYovQOkoFU1f
Content-Disposition: form-data; name="qqfilename"

dohPlayDat.PNG
------WebKitFormBoundarySQwYoYovQOkoFU1f
Content-Disposition: form-data; name="qqtotalfilesize"

3535659
------WebKitFormBoundarySQwYoYovQOkoFU1f
Content-Disposition: form-data; name="qqfile"; filename="dohPlayDat.PNG"
Content-Type: image/png


------WebKitFormBoundarySQwYoYovQOkoFU1f-
Any help at all will be greatly appreciated



Bootstrap Date Picker

2018-02-23T09:56:00.36-08:00

Hello Experts, Many apologies in advance for asking a simple question. I have tried to find a solution to this for days now!! I have inserted the datepicker code into a new webform. But no matter what else I do, I cannot get it to work. When i run in the browser, Ican see the box and the image to click on but nothing happens on click. So the date picker doesn't appear. I can also type into the box. My code is below. I would be very, very grateful if someone could help me out with this. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Test.WebForm1" %>
[...]



How to get an accesstoken from facebook to create a photo album ?

2018-02-24T14:04:48.23-08:00

In a Asp.net Core application I want to create a photo album on a page I manage.

In a console application I have been able to create a photo album and upload a photo to that album. The access token I used I obtained via the Facebook graph api explorer.

Now I need to obtain the accesstoken from within the web application.

My application use Azure AD authentication and I do not want endusers to authenticate with facebook, that is not needed since they are not posting to facebook and the application will not post to their facebook account.

So how do I implement this?




JSON Serialization

2018-02-21T09:22:48.93-08:00

I am writing a service(technically, it's asp.net mvc website, but whatever) that is supposed to send and recieve requests to and from a Telegram webhook. Looking through different serialization options I stumbled upon DataContracts, which seemed like a really cool thing providing a fine control over serialization via attributes. But since DataContract is a WCF thing, which is completely unknown to me, I wonder if that's the right thing to do?




Jcrop not working when using masterpages MVC Core2

2018-02-23T16:39:24.32-08:00

have a had this issue twice and stranded.

Jcrop does not work when I add a layout page, however when I remove the layoutpage and use layout is null it works

Error message in google inspect is JCrop:244 Uncaught TypeError: $(...).Jcrop is not a function at FileReader.reader.onload (crop:244)

I am using MVC core 2

kindly advise

thank you

script>
    //= require jquery.Jcrop.min 
    $(function () {
        $('#FileUpload1').change(function () {
            $('#Image1').hide();
            var reader = new FileReader();
            reader.onload = function (e) {
                $('#Image1').show();
                $('#Image1').attr("src", e.target.result);
                $('#Image1').Jcrop({
                    onChange: SetCoordinates,
                    onSelect: SetCoordinates
                });
            }
            reader.readAsDataURL($(this)[0].files[0]);
        });

        $('#btnCrop').click(function () {
            var x1 = $('#imgX1').val();
            var y1 = $('#imgY1').val();
            var width = $('#imgWidth').val();
            var height = $('#imgHeight').val();
            var canvas = $("#canvas")[0];
            var context = canvas.getContext('2d');
            var img = new Image();
            img.onload = function () {
                canvas.height = height;
                canvas.width = width;
                context.drawImage(img, x1, y1, width, height, 0, 0, width, height);
                $('#imgCropped').val(canvas.toDataURL());
                $('#btnUpload').show();
            };
            img.src = $('#Image1').attr("src");
        });
    });
    function SetCoordinates(c) {
        $('#imgX1').val(c.x);
        $('#imgY1').val(c.y);
        $('#imgWidth').val(c.w);
        $('#imgHeight').val(c.h);
        $('#btnCrop').show();
    };

jcrop