C# IFrame:页面在IFrame src上回发或刷新

C# IFrame:页面在IFrame src上回发或刷新,c#,javascript,jquery,asp.net,iframe,C#,Javascript,Jquery,Asp.net,Iframe,我是asp.net新手。我正在调用Iframe src throw table row javscripct click事件。(即onclick=“return loadPhaseWiseChart(“DGSET00025”);”) 我的代码:- <tr height="25" id="row3" onclick="return loadPhaseWiseChart("DGSET00025");" bgColor="#e1f2fe"> <td> <tr> 当

我是asp.net新手。我正在调用Iframe src throw table row javscripct click事件。(即onclick=“return loadPhaseWiseChart(“DGSET00025”);”)

我的代码:-

<tr height="25" id="row3" onclick="return loadPhaseWiseChart("DGSET00025");" bgColor="#e1f2fe">
<td>
<tr>
当我单击行时,我的页面正在恢复或刷新。我希望避免页面刷新或返回到行单击事件。
我怎么能做到这一点。任何帮助都将不胜感激。

您的单击应如下所示:

<tr height="25" id="row3" onclick="loadPhaseWiseChart('DGSET00025');" bgColor="#e1f2fe">
<tr height="25" id="row3" data-chart="DGSET00025" bgColor="#e1f2fe">
$('#row3').on('click', loadPhaseWiseChart);
document.getElementById('<%= IframeChart1.ClientID %>')
这会将“loadPhaseWiseChart”更改为:

function loadPhaseWiseChart() {
  document.getElementById('IframeChart1').src = "PhaseOneChart.aspx?assetdiscription=" + $(this).data('chart');
}
最后,为了确保您不会被这个问题所困扰,ASP.net会通过添加“runat=“server”来更改HTML元素的ID,因此如果您的iframe的ID为“IframeChart1”且具有“runat”属性,则ASP会将其转换为类似“iframe\u 01\u h1”的内容。您可以使用以下ASP代码获得此值:

<tr height="25" id="row3" onclick="loadPhaseWiseChart('DGSET00025');" bgColor="#e1f2fe">
<tr height="25" id="row3" data-chart="DGSET00025" bgColor="#e1f2fe">
$('#row3').on('click', loadPhaseWiseChart);
document.getElementById('<%= IframeChart1.ClientID %>')
document.getElementById(“”)