c# - Disabling AutoPostback on gridview asp:hyperlinkfield? -


i trying execute javascript on click of asp gridview's hyperlinkfield. javascript executes fine page posts when iframe flickers before showing (the javascript sets iframe's source , display none block.). how can go disabling autopostback on control since not have such attribute?

<columns> <asp:hyperlinkfield text="update"                     navigateurl="javascript:showform('frmaddaudits.aspx');"                     headertext="update"                     target="_blank"/> <asp:hyperlinkfield text="add findings"                     navigateurl="javascript:showform('frmauditfindings.aspx');"                     headertext="add findings"                     target="_blank" /> </columns> 

css

.showme{display:block;}  .hideme{display:none;} 

javascript

function showform(urltogoto){ document.getelementbyid('myiframe').src = urltogoto; document.getelementbyid('myiframe').classname = "showme"; } 

try using templatefiled , anchor tag :

<columns>     <asp:templatefield>         <itemtemplate>               <a href="#" onclick="javascript:showform('frmaddaudits.aspx');return false;">         </itemtemplate>     </asp:templatefield>     

if want can set runat="server" , give id


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -