I just created a net6.0 Razor Pages project in Visual Studio 2022. I haven't made any changes to it at all.
The layout is the standard file that gets created. Using a nav bar with links to Home/Index and Privacy. I plan on adding a side bar for navigation as well.
All I want to do is, while using _Layout.cshtml, load pages from my nav links (ex: Index, Privacy, etc...) without reloading/refreshing the entire page. I just want to update the main content without reloading everything.
I've been searching online for a few hours and I just can't find what I'm looking for. I'm not sure where to start :(
There is no way without JavaScript. Try SignalR and JavaScript for Razor Pages
Related
I've noticed that whenever I add a new asp.net with a master page to a project, I am unable to edit it in the design view. I am able to see the master page content and an element that says ; however, I am unable to edit the content. I'd like to drop things in there and adjust their properties but I am unable to access them in the design view. How can I accomplish this?
Thanks!
I am ignorant. For anyone who has the same problem, be sure that your content is not wrapped inside a user control. I did some testing and found that was the problem.
Is there a Design View in ASP.NET MVC3 ?
There is no 'Design' view in MVC, like there is in Forms. However your views are just HTML so you can use any HTML editor, although they will not be able to interpret the Razor syntax.
What most people do is make changes to the HTML, save (you don't have to recompile,) and refresh your browser. Google Chrome has a very help full tool built in (Firebug or something like it.) Just right click on the page and select Inspect Element. This will come in very handy.
Also one thing to think about since you're new to MVC is that you can easily use most any css themes that you can find online to make the site look very different out of the box.
I setup a new site on dreamweaver and imported my site files in. I only did this since I wanted to play around with the design view, otherwise I just use notepad++. Anyways When I go into design view I can see the text of all my smarty tags and I don't see the design of the website. Is there a way to make the design view work properly so that my smarty code isn't shown as text and my website is shown correctly. Any nudges in the right direction would be greatly appreciated! If this isn't possible should I just stick with editing my code in notepad++ or is dreamweaver better?
You can switch to Live View. Live view differs from the traditional Dreamweaver design view in that it provides a non-editable, more realistic rendering of what your page will look like in a browser.
When you switch to Live view from Design view, you are simply toggling the Design view between editable and “live”.
While Design view remains frozen once you enter Live view, Code view remains editable, so you can change your code, and then refresh Live view to see your changes take effect. When you’re in Live view, you have the additional option of viewing live code. Live Code view is like Live view in that it displays a version of the code that the browser is executing in order to render the page. Like Live view, Live Code view is a non-editable view.
An additional advantage of Live view is the ability to freeze JavaScript. You can refer to the following Wiki to know more: http://help.adobe.com/en_US/dreamweaver/cs/using/WS753df6af718a350a-43cf1449133aea5253f-8000.html#WS16D4BD4B-0A17-44b9-95E9-ACC9795CE4F9
Regards,
Yalpi Shiva Prasad
Adobe Systems Incorporated.
I am playing with MarkdownDeep .Net/Javascipt Edition for an MVC 3 application. Added it via NuGet. The page renders Markdown sharp box just fine. However I get a weird jump to top of page behavior if any of the icons on the markdown sharp toolbar are clicked. I googled and didn't find anyone else having this issue.
Any thoughts? The script file and css are being loaded properly - no errors in Chrome console.
Have you checked that the microsoft ajax scripts are included in the page and that the web.config file is configured to use it? Try something simple like a ajax.beginform to see if it posts the page or if it calls an ajax post.
Any DevExpress control I use, just renders a list. I’ve tried all 3 possible syntaxes (listed on the site below) and every time, the control I want to use (TreeView, NavBar, etc.) just renders as a bulleted list. Any ideas why? I’ve checked Google and the DevExpress support center, but I can’t find any issues like this.
DevExpress with razor guide: http://documentation.devexpress.com/#AspNet/CustomDocument9944
I just put this code on my index page to test that DevExpress is working:
#{Html.DevExpress().NavBar(settings => {
settings.Name = "myNavBar";
settings.Groups.Add("Group1").Items.Add("Item1-1");
settings.Groups.Add("Group2").Items.Add("Item2-1");
settings.Groups.FindByText("Group2").Expanded = false;
}).Render();}
When it reaches the page, it just shows a bulleted list:
Group1
Item1-1
Group2
Any ideas what's causing this?
The project I was working on was being rendered inside another project. I just needed to get rid of my project's layout and add using statements to the cshtml pages:
#using DevExpress.Web.Mvc.UI;
#using DevExpress.Web.Mvc;
The only problem I still have, is the scriptlet code gets highlighted red (but it builds/works fine and has intellisense).
It seems that any required DevExpress' entry is not registered within the MasterPage (_Layout.cshtml) / Web.config http://help.devexpress.com/#AspNet/CustomDocument8163. I suggest that you use specially designed Visual Studio Project Templates http://help.devexpress.com/#AspNet/CustomDocument9145 to avoid missing any required DevExpress' entry.