1246 1
Implementing Forgot password functionality in ASP.NET MVC (Reset password by Email)
In this article, I have explained how we can implement forgot password functionality by sending reset password link by email in ASP.NET MVC.
Type
Article
ASP.NET ASP.NET MVC Implementing Forgot password in MVC
1210 1
Error "Entity Framework: Store update, insert, or delete statement affected an unexpected number of rows (0)"

Hello, I am using Entity framework in my asp.net MVC project, when I try to delete any row using Entity framework, I am getting following error

...
Type
Question
ASP.NET MVC Store update insert or delete statement affected an unexpected C# Entity-framework
1205 1
ViewBag data from controller is not visible in Partial View

I am passing Select List from ViewBag in controller to partial View, like I used to do , but it is not showing SelectList on partial View when code is pushed on server, while it works when running code locally, here is the code

Controller

...
Type
Question
C# asp.net-mvc razor mvc-partial-view ViewBag
1204 1
Getting error "Method arguments are not valid! See validationErrors for details " when posting ajax beginform in mvc

When I am trying to post regular Ajax.BeginForm in my asp.net MVC project (asp.net zero boilerplate project), I am getting this error

Method arguments are not valid! See ValidationErrors for details

Here is the image of the error

...

Type
Question
MVC C# asp.net zero boilerplate
1202 2
How to create shopping cart in asp.net MVC?

I have to create shopping cart in Asp.net MVC ,i don't know from where I should start

As i am a beginner, I saw various Youtube videos online but i am not able understand coding in those videos, so Please give me some other appropriate recommendation or advise??? 

Thanks

...
Type
Question
asp.net razor shopping-cart

1201 2
Error implementing Paging in MVC C#

I am trying to add Pagination in ASP.NET MVC using this link(https://qawithexperts.com/article/asp.net/paging-sorting-and-filtering-in-aspnet-mvc-c/31)

...
Type
Question
mvc Razor IPagedList
1193 1
No assembly found containing an OwinStartupAttribute. error in asp.net mvc project

Hi, I have just created a project using Visual Studio 2015 & selected MVC template, but When I tried to build the project and executed it in the browser, I got the error as below

The following errors occurred while attempting to load the app.
- No assembly found containing an OwinStartupAttribute.
- No assembly found containing a Startup or [AssemblyName].Startup class.
To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config.
To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config.

Here is the Image of the error

...

Type
Question
C# asp.net mvc owin
1176 2
Populating DropDownList with values showing error There is no ViewData item of type IEnumerable SelectListItem that has the key Name

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 :

...
Type
Question
MVC C# SQL
1151 1
Clicking on browser back button after login shows login page again??

How can I maintain the session of the user in ASP.NET MVC? Here is the login case for the user. (Only authenticated users are allowed to login in the system.) But once the user gets logged in and press the back button then the user needs to login again. I want to solve this issue. Can anyone have idea about it?

...
Type
Question
ASP.NET MVC C# session-management
1149 1
How to create N Level Of TreeView from database in asp.net

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:

  •    How to create n level of Treeview in asp.net c# from SQL Database Record.

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 ...

...

Type
Question
Treeview C# Asp.Net SQL

Page 10 of 24