How do I implement simulated frames in ASP.NET MVC? - c#

How do I implement a simulated frameset in ASP.NET MVC without running afoul of browser differences?
If possible, I would like a header and two vertical panes. The header will be pinned to the top of the browser. The left pane will contain an index of some sort, and the right frame will contain content. Each of these panes can have its own scrollbar, but only if the content is long enough to require it.
It should look similar to this: http://msdn.microsoft.com/en-us/library/w0x726c2(loband).aspx
NOTE: I do not need to support IE6, but I do need to support IE7 for awhile.

You could try the jQuery splitter plugin.
http://methvin.com/splitter/

Use CSS Layouts. Some examples: http://layouts.ironmyers.com/

Related

Dot Net Nuke : Selecting different skin files based on the browser width change

Is there any way of selecting different skin files(.ascx files) in DNN when there is a change in the browser or window width?
In addition to it, is there any event in asp.net that is triggered whenever there is any change in the width/size of the browser?
You can create separate sites for different devices using DNN's "Device Preview Management"and "Site Redirection"
http://www.dnnsoftware.com/community/learn/video-library/view-video/video/532/view/details/redirecting-website-visitors-to-your-mobile-website-using-dotnetnuke
To answer the question, you'll need to use JavaScript to update the stylesheet url based on browser width. In javascript, you can get the viewport's width with
window.innerWidth
However, a much better approach would be to employ responsive design in the design of your theme. Modern CSS is capable of handling much of the calculation for modifying layout based on viewport size with an elegant and simple syntax.
To assist you in this, you may want to use a responsive design framework such as bootstrap or foundation

How would you create a page like WP's Mail app's Compose screen?

I'm new to WP dev (and pretty much C# and Silverlight in general) and I've been playing with Textboxes. I found pretty quickly that you can't really scroll a TextBox control.
I've seen some solutions to this on various blogs and StackOverflow posts, and the most popular one seems to be to embed the TextBox in a ScrollViewer, then use some code to make the current input line always visible, like this:
scrollViewer.ScrollToVerticalOffset(textBox.ActualHeight);
This works okay if you have a relatively small TextBox, but if you want to make one that takes up quite a bit of space, you run into problems where the keyboard covers up the bottom section, you can't scroll to the top unless you manually move the cursor up there, etc.
Now the Compose page of the Mail application seems to do this perfectly: a nice big space for text entry where the keyboard never blocks the input, you can freely scroll through the entire pane, it just works really. I've tried various combinations of scrollviewers and textboxes but I haven't had any success in matching its behavior.
Any help?
The default apps are not written in C# using controls accessible in SDK or on the net.
Replication of mail viewer and composer has been tried before rather un-successfully. (Based on similar posts of AppHub - old WP7 forum)

ASP.NET Disable page formatting when not full screen

I have a web application on VS2005 using C#.
Whenever my webpage does not open up in full screen, the icons and labels will automatically adjust to fit the width of the windows, making the buttons and icons disoriented.
Is there any way to disable this or enable the format to be fixed regardless if the windows is full screen or not?
This would be hard to do. You could use a function in javascript to chceck if browser is in full screen. Then you woud have to do this in intervals to make sure that this is or is not true.
if (screen.width == window.innerWidth && screen.height == window.innerHeight) {
// web browser full screen
}
Based on that you could make another screen CSS template that you could apply based on that condition. Then you could make your site apply another layout.
Another approach I would reccoment is to make your CSS layout in a way that you would be satisfied with it with any browser size.
You can use CSS to set width (which will be fixed) or min-width (layout will not shrink to less). min-width is not supported on older versions of IE.
In both cases if the browser window is smaller (or the available space – if something like history is opened down the side) than this then horizontal scrolling will be alloed.
However consider that many users have very wide screens these days, far too wide for comfortable reading if a browser is maximised.

Browser scrollbars in ASP.net (how to set them)

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?

html links & hover events over certain locations on an image

So i created a web site a long time ago using a designer alot like frontpage + expression design put together, and since then Ive gotten more into coding, and I'm learning html, CSS, and all that good stuff.. and i have this re-designed header that Ive made here:
http://prntscr.com/8zct
So what I need to know, is how i can get it so that when a user clicks on one of the links in the header design it will redirect to a page. and also if possible, how to make it so when a user hovers over a link a drop down may appear with other options, EDIT: I'd like to be able to add a backround image to the drop down navigation menu
As me being quite new to this sort of stuff, could anybody help me achieve this?
PS. I'm working in Visual Studio with ASP. but that doesn't change anything about the html and css stuff. just letting you guys know.
To navigate based on clicks on certain areas of an image, read about image maps.
To create menus and other active components, read about JavaScript (also recommended: jQuery).
You can also create divs that are clickable to use as hot spots on an image. that way you could add a background image to that div if ti's hovered/clicked, whereas image maps does not afford you that opportunity.

Categories