5
Answers

how to not display button on page load time in asp.net .

Photo of Anjali Khan

Anjali Khan

7y
170
1
Hi frnds
how to none display button on page load time in asp.net .
i have a page treeview with submit button.
here i want when page will load that time button should not be dispaly and once i select on tree view that time button should be enable
i am sharing my code
<div id="CheckBoxList1">
<asp:Label ID="lbl" runat="server" Text="Department to send "></asp:Label>
<br />
<asp:TreeView ID="TreeView1" runat="server" ShowCheckBoxes="All"></asp:TreeView>
</div>
<asp:Button ID="btnSubmit" runat="server" Text="Send" CssClass="btn btn-primary" ToolTip="Click To Send"/>

Answers (5)

3
Photo of Gaurav Raut
NA 171 2 7y
function Show() {
var data = $('#CNform').serialize();
console.log(data);
$.ajax({
type: 'POST',
cache: false,
url: '/CN/Show',
data: data,
success: function (data, textStatus, jqXHR) {
},
error: function (jqXHR, textStatus, errorThrown) {
}
});
}
 
 
And change the type of parameter
//Controller
[HttpPost]
[AcceptVerbs(HttpVerbs.Post)]
public string Show(CNModel modelParameter)
{
// Code
}
Accepted
1
Photo of Faizan Syed
NA 16 1 7y
Thanks @Gaurav Raut
1
Photo of Pravin Ghadge
NA 2.5k 358.5k 7y
Thanx a lot Gaurav.
 
Issue has been resolved .
 
Also one thing i have modified in the cshtml file is:
 
  1. @using (Html.BeginForm(nullnullnew { @id = string.Empty }, FormMethod.Post,  
  2. new { @id = "CNform" })