15,911,496 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by cityindicator.com (Top 3 by date)
cityindicator.com
27-Feb-16 11:14am
View
Deleted
View Part :
<div style=" margin-top:15px" class="col-md-8">
<div class="col-md-4"><span style=" color:black">Class</span></div>
<div class="col-md-4">
@Html.DropDownListFor(m => m.classlistid, Model.classlistvalue, "<--select-->", new { @class = "textbox" })
</div>
</div>
Modal :
[Required(ErrorMessage = "Please Enter Class")]
[Display(Name = "Enter Class")]
public string classlistid { get; set; }
public List<SelectListItem> classlistvalue
{
get;
set;
}
ControllerPart :
public ActionResult AddStudent(studentmodel MB,FormCollection formCollection) // Calling on http post (on Submit)
{
MB.classlistid = formCollection["classlistid"];
if (ModelState.IsValid)
{
DataLayer.student objDB = new DataLayer.student(); //calling class Dbdata
string result = objDB.AddStudent(MB); // passing Value to DBClass from model
ViewData["result"] = result; // for dislaying message after saving storing output.
ModelState.Clear(); //clearing model
return View();
}
else
{
ModelState.AddModelError("", "Error in saving data");
return View();
}
}
Code Part :
md.Parameters.AddWithValue("@phone", MD.phone);
cmd.Parameters.AddWithValue("@studaderess", MD.address);
cmd.Parameters.AddWithValue("@class", MD.classlistid);
cmd.Parameters.AddWithValue("@section", MD.section);
cmd.Parameters.AddWithValue("@rollno", MD.rollno);
cityindicator.com
26-Feb-16 8:39am
View
Hello ,
Thanks for reply,
but i got same error "An exception of type 'System.NullReferenceException' occurred in App_Web_o33c4lci.dll but was not handled in user code
Additional information: Object reference not set to an instance of an object."
cityindicator.com
31-Jul-15 11:45am
View
Hello Sir,
Your Code is Working f999 but there is little problem,actually i want to show preview on same imagebutton after selecting image...