I'm using asp.net and c#.net.
I'm gonna implement a website that has content navigation like that Microsoft did on this link:
Microsoft Windows
In this link you're able to browse page content with freeze header on postback
and also you're able to browse videos from left Navbar without page postback.
The important thing is for each click url is changed.
Any ideas or help would be appreciated.
Thanks and regards
First off, to clarify, postbacks are only required if you're submitting form elements. If you're creating a webforms application, you can easily use controls like HyperLink with a NavigationUrl to navigate among URLs without needing postbacks.
If what you mean is that you're seeing the page partially updating when following links, that's not what I'm experiencing. The pages appear to completely reload when the links in that page are clicked. In your own site, you can use AJAX and JavaScript to implement a navigation system that doesn't require heavy navigation requests. Look at Manipulating the browser history (MDN) for information on exciting new JavaScript features that will let you modify the browser's URL/history without reloading the page. There are several JS libraries that integrate with this feature to give you "AJAX" navigation capabilities.
To simply get the header to not scroll along with the rest of the page, use position: fixed in the CSS for the element.
Related
Before I go down the rabbit hole which is over my head and I would like to avoid for now… Is there a simple way to see if an online .aspx webpage loaded in the web browser control? .html pages work fine using .DocumentCompleted for me but .aspx visually loads fine but never triggers the DocumentCompleted event. I saw some good articles that mention the need of creating separate 3 threads and etc… unlike in those articles I am not interacting with the web application (the user is) I just want to hide a few irrelevant DIV elements on the side off the page.
user9938 Thank you! Unfortunately, I cannot mark your comment as an answer so I will post it for others here.
webview2 worked amazingly. On aspx pages NavigationCompleted still did not work however I was able to achieve this with CoreWebView2_DOMContentLoaded
I have a page which contains user controls with Telerik Charts (grids also, but they work fine). From this page, the user can click on a button to be redirected to a "Printer-Friendly Version" type page, which opens a new window via javascript and goes through a slightly different view (for formatting and stuff), but the telerik code is all the same.
The problem is, my Chart displays just fine in the original window, but the new window displays basically an empty chart with no data. This bug is only present in IE, and only applies to Charts. Grids work fine, for whatever reason. I'm thinking this is due to differences in script caching between browsers -- correct me if I'm wrong, I'm semi-new to client-directed web development.
Anyway I read somewhere that Telerik has issues with loading data and/or js files when loaded via ajax, so maybe that's the problem? If so, how could I get around this? And if not, any ideas on what could be causing this issue? It's causing me a great deal of frustration, since a print preview page seems like it should be the easiest of jobs.
Edit:
The charts are being rendered as html (if somebody can explain how to render them as images, that would be awesome). And dev tools shows basically the same thing between chrome and IE. Whenever my web service goes back up ill WinMerge them and look for any peculiarities/differences between them. In the mean time, though, the "render as an image" concept sounds promising. That way I could just save the image from the first page, and insert it right into the print preview page, right?. And since it's a print-preview page, it's not going to need to be interactive or anything, so that'd work out nicely.
Another (important) Edit:
These are probably the culprit...
And here is a little more detail on that:
And here is a side-by-side of it working(in chrome) and not working (in IE):
Have you considered using a print-specific stylesheet instead, e.g.
<link rel="stylesheet" type="text/css" media="print" href="print.css" />
In which you specify the styling to apply when printing.
That way, you avoid reloading the page (duplicate database hits, etc.) and don't need to delve into the AJAX of Telerik's controls.
EDIT:
Regarding using an image rather than HTML, first make sure you won't lose any features/detail, then check out the .Save() method of the RadChart control. You could either save it to a memory stream, or if you want to re-use the image save it to a directory on the webserver and clean it up periodically. That way, you can just point your print version to the image and not re-generate it.
This Telerik forum post may be of use.
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
I'm developing a web template using asp.net and c#, which contains 3 parts. I handle the partial refreshing of the page with using updatepanel.
As you can see in picture below, the first parts is the top menu which is refreshed; the left sub menu, then the left sub menu refresh the middle panel(Details) and shows all the detail which contains a table with insert, delete, edit and paging buttons. I used a listview to develop the tables.
I have more than 50 modules similar to this which contain a table with some buttons, and if I put all the tables in the same page the page, the code would be very huge. That's why I came up with the idea to put each table in separate page and just load each page in the 3rd panel.
I have gone through the Uframe but I couldn't use it at my page properly.
I would really appreciate that anybody help me to overcome this problem, to load separate aspx page in 3rd panel, but without using iframe, or guide me how to use the uframe step by step. Or if you have another idea to get rid of this problem.
This is exactly the type of situation that Master Pages were intended for. Master pages allow you to define a consistent look for pages, with as much content as you like on the Master, and the parts that change in a "child" page (in the ContentTemplate)
Master Pages are documented here and there is an introduction to Master Pages video here.
Master pages can absolutely work with an UpdatePanel as well. This is documented specifically here.
How do I set the scrollbars in an ASP.net page dynamically? When a user comes to certain pages on my site I would like the page to be scrolled down about halfway. Is there a way to do this without using Javascript?
One standard HTML option is to set a target <a name="foo"></a> on your page. Links to the page would need to be /yourpage.aspx#foo, but that would cause the browser to scroll to the target.
Sounds like you're looking for an anchor tag. You specify the URL as www.site.com/page.aspx#middle
Then in your page, you put the tag where you want them to scroll to
<a name="middle" />
http://www.w3schools.com/tags/tag_a.asp
asp.net is a server side technology so it is not possible to manage the scroll position without using javascript. At least I have not seen it done.
Something you might be interested in that I've used successfully on projects before is the smartScroller. You can place this control on a web page and the web page will automatically remember the scroll position between postbacks and scroll there. Check it out: https://web.archive.org/web/20211020140248/https://www.4guysfromrolla.com/articles/111704-1.aspx
It does use javascript though. Any reason in particular you don't want to use javascript?