如果用户单击下面的href,则会运行jquery中编写的复杂函数。有什么办法可以在asp窗体后面的代码中模拟这个点击吗?换句话说,我需要点击" href名为" shipping_question_ID_product_received_as_ordered_link"从我的代码背后预先填充此输入。有人可以帮忙吗?
<div class="no"><label class="label-1" for="shipping_question_ID_product_received_as_ordered_not_acceptable">Not Acceptable</label></div>
<a href="#" class="toggle" runat="server" id="shipping_question_ID_product_received_as_ordered_link"></a>
<div class="yes"><label class="label-2" for="shipping_question_ID_product_received_as_ordered_acceptable">Acceptable</label></div>
<label class="universal-label"></label>
<input type="radio" id="shipping_question_ID_product_received_as_ordered_not_acceptable" name="shipping-question-ID-product-received-as-ordered" value="Not Acceptable" runat="server">
<input type="radio" id="shipping_question_ID_product_received_as_ordered_acceptable" name="shipping-question-ID-product-received-as-ordered" value="Acceptable" checked="true" runat="server">
答案 0 :(得分:2)
答案 1 :(得分:0)
您可以使用以下内容。
string jScript;
jScript="<script>$('#linkid').click()</script>";
Page.RegisterClientScriptBlock("keyClientBlock",jScript);
所以这将以编程方式向aspx添加一个JS代码块,这个JS将执行以单击一个href(具有id =&#34; linkid&#34;