Quantcast
Channel: Visual Studio and Visual Web Developer Express

Images in Popup window no longer works in Edge

$
0
0
I have recently upgraded windows to version 10 that uses the new Edge browser. i can open a new window but the image will not show except for code output from datatable file? I know that the images can be loaded in data control but not in browser window? nw = window.open("", "window", ",,scrollbar=yes,toolbar=no,menubar=no"); nw.location.href = "FullImage.ashx?ID=" + id + "&type=no";

I get this error: "configuring IIS Express failed - cannot read redirection.config"

$
0
0

Visual Studio used to have a 'open web site' option.   I need this for an older website so I went to the VS installer and added it.  Now I try to use 'open web site', and I get the message: "configuring IIS Express failed with the following error: Filename redirection.config, Error cannot read configuration file. "  I did reinstall IIS Express using the VS installer.   'redirection.config' does exist.   But my project doesn't load (it gets unloaded).

The history of this project is odd, at one point I tried to resurrect it by making it as a new web-app, and so it has some files from that effort that an older project would not have (like bundle.config). 

There were problems with the modern version of Visual Studio, for instance, old VS projects allowed pages to inherit from classes in 'App_code' and new projects do not.   Anyway, assuming I want to get this project working as a website (the old way), how do I do that?

How to get HTML Dialog with modal to work in a ASPX page?

$
0
0

I am trying to get this Modal example to work in a aspx page that was originally constructed for HTML page. But nothing works?

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ModalDialog.aspx.vb" Inherits="ModalDialog" %><!DOCTYPE html @charset "UTF-8";><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title><style>

dialog {
  padding: 0;
  border: 0;
  border-radius: 0.6rem;
  box-shadow: 0 0 1em black;
}

/* native backdrop */
dialog::-webkit-backdrop {
  background-color: rgba(0, 0, 0, 0.4);
}
dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.4);
}

/* polyfill backdrop */
dialog + .backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.4);
}

dialog[open] {
  -webkit-animation: slide-up 0.4s ease-out;
          animation: slide-up 0.4s ease-out;
}

/* The following styles are for older browsers when using
   the polyfill. These aren’t necessary for Chrome/Firefox. */
dialog {
  display: none;
  position: absolute;
  margin: 0 auto;
  /* should center it, but not working in Safari */
  max-width: 80vw;
  background-color: white;
}

dialog[open] {
  display: block;
}

/* prettying things up a bit */
.close {
  position: absolute;
  top: 0.2em;
  right: 0.2em;
  padding: 0.3em;
  line-height: 0.6;
  background-color: transparent;
  border: 0;
  font-size: 2em;
}

.modal-header,
.modal-body,
.modal-footer {
  padding: 1em;
}

.modal-header {
  margin: 0;
  padding-bottom: 0.6em;
  background-color: #ddedfd;
  border-top-left-radius: 0.6rem;
  border-top-right-radius: 0.6rem;
  border-bottom: 1px solid #78a4d3;
}

.modal-footer {
  border-top: 1px solid #78a4d3;
}

/* misc page styles -- not important for demo */
body {
  margin: 1em;
}

:first-child {
  margin-top: 0;
}

:last-child {
  margin-bottom: 0;
}

button {
  padding: 0.4em 1em 0.2em;
  font-family: Glober, Helvetica, sans-serif;
}

