-
Notifications
You must be signed in to change notification settings - Fork 930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ASP.NET Web Forms (VB.NET) config #963
Comments
It should be possible, yeah. You may need to write your own HTML helpers to
pull off server rendering though, since the ones included won’t work with
web forms.
…On Thu, Oct 31, 2019 at 17:28, pmonty ***@***.***> wrote:
Wondering if it is a possibility to get this done. We have an existing
ASP.NET Web forms app we would love to convert to ReactJS and really want
to use this package.
Just a test I installed the nuget React.Web.MVC4 package and it added a
reactconfig.cs to App_Start. Is there a way to generate vb files or do i
need to convert them manually? Fine to do the entire thing manually. But
thought I would ask here if this is even possible before I went and started
adding stuff for no reason maybe?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#963?email_source=notifications&email_token=AAHGCFSF4DOWKIWIN35OGMLQRNZY7A5CNFSM4JHUPATKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HV7CRCA>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHGCFVRTE7MP3ANQCCTHB3QRNZY7ANCNFSM4JHUPATA>
.
|
It's not tightly-coupled to MVC so it should work with WebForms too. You might find this issue useful: #55 I don't have any VB examples, but anything doable in C# should be doable in VB too 😄 |
Thanks for the quick reply guys! After some messing about I have the following: Imports React
<Assembly: WebActivatorEx.PreApplicationStartMethod(GetType(ReactConfig), "Configure")>
Public Module ReactConfig
Sub Configure()
ReactSiteConfiguration.Configuration.AddScript("~/Scripts/React/index.jsx")
End Sub
End Module
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<div>
hello this is div test
</div>
<asp:Literal ID="PageContent" runat="server"></asp:Literal>
</asp:Content>
It is rendering the div but not my react component UPDATE: UPDATE 2: Have also tried ReactEnvironment.Current per your tip in #55 |
Have just setup a repo so it is easier to see what I have done... wrong 😄 ReactJS.WebForms repo Edit was reading and discovered I might need to add Microsoft.ClearScript, so done it and then also removed those from Update: |
Ok so got it working. Main issue was I think forgetting Seems it wasn't necessary to call that explicitly. Will close for now as it seems it is all working. Going to attempt webpack bundling and typescript support. If that all works can actually attempt copying some react stuff into our project and working inside which will significantly help! Amazing effort by all collaborators and contributors! Great project |
@pmonty how did you resolve this issue mentioned in #Update2, however i am working in asp.net and getting the same error for the line : |
@pmonty Did you ever happen to make a video or something showing the whole process? I've tried to do this multiple times using other resources, but have never succeeded. Maybe one day I can get around to trying your above steps. |
Wondering if it is a possibility to get this done. We have an existing ASP.NET Web forms app we would love to convert to ReactJS and really want to use this package.
Just a test I installed the nuget React.Web.MVC4 package and it added a reactconfig.cs to
App_Start
. Is there a way to generate vb files or do i need to convert them manually? Fine to do the entire thing manually. But thought I would ask here if this is even possible before I went and started adding stuff for no reason maybe?The text was updated successfully, but these errors were encountered: