我需要你的帮助!我被困在这里。我有一个webform,其中有一个下拉列表和一个按钮。但是onClick函数没有触发。我用调试和断点测试它。
我尝试过的事情:
这是我的WebForm代码:
<%@ Page Title="" Language="C#" MasterPageFile="~/CTOAdmin.Master" AutoEventWireup="true" CodeBehind="AddCityArea.aspx.cs" ClientIDMode="Static" Inherits="E_Challan.AddCityArea" %><asp:Content ID="Content1" ContentPlaceHolderID="inner_content" runat="server">
<div class="md-card">
<div class="md-card-content">
<div class="uk-grid" data-uk-grid-margin>
<div class="uk-width-medium-1-2">
<div id="form_validation" class="uk-form-stacked">
<center><h2>Add City Area</h2>
<div class="uk-form-row">
<label for="fullname">Select City<span class="req">*</span></label>
<asp:DropDownList runat="server" id="val_select" data-md-selectize>
<asp:ListItem value="">Choose..</asp:ListItem>
<asp:ListItem value="press">Press</asp:ListItem>
<asp:ListItem value="net">Internet</asp:ListItem>
<asp:ListItem value="mouth">Word of mouth</asp:ListItem>
<asp:ListItem value="other">Other..</asp:ListItem>
</asp:DropDownList>
</div>
<div class="uk-form-row">
<label for="fullname">City Name<span class="req">*</span></label>
<asp:TextBox runat="server" id="txtsearch" ClientIDMode="Static" type="text" name="fullname" class="md-input" /><br /><br /><br />
<br />
<div id="mymap" style="width:auto;height:400px" ></div>
</div>
<div class="uk-form-row">
<asp:Button runat="server" ID="btnAdd" class="md-btn md-btn-primary" Text="Add Area" OnClick="btnAdd_Click"></asp:Button>
</div></center>
</div>
</div>++
</div>
</div>
</div>
<script src="http://maps.google.com/maps/api/js?sensor=true&v=3.exp&libraries=places"></script>
<script src="maps.js"></script>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace E_Challan
{
public partial class AddCityArea : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnAdd_Click(object sender, EventArgs e)
{
Label1.Text = txtsearch.Text.toString();
}
}
}
我有另一个具有相同母版页的网络表单。在该webform上我的按钮点击功能正在激活。但是在那个webform中我的onclick函数没有触发。