KavyaVS
asked on
How to pass parameters to java script function from OnClient Click(from the Link button in DataGrid)
Hi,
I am trying to pass parameters to java script function from OnClient Click(from the Link button in DataGrid).It is giving me the error in the grid generation itself.The error is
Server tag is not well formed.
Please see the DataGrid source and JavaScript function.
<ASP:DATAGRID id="DGrid" runat="server" ShowFooter="False"
AutoGenerateColumns="False " BorderWidth="2" cellspacing="0" cellpadding="3" HeaderStyle-CssClass="Tabl eHeaders"
EnableViewState="True" >
<Columns>
<asp:TemplateColumn HeaderText="Number">
<ItemTemplate>
<asp:LinkButton ID="lnkNumber" runat="server" CausesValidation="false" OnClientClick="openmodaldi alog2(docu ment.getEl ementById( " + '<%#("lnkNumber.ClientID") %>' + ");" Text='<%# DataBinder.Eval(Container, "DataItem.ID") %>' readonly="True"></asp:Link Button>
</ItemTemplate>
<HeaderStyle Width="200px" />
</asp:TemplateColumn>
<ASP:BoundColumn HeaderStyle-Width="50px" HeaderText="Name" DataField="Name" readonly="True" />
<ASP:BoundColumn HeaderStyle-Width="100px" HeaderText="Address" DataField="Address""
readonly="True" />
<ASP:BoundColumn HeaderStyle-Width="100px" HeaderText="State" DataField="State"
readonly="True" />
<ASP:BoundColumn HeaderStyle-Width="100px" HeaderText="Zip" DataField="Zip"
readonly="True" />
</Columns>
</ASP:DATAGRID>
function openmodaldialog2(Num)
{
myPopUp2 = window.showModalDialog("Pa ge1.aspx", "", "dialogHeight: 350px;dialogWidth: 650px;status:no;")
return false;
}
if there is no OnClienClick() event the Grid is populating fine.
Any suggestion for passing the parameres from OnClientClick event in the DataGrid.
Thanks.
I am trying to pass parameters to java script function from OnClient Click(from the Link button in DataGrid).It is giving me the error in the grid generation itself.The error is
Server tag is not well formed.
Please see the DataGrid source and JavaScript function.
<ASP:DATAGRID id="DGrid" runat="server" ShowFooter="False"
AutoGenerateColumns="False
EnableViewState="True" >
<Columns>
<asp:TemplateColumn HeaderText="Number">
<ItemTemplate>
<asp:LinkButton ID="lnkNumber" runat="server" CausesValidation="false" OnClientClick="openmodaldi
</ItemTemplate>
<HeaderStyle Width="200px" />
</asp:TemplateColumn>
<ASP:BoundColumn HeaderStyle-Width="50px" HeaderText="Name" DataField="Name" readonly="True" />
<ASP:BoundColumn HeaderStyle-Width="100px" HeaderText="Address" DataField="Address""
readonly="True" />
<ASP:BoundColumn HeaderStyle-Width="100px" HeaderText="State" DataField="State"
readonly="True" />
<ASP:BoundColumn HeaderStyle-Width="100px" HeaderText="Zip" DataField="Zip"
readonly="True" />
</Columns>
</ASP:DATAGRID>
function openmodaldialog2(Num)
{
myPopUp2 = window.showModalDialog("Pa
return false;
}
if there is no OnClienClick() event the Grid is populating fine.
Any suggestion for passing the parameres from OnClientClick event in the DataGrid.
Thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER