Asp.net works on mobile device - c#

I asked to get clarify, I have an asp.net site it works great.
Site Contains many pages ,what I aim to do, is to make this page works on mobile device.
The Real problem it, my page contains many and many controls, So there is messy in the page .
First I want to know, how can I make page on asp.net works on mobile device?
Second ,Is it should to create a new one to get few of controls of the main page , because on the mobile page I need only few of the original .
Update:-
my site is responsive
But I have a specific page which have a lot of controls and it looks messy in appearing on mobile , So I need to create a new page similar to this page with fewer controls appears only when user use mobile not web browser.
Sorry for bad English, or being not organized.

Browser sniffing is not reliable. You should look to redesigning your site as RWD (Responsive Web Design). Use Nuget to bring in Twitter Bootstrap and start from there.
Here's an example using Web Forms (MVC would be similar):
http://www.mytecbits.com/microsoft/dot-net/bootstrap-3-0-0-with-asp-net-web-forms

Related

Transferring an existing C# and ASP.NET Web Form site to Bootstrap

So I have an existing page that's running ASP.NET and C# in order to display a front-end for some PowerShell commands. This was all developed in the community/free version of Visual Studio 2017.
Pseudo-code is below
User browses to page in browser
Browser presents lists of buttons and text fields
User inputs options into fields and clicks a button
C# runs in backend to run a PowerShell command doing various things, dumping into a JSON file the results
C# returns the results to the page by reading the JSON and turning it into a C# object, displaying as a C# Table
What I have already is that page (and sub pages for different features), displaying results to a simple table or div and displaying the buttons and text fields using the default C# table and some custom HTML to display the JSON properly.
What I want though, is to be able to port those features and functions to a Boostrap template, so I can take advantage of the handy dropdown menus, fancy buttons, etc. that are provided by Boostrap. Specifically I'm looking at using Flatkit.
All of the examples I've seen have either been for MVC stuff, starts entirely from scratch, or uses very simplistic Hello World examples, neither of which help when tackling this task as my code is web form based and more complex than an About page.
So my question(s) is/are
a) How can I create ASP.NET controls that will both play nicely with Bootstrap and feed data back into the C# file for processing? Something that can duplicate an <asp:Button> essentially, without refreshing the page entirely.
b) How can I then create another control or similar element on the front-end side to display that information? I'm using a simple <asp:Table> currently
I have the backend PowerShell and most of the logic written, I just need to know how I can make it interact nicely with Bootstrap essentially.
Web dev is not my usual forte , so a lot of the tutorials feel like reading Ancient Greek as they assume I know JQuery, Angular, DOM, etc. So if there's knowledge I'm lacking to make this work, links would be great.
Thanks!
End of day, Bootstrap or any CSS framework applies styles to HTML elements. ASP.Net Web Forms Controls render "vanilla" HTML - though some can be unwieldy (like <form> input name and id attributes - re: ASP.net uses the same value).
They can be styled as needed. Look into CssClass
Hth.

Transfer information between asp.net and WPF

What I am trying to do is a bit complex:
I have a web site developed in asp.net, this site is displayed in a desktop application which was developed in WPF, the browser used to show this site is awesomium.
I need a way for one of the C# classes in the asp site (back end) to ask for information from the WPF application and get a response. all of the information is simple string.
A big plus (but not a requirement for the solution), in the site there are a few pages + I will need to add this implementation in other sites that I will build in the future so if there is a solution that does not affect the front end or the html file that will be helpful since it will prevent a dependency between the front end and this code.

In a ASP.NET Webforms App - The purpose of Site.Mobile.Master and the ViewSwitcher.ascx control

