English 中文(简体)
A. 用javascript with Asp.Net做一个子点点点,并使用 process。
原标题:Making a button click and process using javascript with Asp.Net

I m having two buttons and one button is hidden. Now when I click the visible button I need to do two things

1.Open Iframe。

2. 象征性地把第2次布顿(黑色)点击。

当第二个纽克被点击时,我需要在我作为<条码>提到的“IFrame”顶上显示信息。

现在,我得以开放了Francorame,但我无法自动点击Hiddenhton。

这是我说的:

      <script type="text/javascript">
       $(document).ready(function(){
        $("#<%=Button1.ClientID%>").click(function(event){
            $( #<%=TextBox1.ClientID%> ).change(function () {
                $( #various3 ).attr( href , $(this).val());
            });
    });
       function showStickySuccessToast() {
        $().toastmessage( showToast , {
            text:  Finished Processing! ,
            sticky: false,
            position:  middle-center ,
            type:  success ,
            closeText:   ,
            close: function () {

            }
        });
    }
    }) 
    </script>

我的两个纽州是:

<a id="various3" href="#"><asp:Button ID="Button1" 
runat="server" Text="Button" OnClientClick="Button2_Click"/></a>

<asp:Button ID="Button2" 
runat="server" Text="Button" Visible="False" OnClick="Button2_Click"/>

在纽特2-Click活动中:

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
       System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "Script", "showStickySuccessToast();", True)
    End Sub
最佳回答

在你第一次(看得见)纽芬兰的点击事件中,

$("#<%=Button1.ClientID%>").click(function(event){
       $( #<%=TextBox1.ClientID%> ).change(function () {
             $( #various3 ).attr( href , $(this).val()); 
       });
       $("#<%=Button2.ClientID%>").click();
});
问题回答
  <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script> 
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Text="Button" />
           <script type="text/javascript">
               $( #Button1 ).click(function () {
                   if ($( #TextBox1 ).val() ==   ) {
                       alert("Error")
                       $( #TextBox1 ).focus();
                       return false;
                   }
               });
</script>
    </div>    
    </form>
</body>
</html>




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签