Click here to Skip to main content
       

ASP.NET

 
QuestionHave userID in view, need userName posted PinmemberxnaLearner19-Dec-12 0:41 
AnswerRe: Have userID in view, need userName posted PinmemberMatt U.19-Dec-12 4:11 
AnswerRe: Have userID in view, need userName posted [modified] PinmemberCommDev20-Dec-12 22:55 
QuestionUnable to start program http://localhost:1837/default.aspx using VS 2008 in Windows XP IE 8 Pinmembersr15919-Dec-12 0:08 
QuestionHow to access 'name' given when user registers PinmemberxnaLearner18-Dec-12 22:52 
AnswerRe: How to access 'name' given when user registers PinmemberxnaLearner18-Dec-12 22:58 
Questionsequence contains no elements PinmemberxnaLearner18-Dec-12 2:44 
AnswerRe: sequence contains no elements PinmemberMatt U.18-Dec-12 7:23 
GeneralRe: sequence contains no elements PinmemberxnaLearner18-Dec-12 23:00 
GeneralRe: sequence contains no elements PinmemberMatt U.19-Dec-12 1:47 
Question[session] returns null PinmemberxnaLearner17-Dec-12 23:20 
AnswerRe: [session] returns null PinmemberRahul Rajat Singh17-Dec-12 23:47 
GeneralRe: [session] returns null PinmemberxnaLearner18-Dec-12 0:10 
GeneralRe: [session] returns null PinmemberxnaLearner18-Dec-12 0:12 
I want to store the users ID from the previous drop down so it will update automatically if they try to create another holiday (to replace the second drop down)
 
Im using a session variable to do this, My View:
 
//this coverts the user ID to a string and stores it in
session["usernameID"]
string userID = currentPersonID.ToString();
Session["usernameID"] = userID;
-------------------------------------------------
 
//My Create:
//catches the session["UsernameID"], stores it in string 'xx'
//converts it to an int and stores it in currentPersonID
//then store the value of currentpersonID in the model
 
public ActionResult Create()
        {
        string xx = (string)Session["usernameID"];
 
        int? currentPersonID = Convert.ToInt32(xx);
 
        HolidayList model = new HolidayList();
        model.currentPersonID = currentPersonID.Value;
-------------------------------------------------
This all works fine, howeve how do I display the value properly in the view?
Where I was using :
 
@Html.DropDownListFor(model => model.PersonId, new SelectList(ViewBag.Id, "Value", "Text"),"---Select---") 
i've tried:
 
@Html.TextBoxFor(model =>model.currentPersonID, "currentPersonID") 
 
//and
 
@Html.LabelFor(model =>model.currentPersonID)

hoping the correct ID would display, but only the text 'currentPersonID is displayed
 
please advise, thanks again
SuggestionRe: [session] returns null PinmemberChandrabhan Sangale18-Dec-12 17:59 
QuestionMultilingual support for Web Application PinmemberAB777117-Dec-12 23:18 
AnswerRe: Multilingual support for Web Application PinmemberRahul Rajat Singh17-Dec-12 23:43 
GeneralRe: Multilingual support for Web Application PinmemberAB777118-Dec-12 2:27 
AnswerRe: Multilingual support for Web Application Pinmemberdeflinek17-Dec-12 23:57 
SuggestionRe: Multilingual support for Web Application PinmemberChandrabhan Sangale18-Dec-12 18:01 
Questiongoogle map Pinmembercdpsource17-Dec-12 20:52 
AnswerRe: google map Pinmemberryanb3118-Dec-12 4:55 
QuestionProblem to send message from MSMQ PinmemberTRAORE cheickna17-Dec-12 10:20 
Questionexport report failed in crystal report Pinmemberhimadribanik17-Dec-12 6:51 
QuestionRefresh particular parts on masterpage Pinmembercdpsource17-Dec-12 5:58 
AnswerRe: Refresh particular parts on masterpage PinmemberMatt U.17-Dec-12 6:51 
GeneralRe: Refresh particular parts on masterpage Pinmembercdpsource17-Dec-12 6:59 
GeneralRe: Refresh particular parts on masterpage PinmemberMatt U.17-Dec-12 7:06 
GeneralRe: Refresh particular parts on masterpage Pinmembercdpsource17-Dec-12 8:23 
SuggestionRe: Refresh particular parts on masterpage PinmemberChandrabhan Sangale18-Dec-12 18:04 
Questionsession variable / temp data PinmemberxnaLearner17-Dec-12 4:25 
QuestionSalable Comet (server hang while more user) Pinmembervaibhav.baldha17-Dec-12 3:47 
AnswerRe: Salable Comet (server hang while more user) PinmemberChandrabhan Sangale18-Dec-12 17:49 
QuestionThe underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. Pinmemberkapil sharma 4917-Dec-12 2:02 
AnswerRe: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. Pinmemberryanb3118-Dec-12 4:58 
QuestionCan only book for yourself and not other users? PinmemberxnaLearner17-Dec-12 1:29 
QuestionRe: Can only book for yourself and not other users? PinmemberZaf Khan19-Dec-12 5:49 
QuestionEval + onclientClick Gridview Error [modified] Pinmemberjojoba201116-Dec-12 20:38 
QuestionRe: Eval + onclientClick Gridview Error Pinmemberryanb3118-Dec-12 4:59 
QuestionSound transmission Pinmemberleone16-Dec-12 5:16 
QuestionRe: Sound transmission Pinmemberryanb3118-Dec-12 5:00 
AnswerRe: Sound transmission Pinmemberleone18-Dec-12 23:22 
GeneralRe: Sound transmission Pinmemberryanb3119-Dec-12 1:38 
GeneralRe: Sound transmission Pinmemberleone19-Dec-12 2:54 
QuestionDropDownList changed after reading SelectedValue !!!! [modified] PinmemberAdore C++15-Dec-12 9:11 
AnswerRe: DropDownList changed after reading SelectedValue !!!! Pinmemberrakak15-Dec-12 18:29 
GeneralRe: DropDownList changed after reading SelectedValue !!!! PinmemberAdore C++16-Dec-12 4:18 
GeneralRe: DropDownList changed after reading SelectedValue !!!! Pingroupchester_it2116-Dec-12 9:10 
QuestionIIS7.5 Specific Problem PinmemberAyan Chatterjee15-Dec-12 7:07 
QuestionRe: IIS7.5 Specific Problem Pinmemberryanb3118-Dec-12 5:01 

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

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


Advertise | Privacy | Mobile
Web03 | 2.8.140921.1 | Last Updated 21 Sep 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid