javascript函数中的问题 [英] Problem in javascript function
问题描述
大家好,
我有asp.net页面,
我有javascript功能有三个参数。
&
我从转发器调用此功能。
javascript
Hi guys,
I have asp.net page,
where i have javascript function with three parameters.
&
i'm calling this function from a repeater.
javascript
<script type="text/javascript">
function UpdateDiff(RegNo, ddlval, filedate) {
$('.Display').attr('href', 'UpdateDifferences.aspx?RegNo=' + RegNo + ' &Status=' + status + ' &filedate=' + filedate + '');
$('.Display').trigger('click');
}
</script>
来自转发器的电话
Calling from repeater
<a class="Display" href="UpdateDifferences.aspx"><asp:ImageButton ID="imgView" Visible="true" runat="server"
OnClientClick='<%# String.Format("javascript:return UpdateDiff({0},{1},{2})", Eval("RegNo") , Eval("Status") , Eval("File_Date")) %>'
ToolTip="Edit" ImageUrl="~/images/Edit.png"
Width="20" Height="20" />
</a>
当检查chrome中的'inspect element'时,它会将值传递给函数。
我将这些值作为查询字符串传递给其他页面。
但在其他页面上,我没有得到这些价值。
When checked its 'inspect element' in chrome, its passing the values to the function.
i'm passing these values as query string to other page.
but on other page, i'm not getting these values.
string URL = HttpContext.Current.Request.Url.AbsolutePath;
//System.Net.WebClient wc = new System.Net.WebClient();
string Reg = Request.QueryString["RegNo"].ToString(); // null ref except
string Sts = Request.QueryString["Status"].ToString();
string fdt = Request.QueryString["filedate"].ToString();
string data = URL + Reg + Sts + fdt;
Response.Write(data);
PageSource查看:
PageSource View:
<a class="Display" href="UpdateDifferences.aspx"><input type="image" name="ctl00$MainContent$Repeater1$ctl01$imgView" id="MainContent_Repeater1_imgView_0" title="Edit" src="images/Edit.png" onclick="javascript:return UpdateDiff(23155,Yes,11/30/2014);" style="height:20px;width:20px;" />
</a>
任何人都可以查看代码不正确的代码。
谢谢
Can any one please check the code where the code is not correct.
Thanks
推荐答案
('。Display')。attr('href','UpdateDifferences.aspx?RegNo ='+ RegNo +'& Status ='+ status +'& filedate ='+ filedate +'');
('.Display').attr('href', 'UpdateDifferences.aspx?RegNo=' + RegNo + ' &Status=' + status + ' &filedate=' + filedate + '');
('。Display')。trigger('click');
}
< / script>
('.Display').trigger('click'); } </script>
来自转发器的电话
Calling from repeater
<a class="Display" href="UpdateDifferences.aspx"><asp:ImageButton ID="imgView" Visible="true" runat="server"
OnClientClick='<%# String.Format("javascript:return UpdateDiff({0},{1},{2})", Eval("RegNo") , Eval("Status") , Eval("File_Date")) %>'
ToolTip="Edit" ImageUrl="~/images/Edit.png"
Width="20" Height="20" />
</a>
当检查chrome中的'inspect element'时,它会将值传递给函数。
我将这些值作为查询字符串传递给其他页面。
但在其他页面上,我没有得到这些价值。
When checked its 'inspect element' in chrome, its passing the values to the function.
i'm passing these values as query string to other page.
but on other page, i'm not getting these values.
string URL = HttpContext.Current.Request.Url.AbsolutePath;
//System.Net.WebClient wc = new System.Net.WebClient();
string Reg = Request.QueryString["RegNo"].ToString(); // null ref except
string Sts = Request.QueryString["Status"].ToString();
string fdt = Request.QueryString["filedate"].ToString();
string data = URL + Reg + Sts + fdt;
Response.Write(data);
PageSource查看:
PageSource View:
<a class="Display" href="UpdateDifferences.aspx"><input type="image" name="ctl00
MainContent
MainContent
这篇关于javascript函数中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!