开发者

Why an input button created dynamically through a literal tag doesn't work?

I have created button 2 below:

<input id="Button1" type="button" value="Stop" 

    onclick="alert('hello world');"/> 

<input id="Button2" type="button" value="button" OnClik="alert('hello world');"/> 

using a litteral tag on page load like this:

protected void Page_Load(object sender, EventArgs e)
{

    Literal1.Text = "<input id=\"Button2\" type=\"button\" value=\"button\" OnClik=\"al开发者_如何学JAVAert('hello world');\"/>";

}

Incredibly when testing in browser, click on button 1 works, not click on button 2 whereas the codes are the same !

Am I missing something ?


You misspelled onclick for the second button

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