Home All Groups Group Topic Archive Search About

) expected erro when trying to create a popup

Author
5 Apr 2005 9:51 PM
aaa
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>

Author
5 Apr 2005 11:35 PM
Ken Cox [Microsoft MVP]
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>
>
>
Author
6 Apr 2005 10:29 AM
aaa
thanx

Show quote
"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
Show quote
> > p:LinkButton>
> >
> >
>
Author
6 Apr 2005 10:41 AM
aaa
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
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
Show quote
> > p:LinkButton>
> >
> >
>
Author
6 Apr 2005 11:39 AM
Ken Cox [Microsoft MVP]
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>
>> >
>> >
>>
>
>
Author
6 Apr 2005 12:17 PM
aaa
I got thanks again 4 the help!

Show quote
"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@sympatico.ca> wrote in message
news: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"
> >> >
> >
onClick="window.open(http://www.microsoft.com,_new,toolbar=yes)">Details</as
Show quote
> >> > p:LinkButton>
> >> >
> >> >
> >>
> >
> >
>
Author
5 Apr 2005 11:36 PM
Steve C. Orr [MVP, MCSD]
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

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net



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>
>
>
Author
6 Apr 2005 9:38 AM
MasterGaurav
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
----------------------------

AddThis Social Bookmark Button