ASP.NET

125K

Solutions

28K

Contributors

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

Share tech news, updates, or what's on your mind.

Sign up to Post

I'm confirming on the ServicePointManager...

https://docs.microsoft.com/en-us/dotnet/api/system.net.servicepointmanager?view=netframework-4.7.2

That if I use this with an HttpWebRequest, it will require one of these protocols:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 Or System.Net.SecurityProtocolType.Ssl3 Or System.Net.SecurityProtocolType.Tls

Open in new window


When we send XML to the client, it is erroring with a 500 server error, and I suspect it is because, as I was just informed, that they haven't configured the TLS12 yet.

If I have that protocol set prior to sending our HttpWebRequest, will it cause a 500 server error if they don't have it configured?

Thanks!
0
OWASP Proactive Controls
LVL 12
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

I am currently building a web application with ASP.NET MVC and I'm using ReactJs.NET in the front-end. I want to use Webpack with ReactJS.NET's server-side rendering in my project, but I can't seem to get it working. I followed the the instructions on the ReactJS.NET site. I get an error that says: Could not find a part of the path 'C:\...\build\server.bundle.js'.

Here's what my webpack.config.js file looks like:
"use strict";

var path = require("path");
var WebpackNotifierPlugin = require("webpack-notifier");
var BrowserSyncPlugin = require("browser-sync-webpack-plugin");

module.exports = {

    entry: './Scripts/Home/react/server.js',
    output: {
        filename: './wwwroot/server.bundle.js',
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                use: {
                    loader: "babel-loader"
                }
            }
        ]
    },
    resolve: {
        extensions: ['*', '.js', '.jsx'],
    },
    devtool: "inline-source-map",
    plugins: [new WebpackNotifierPlugin(), new BrowserSyncPlugin()]
};

Open in new window


I made a simple test jsx file that I expose globally in ~/Scripts/Home/react/server.js:
import ServerRenderTest from './ServerRenderTest.jsx';

global.ServerRenderTest = ServerRenderTest;

Open in new window


And the ServerRenderTest.jsx file:
export default class ServerRenderTest extends React.Component {
    render() {
        return (
            <div>
                <h2>Hello from the ServerRenderTest</h2>
            </div>);
    }
}

Open in new window


I also added this to App_Start/ReactConfig.cs:
ReactSiteConfiguration.Configuration
    .SetLoadBabel(false)
    .AddScriptWithoutTransform("~/build/server.bundle.js");

Open in new window

0
How to show tooltip on hover of image icon who is next to checkboxlist in asp.net and c#?

I have 10-11 checkboxes with different values.
Ex. Chk CA
       Chk MN image icon
       Chk OH image icon
       Chk TN
       Chk NY  image icon

When we hover the image icon, help tooltip will appear? How can that be accomplished if we get the data from database. Or whats the bet approach
0
How can I double click on a text box and copy the contents in ASP.net Visual Basic. And please make your answer understandable and complete so I will be able to use it on my web site.
Thank you very much for any help you can give me.
Scott
0
Hi,

I have a proxy server which is windows 2012 server and I route to another webserver using reverse proxy. The webserver is windows 2003 and we have an asp.net application installed.
All the functionalities are working fine except when I try to generate excel thru crystal report I am getting bad gateway error.
IMG-20190117-WA0041.jpeg
IMG-20190117-WA0043.jpeg
IMG-20190118-WA0018.jpeg
0
Trying to create a connection string in web.config.  It will connect a .aspx page and pull a recordset out of database on SQL Express.  SQL express is not local it's a remote server.  Have login and password set up but keeps coming up with "SqlException (0x80131904): Login failed for user"
The login name is set up in SQL Express, and on the database it has permissions to select on the view.  
Tried using an account that can access everything and still failed.

Any ideas?

Here's the string
<add name="conName" connectionString="Data Source=servername;Initial Catalog=databaseName;Persist Security Info=True;User ID=loginName;Password=password" providerName="System.Data.SqlClient" />
0
Hi,

I have a requirement.I need to write in HTML/ JavaScript / CSS to embed a  chat BOT widget (web chat window) on an ASP.NET website with collapsible window. Initially an icon should be shown  and on click of that icon it should play an audio sound and then display that collapsible pop up .
(i.e.,The popup widget  should stick to the bottom of the browser and popup /collapse feature.)
An help will be highly appreciated.
0
I am checking if a particular user is in the database if not i want to popup a error which says not in the database but the method runs over the error and does not popup.

