Click here to Skip to main content
       

ASP.NET

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
AnswerRe: sequence contains no elementsmemberMatt U.18 Dec '12 - 7:23 
GeneralRe: sequence contains no elementsmemberxnaLearner18 Dec '12 - 23:00 
GeneralRe: sequence contains no elementsmemberMatt U.19 Dec '12 - 1:47 
Question[session] returns nullmemberxnaLearner17 Dec '12 - 23:20 
AnswerRe: [session] returns nullmemberRahul Rajat Singh17 Dec '12 - 23:47 
GeneralRe: [session] returns nullmemberxnaLearner18 Dec '12 - 0:10 
GeneralRe: [session] returns nullmemberxnaLearner18 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 nullmemberChandrabhan Sangale18 Dec '12 - 17:59 
QuestionMultilingual support for Web ApplicationmemberAB777117 Dec '12 - 23:18 
AnswerRe: Multilingual support for Web ApplicationmemberRahul Rajat Singh17 Dec '12 - 23:43 
GeneralRe: Multilingual support for Web ApplicationmemberAB777118 Dec '12 - 2:27 
AnswerRe: Multilingual support for Web Applicationmemberdeflinek17 Dec '12 - 23:57 
SuggestionRe: Multilingual support for Web ApplicationmemberChandrabhan Sangale18 Dec '12 - 18:01 
Questiongoogle mapmembercdpsource17 Dec '12 - 20:52 
AnswerRe: google mapmemberryanb3118 Dec '12 - 4:55 
QuestionProblem to send message from MSMQmemberTRAORE cheickna17 Dec '12 - 10:20 
Questionexport report failed in crystal reportmemberhimadribanik17 Dec '12 - 6:51 
QuestionRefresh particular parts on masterpagemembercdpsource17 Dec '12 - 5:58 
AnswerRe: Refresh particular parts on masterpagememberMatt U.17 Dec '12 - 6:51 
GeneralRe: Refresh particular parts on masterpagemembercdpsource17 Dec '12 - 6:59 
GeneralRe: Refresh particular parts on masterpagememberMatt U.17 Dec '12 - 7:06 
GeneralRe: Refresh particular parts on masterpagemembercdpsource17 Dec '12 - 8:23 
SuggestionRe: Refresh particular parts on masterpagememberChandrabhan Sangale18 Dec '12 - 18:04 
Questionsession variable / temp datamemberxnaLearner17 Dec '12 - 4:25 
QuestionSalable Comet (server hang while more user)membervaibhav.baldha17 Dec '12 - 3:47 

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


Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 18 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid