I've got a little problem saving data from labels so that when the page reloads the data does not go into the void.

Scenario: on the page load some data gets pulled from SQL table and gets displayed in Labels(meaning that data from row[0] will be displayed on page load). On form there are also some radio buttons where the clients makes choices. Now when a client clicks one button data on page load (label text and radio button choices) should be submitted in database and the next row in data table should be displayed. This will continue until the last record in the data table.

Any help will be highly appreciated.

Thanks in advance

error image

Used ASP.NET boilerplate to create Multi Page Web Application (includes login, register, user, role and tenant management pages https://aspnetboilerplate.com/Templates)

Getting below mention error while building the project. Kindly point me a direction to sort the mention issue.

Thank-you.

Error -

Severity Code Description Project File Line Suppression State Error CS7036 There is no argument given that corresponds to the required formal parameter 'organizationUnitRepository' of 'AbpRoleManager.AbpRoleManager(AbpRoleStore, IEnumerable>, ILookupNormalizer, IdentityErrorDescriber, ILogger>, IPermissionManager, ICacheManager, IUnitOfWorkManager, IRoleManagementConfig, IRepository, IRepository)' test.Core C:\test\4.6.0\aspnet-core\src\test.Core\Authorization\Roles\RoleManager.cs 25 Active

Model classes:

public class Video
{
    public int Id { get; set; }
    public string Name { get; set; }
    public DateTime ReleasedDate { get; set; }
    public byte GenreId { get; set; }
    public Genre Genre { get; set; }
    public Classification Classification { get; set; }
    public IList<Tag> Tags { get; set; }
}

public class Genre
{
    public byte Id { get; set; }
    public string Name { get; set; }
    public IList<Video> Videos { get; set; }
}

For example Genre Names are: Action, Drama, Comedy and Horror. There are no videos for Comedy and Horror genre.

View Model Class:

public class CountOfVideos
{
    public string Classification { get; set; }
    public int NumberOfMovies { get; set; }
}

Controller Class:

 public ActionResult Movies()
    {
        var movies = _context.Videos
            .GroupBy(v => v.Genre.Name)
            .Select(g => new CountOfVideos { Classification = g.Key, NumberOfMovies = g.Count() })
            .ToList();

        return View(movies);
    }

View:

@model IEnumerable<LinqTest.ViewModels.CountOfVideos>

<table class="table table-bordered table-hover">
<thead>
    <tr>
        <th>Name</th>
        <th>Count</th>
    </tr>
</thead>
<tbody>
    @foreach (var movie in Model)
    {
        <tr>
            <td>@movie.Classification</td>
            <td>@movie.NumberOfMovies</td>
        </tr>
    }
</tbody>

Code works correctly but it doesn't show names of the genres where there are no videos in them. View generates something like:

Action 23 Drama 15 but I'd like to generates Action 23 Drama 15 Comedy 0 Horror 0.

I have an encompassing object that is needed on every razor page called CurrentEnvironment. This will combine many services this application will use in a centralized, shared object. Such as Visitor's IP Address, Requested URL, ClaimsPrincipal, etc...

I'm looking for the best method:

Option 1:

Should I use a CommonPageModel that derives from PageModel and populated in the filter method OnPageHandlerExecutionAsync?

Option 2:

Definte a Global Page Filter, say AdminPageFilterAsync, that is derived from IAsyncPageFilter?

or...

Is there an even better solution?

Thank you in advance...

I am trying to learn MVC and bootstrap. I am trying to display a table with page. I am following this tutorial. I am able to display, sorting, searching, and even able to paging. But my issue here is the styling. Somehow the styling is not as i desired. I am using WebPagerReplacement

Desired: enter image description here

Actual: enter image description here

<div>
        @grid.Table(
     tableStyle: "table table-striped table-hover",
     columns: grid.Columns(
         grid.Column(columnName: "FirstName", header: "First Name"),
         grid.Column(columnName: "LastName", header: "Last Name"),
         grid.Column(columnName: "EmailID", header: "Email"),
         grid.Column(columnName: "City", header: "City"),
         grid.Column(columnName: "Country", header: "Country")
            )
        )

        <div class="pagination pagination-small pagination-right">
            @grid.PagerList(mode: WebGridPagerModes.All)
        </div>

        @Html.Hidden("dir", grid.SortDirection)
        @Html.Hidden("col", grid.SortColumn)
    </div>

I know this is simple. But i am not sure why this happens and how to fix it. Please help me

I am trying to generate pdf of my gridview but I am getting error. When I inspect the button click event, the console shows ::

AcroForm-Classes are not populated into global-namespace, because the class-Names exist already. jspdf.node.debug.js:6397:5

AcroForm-Classes are not populated into global-namespace, because the class-Names exist already. acroform.js:2791:7

My aspx page ::

<body>
    <form id="form1" runat="server">
    <div id="printDiv">
/// gridview ///
 </div>
        <button id="gpdf">gen PDF</button>
    </form>
</body>
    <script src="scripts/jquery-1.12.0.min.js"></script> 
    <script src="scripts/jspdf.min.js"></script>
    <script src="scripts/jspdf.node.debug.js"></script>
    <script src="scripts/acroform.js"></script>
     <script type="text/javascript">
         var pdfdoc = new jsPDF();         
         $(document).ready(function () {
             $('#gpdf').click(function () {
                 pdfdoc.fromHTML($('#printDiv').html(), 10, 10);
             pdfdoc.save('test.pdf');
         });});
    </script>
</html>

When I get the error I added the acroform js file but still getting the error. How to solve this problem?

The problem is that dictionary connectionstring (1) is being shown 2x on my gridview, and i can't seem to find a code combination that shows the data like this:

(0) = Local (1) = Remote

Right now its showing like this(look at the pic):

(1) = Remote (1) = Remote

Program

Here is my code:

foreach (KeyValuePair<string, string> constring in condictionary)
                {
                    visualDataTableMorerow["Credentials"] = (constring.Value);
                    visualDataTableMorerow["Site"] = siteName; // Shows the sitename on the gridviewmore                               
                }
                foreach (DataTable checktable in conresults)
                {
                    foreach (DataRow datarow in checktable.Rows)
                    {
                        string value = datarow.Field<string>("Slave_IO_Running");   //Looks for "Slave_IO_Running" status.

                        if (value == "Yes")
                        {
                            visualDataTableMorerow["Status"] = ("✔️ WORKING ✔️"); //adds working to the visual table   
                            visualDataTableMore.Rows.Add(visualDataTableMorerow.ItemArray);
                        }
                        else
                        {
                            visualDataTableMorerow["Status"] = ("⚠️ REPLICATION ERROR ⚠️"); //adds error status to the visual table
                            visualDataTableMore.Rows.Add(visualDataTableMorerow.ItemArray);
                        }
                    }

                }

I am trying to capture image from webcam and also from Android mobile camera and insert binary code of image into database. i am using Javascript function to capture the image, now image is captured and having it into a variable now i need to store it into SQL Database and display it from database.

DB is:

  CREATE TABLE [dbo].[test] (
                [Id]   INT  IDENTITY (1, 1) NOT NULL,
                [data] VARBINARY (MAX) NULL,
                PRIMARY KEY CLUSTERED ([Id] ASC)
            );


    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

    <!doctype html>

    <html lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>WebcamJS Test Page</title>
        <style type="text/css">
            body { font-family: Helvetica, sans-serif; }
            h2, h3 { margin-top:0; }
            form { margin-top: 15px; }
            form > input { margin-right: 15px; }
            #results { float:right; margin:20px; padding:20px; border:1px solid; background:#ccc; }
        </style>
    </head>
    <body>

        <form id="form1" runat="server">
        <div id="results">Your captured image will appear here...</div>

        <h1>WebcamJS Test Page</h1>
        <h3>Demonstrates simple 320x240 capture &amp; display</h3>

        <div id="my_camera"></div>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <!-- First, include the Webcam.js JavaScript Library -->
        <%--<script type="text/javascript" src="../webcam.min.js"></script>--%>
        <script src="webcam.min.js"></script>
        <!-- Configure a few settings and attach camera -->
        <script language="JavaScript">
            Webcam.set({
                width: 320,
                height: 240,
                image_format: 'jpeg',
                jpeg_quality: 90
            });
            Webcam.attach('#my_camera');
        </script>

        <!-- A button for taking snaps -->
        <form>
            <input type=button value="Take Snapshot" onClick="take_snapshot()">
        </form>

        <!-- Code to handle taking the snapshot and displaying it locally -->
        <script language="JavaScript">
            function take_snapshot() {
                // take snapshot and get image data
                Webcam.snap(function (data_uri) {
                    // display results in page
                    document.getElementById('results').innerHTML =
                        '<h2>Here is your image:</h2>' +
                        '<img src="' + data_uri + '"/>';
                    document.getElementById('<%=TextBox1.ClientID %>').value = data_uri;
                    //document.getElementById["TextBox1"].innerHTML = data_uri;
                });
            }
        </script>
        </form>
    </body>
    </html>

I'm working on an ASP.NET Web Forms web site and frequently get run-time exceptions like the following:

Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
=== Pre-bind state information ===
LOG: DisplayName = Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
 (Fully-specified)
LOG: Appbase = file:///C:/Code/MyProject/
LOG: Initial PrivatePath = C:\Code\MyProject\bin
Calling assembly : System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Code\MyProject\web.config
LOG: Using host configuration file: \\foo\bar\Profile.v2\simonm\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Redirect found in application configuration file: 4.5.0.0 redirected to 11.0.0.0.
LOG: Post-policy reference: Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
LOG: Attempting download of new URL file:///C:/Users/simonm/AppData/Local/Temp/Temporary ASP.NET Files/vs/8d6ca9e7/1d38a78a/Newtonsoft.Json.DLL.
LOG: Attempting download of new URL file:///C:/Users/simonm/AppData/Local/Temp/Temporary ASP.NET Files/vs/8d6ca9e7/1d38a78a/Newtonsoft.Json/Newtonsoft.Json.DLL.
LOG: Attempting download of new URL file:///C:/Code/MyProject/bin/Newtonsoft.Json.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

They're invariably because the "wrong" version of an assembly (it always seems to be Newtonsoft.Json) gets copied to the Bin directory despite the fact that the packages.config in the root of the site has:

<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />

and the web.config contains:

<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
</dependentAssembly>

Can somebody please explain what dictates which assembly gets copied to the Bin directory, why this keeps happening and how to prevent it from happening in the future?

Could WIX package change registry editor HKCU settings if we don't have admin privilege?

I want to add port for ie11 compatibility in regedior through package but don't have admin privilege of that system.

enter image description here

Is there any possibility or any builtin function on iTextsharp that while click on print button on pdf generated file the function call from server side? Basically I want to change the status for this file that it is printed or not.

I have Asp.Net Core application and I create a new project on the solution as an Entry Point, like this:

public static int Main(string[] args)
    {
        var commandLine = Environment.CommandLine.ToLowerInvariant();

        if (commandLine.IndexOf("--mode=web") > 0)
            return Web.Program.Main(args);

        if (commandLine.IndexOf("--mode=database") > 0)
            return Database.Program.Main(args);

        return -1;
    }

Now, I want to get a publish and host the project on IIS. What should I do?

Thanks.

I'm not finding any clear answer on this. On the Compatibility page, they say:

Everything in .NET 4.7 except WPF, WWF, and with limited WCF and limited ASP.NET async stack

What about .NET Core 2.2? Is it possible to run it on MONO or not?

I'm glad .NET Core framework is becoming more mature; but unfortunately it doesn't support legacy WebForms, and MONO's support for Core is unclear, so they don't mix well.

I want to build an advanced multiple parameters search for a website.
This is my DBML and ORM schema:
enter image description here In this advanced multiple parameters search user can search through Estates with multiple parameters as like size, floor, city, price and so on.
This is the function that I coded to handle this part.

 private DataTable linq_search_by_details()
    {
        myDBMLDataContext ctx = new myDBMLDataContext(address);
        var query = ctx.Estates.AsQueryable();
        query = query.Where(c => c.eshId == int.Parse(ddlEshape.SelectedValue.ToString()));
        query = query.Where(c => c.cityId == int.Parse(ddlcity.SelectedValue.ToString()));
        query = query.Where(c => c.ETId == int.Parse(ddlType.SelectedValue.ToString()));
        query = query.Where(c => c.dealingId == int.Parse(ddldeal.SelectedValue.ToString()));
        query = query.Where(c => c.deedId == int.Parse(ddldeed.SelectedValue.ToString()));
        if (!string.IsNullOrEmpty(txtPrepaymentFrom.Value.Trim()))
        {
            query = query.Where(c => int.Parse(c.prepayment) <= int.Parse(txtPrepaymentFrom.Value));
        }
        if (!string.IsNullOrEmpty(txtPrepaymentTo.Value.Trim()))
        {
            query = query.Where(c => int.Parse(c.prepayment) >= int.Parse(txtPrepaymentTo.Value));
        }
        if (!string.IsNullOrEmpty(txtPrepaymentFrom.Value.Trim()) && !string.IsNullOrEmpty(txtPrepaymentTo.Value.Trim()))
        {
            query = query.Where(c => int.Parse(c.prepayment) <= int.Parse(txtPrepaymentFrom.Value) && int.Parse(c.prepayment) >= int.Parse(txtPrepaymentTo.Value));
        }

        if (!string.IsNullOrEmpty(txtPriceFrom.Value.Trim()))
        {
            query = query.Where(c => int.Parse(c.price) <= int.Parse(txtPriceFrom.Value));
        }
        if (!string.IsNullOrEmpty(txtPriceTo.Value.Trim()))
        {
            query = query.Where(c => int.Parse(c.price) >= int.Parse(txtPriceTo.Value));
        }
        if (!string.IsNullOrEmpty(txtPriceFrom.Value.Trim()) && !string.IsNullOrEmpty(txtPriceTo.Value.Trim()))
        {
            query = query.Where(c => int.Parse(c.price) <= int.Parse(txtPriceFrom.Value) && int.Parse(c.price) >= int.Parse(txtPriceTo.Value));
        }

        if (!string.IsNullOrEmpty(txtFloor.Value.Trim()))
        {
            query = query.Where(c => c.eFloor == short.Parse(txtFloor.Value));
        }
        if (chbExchange.Checked)
        {
            query = query.Where(c => c.exchange == true);
        }

        var final = query.Select(c => new { c.esId,c.owId, c.City.cityName, c.EstateShape.eshName, c.EstateType.ETName, c.owner.owFname, c.owner.owLname, c.esSize, c.prepayment, c.price });
        return Special.LINQResultToDataTable(final.ToList());
}

This function works perfectly but now I want more to add some parameres from EstateEquipment and EstateFacility.
As you can see in ORM the relation between Estate and EstateEquipment (also Estate and EstateFacility) is one to many.
Now I want to user can search through Estate in cityId = 1, size around 400m which has for example eqId = 1 and 2 from EstateEquipment then which has for example fId = 1 and 2 from EstateFacility.

This is how I tried to handle last part.

foreach (ListItem item in cblEquipment.Items)
{
    if (item.Selected)
    {
        eq = true;
    }
}
if(eq)
{
    var eqQuery = ctx.EstateEquipments.AsQueryable();
    foreach (ListItem item in cblEquipment.Items)
    {
        if (item.Selected)
        {
            eqQuery = eqQuery.Where(c => c.eqId == int.Parse(item.Value.ToString()));
        }
    }
    var eqFinal = eqQuery.Select(c => new { c.Estate.esId, c.Estate.owner.owId, c.Estate.City.cityName, c.Estate.EstateShape.eshName, c.Estate.EstateType.ETName, c.Estate.owner.owFname, c.Estate.owner.owLname, c.Estate.esSize, c.Estate.prepayment, c.Estate.price });
    DataTable dtEq = Special.LINQResultToDataTable(eqFinal.ToList());
    if(dtEq.Rows.Count>0)
    {
        this.Build_search(dtEq);
    }
    else
    {
        msg = "No record found";
        sysMsg.Attributes["class"] = "";
        sysMsg.Attributes["class"] = "alert alert-warning";
    }
}

Here, First I check which equipment is selected from the list. Then extended the query accordance with Items selected. But I don't know how to join this new result with last result and even EstateFacility result.
Thanks for any help.

I have Default.cs file with Default.aspx.cs file. Where I implemented rules_abort_execution_button with OnClick and OnServerClick methods. Both functions are implemented in Default.cs UI button: Default.aspx.cs

<div id="rules_execution_dialog" runat="server" class="theme-border">
    <div id="rules_execution_dialog_drag_control" title="Drag me">
        <img id="rules_execution_dialog_maximize_button" src="./Resources/Theme/Images/maximize.png" alt="Maximize" title="Maximize" />
        <br style="clear: both" />
    </div>
    <div style="margin-top: 10px">
        <input class="btn" id="rules_execute_close_button" type="button" value="Close" disabled="disabled" onclick=" dialogClosed($('rules_execution_dialog')) " style="float: right; min-width: 0px; width: 70px;" />
        <input class="btn" id="rules_abort_execution_button" type="button" value="Abort execution" runat="server" OnClick="abort_click" OnServerClick="btn_Abort_Click" style="float: right; min-width: 0px; width: 90px;" />
        <br style="clear: both" />
    </div>
</div>

My Default.cs with both functions:

protected void btn_Abort_Click(object sender, EventArgs e)
{
    var IamHere = "";
    return;
}

protected void abort_click(object sender, EventArgs e)
{
    var test = "";
    return;
}

When I am executing Soap client method from another file Download.cs to get a data it takes quite long , so I would like to add abort button which could allow abort execution. But unfortunately while fetching data from third part client my UI do not response to my UI click button methods. I tried various examples and I didnt found solution.

Am developing webform application which scans for QR/barcode for specific duration and perform results based on information read. Am using AForge.net and ZXing.net to access camera. The camera lights up and keeps sending BMP frames to ZXing library to detect QR code. Everything works fine and QR code gets detected.

The requirement is also to display a video stream of what is read from camera so that the user can place QR code at right position. On winforms, there are tons of assistance on how this is possible but couldn't find a good direction for webforms. Google search mostly results in windows forms and not webforms.

Any help is really appreciated. I know i can't use deprecated javascript handlers (flash player) which are not handled in android/iOS (correct me if I am wrong).

Have attached a snippet of code which was provided by AForge.net on reading QR code. All I need is to create a player and pass the bmp frames. Any suggestions to documents or sample code is highly appreciated.

Code snippet:

    protected void video_NewFrame(object sender, NewFrameEventArgs eventArgs)
    {
        // get new frame
        Bitmap bitmap = eventArgs.Frame;

        // process the frame
        var barcodeReader = new BarcodeReader();

        // decode the barcode from the in memory bitmap
        var barcodeResult = barcodeReader.Decode(bitmap);

        if (barcodeResult != null && barcodeResult.Text.Length != 0)
        {
            // signal to stop when you no longer need capturing
            videoSource.SignalToStop();
            Response.Redirect("Home.aspx?Id=" + barcodeResult.Text, false);
        }
    }

I have a C # application using MVC, I have a model called Employee, that each attribute corresponds to a tab. I have a form that is separated by tabs. I would like to know if it is possible to create an empty "Schema" in mongoDb and each filled tab will update. Is this the best way to do it?

using AdmissionAnonymousForm.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace AdmissionAnonymousForm.Infrascructure.Models
{
    public class Employee
    {
		public Guid ownerId { get; set; }
		public PersonalData personalData { get; set; }
		public Address address { get; set; }
		public Emails emails { get; set; }
		public Syndicate syndicate { get; set; }
		public Dependents dependents { get; set; }
		public Phone phone { get; set; }
		public Bank bank { get; set; }
		public Attributes attributes { get; set; }
		public Benefits benefits { get; set; }
		public Transport transport { get; set; }
		public Attachments attachments {get; set; }
		public Documents documents { get; set; }
		


	}
}

Architecture of my application is something like this.I have a application which is hub for many other applications which allows user to pass credentials. After credentials are checked, Hub application presents one or more applications which the user is allowed to use. If user has only one application it redirects directly to the application. How do i maintain the authorized state of the user passed in hub application and access them again in the children application?

I have encrypted the web.config connectionString, then Tilde (~) releted paths are redirecting to 404 errors,

Ex: ~/ images/ title.png not opening, it showing 404 error,

Please suggest me any IIS settings need to change.

Error screenshot:

enter image description here

Thank you in advance

This question already has an answer here:

<tbody>
    @foreach (var item in Model.Charts)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.chart)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.market)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.selection)
            </td>
            <td>
                <a asp-page="./Edit" asp-route-id="@item.ID">Edit</a> |
                <a asp-page="./Details" asp-route-id="@item.ID">Details</a> |
                <a asp-page="./Delete" asp-route-id="@item.ID">Delete</a>
            </td>
        </tr>
    }
</tbody>

item.chart is a base64string that I want to display. I'm new to Razor pages and after struggling to find a solution I thought I would ask this community.

I want to use JWT authorization for .net core MVC project. I've found a number of examples of how to return a JWT token when a user logs in. However, there are only a few examples of how to transmit a token at each request from the header.

I found example with AJAX:

$.ajaxSetup({ headers: { "Authorization": "Bearer " + accessToken } });

Simple Authentication using Jwt in dot net core MVC

How to use JWT in MVC application for authentication and authorization?

Is this the right way to transfer a JWT token? Do I always have to use AJAX?