How to add a Second Parameter
-
How to add a Second Parameter
<%# Eval("Patameter1","return showComment(""{0}"")") %>
please note that the "showComment" is a Jquery function Thanks
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@dotnetfunda.com http://www.Dotnetfunda.com
-
How to add a Second Parameter
<%# Eval("Patameter1","return showComment(""{0}"")") %>
please note that the "showComment" is a Jquery function Thanks
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@dotnetfunda.com http://www.Dotnetfunda.com
You can using String.Format directly in the binding:
<%# String.Format("return showComment(""{0}"",""{1}"")", "Patameter1", "Parameter2") %>
-
You can using String.Format directly in the binding:
<%# String.Format("return showComment(""{0}"",""{1}"")", "Patameter1", "Parameter2") %>
hi Mat here is my code with your advice
<asp:ImageButton ID="btnComment" runat="server"
ImageUrl="~/Imgs/comment2.png"
OnClientClick= '<%# String.Format("return showComment(""{0}"",""{1}"")", "Parameter1", ""Parameter2") %>'
ToolTip="Click here to view a Comment" Visible='<%# CheckPendStatus() %>' />and it gives an Error
Error 149 Comma, ')', or a valid expression continuation expected.
Error 219 Comma, ')', or a valid expression continuation expected.Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@dotnetfunda.com http://www.Dotnetfunda.com
-
hi Mat here is my code with your advice
<asp:ImageButton ID="btnComment" runat="server"
ImageUrl="~/Imgs/comment2.png"
OnClientClick= '<%# String.Format("return showComment(""{0}"",""{1}"")", "Parameter1", ""Parameter2") %>'
ToolTip="Click here to view a Comment" Visible='<%# CheckPendStatus() %>' />and it gives an Error
Error 149 Comma, ')', or a valid expression continuation expected.
Error 219 Comma, ')', or a valid expression continuation expected.Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@dotnetfunda.com http://www.Dotnetfunda.com
You have a second quote before Parameter2.
-
You have a second quote before Parameter2.
hi Matt thanks for pointing that out it now looks like this
'<%# String.Format("return showComment(""{0}"",""{1}"")", "PARAMETER1", "PARAMETER2") %>'
when i run it it does not take the values but it give me the names of the variable, can i use Eval like this
'<%# String.Format("return showComment(""{0}"",""{1}"")", Eval("PARAMETER1"), Eval("PARAMETER2") %>'
THanks
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@dotnetfunda.com http://www.Dotnetfunda.com
-
hi Matt thanks for pointing that out it now looks like this
'<%# String.Format("return showComment(""{0}"",""{1}"")", "PARAMETER1", "PARAMETER2") %>'
when i run it it does not take the values but it give me the names of the variable, can i use Eval like this
'<%# String.Format("return showComment(""{0}"",""{1}"")", Eval("PARAMETER1"), Eval("PARAMETER2") %>'
THanks
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@dotnetfunda.com http://www.Dotnetfunda.com
I used string literals in my example. If you want the variables themselves (and they're at least protected), you can do this:
<%# String.Format("return showComment(""{0}"",""{1}"")", Parameter1, Parameter2) %>
where Parameter1 and Parameter2 are variable names in the page object.
-
I used string literals in my example. If you want the variables themselves (and they're at least protected), you can do this:
<%# String.Format("return showComment(""{0}"",""{1}"")", Parameter1, Parameter2) %>
where Parameter1 and Parameter2 are variable names in the page object.
Thank you very much for you help , i have ended up using it this way and it works
'<%# String.Format("return showComment(""{0}"",""{1}"")", Eval("Parameter1"), Eval("Parameter2")) %>'
Thanks you a Star
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@dotnetfunda.com http://www.Dotnetfunda.com
-
You have a second quote before Parameter2.
Thanks. Your code solved my problem