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
Post a Comment