访问动态创建的html单选按钮 [英] access to html radio button that created dynamically

查看:85
本文介绍了访问动态创建的html单选按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

专家
我有一个gridview,在它的每一行中,我动态创建了几个html单选按钮,我如何访问在click_button中以动态方式创建它们的动态html单选按钮,当用户单击提交"时,单击如何我可以理解作者"的复选框就被选中了?

hi experts
i have a gridview that in every row of it i create several html radio button dynamically,how i can access to dynamic html radio button that i created them dinamically in click_button,when user clicked on submit click how i can understand wiche one them is checked?

protected void grdData_RowDataBound(object sender, GridViewRowEventArgs e)
    {

            var drvData = (DAL.CompetitionQuestion)e.Row.DataItem;

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                var strLiteral = Template;
                var strOption = "";
                strLiteral = strLiteral.Replace("[Question]", drvData.QuestionBody);

                var query = BLL.Competitions.GetOptionByQuestionID(drvData.QuestionID);
                foreach (var item in query)
                {
                    strOption = strOption + string.Format("<input type=\"radio\" name=\"{0}\" value=\"{1}\"> {1}<br/>",item.QuestionID,item.OptionBody);
                }

                strLiteral = strLiteral.Replace("[Option]",strOption);
                e.Row.Cells[0].Text = strLiteral;
            }

    }



和我的求婚点击



and its my sumit click

protected void btnVote_Click(object sender, EventArgs e)
    {
what i must write here for access to html radio button
}


在此先感谢


thanks in advance

推荐答案

访问html单选按钮我必须在这里写些什么
您不能在此处写任何内容来访问它们.您创建了HTML控件而不是服务器控件.无法在服务器端代码库上访问HTML控件.
what i must write here for access to html radio button
You cannot write anything here to access them. You made a HTML control and not server control. HTML controls cannot be accessed on server side codebase.


这篇关于访问动态创建的html单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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