从HTML页面源将按钮回发到回发和事件处理中 [英] Button postback from html page source into the postback and event processing

查看:69
本文介绍了从HTML页面源将按钮回发到回发和事件处理中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,最近有一个面试问题问我,那就是我是否具有服务器控件,如< asp:button id ="button1" runat ="server" Text ="Insert" OnClick ="button1_Click"/>在网页中,在运行时,如果我右键单击该页面并在mozilla firefox浏览器中查看该页面的页面源,则在页面源中,按钮控件源以html格式显示,例如< input type ="submit" name ="Button1" value =提交" id ="Button1"/>在这里它没有onclick属性,那么当我单击按钮时,事件是如何触发的,页面是回发的,以及html页面源如何执行按钮的click事件,即使它没有runat =页面源中的服务器"和onclick属性.如果有人知道答案,请帮助我

Hi, recently one interview question asked to me, that is if i have the server control like <asp:button id="button1" runat="server" Text="Insert" OnClick="button1_Click"/> in the web page, during the runtime if i right click on the page and view the page source of the page in mozilla firefox browser, in the page source the button control source display in the html format like <input type="submit" name="Button1" value="Submit" id="Button1" /> here it doesn''t have the onclick property, then how the event is fired when i click the button, and page is postback, and how the html page source is performing the button click event, even it doesn''t have runat="server" and also onclick property in the page source. if anyone knows answer for it please help me

推荐答案

页面将在单击后通过Post方法提交,并且页面视图状态将在服务器端使用来调用事件
Page will be submited on click with Post method and page view state will be used at server end to call event


这篇关于从HTML页面源将按钮回发到回发和事件处理中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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