ASP.NET controls opening new windows intead of postback in same window - c#

The fils containing these control work fine in another project and they work fine on visual studio so I guess it is safe to assume that the problem is not in the files or with the server but has something to do with the project? What could be causing this?

Only a hyperlink with target="_blank" or javascript events will open new windows.
Are you using some javascript enhancement that changes links or adds functionality to them? Could be a lightbox/shadowbox like script.

Related

WPF WebBrowser with Bootstrap form

I am working on a project that involves using a WPF WebBrowser to load a form created using Bootstrap JS framework. However, it appears that parts of the form (specifically drop-down select options buttons) do not function within the WebBrowser, despite working normally in IE11. The form does not retain drop-down selected values (on submit, the default value is recorded) and on change commands (e.g. loading specified data) do not work. I have searched extensively but have not found a solution that works. Drop down menus on non-Bootstrap forms seem to work when loaded, but Bootstrap forms on any site I load in the WebBrowser seem to fail.
Steps I have taken already that have not resolved the issue:
I have changed the FEATURE_BROWSER_EMULATION registry keys (among other keys suggested online) to change the default IE of the WebBrowser to IE11, and I have tested to make sure this is working, but it does not resolve the issue.
I have checked drop down boxes on other websites within the WebBrowser, which seem to be working fine.
I have ensured JavaScript is functional within the WebBrowser interface.
I have checked that the website works in IE11 outside of the WebBrowser interface.
I have tried the WebBrowser in both a Window and within a Form
I appreciate any help!

Script Error in webBrowser control WPF

When am work on webBrowser control using wpf Getting error like "script error" even i pasted screen shot here and even some jquery UI and css not working
I faced this problem too. I need to create browser application which the web has lot of Jquery, JSON etc and webbrowser control does't work as expected (I'm using Windows 10 and Visual Studio 2015)
As solution, I use cefsharp.github.io which allow me to embed a full-featured standards-complaint web browser into C# or VB.NET project solution without hacking windows registry key. It based on Chromium Embedded Framework. It work like a charm!
Just grab nuget packages and create ChromiumWebBrowser class and you are ready to use it.
You have to change your WebBrowser rendering engine, by default it uses the oldest one.
In this link Microsoft describes how you can do it:
http://msdn.microsoft.com/en-us/library/ie/ee330730%28v=vs.85%29.aspx
And you can follow this good answer too.
Will the IE9 WebBrowser Control Support all of IE9's features, including SVG?
Pay attention that if you are running a 32 bit app on a 64bit system you must set this key instead
[HKLM\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
I tried the site that fails in your screenshot and works well with this registry change from a WebBrowser.

is there any design view in razor view engine?

I have to make a mvc application, But got stuck whether to use Razor or Aspx engine. I have made many web application in aspx, so razor is new to me.
I have not found any DESIGN View in Razor like we found in aspx ( design and source).
I have to make a .net application through which i can send sms through An android mobile connected via Usb to computer. Is there any code or api similar to send sms Like in Nokia Mobile AT Commands.
There isn't a traditional design view like there was for ASP. The closest thing you can get to it can be achieved in the steps below:
Get Visual Studio 2013
Install the Web Essentials 2013 extension
Open the Browser Link Dashboard from View > Other Windows
Press the View in Browser button
You should see Internet Explorer (or another browser) appear with your web application displayed. Also notice that browser now appears under the Connections group in the Browser Link Dashboard in Visual Studio. Go ahead and open the dropdown arrow next to the browser name. Select Design Mode
Return to the browser, you will now be able to select elements in the page and modify things like text. Your changes should be reflected in the respective cshtml file. You can also modify the css or underlying html of the page through the browser's developer tools (F12) and sync them back to Visual Studio
It isn't nearly as convenient as the old ASP style design mode, and can get cumbersome when you start involving layouts, partial views, editor templates, display templates, etc. But it's about as good as it gets when it comes to realtime editing of Razor pages.
There is no design view for creating Razor views.
If you are deciding between Razor or the ASPX view engine, I would highly recommend Razor.
No, theres no design view for Razor unfortunately. You have to run the app and use a browser to see changes to you page. If you do decide to go with WebForms id recommend looking at how to do the MVP pattern with it.
I've found something similar to that.
I just accidentally went to File -> Recently Closed Documents and I got something similar:
Now I have Design Split and Source modes:
I'm using VS2019 Community, version 16.8.2

After building and running asp.net website my page get refreshed automatically one time

I am new to asp.net
I have created a small web site in visual studio 2010 using asp.net and C#.
whenever i run the website it get refreshed one time automatically.
I have not used any meta tag refresh attribute.
why this happening, Please help.....
Sounds like a browser issue rather than a code one. Try checking your browser extensions and settings, something may be conflicting with the default.aspx page. Try pressing F12 as well and check the console. It will tell you if something is going wrong.

Webbrowser and IE acts differently?

I'm in a trouble trying to fix some problem.. I have a program with Webbrowser control inside it.
It automates crawling process from some website. The problem is that I cannot fix webbrowser after recent website changes.
They have changed page navigation on website. And when I do actions MANUALLY in webbrowser (in my app) it doesn't go to the next/previous page on website. It does nothing... Whereas it works properly in IE 7/8/9 (only scripting errors thrown this time).
So does it mean that Webbrowser is not fully similar to IE??
I'm sorry for not showing source codes here, I think it wouldn't help here. Which way should I go to troubleshoot it? Why page navigation is not working in Webbrowser control?
I tried to simply put Webbrowser on a Window Form in new project and tried to navigate page 2/3/../10 in the website catalog, but it simply changes page number and doesn't navigate to it...
EDIT: Website doesn't work propely even if I do actions manually in webbrowser using mouse clicks.. but works in IE.
EDIT2: I might be not clear in my question. The problem is that I cannot use website even Manually with mouseclicks via my Webbrowser control in app. It changes page number after I click on it, but it doesn't navigate to that page. It stays silent. I'm sure that AllowNavigation property is true. It worked just yesterday and stopped after website changes today... Please tell me which way should I go to troubleshoot it.. I thought that Webbrowser control acts the same way as Internet Explorer.. Any help from you highly appreciated! Thanks
EDIT3: Strange thing... i just loaded Extended Webbrowser and navigated to that website. Page navigation panel doesn't work there also.. Is it a bug on their side or some type of guard from crawlers? What do you think?
(http://www.codeproject.com/KB/cpp/ExtendedWebBrowser.aspx)
I'm sure this isn't the answer your want but using the webbrowser control to scrape websites is very painful to maintain.
Instead use the HttpWebRequest and HttpWebRepsonse objects to recreate the calls to the webserver.
You can use Fiddler (http://www.fiddler2.com/fiddler2) and your browser to record your web sessions and recreate them in code.
You can setup your webbrowser control to disable a number of features including navigation.
I.e. to disable nav in the C# WebBrowser control:
webBrowser1.AllowNavigation = false;
I'd double check that you're not doing anything like this.
I had the same issue with a certain web site that recently changed its format. It has to do with the version of IE used by the control.
Simply force the IE version used to the latest (in my case 9). Setting the appropriate registry item to 9999 for my application worked; see: Webbrowser control behaving different than IE

Categories