Click here to Skip to main content
15,890,123 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: hi experts..i'm using dropdownlist statically for gender field its not show me proper data when im update Pin
John C Rayan18-May-16 1:12
professionalJohn C Rayan18-May-16 1:12 
QuestionCalendar Pin
Member 125105918-May-16 15:09
Member 125105918-May-16 15:09 
AnswerRe: Calendar Pin
John C Rayan12-May-16 1:59
professionalJohn C Rayan12-May-16 1:59 
QuestionHow to block bad users Pin
Vimalsoft(Pty) Ltd7-May-16 23:37
professionalVimalsoft(Pty) Ltd7-May-16 23:37 
GeneralRe: How to block bad users Pin
Kornfeld Eliyahu Peter8-May-16 1:43
professionalKornfeld Eliyahu Peter8-May-16 1:43 
AnswerRe: How to block bad users Pin
John C Rayan12-May-16 2:09
professionalJohn C Rayan12-May-16 2:09 
QuestionPassing a std::list using gSOAP Pin
GazMiller19794-May-16 21:39
GazMiller19794-May-16 21:39 
Questionhi experts imgetting the error index out of rang pls help to solve Pin
sunil34-May-16 21:04
sunil34-May-16 21:04 
Error Is: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

controller code:
public ActionResult Edit(int id = 0)
{
Student1 student1 = new Student1();
StudentCRUD stud = new StudentCRUD();
    var st = stud.SelectById(id);
   // if (st == null)
   // {
   //     return HttpNotFound();
   // }
    if (st != null)
    {
        student1.First_Name = st.First_Name;
        student1.Middle_Name = st.Middle_Name;
        student1.Last_Name = st.Last_Name;
        student1.Contact_No = st.Contact_No;
        student1.Email_ID = st.Email_ID;
        student1.Temp_Address = st.temp_Address;
        student1.Permanant_Address = st.permanant_address;
        student1.CountryName = st.CountryName;
        student1.StateName = st.StateName;
        student1.CityName = st.CityName;
    }

    ViewBag.CityID = new SelectList(db.Cities, "CityID", "CityName", student1.CityID);
    ViewBag.CountryID = new SelectList(db.Countries, "CountryID", "CountryName", student1.CountryID);
    ViewBag.StateID = new SelectList(db.States, "StateID", "StateName", student1.StateID);
    return View(student1);
}

StudentCRUD Class:

public Sp_FindbyId_Result SelectById(Nullable<int> stid)
{
var stud = db.Sp_FindbyId(stid).ToList();
return (stud[0]); // Error coming here
}
AnswerRe: hi experts imgetting the error index out of rang pls help to solve Pin
Richard MacCutchan4-May-16 22:58
mveRichard MacCutchan4-May-16 22:58 
AnswerRe: hi experts imgetting the error index out of rang pls help to solve Pin
Kunwar Bahadur Singh5-May-16 0:43
Kunwar Bahadur Singh5-May-16 0:43 
GeneralRe: hi experts imgetting the error index out of rang pls help to solve Pin
sunil35-May-16 1:56
sunil35-May-16 1:56 
AnswerRe: hi experts imgetting the error index out of rang pls help to solve Pin
John C Rayan12-May-16 2:47
professionalJohn C Rayan12-May-16 2:47 
GeneralRe: hi experts imgetting the error index out of rang pls help to solve Pin
Richard Deeming12-May-16 3:22
mveRichard Deeming12-May-16 3:22 
PraiseRe: hi experts imgetting the error index out of rang pls help to solve Pin
John C Rayan12-May-16 4:24
professionalJohn C Rayan12-May-16 4:24 
QuestionForm not sending Pin
Member 87616674-May-16 5:32
Member 87616674-May-16 5:32 
QuestionRe: Form not sending Pin
Richard MacCutchan4-May-16 5:57
mveRichard MacCutchan4-May-16 5:57 
AnswerRe: Form not sending Pin
Member 87616674-May-16 7:27
Member 87616674-May-16 7:27 
GeneralRe: Form not sending Pin
Richard MacCutchan4-May-16 9:33
mveRichard MacCutchan4-May-16 9:33 
GeneralRe: Form not sending Pin
Member 87616674-May-16 10:07
Member 87616674-May-16 10:07 
GeneralRe: Form not sending Pin
Richard MacCutchan4-May-16 20:51
mveRichard MacCutchan4-May-16 20:51 
GeneralRe: Form not sending Pin
Member 87616675-May-16 0:04
Member 87616675-May-16 0:04 
GeneralRe: Form not sending Pin
Richard MacCutchan5-May-16 0:13
mveRichard MacCutchan5-May-16 0:13 
GeneralRe: Form not sending Pin
Member 87616675-May-16 4:14
Member 87616675-May-16 4:14 
GeneralRe: Form not sending Pin
Richard MacCutchan5-May-16 5:04
mveRichard MacCutchan5-May-16 5:04 
AnswerRe: Form not sending Pin
Richard Deeming4-May-16 7:29
mveRichard Deeming4-May-16 7:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.