@-webkit-keyframes slide-up {
  0% {
    opacity: 0;
    transform: translate(0, 15px);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes slide-up {
  0% {
    opacity: 0;
    transform: translate(0, 15px);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
  }
}
</style><script>
        const modal = document.getElementById('demo-modal');
        const open = document.getElementById('open-modal');
        const close = document.getElementById("close");
        const likeIt = document.getElementById("like-it");
        const loveIt = document.getElementById("love-it");
        const returnSpan = document.getElementById("return-value");

        dialogPolyfill.registerDialog(modal);

        open.addEventListener("click", () => {
            alert('test');
            modal.showModal(); 
        });

        likeIt.addEventListener("click", () => {
            modal.close("Like it");
        });

        loveIt.addEventListener("click", () => {
            modal.close("Love it");
        });

        close.addEventListener("click", () => {
            modal.close("cancelled");
        });

        modal.addEventListener("cancel", () => {
            modal.close("cancelled");
        });

        // close when clicking on backdrop
        modal.addEventListener("click", event => {
            if (event.target === modal) {
                modal.close("cancelled");
            }
        });

        // display returnValue
        modal.addEventListener("close", () => {
            returnSpan.innerHTML = modal.returnValue;
        });</script></head><body><form id="form1" runat="server"><button id="openmodal" type="button" >Show me the modal</button><dialog id="demo-modal" ><h3 class="modal-header">A native modal dialog box</h3><div class="modal-body"><p>Finally, HTML has a native dialog box element! This is fantastic.</p><p>And a polyfill makes this usable today.</p></div><footer class="modal-footer"><button id="like-it" type="button">I like it</button><button id="love-it" type="button">I love it</button></footer><button id="close" class="close" type="button">&times;</button></dialog><p><code>returnValue</code>: <span id="return-value"></span></p><hr><p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus porttitor porttitor interdum. Vivamus vehicula nibh sit amet sapien varius hendrerit. Suspendisse ac lobortis mauris. Praesent tincidunt, risus nec pulvinar ullamcorper, ante erat luctus ante, eu suscipit elit purus sit amet turpis. In hac habitasse platea dictumst. Nulla lobortis libero non pulvinar tempus. Nulla tempor luctus sapien faucibus efficitur. Curabitur maximus nibh id sapien facilisis, vitae ultricies sem convallis. Nulla fermentum eget diam et finibus. Sed efficitur justo sed mollis ultrices. Sed pharetra dapibus nisi, non venenatis purus bibendum at. Integer risus mauris, faucibus non efficitur nec, viverra in mauris.</p><p>In lobortis arcu ac lobortis pulvinar. Aenean libero tellus, cursus id tortor non, iaculis dapibus diam. Nullam id nisi odio. Vivamus pellentesque lacinia turpis, eu eleifend justo posuere vel. Nulla pharetra nec justo eu facilisis. Vivamus sollicitudin, est ut varius eleifend, justo metus ultrices dui, ut scelerisque nisi odio vel est. Pellentesque nec tortor tristique, tempor velit at, lobortis augue. Nunc nunc neque, accumsan a placerat accumsan, rutrum sit amet turpis.</p><hr><p>See my <a href="https://keithjgrant.com/posts/2018/meet-the-new-dialog-element/">&lt;dialog&gt; element write-up</a> for more details.</p></form></body></html>

Vs 2019 16.8.X - WebAPI is actively refusing the connection from Blazor app some of the time

$
0
0

I am developing a Blazor Server Side app with a Web API.

Typically I start the WebAPI first with CTRL F5, and then the same for the Blazor app.

3 out of 10 times I start it like this the WebAPI is actively refusing the connection, then I have close the browser tabs down and redo it.

7 out of 10 times I can get my Blazor app to return data, and then I make some changes to it and once I hit save the Blazor app is attempting to refresh the connection but fails. Then I need to close that tab and do a CTRL5.

What am I missing here? This cannot be this cumbersome, right.?

How to convert existing "Website Solution" + to + "Web application solution" on Visual Studio 2019 IDE ?

$
0
0

How do I convert a Web Site Project to a Web Application project using Visual Studio 2019? I've seen other posts using previous versions of Visual Studio, but those options do not seem to be available on Visual Studio 2019.

Here is one such solution (does not work in VS2019): Microsft Devblog Convert

TIA,

Visual Studio opening https://localhost:50382/ instead of regular http://localhost:50382

$
0
0

Hi,

I can not test any of my websites any more on my localhost.

When I press F5 in Visual Studio it open a https://localhost:50382 and gives an error not secure and I can not test any of my web projects.

How can I remove this HTTPS and use only HTTP for local host?

I do not remember changing anything in Visual Studio, I also tried to uninstall and reinstall complete visual studio but it did not help.

Any suggestions?

Thx

Live sharing function with ".aspx" file in visual studio doesn't work

$
0
0

So the live sharing function works for me and a friend in visual studio with files such as ".cs" ".css" etc. But we can't display and write/edit code together in a .aspx file. I know that it is a ASP.NET server page, but we should still be able to work with the code simultaneously right? So to clearify, my friend gets access to the aspx files, but we can't be in the same together.

Thanks in advance !

how to update from VS 2019 16.8.3 to 16.8.latest instead of 16.9?

$
0
0

Seems like my only options are download some 2017 version or 16.9, but not the latest 16.8.X

Ideas?


Problems with VS2019 ASP.NET project and href links

$
0
0

Hi,

I have a problem with the url used in the href attribute for my style sheets. The website should run under a directory I will call /MyWebSite. I have added the virtual directory to my applicationhost.config so that it look like this:

        <sites>
            <site name="WebSite1" id="1" serverAutoStart="true">
                <application path="/">
                    <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation=":8080:localhost" />
                </bindings>
            </site>
            <site name="Web Site" id="2">
                <application path="/" applicationPool="Clr4IntegratedAppPool">
                    <virtualDirectory path="/" physicalPath="D:\Visual Studio 2019\My Web Site\My Web Site" />
                </application>
                <application path="/MyWebSite" applicationPool="Clr4IntegratedAppPool">
                    <virtualDirectory path="/" physicalPath="D:\Visual Studio 2019\My Web Site\My Web Site" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:50380:localhost" />
                </bindings>
            </site>
            <siteDefaults>
                <!-- To enable logging, please change the below attribute "enabled" to "true" -->
                <logFile logFormat="W3C" directory="%AppData%\Microsoft\IISExpressLogs" enabled="false" />
                <traceFailedRequestsLogging directory="%AppData%\Microsoft" enabled="false" maxLogFileSizeKB="1024" />
            </siteDefaults>
            <applicationDefaults applicationPool="Clr4IntegratedAppPool" />
            <virtualDirectoryDefaults allowSubDirConfig="true" />
        </sites>

Now I can open my top page using http://localhost:50380/MyWebSite/StartPage.aspx and all the page links work.

Now, in start page I have the following tag in StartPage.aspx:

<link rel="stylesheet" type="text/css" href="/MyWebSite/Styles/Styles.css" />

However, the style sheet is not being loaded. Can anyone tell me how I can get this to work?

Thank You

Visual Studio Community 2019 keeps locking me out

$
0
0

Hi. Every time I open Visual Studio Community 2019 it says my 'extended free trial' has expired. I thought this was free software? I can't even work out how I'd go about buying it! I'm very confused, and this is VERY frustrating. I'm just trying to learn how to code, and didn't expect the most difficult part to be making the software work! Reinstalling lets me use it once, but then it 'expires' again. What do I even do?

Go To Definition Error

$
0
0

I use VS Community 2017, ver. 15.9.33. 

"Go To Definition" and "Peek Definition" are most used by me to check and revise css. Lately, I cannot get either one to work. "Peek" just seems to endlessly search and not bring up the css definition. When I use "Go To" I get a popup error partially shown here:

'microsoft.css.editor.parser.cssparserlocator.findcomponent(microsoft.visualstudio.utilities.icontenttype)'failed

I have tried reading all sorts of posts and can find no solution that corrects this. Any suggestions appreciated.

RC

Website Conversion

$
0
0

Please I want to know if a website built with Microsoft Visual Studio can be converted into an application without having to build the app from scratch? If so, what is the process of conversion. Thanks

how to change default where my SQL Server object explorer appears

$
0
0

I always had it on the far left side of my window but now its showing up on the far right. If I open it, It hides my solution explorer which is also on the far right. I want the SQL window on left like I used to have it. How do I change that?

Visual Studio abilities for Vue Js

$
0
0

Hi,

Is there any way to add VisualStudio abilities for Vue js?

It sounds all extensions are for VS code.

Thanx

Visual Basic Class

$
0
0

Have an issue trying to figure out the code to work for this program. I think I did everything as described fir the project but I'm stuck in a particular section.

This is my Instructor Feedback: The code in step 8 of this project was not coded properly (the VerifyUsername and VerifyPassword Functions) There should be more code in the Functions besides Return True!

I know where it needs to be inserted but can't figure out how to make it work?


Unable to display Chinese characters

$
0
0

Hi,

I have a file which is in ebcidic format.

I have the change the encoding of this file to UTF-8, so that it could display data which both in English and Chinese.

I used StreamReader/StreamReader to do this,but i m able to display only English Characters and not the Chinese.

How can I achieve this?Please help

Why my debgger debugs other projects?

$
0
0

Hello,

I have inadvertently made changes to the debugger setting. 

Now when I try to debug my code it starts debugging other projects. 

How can I fix it? Please inform me.

Saeed

WIn 10 upgrade broke debugging project in IIS Express

$
0
0

Not even sure how to diagnose this, I die the most recent Win 10 update (19041.1) and suddenly I can't run projects against IIS).

The Chrome error is "The site can't be reached". 

The IE error is "Can't connect securely to this site"

The Edge error is "Hmm... can't reach this page."

I know this has to be related to the upgrade for the following reasons:

  1. I was upgrading virtual disk on my Visual Studio 2019 VM.
  2. I made a copy of the VM (Not a clone, a full folder copy) as a backup
  3. After upgrading the disk and extending the partition in WIN 10. The update was installed after the reboot.
  4. I can run the project just fine in the backup copy from step 2, but get those errors in the newly upgraded VM.

As I said above, I have no idea how to diagnose other than to go back to the copy, start using it again, add the disk again and NOT do the Win upgrade, but at some point I'm sure MS will make the update mandatory so I really need to figure this out.

Migrate VS2017 to 2019 project

$
0
0

I have a new task. Looks like I need to migrate my web application from VS 2017 - 2019. My manager said "update the Solution builder to work with VS2019". That is what i thought. If it is, please explain me what I need to do to migrate a web application to VS 2019. What are the steps involved? Please suggest me.

Regards,

Deepak

Using Javascript to Change a Radio Button's label (value) with a button click

$
0
0

My personal project (not college related) is to program a Multiple Choice Quiz web page.  I am using Visual Studio 2010 ASP.net to perform this task.  My dilemma is that I cannot, for the life of me, figure out how to change the (text) in my radio buttons labels upon button click.  I have three Radio Buttons for the User to choose the correct answer from and have been successful (thanks to a moderator in a forum) in changing the text in the first Radio Button but cannot get the other two to change text.  I have, unsuccessfully, tried every angle I could possibly imagine to tweak the code (for hours and hours - day after day - although I must admit I enjoyed the challenge)  and that is why I am here.  Can anyone assist me please.

This is what I have:

<!DOCTYPE html PUBLIC "">

<html xmlns="">
<head runat="server">
<meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Multiple Choice Quiz</title>
   
  /*** Begin Style the Header ***/  
  /*** End Style the Header ***/  

  /*** Begin Style the Top Nav Bar ***/  
  /*** End Style the Top Nav Bar ***/  

  /*** Begin Image with Transparent Text ***/  
   /*** End Image with Transparent Text***/  

</head>

<body runat="server" id="Body1">

<form id="Form1" method="post" runat="server">

   <!--*** Begin Header Here***-->
   <!--*** End Header Here***-->

   <!--*** Begin Navigation Here***-->
   <!--*** End Navigation Here***-->

   <!--*** Begin Image With Transparent Text Insert Here***-->

   <!--*** End Image With Transparent Text Insert Here***-->


<div class="container">                                                                                     

<img src="Images/forest.jpg" alt="forest" style="width:100%;">
  
<div class="content">

<h1 id = "queue" style = "font-size: 15px; font-family: 'Segoe UI'">Question Queue</h1>

<h2 id = "question" style = "font-size: 20px; font-family: 'Charm'">Question Presented Here!</h2>

<!--****     BEGIN CODE FOR RADIO BUTTONS     ****-->

<asp:RadioButtonList id="RadioButtonList1" runat="server">
  <asp:listitem Value="1">Item 1</asp:listitem>
  <asp:listitem Value="2">Item 2</asp:listitem>
  <asp:listitem Value="3">Item 3</asp:listitem>
 </asp:RadioButtonList>
 
<!--****     END CODE FOR RADIO BUTTONS     ****-->

<!--****     BEGIN CODE FOR OTHER BUTTONS     ****-->

<input type="button" onclick="JavaScript: buttonOnClick(0);" value="Change Radio Button #1 Text">

<br />

<asp:Button ID="Button1" runat="server" Text="Start Quiz" OnClientClick="return Click()"  Visible="True" />

<!--****     END CODE FOR OTHER BUTTONS     ****-->

</div>                                                                                                             

<script type="text/javascript">

    function buttonOnClick(radioButtonNumber) {
        var elementRef = document.getElementById('<%= RadioButtonList1.ClientID %>');
        var radioButtonListArray = elementRef.getElementsByTagName('input');

        for (var i = 0; i < radioButtonListArray.length; i++) {
            var radioButtonRef = radioButtonListArray[i];
            if (i == radioButtonNumber) {
                var labelArray = radioButtonRef.parentNode.getElementsByTagName('label');
                if (labelArray.length > 0) {
                    labelArray[0].innerHTML = 'CHANGED TEXT';
                    break;
                }
            }
        }
    }
</script>

</div>
</form>
</body>
</html>

 





Latest Images