XAML and ASP.NET?

Please post public support tickets here. Note: for private support tickets, please send an email to support@cshtml5.com instead.
MulleDK19
Posts: 1
Joined: Mon Oct 24, 2016 6:32 am

XAML and ASP.NET?

Postby MulleDK19 » Mon Oct 24, 2016 6:39 am

Hi.

I've been following C#/XAML for HTML5 for quite a while, but never really used it, since my apps are mostly Windows specific.
I do however make websites from time to time, and I'm not nearly as proficient in HTML as I am in XAML. And XAML just allows for more stuff more easy.

My question is. Is it possible to use C#/XAML for HTML5 to design the .aspx pages in ASP.NET?
I surely could copy/paste the resulting HTML, but I'm not sure how I would make the textboxes, etc. perform posts backs, etc.

Eg. I could replace all the resulting input elements to <asp:TextBox id="" runat="server" />, etc. but every time I'd make a change, I would have to replace all these elements again. And I'd have to wrap stuff in <form>, etc. too.


Is there currently any easy way to use XAML with ASP.NET websites, and if so, how? Are there any examples? If not, are there any plans to add support for this? Making website layouts in XAML would be a godsent.


Thanks in advance.

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: XAML and ASP.NET?

Postby JS-Support @Userware » Tue Oct 25, 2016 12:18 am

Dear MulleDK19,

Thanks for your message.

You can put the output of a CSHTML5 application into an ASP.NET page. To do so, create a new CSHTML5 application project, write your XAML there, compile it, then copy the JS files located in the "bin/Debug/Output" folder into your ASP.NET application. Then, manually merge the content of the file "index.html" (located in "bin/Debug/Output") into your .aspx page. This last operation will be made faster in a future version because we are going to reduce the number of lines of "index.html" to the minimum.

Please note that the XAML may take some time to appear, because it is meant to be used for developing "single page applications", that is, applications where there is only one "aspx" page, and all client/server communications are made via webservice (=ajax) calls, similar to the architecture of a Silverlight application. Of course, even though you should only have one "aspx" page, you can have multiple XAML pages within it, as explained here:
http://forums.cshtml5.com/viewtopic.php?f=2&t=126

Regards,
JS-Support


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 32 guests

 

 

cron