protected void Page_Load(object sender, EventArgs e)
        {
          
            if (Session["ISADMIN"] == null)
            {
                isAdminUser();
            }
          
                userrole = Session["USERROLE"].ToString();
                userplant = Session["USERPLANT"].ToString();
            
        }

 public void isAdminUser()
        {
           string con = ConfigurationManager.ConnectionStrings["OEEDBConnectionString"].ToString();
            string username = System.Web.HttpContext.Current.User.Identity.Name.Substring(System.Web.HttpContext.Current.User.Identity.Name.LastIndexOf(@"\") + 1); // Request.LogonUserIdentity.Name.Substring(Request.LogonUserIdentity.Name.LastIndexOf(@"\") + 1);             
            string IsAdmin = "NO";
            using (SqlConnection sqlcon = new SqlConnection(con))
            {
                try
                {
                    sqlcon.Open();
                    SqlCommand mycmd = new SqlCommand();
                    mycmd.Connection = sqlcon;
                    mycmd.CommandText = "SELECT [User Id], Role, Plant FROM [WasteUsers] with (nolock)  WHERE [User Id] =" + "\'" + username.ToLower() + "\'";
                    mycmd.CommandType = CommandType.Text;
                    SqlDataReader myrdr = mycmd.ExecuteReader();

Open in new window

0
How Send Message via Whatsapp using ASP.NET Application....
0
What are your advices and technologies to design a Web portal UI for our customers to be robust, reliable, light and modern?
Note: The web portal will integrate with another Web applictions.
0
CompTIA Network+
LVL 12
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

I want to disable a dropdown in my cshtml code

<dropdown dropdown-menu-items="results" option-label="Not Reviewed" class="jq-checker-inspection-dropdown" data-poi-index="@inspectionItem.PointOfInspection"></dropdown>

I tried disabled = "true" and that does not work.

I also have a boolean variable
isenable = false

and i tried something like this

<dropdown dropdown-menu-items="results" option-label="Not Reviewed" class="jq-checker-inspection-dropdown" data-poi-index="@inspectionItem.PointOfInspection" @(isEnabled ? "disabled" : "")></dropdown>

None of them work. can you please suggest on how i can diable the dropdown box.
0
Thank you all in advance for your help!

I am just now learning ASP.NET and have plowed through a few tutorials. I Successfully completed one on Webforms and was able to publish the contents of a table with a "Select:" button for each of the rows. The intent? To allow details pertaining to the selected row (Patient ID) to be displayed in the next/new page.  

IN fact, when I run the application, I can click select on a row and then go to my aspx.cs tab and see the value when I hover over the variable (PT_ID).

int PT_ID = Convert.ToInt32((sender as LinkButton).CommandArgument);

My question is, and I apoligies for how "NOOB" this is but,

What kind of tutorial do I need to focus on next to have a new page open with the contents relevant that PT_ID?

What are these topics/functions called in ASP.NET that would allow me to send the variable assign to PT_ID to a webform that display the results of the subsequent query?

Im pretty sure I can find how to display a table in a webform once I pass the variable. Just dont know how to pass the variable from one form to another.

Thank you in advance!
0
I have an ASP.Net website and now I need to create an API for some of my clients.  Can I add that to a section of my website or do I have to create a separate one?  

My current site is not MVC.
0
Hi, I want to integrate Google Ads in my Asp.net website ,Please provide me method and steps to do that.
0
Hi experts
Created a page in html and published and it's working fine but when same page copied and paste on different location, after publish page is not displaying properly its displayed like symbolic instead of image...
Please assist me..
Check attached file plz
0
Hi I am using Microsoft.Office.Interop, I have added its DLL on BIN folder and using its object, which is working fine when I run code through Visual Studio but when I run exact same code from IIS then It gets failed, I tried to find solution but its not working, Please suggest what I can do to fix that. Below is my code:
Dim xlapp As Excel.Application
            Dim xlworkbook As Excel.Workbook
            Dim xlworksheet As Excel.Worksheet
            Dim misvalue As Object = Reflection.Missing.Value
            Dim sheetIndex As Integer = 0
           
            xlapp = New Excel.Application
            xlworkbook = xlapp.Workbooks.Add(misvalue)
            xlworksheet = xlworkbook.Sheets("Sheet1")
         
            sheetIndex += 1

            ' Copy the DataTable to an object array
            Dim rawData(dt.Rows.Count, dt.Columns.Count - 1) As Object

            ' Copy the column names to the first row of the object array
            For col = 0 To dt.Columns.Count - 1
                rawData(0, col) = dt.Columns(col).ColumnName
            Next

            ' Copy the values to the object array
            For col = 0 To dt.Columns.Count - 1
                For row = 0 To dt.Rows.Count - 1
                    rawData(row + 1, col) = dt.Rows(row).ItemArray(col)
                Next
            Next
         
            ' Calculate the final column letter
            Dim finalColLetter As String = String.Empty
            Dim …
0
This is my web.config file:

<?xml version="1.0" encoding="utf-8"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  https://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.6.1"/>
    <httpRuntime targetFramework="4.6.1"/>
  </system.web>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>
  <system.webServer>
    <directoryBrowse enabled="true"/>
  </system.webServer>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IService1" >
         
        </binding>
      </basicHttpBinding>
      <netTcpBinding>
        …
0
Can anyone give me the code to display a multiple page tiff image using MVC and ASP.Net C#?
0
Try to run a ASP Core 2.0 with C# and the CSS can only apply if I set the APP URL to 53400 port. It doesn't work for other port. Why it appear so strange ?

Thx
Work.png
NoWork.png
0
OWASP: Threats Fundamentals
LVL 12
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

I created a click-once install for a .NET app.  Crystal reports is downloading and installing.  The problem is that the download location is wrong.

An error occurred downloading the following resource:
http://xxxxxx.com/downloads/CrystalReports10_5/CRRedist2008_x64.msi

Should be

https://xxxxxx.com/xxxxxx/CrystalReports10_5/CRRedist2008_x64.msi

How can I set the correct location?  It should be https and xxxxx not downloads.
0
ASP.net
VB.net

I have three tables that I need to compare and use a checkbox

Table one - list of all the stores
Table two - list of managers
Table three - list of store assignments

Table three is the one that needs to be able to update / add / delete

I would like a list of all the stores when a manager is picked (dropdown list) in one gridview, and the ability to check (assign a store to) and uncheck (remove an assigned store).  Table one and two are static and will never change.

Any help would be great!  I am stuck on how to do the SQL statement and the code for the gridview
0
i have a gridview with a header template and trying to use masked edit extender so its easy for users to enter data as they tab through the gridview. but what happens is:

highlighted.PNG
even after i click out of focus and enter data this happens:

maskededit.PNG
how do i go by removing focus of the textbox and how can i have the mask to stay and be replace by the time entered by the user??

 <asp:TemplateField HeaderText="Start Time" SortExpression="Start Time">
                <EditItemTemplate>
                    <asp:MaskedEditExtender runat="server"
                                            AutoComplete="false"
                                            TargetControlID="TextBox13"
                                            Mask="99:99"
                                            MessageValidatorTip="true"
                                            OnFocusCssClass="MaskedEditFocus"
                                            OnInvalidCssClass="MaskedEditError"
                                            MaskType="Time"
                                            InputDirection="LeftToRight" AcceptAMPM="true"
                                            ErrorTooltipEnabled="True"  ID="MENEWStartTImeEdit" ClearMaskOnLostFocus="false" />
                    <asp:TextBox ID="TextBox13" runat="server" Text='<%# Bind("Start_Time","{0:HH}:{0:mm}") %>'></asp:TextBox>
                </EditItemTemplate>
                <HeaderTemplate>
        

Open in new window

0
I have images saved in different Idproduct folder. Each image will be linked to a third-party website with the same image. I followed  the expert Snarf0001's  example. But has error saying 'i' is not declared. It may be inaccessible due to its protection level.
Below is the coding:
 <a href="http://www.xxx.com/sku=<%=productsku%>&imagelocation=images/600x600/<%=idProduct%>/<%= System.IO.Path.GetFileName(imageList(i)) %>"><img width="60px" height="60px" src="images/600x600/<%=idProduct%>/<%= System.IO.Path.GetFileName(imageList(i)) %></a> 

Open in new window


Please advise! Thank you!
0
Razor# MVC

I have a javascript function that is called when a drop down is changed. this function calls a code behind function in the controller. the problem is the js function does not wait for the function to run, it never calls success or error. Once the java script function exists then the function called in the code behind runs.

Can anyone advise on how to make the javascript function wait while the code behind function is called and returns?

Javascript
function toggleDIvDisplay(e) {
        debugger;
        var result;
        $.ajax({
            type: "POST",
            url: '@Url.Action("FleetSelect", "Reports")',
            data: "{'value':'" + e + "'}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (data) {
                result = data;
                if (data == "OK") {

                }
            },
             error: function () {
                alert("Failed to load Item");
            }
        });

        if (result == "123") {
            $('#divtwo').show();
        }
        else {
            @* $('#divtwo').hide(); *@
        }
    }

Open in new window



Code behind controller
 public JsonResult FleetSelect(string value)
        {
            List<ReportType> rList = GetReportList();
            foreach (ReportType rt in rList)
            {
                if (rt.id == Convert.ToInt32(value))
                {
                    if (rt.vehicle)
                    {
                        return new JsonResult { Data = "V" }; 
                    }
                    else
                    {
                        return new JsonResult { Data = "F" };
                    }
                }
            }
            return new JsonResult { Data = "V" };
        }

Open in new window

0
We create VMs with the latest build of our code on. One VM has a weird ASYNC_NETWORK_IO error when running a SQL SELECT statement. It isn't on any other VM.

I have tried googling for the error - clearly something failed to start or get set when this VM was created.

Just for peace of mind it would be really useful to know what might be the cause of this and if there is some setting I can adjust to fix it.

The symptom is that a SQL SELECT statement just seems to time out with this ASYNC_NETWORK_IO error, but the strange thing is that it must have somehow returned some results because it then blocks an INSERT statement that has used the results of the SELECT statement.

Everything necessary for the application is on the VM - the ASP.NET application and the SQL Server database so there is no actual network access outside of the VM.

There is no antivirus running on the VM either which is one possibly cause I came across.

The server is Windows Server 2016 and the SQL Server is 2016 also.

I've attached a picture of what is happening.

Just to repeat this doesn't occur on any other VMs with the same software on.

I have tried restarting IIS and restarting the VM.

The VM is Hyper-V.

ASYNC_NETWORK_IO error
0

ASP.NET

125K

Solutions

28K

Contributors

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications