is there any design view in razor view engine? - c#

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

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.

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.

How to add and use silverlight controls in asp net webpage along with other asp.net controls

Using Visual Studio 2012 I tried to follow the steps given in the link
http://msdn.microsoft.com/en-us/magazine/cc135987.aspx
for the same I downloaded Silverlight.js file from
http://archive.msdn.microsoft.com/silverlightjs
but in the very first example of growing and shrinking green sphere I was unable to see expected output. I see a blank white page. Is something I am missing. I tested my silverlight installation, its perfectly running sample silverlight application in browser, so no issue in silverlight version etc. Because the article posted on the link is too old. So there may be some updates or change in way of using. Please let me know where am I going wrong.
You are right - that is a very old article, and the method of embedding the Silverlight control in the ASPX page changed at about v3 of Silverlight.
I suggest you watch this instruction video: Adding Silverlight to a Web Page. Additionally this page is also a good launch page for learning more about Silverlight.

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.

Minor web-forms designer thingy

As a high-school student [that pretty much has C# knowledge of a first degree] - I got an assignment for the Israelish 'Bagrut' exams [which are the final, most important exams in high-school] - before we actually went through the materiel in-class [about 3 years earlier.]
It was to make a simple dynamic website, maybe a basic social website or an online-store, with importance of server-side ASP.NET.
My teacher gave me a book from 2006 called 'ASP.NET & XML Web Services' - and I've started learning.
The problem is, I have VS2010 Ultimate with .NET FW 4 installed, and apparently, is majorly different from the C# Express that the book author has.
On my VS, the Design Editor of the HTML is not allowing me to have the WinForms level of freedom, but makes me write the CSS myself, not show me the common XY based designer, but something like a blog WYSIWYG - without the freedom of moving stuff around.
As I do not want to work too hard converting the book instructions to my VS, I would like to know if its possible to get the [probably obsolete] WinForms - WebForms designer - and not by downloading a very old version of VS.
I've tried playing around a bit with VS, and found out that the book used System.Web.UI.Page, while my VS uses System.Web.UI.HtmlControls.HtmlForm - even manually changing to UI.Page did nothing to the designer.
Is it possible to 'go back' to the WinForm type of designer? Thank you!
No, it's not possible to do what you want. You are referring to the ugly, terrible, thing-that-should-have-never-been-created-in-the-first-place grid layout thing that Visual Studio 2003 used to have. Learn a bit of HTML. Tables are easy enough to learn and lay out things properly on your markup.
Designing webforms is much different than designing winforms, as the designer uses HTML for the markup. There's really no way to change that, but there should be a design view that allows you to drag and drop, and move things around similarly to how you would a windows form.
As for the design aspect of your site, there is probably no way to escape CSS. The design view should help you with the layout, but most of the styling and aesthetics will have to do be done in CSS.
Page shown in design view
Toolbox
View (Design/Split/Source)
Solution Explorer
Properties Window
Run (F5)
Umm, I'm no web developer and I have no real opinion about whether WebForms is really as evil as Icarus says, but I'm going to have to just throw out there as an alternate answer to his - don't learn to lay out your HTML using tables - HTML tables are for tabular data. Learn to layout your HTML using <span> and <div>, because that is the correct and standards-compliant way to do it. Also because every time you use tables for layout, a skinny-jeans-and-thick-rimmed-glasses wearing hipster dies somewhere, and we need them and their creativity.
You can switch between Content (where you can move your 'stuff') and Code in the HTML Designer, but the point is that VS2010 (be it Express or Ultimate) is for professional development and if you are unwilling to get to know HTML and CSS, there is not point in using it.
You'd be better using other tools like Adobe Dreamweaver or free tools like Amaya
Update: Try WebMatrix

Categories