本文介绍了如何同时运行jquery和代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我在数据库中提交后写了成功消息的代码。但后面的代码不起作用,jquery正在工作。 这是我的代码。 $( document )。ready( function (){ $( #ContentPlaceHolder1_btnsubmit)。live( 点击, function (){ $( #dialog)。dialog({ autoOpen: false , hide: puff, title: 消息,按钮:{关闭: function (){ $( this )。dialog(' close'); var url = ' ../查看/Home.aspx'; $( location )。attr(' href',url); } },模态: true }); return false ; }); }); protected void btnsubmit_Click(object sender,EventArgs e) { RegisterObject robj = new RegisterObject(); robj.fname = txtfname.Text; robj.lname = txtlname.Text; robj.dob = txtdob.Text; robj.email = txtemail.Text; robj.role = ddlrole.Text; robj.user_id = txtuserid.Text; string strpassword = Encryptdata(txtpwd.Text); robj.password = strpassword; RegisterLogic RL = new RegisterLogic(robj); } 解决方案 ( document )。ready( function (){ ( #ContentPlaceHolder1_btnsubmit)。live( click, function (){ ( #dialog)。dialog({ autoOpen: false , hide: puff, title: 消息,按钮:{关闭:功能(){ I have written the code for success message after submitting in database.But the code behind is not working and jquery is working.Here is my code.$(document).ready(function () {$("#ContentPlaceHolder1_btnsubmit").live("click", function () {$("#dialog").dialog({autoOpen: false,hide: "puff",title: "Message",buttons: {Close: function () {$(this).dialog('close');var url = '../View/Home.aspx';$(location).attr('href', url);}},modal: true});return false;});});protected void btnsubmit_Click(object sender, EventArgs e) { RegisterObject robj = new RegisterObject(); robj.fname = txtfname.Text; robj.lname = txtlname.Text; robj.dob = txtdob.Text; robj.email = txtemail.Text; robj.role = ddlrole.Text; robj.user_id = txtuserid.Text; string strpassword = Encryptdata(txtpwd.Text); robj.password = strpassword; RegisterLogic RL = new RegisterLogic(robj); } 解决方案 (document).ready(function () {("#ContentPlaceHolder1_btnsubmit").live("click", function () {("#dialog").dialog({autoOpen: false,hide: "puff",title: "Message",buttons: {Close: function () { 这篇关于如何同时运行jquery和代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-03 17:04