c# - Show the Button in asp.net whenever the query execution occurs -


i using asp.net c# , aspx code shown below

<html xmlns="http://www.w3.org/1999/xhtml"> <body>  <asp:panel id="panel1" runat="server"> <table><tr><td><asp:label id="label2" runat="server" font-bold="true"          font-underline="true"></asp:label></td></tr>   <tr> <td>    <asp:button id="btnsubmit" runat="server" text="submit" backcolor="#993300"         forecolor="white" onclick="btnsubmit_click" /></td> <td>     <asp:button id="btnlogout" runat="server" text="logout" backcolor="#993300"         forecolor="white" onclick="btnlogout_click"  /> </td> </tr> </table> 

now c# code

cmd.commandtext = "update trackingfaculty_det set type=@type (fid=@fid) , datediff(d,trackingfaculty_det.lastupdatedate,getdate())>60"; 

which present in submit button,i need display submit button whenever above query true , executed or else dont need show submit button

 protected void btnsubmit_click(object sender, eventargs e) {     string type = "c";     string fid = session["fid"].tostring();     sqlconnection cn = new sqlconnection();     sqlcommand cmd = new sqlcommand();     //int str_diff = convert.toint32(configurationmanager.appsettings["difference"]);     cn.connectionstring = @"data source=bopserver;initial catalog=project;integrated security=true";     cn.open();     cmd.commandtext = *"update trackingfaculty_det set type=@type (fid=@fid) , datediff(d,trackingfaculty_det.lastupdatedate,getdate())>60*";     cmd.connection = cn;     cmd.parameters.add("@fid",sqldbtype.varchar,10);     cmd.parameters["@fid"].value = fid;     cmd.parameters.add("@type", sqldbtype.varchar, 1);     cmd.parameters["@type"].value = type;     cmd.executenonquery();     cn.close();      response.redirect("~/faculty/personaldet.aspx"); } protected void btnlogout_click(object sender, eventargs e) {     response.redirect(@"~\home.aspx"); } 

image should display if update trackingfaculty_det set type=@type (fid=@fid) , datediff(d,trackingfaculty_det.lastupdatedate,getdate())>60" executed

put submit button process on form load event add condition if true hide/disable btnsubmit


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -