How to edit the content of the repeater control

Learning the repeater control generally operates on <itemTemplate></ itemTemplate>, generally deleting and adding are relatively easy, the more troublesome is the data processing

Modify operation. This is very nerve-racking. The following two methods are recommended for you to modify the data.

method one:

Use Ajax to refresh and modify the part of this page without jumping.

The content inside "" is the webpage you want to jump to

$.get(”",function(result){

alert(result)

});

Of course, using this method needs to be used with js.


The following is the specific implementation of the code

Edit the reapater control



Use get in Ajax to pass values.

The meaning of this sentence is to find the value you modified (you can use alert() to try to see if it is the value you want), data (defined by yourself), and pass the value to

Inside Update.ashx . ( Update.ashx is a general handler)

$.get("Update.ashx?data=" + CustomerID + "|" + LoginID + "|" + Pwd + "|" + CustomerName + "|" + IdentityID +
                    "|" + Address + "|" + Phone, function (result) {
                    alert(result);
                })




这是一个一般处理程序,以.ashx结尾,如果你想要输出response.write("内容")是输不出来的。需要context.
response.write("内容")才可以。
context.request("data"):是接收你从js里面data里面传过来的值。
str.split("|"):是根据"|"进行解析你传过来的值。当然也可以吧"|"换成",",相对应的js你穿过来的值也要把"|"换成",",
string[] list : Use an array to accept values ​​parsed according to "|".
After that, according to your judgment, the prompt will pop up such a sentence in the alert(result) in js, alert("Successful modification!")



Method Two:

Is to pass your value to another interface for modification.

window.open("");

The value in the parentheses is your jump path, you can add a value, just like the method.

例如:window.open("Update.ashx?data=" + CustomerID + "|" + LoginID + "|" + Pwd + "|" + CustomerName + "|" + IdentityID +
                    "|" + Address + "|" + Phone);

You can refer to it.



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325735252&siteId=291194637
Recommended