模板字段的问题 [英] Issues with template field

查看:68
本文介绍了模板字段的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网格视图中有一些模板字段(文本框)。填写字段中的数据后,当我单击提交按钮时,数据将消失。任何人都可以帮我解决这个问题吗?



谢谢

S.Rajagopal

I have a few template fields (text boxes) in Grid View. After filling in data in the fields, when I click 'Submit' Button, the data disappears. Can any one kindly help me to resolve this?

Thanks
S.Rajagopal

推荐答案

检查你的Page_Load方法:我打赌你清除那里的字段。

Page_Load被调用所有页面活动,包括按钮点击引起的回发,所以除非你检查一下回复后,它们将在点击事件处理程序运行之前被清除。

Check your Page_Load method: I'm betting you clear the fields there.
Page_Load is called fro all page activities, including the postbacks caused by button clicks, so unless you check for a post back they will be cleared before the click event handler gets to run.
protected void Page_Load(object sender, EventArgs e)
    {
    if (!IsPostBack)
        {
        // Handle the initial page setup.


manage

ispostback on page load

and bind data on every submit


这篇关于模板字段的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