HLRosenberger
asked on
Passing a parm to onClientClick
See code below. The asp code works. As does the VB.NET in the code behind.
What I want to do is in the asp code pass the PrimaryKey.Text as a parm, instead of where the 4 is. Syntax-wise, I cannot get this to work.
VB.NET CODE:
ShowButton1.Attributes.Add ("onClick" , "ShowRecord('" & PrimaryKey.Text & "');")
ASP.NET CODE
<asp:ImageButton runat="server" id="ShowButton1" causesvalidation="False" commandname="Redirect" cssclass="button_link" imageurl="../Images/icon_v iew.gif" tooltip="Show Funding Request"
onclientclick="return ShowRecord(4);">
</asp:ImageButton>
What I want to do is in the asp code pass the PrimaryKey.Text as a parm, instead of where the 4 is. Syntax-wise, I cannot get this to work.
VB.NET CODE:
ShowButton1.Attributes.Add
ASP.NET CODE
<asp:ImageButton runat="server" id="ShowButton1" causesvalidation="False" commandname="Redirect" cssclass="button_link" imageurl="../Images/icon_v
onclientclick="return ShowRecord(4);">
</asp:ImageButton>
ASKER
I can get to it work in VB code. What I cant get to work is the aspx code. How do this change this, and replace the 4 with 'PrimaryKey.text' ?
<asp:ImageButton runat="server" id="ShowButton1" causesvalidation="False" commandname="Redirect" cssclass="button_link" imageurl="../Images/icon_v iew.gif" tooltip="Show Funding Request"
onclientclick="return ShowRecord(4);">
</asp:ImageButton>
<asp:ImageButton runat="server" id="ShowButton1" causesvalidation="False" commandname="Redirect" cssclass="button_link" imageurl="../Images/icon_v
onclientclick="return ShowRecord(4);">
</asp:ImageButton>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
CodeCruiser:
My PrimaryKey is a textbox control within a repeater control. Will your suggestion with in this case?
My PrimaryKey is a textbox control within a repeater control. Will your suggestion with in this case?
ASKER
thanks
ShowButton1.Attributes.Add