如何在jquery mobile中为html5元素触发服务器端事件 [英] how to fire server side events for the html5 elements in jquery mobile
本文介绍了如何在jquery mobile中为html5元素触发服务器端事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用jquery mobile开发网站。
Iam使用HTML5标签进行设计。
我需要点击按钮上的服务器端事件。
请帮助我..
Iam developing a site using jquery mobile.
Iam using HTML5 tags for the design.
I need to fire server side event on cliking on button.
Please help me..
<input type="submit" runat="server" id="btnSubmit" value="Submit" önclick="btnSubmit_Click" />
protected void btnSubmit_Click(object sender, EventArgs e)
{
try
{
string SelectedValue = drpAdditionalGuests.Value;
Response.Redirect("SampleRegistration.aspx");
}
catch (Exception ex)
{
}
}
推荐答案
你在aspx中使用html元素 - 输入 - 的问题。为此,onclick
仅是一个客户端事件...
使用ASP.NET按钮 - 为此onclick
将转换为服务器端事件。
The problem that you are using a html element - input - in your aspx. For this theonclick
is a client side event only...
Use ASP.NET button - for thisonclick
will translated into a server side event.
<asp:button runat="server" id="btnSubmit" onclick="btnSubmit_Click" xmlns:asp="#unknown" />
这篇关于如何在jquery mobile中为html5元素触发服务器端事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文