I normally delete ViewSwitcher.ascx and Site.Mobile.Master from my project whenever I create a new WebApp using the default Webforms template.
After researching I believe the Site.Mobile.Master and ViewSwitcher.ascx are used along with the new Friendly Urls feature.
I am looking for some information on why Microsoft added these files to the default webforms template and how/when I would go about using them. I usually create web applications that run on both desktop and mobile using the same master page.
It seems like a scenario when I would want to use Site.Mobile.Master is when I want to completely separate mobile from desktop. Meaning I would have 2 files like this:
AboutUsMobile.aspx (uses Site.Mobile.Master)
AboutUs.aspx (uses Site.Master)
I believe the ViewSwitcher control simply allows the user to leave mobile and switch to the desktop page.
However, I do not understand what logic is in place to automatically take the user to the Mobile page vs the Desktop page.
I just feel like I don't see the full potential in using these controls and how they work with the new URL routing. Any information on these items would be great.

Adding a re-usable 'box' to my asp.net web app

I'm building a basic web application in ASP.NET 4.0 with C# in Visual Studio 2010 Pro. I'm still very new to C#, and am used to Delphi coding. My website already has registration/login, and although I use some asp.net controls, a majority of my pages are dynamically loaded from my SQL database and I manually compile the HTML code from C# and insert it into the document.
Now what I would like to do is implement a poll - or a vote box - an 'object' which can be re-used in different pages. My website's master page already has a permanent left panel which has things which show on every page. One of these will be a small box with a vote of a few questions.
All I need to know is how do I begin to build an independent plugin control for a web page like this? I don't necessarily mean a separate DLL or anything, my existing one can handle everything. But I'd like to re-use the same little voting box in different pages too. So I'm assuming this will be considered a separate page, in a way, which is probably about 120 pixels wide by 80 high. Each vote will be limited to either login account or ip address (which I already have access to). So this solution must interact with the existing asp.net application.
So how do I begin the 'backbone' of such a plugin which can be re-used in multiple pages? I do not plan on distributing this plugin, and I don't even know if this is the correct term for what I need. Just a 'box' which can be 're-used' on multiple pages - which must interact with the asp.net app.
To better explain what I mean, imagine how Facebook has the plugin where you can embed some general info about likes and such. I'd like to make my own box like this - and even be able to embed it in other websites.
It sounds like you just need to make the poll into a user control. The documentation should get you started with them. A control can access everything an ASP.NET page can when it comes to the login information. It won't handle embedding into other pages though – embeddable active content that authenticates against your site is a nontrivial problem.
As I said in the comment, if most of your HTML is creates as a blob that's opaque to ASP.NET, it will probably be nontrivial to insert a user control into the middle of it.

How to show the list of recently visited web pages as chrome does

I would like to display the list of recently accessed/visited web pages just as google chrome shows. I want to achieve this using C# and asp.net.
I am working on a site where the user can see the list of pages that they have visited, I tried using iframe but that does not work as per expectation. I am looking for a clean and intuitive interface something like google chrome.
I would like to provide a thumbnail view of the recently visited pages.
To keep my question simple, I want to display a list of urls as thumbnails, just as chrome does
Note that Chrome can do it easy, as they get to render the page and can take a bitmap snapshot of it easily to show for the thumbnails. (These are not live websites in there)
If you want to do the same thing, you have to render the website offscreen and take a snapshot to show to the user.
If you want to actually show a live website - now that's another story. There are a lot of sites that don't like being shown in the context of another website (for whatever reasons - security, marketing and so on) and will employ any tricks (including legal) to make sure this does not happen.
Pages only visited within your own app?
There are several components that will alow for that using their api. For example:
http://www.tonec.com/products/wssh/index.html
You can just take a snapshot after the DOM for tha page is completely generated and save the output using the tool on peruser basis.
Now, if you want something more generic that works for any web site, you'd probably want to go with a web browser plugin.
Here would be a possible solution, although I've not tried it personally:
Keep a record of all the pages that a user visits (e.g. in a database)
When the user visits a landing page on your site, you could call the WebBrowser.DrawToBitmap function to render a bitmap of each page they have visited recently.
Please note: this is just a theory, I'm not saying it will work! ;)
This link might help you get started:
http://pietschsoft.com/post/2008/07/c-generate-webpage-thumbmail-screenshot-image.aspx

Categories