Category "asp.net"

how to create a hyperlink for file download in asp.net?

I have some files stored on my machine. When a user wants to generate a link the page should generate a hyperlink. This hyperlink can be used by any other user

Convert numerical amount to words in vb.net showing Type Expected error

I am trying to convert numeric numbers to words in vb.net. But somewhere I am getting Type Expected error. Below is my entire code. I am also putting code separ

Why is my hidden input writing: value="value" instead of true/false?

I have an MVC4 site, with (as part of a hidden form): <input name="somefield" type="hidden" value="@ViewBag.Test"/> The value of ViewBag.Test is true.

How can I use ActiveDirectoryMembershipProvider with ASP.NET Identity?

I'm learning to use .NET Identity. I have to authenticate to Active Directory. For that purpose I am trying to use ActiveDirecotoryMembershipProvider. I have to

How to automatically upload file after file has been chosen

I have the following code for uploading a file in my site: @using (Html.BeginForm("UploadProfileImage", "Member", FormMethod.Post, new { @encType = "multipart/

Failed to acquire connection. Connection may not be configured correctly or you may not have the right permissions on this connection

I am getting following error while attempting to execute the package. I can execute individual task successfully. But whenever attempt to execute whole package

What is the use of href="###" in an anchor tag?

I see these lines of code in some professional developer's project: <a href="###"> ... </a> What is the use of three # instead of one?

Best way to scrolldown onpageload

I have the following code: <script type="text/javascript"> window.onload = function () { window.scrollBy(0, 100); } </script

Cancelling JavaScript events in IE11

I have some historical code that's using event.returnValue = false to prevent CR from causing a post back in an ASP.NET via the onkeydown event: onkeydown = "if

Views not found after migrating to .NET 6

I migrated an ASP.NET CORE MVC project from .NET Core 2.1 to .NET 6. After making relevant changes, the project compiles and starts seemingly OK, but the views

How can I react to 'onchange' and 'aspx state' information for a form dropdown?

I'm after what seems to me to be a straightforward pattern for handling page refreshes when I've got a drop-down that reacts to the onchange event. I've used th

Change value of a textbox, compared to another text box value with a ratio

I am working on ASP.NET C#. With Javascript, I need to change the value of a textbox, when another text box value changes with the ratio of 3:2. For example

Authorization in ASP.NET Core. Always 401 Unauthorized for [Authorize] attribute

For the first time I'm creating Authorization in ASP.NET Core. I used tutorial from here TUTORIAL The problem is when I sending request from postman: Authori

Sequencing two action on a button click

Problem: I have a asp.net button and on click of that I am displaying another window using window.open() at the client side using <script></script>

Can't open web project because IIS Express is not installed (even though it is)

I have recently changed machines at work, and a long-standing web project now refuses to open in Visual Studio. The error log reads: "The Web project 'xxx' is

Get Parameters of sqlcommand to string

I'm creating an error log for a webpage. I need a way to get the parameters from a SQL Command to output to string so that the parameters passed through keep th

In ASP.NET, After Selecting "Stay On This Page" nothing is working

I am using this code for preventing user to leave the page if there is any changes on the form in SharePoint FarmApplication <script> var formDirty

GridView_RowDataBound (If e.Row.RowType = DataControlRowType.DataRow)....include 2 IF's?

I've got a grid view which uses a "If e.Row.RowType = DataControlRowType.DataRow" to calculate the total of a column and hold this in the footer. Protected S

Where to store db passwords when using Windows .NET or ASP.NET applications

I have a scenario that has been troubling me for years. If you have to connect to a database or other service (like a web service) using a username and password

Adding nonce value to @Scripts.Render ASP.Net MVC razor pages with NWebSec

I am trying to implement Content-Security-Policy with the NWebSec NuGet package The basic configuration level is working at this moment but trying to add nonce