Not sure if this is doable in 0.3.0, but I want to pass arguments to my onclick method like so:
button onclick=@MyMethod(MyParam)
Doing so results in a compile error of "CS 1503 cannot convert from 'void' to 'string'"
try <button onclick=@(() => Mymethod(MyParam)) />
Thanks, @Suchiman!
Thanks guys! Side note: So happy you guys are responding so quickly to help requests, but is there a better spot for these? I feel guilty opening issues when they aren't really _issues_ :P
@alexanderjwoods https://gitter.im/aspnet/Blazor is a quite active place 馃槈
@alexanderjwoods You can also post questions on StackOverflow. That way they can be referenced over time
@Suchiman Awesome! I will post over there unless it is a real bug!
@danroth27 I refuse to post on SO because of their attitude toward beginners. I have had more than one intern tell me they don't like SO because of the condescending nature toward "n00b" questions, and I quite agree. It turns people off to programming at worst, and at best it makes it harder for people to become proficient!
Fair enough. I think you'll find the folks on the Blazor Gitter to be very helpful.
when doing it within svg got following error:
Uncaught Error: Microsoft.AspNetCore.Blazor.Browser.Interop.JavaScriptException: Cannot set attribute on non-element child
Error: Cannot set attribute on non-element child
at BrowserRenderer.applyEdits (BrowserRenderer.ts:76)
at BrowserRenderer.updateComponent (BrowserRenderer.ts:33)
at renderBatch (Renderer.ts:45)
at Array.
at _emscripten_asm_const_iiiiii (mono.js:1)
at wasm-function[2679]:25
at wasm-function[3541]:44
at wasm-function[3548]:408
at wasm-function[3550]:224
at wasm-function[3766]:189
at Microsoft.AspNetCore.Blazor.Browser.Interop.RegisteredFunction.InvokeUnmarshalled[T0,T1,T2,TRes] (System.String identifier, T0 arg0, T1 arg1, T2 arg2) <0x1c21a40 + 0x00054> in <92ed9c6772a34798bccecc99cc26cbcd>:0
at Microsoft.AspNetCore.Blazor.Browser.Interop.RegisteredFunction.InvokeUnmarshalled[T0,T1,TRes] (System.String identifier, T0 arg0, T1 arg1) <0x1c21958 + 0x00022> in <92ed9c6772a34798bccecc99cc26cbcd>:0
Most helpful comment
try
<button onclick=@(() => Mymethod(MyParam)) />