I Have populated the DropDownList with the roles from the AspNetRoles, when I am registering a new user and allocating a role an error is thown
"There is no ViewData item of type 'IEnumerable<SelectListItem>' that has the key 'Name'."
My AccountController :
...Hello, I am using Visual Studio and I was constantly adding "/bin/projectname.dll" files on GitHub until now, but now I want to ignore these .dll files. So How can I ignore these build files and push only files like .cs, .html,.js ,.css etc to GitHub Repository.
...How can I delete (remove) single record from database table using entity framework in asp.net MVC Controller?
please note I want to delete row of selected Id from the database permanently(Not to make a column
IsActive
and set it as false
)
Hi, I want to test if I can post from my app under facebook developer to my page facebook (my manager page) please look below image.
But I have got this error message as shown below
...I need help to calculate resulted amount after applying coupon code, the thing is when user enter the coupon code, it can be of two type 0/1, suppose this is the table
Voucher Code |
Amount |
Off_type |
Test |
50 |
0 |
Demo |
10 |
1 |
Now if the Off_type is 1, then Amount to be deducted should be as rupees, and if Off_type 0, then amount to be deducted should be percent of total.
For example: If total amount(without discount) is 100, and Coupon code is "Demo", then after discount total amount to be paid will be 90, as 100 - 10% Of (Total) =90
So I am not able to implement this functionality using jQuery and WebMethod, here is my current code
jQuery
...Hello Guys !!
I have already asked the same question but now I am again asking with the new requirement, so please read carefully and solve my issues.
My Requirement:
Explaining my Requirement
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="N-level-Treeview.aspx.cs"
Inherits="N_level_Treeview" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TreeView ID="TreeView1" runat="server" ImageSet="XPFileExplorer" NodeIndent="15">
<HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />
<NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black" HorizontalPadding="2px"
NodeSpacing="0px" VerticalPadding="2px"></NodeStyle>
<ParentNodeStyle Font-Bold="False" />
<SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False" HorizontalPadding="0px"
VerticalPadding="0px" />
</asp:TreeView>
</div>
</form>
</body>
</html>?
: - I have a table and there are Srno,PId, Pname, CID, CName,Cqty columns in my table.
Suppose if CID is also in PID column, Node must be created on that CID and also must have expand button to show the child of that cID.
What i have done in coding let's see...
CS--------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class N_level_Treeview : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = this.GetData("SELECT cId, cName FROM TopBill");
this.PopulateTreeView(dt, 0, null);
}
}
private void PopulateTreeView(DataTable dtParent, int parentId, TreeNode treeNode)
{
foreach (DataRow row in dtParent.Rows)
{
TreeNode child = new TreeNode
{
Text = row["cName"].ToString(),
Value = row["cId"].ToString()
};
if (parentId == 0)
{
TreeView1.Nodes.Add(child);
DataTable dtChild = this.GetData("SELECT srNo,cid, cName FROM TopBill WHERE pid = " + child.Value);
PopulateTreeView(dtChild, int.Parse(child.Value), child);
}
else
{
treeNode.ChildNodes.Add(child);
}
}
}
private DataTable GetData(string query)
{
DataTable dt = new DataTable();
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand(query))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
sda.SelectCommand = cmd;
sda.Fill(dt);
}
}
return dt;
}
}
}
-------------- Current Output of my Code is ...
...