|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
) expected erro when trying to create a popupI have never had this much trouble creating a popup can someone give me a
heads up? Here is how I am trying to create a popup but I keep getting this error: Compiler Error Message: CS1026: ) expected code: <asp:LinkButton id="lnkDetail" runat="server" onClick="window.open(http://www.microsoft.com,_new,toolbar=yes)">Details</as p:LinkButton> You were missing some quotes, plus the way you were doing will cause a
syntax error. Here's a way to put the onclick into the control using the code behind: Private Sub Page_Load _ (ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles MyBase.Load lnkDetail.Attributes.Add _ ("onClick", _ "window.open('http://www.microsoft.com'," & _ "'_new','toolbar=yes')") End Sub <asp:linkbutton id="lnkDetail" runat="server">Details</asp:linkbutton> Let us know if this helps? Ken Microsoft MVP [ASP.NET] Toronto Show quote "aaa" <some***@microsoft.com> wrote in message news:eq9UymiOFHA.3144@tk2msftngp13.phx.gbl... >I have never had this much trouble creating a popup can someone give me a > heads up? Here is how I am trying to create a popup but I keep getting > this > error: > > Compiler Error Message: CS1026: ) expected > > code: > > <asp:LinkButton id="lnkDetail" runat="server" > onClick="window.open(http://www.microsoft.com,_new,toolbar=yes)">Details</as > p:LinkButton> > > thanx
Show quote "Ken Cox [Microsoft MVP]" <BANSPAMken_cox@sympatico.ca> wrote in message onClick="window.open(http://www.microsoft.com,_new,toolbar=yes)">Details</asnews:uNLJ0gjOFHA.4000@TK2MSFTNGP15.phx.gbl... > You were missing some quotes, plus the way you were doing will cause a > syntax error. Here's a way to put the onclick into the control using the > code behind: > > Private Sub Page_Load _ > (ByVal sender As System.Object, _ > ByVal e As System.EventArgs) _ > Handles MyBase.Load > lnkDetail.Attributes.Add _ > ("onClick", _ > "window.open('http://www.microsoft.com'," & _ > "'_new','toolbar=yes')") > End Sub > > <asp:linkbutton id="lnkDetail" runat="server">Details</asp:linkbutton> > > Let us know if this helps? > > Ken > Microsoft MVP [ASP.NET] > Toronto > > "aaa" <some***@microsoft.com> wrote in message > news:eq9UymiOFHA.3144@tk2msftngp13.phx.gbl... > >I have never had this much trouble creating a popup can someone give me a > > heads up? Here is how I am trying to create a popup but I keep getting > > this > > error: > > > > Compiler Error Message: CS1026: ) expected > > > > code: > > > > <asp:LinkButton id="lnkDetail" runat="server" > > Show quote > > p:LinkButton> > > > > > One thing though this link control exists as part of an UltraGrid control.
There is not a design time reference to this object in the code behind only the Html how can I work with this? Show quote "Ken Cox [Microsoft MVP]" <BANSPAMken_cox@sympatico.ca> wrote in message onClick="window.open(http://www.microsoft.com,_new,toolbar=yes)">Details</asnews:uNLJ0gjOFHA.4000@TK2MSFTNGP15.phx.gbl... > You were missing some quotes, plus the way you were doing will cause a > syntax error. Here's a way to put the onclick into the control using the > code behind: > > Private Sub Page_Load _ > (ByVal sender As System.Object, _ > ByVal e As System.EventArgs) _ > Handles MyBase.Load > lnkDetail.Attributes.Add _ > ("onClick", _ > "window.open('http://www.microsoft.com'," & _ > "'_new','toolbar=yes')") > End Sub > > <asp:linkbutton id="lnkDetail" runat="server">Details</asp:linkbutton> > > Let us know if this helps? > > Ken > Microsoft MVP [ASP.NET] > Toronto > > "aaa" <some***@microsoft.com> wrote in message > news:eq9UymiOFHA.3144@tk2msftngp13.phx.gbl... > >I have never had this much trouble creating a popup can someone give me a > > heads up? Here is how I am trying to create a popup but I keep getting > > this > > error: > > > > Compiler Error Message: CS1026: ) expected > > > > code: > > > > <asp:LinkButton id="lnkDetail" runat="server" > > Show quote > > p:LinkButton> > > > > > Hmmm... Not sure of what the Ultragrid does but you might need to put the
code into a template if it supports them. Perhaps try the vendor's support site? Show quote "aaa" <some***@microsoft.com> wrote in message news:%23G0zvUpOFHA.3292@TK2MSFTNGP12.phx.gbl... > One thing though this link control exists as part of an UltraGrid control. > There is not a design time reference to this object in the code behind > only > the Html how can I work with this? > > > "Ken Cox [Microsoft MVP]" <BANSPAMken_cox@sympatico.ca> wrote in message > news:uNLJ0gjOFHA.4000@TK2MSFTNGP15.phx.gbl... >> You were missing some quotes, plus the way you were doing will cause a >> syntax error. Here's a way to put the onclick into the control using the >> code behind: >> >> Private Sub Page_Load _ >> (ByVal sender As System.Object, _ >> ByVal e As System.EventArgs) _ >> Handles MyBase.Load >> lnkDetail.Attributes.Add _ >> ("onClick", _ >> "window.open('http://www.microsoft.com'," & _ >> "'_new','toolbar=yes')") >> End Sub >> >> <asp:linkbutton id="lnkDetail" runat="server">Details</asp:linkbutton> >> >> Let us know if this helps? >> >> Ken >> Microsoft MVP [ASP.NET] >> Toronto >> >> "aaa" <some***@microsoft.com> wrote in message >> news:eq9UymiOFHA.3144@tk2msftngp13.phx.gbl... >> >I have never had this much trouble creating a popup can someone give me >> >a >> > heads up? Here is how I am trying to create a popup but I keep getting >> > this >> > error: >> > >> > Compiler Error Message: CS1026: ) expected >> > >> > code: >> > >> > <asp:LinkButton id="lnkDetail" runat="server" >> > > onClick="window.open(http://www.microsoft.com,_new,toolbar=yes)">Details</as >> > p:LinkButton> >> > >> > >> > > I got thanks again 4 the help!
Show quote "Ken Cox [Microsoft MVP]" <BANSPAMken_cox@sympatico.ca> wrote in message onClick="window.open(http://www.microsoft.com,_new,toolbar=yes)">Details</asnews:OPXC40pOFHA.2144@TK2MSFTNGP09.phx.gbl... > Hmmm... Not sure of what the Ultragrid does but you might need to put the > code into a template if it supports them. Perhaps try the vendor's support > site? > > "aaa" <some***@microsoft.com> wrote in message > news:%23G0zvUpOFHA.3292@TK2MSFTNGP12.phx.gbl... > > One thing though this link control exists as part of an UltraGrid control. > > There is not a design time reference to this object in the code behind > > only > > the Html how can I work with this? > > > > > > "Ken Cox [Microsoft MVP]" <BANSPAMken_cox@sympatico.ca> wrote in message > > news:uNLJ0gjOFHA.4000@TK2MSFTNGP15.phx.gbl... > >> You were missing some quotes, plus the way you were doing will cause a > >> syntax error. Here's a way to put the onclick into the control using the > >> code behind: > >> > >> Private Sub Page_Load _ > >> (ByVal sender As System.Object, _ > >> ByVal e As System.EventArgs) _ > >> Handles MyBase.Load > >> lnkDetail.Attributes.Add _ > >> ("onClick", _ > >> "window.open('http://www.microsoft.com'," & _ > >> "'_new','toolbar=yes')") > >> End Sub > >> > >> <asp:linkbutton id="lnkDetail" runat="server">Details</asp:linkbutton> > >> > >> Let us know if this helps? > >> > >> Ken > >> Microsoft MVP [ASP.NET] > >> Toronto > >> > >> "aaa" <some***@microsoft.com> wrote in message > >> news:eq9UymiOFHA.3144@tk2msftngp13.phx.gbl... > >> >I have never had this much trouble creating a popup can someone give me > >> >a > >> > heads up? Here is how I am trying to create a popup but I keep getting > >> > this > >> > error: > >> > > >> > Compiler Error Message: CS1026: ) expected > >> > > >> > code: > >> > > >> > <asp:LinkButton id="lnkDetail" runat="server" > >> > > > Show quote > >> > p:LinkButton> > >> > > >> > > >> > > > > > It could be a problem relating to nesting your quotes. My newsreader is
having a similar problem interpreting them. Try using this free code that takes care of such mundane details: http://SteveOrr.net/articles/clientsidesuite.aspx Show quote "aaa" <some***@microsoft.com> wrote in message news:eq9UymiOFHA.3144@tk2msftngp13.phx.gbl... >I have never had this much trouble creating a popup can someone give me a > heads up? Here is how I am trying to create a popup but I keep getting > this > error: > > Compiler Error Message: CS1026: ) expected > > code: > > <asp:LinkButton id="lnkDetail" runat="server" > onClick="window.open(http://www.microsoft.com,_new,toolbar=yes)">Details</as > p:LinkButton> > > OnClick is a server-side control.
You must add it programatically: Page_Load(...) { InkDetail.Attributes["onClick"] = "window.open('http://...', 'new', 'toolbar=yes')"; } Don't forget those single quotes. CHeers, Gaurav Vaish http://mastergaurav.org http://mastergaurav.blogspot.com ---------------------------- |
|||||||||||||||||||||||