ASP.NET single quotes are converted to '

后端 未结 6 1381
我在风中等你
我在风中等你 2021-01-02 02:24

Note: Most probably this will be a double question, but since I haven\'t found a clear answer, I\'m asking it anyway.

In ASP.NET I\'d like to add some JavaScript to

6条回答
  •  醉话见心
    2021-01-02 02:54

    I bumped into this recently where a control was being updated after the databind had taken place. The fix was to add the onchange javascript during the OnItemDatabound server event for the repeater involved:

    protected void rptTarifDetails_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item)
        {    TextBox proposedPrice = e.Item.FindControl("txtProposedUnitSell") as TextBox;
            proposedPrice.Attributes.Add("onchange", "CalcCommissionSingleLine(this,'None','" + ((Repeater)sender).ClientID + "', false, " + rowCount.Value + ")");
    

提交回复
热议问题