Click here to Skip to main content
15,891,880 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: RSS FEED Pin
Muhammad Mazhar7-Dec-10 4:28
Muhammad Mazhar7-Dec-10 4:28 
Questionhow to open page2 from page1 by press button1 on my asp.net program ? Pin
Gali19784-Dec-10 7:57
Gali19784-Dec-10 7:57 
AnswerRe: how to open page2 from page1 by press button1 on my asp.net program ? Pin
TweakBird4-Dec-10 9:51
TweakBird4-Dec-10 9:51 
QuestionPartial postback and update panel problem Pin
Tridip Bhattacharjee4-Dec-10 7:30
professionalTridip Bhattacharjee4-Dec-10 7:30 
AnswerRe: Partial postback and update panel problem Pin
Sandeep Mewara4-Dec-10 7:47
mveSandeep Mewara4-Dec-10 7:47 
GeneralRe: Partial postback and update panel problem Pin
Tridip Bhattacharjee5-Dec-10 4:55
professionalTridip Bhattacharjee5-Dec-10 4:55 
GeneralRe: Partial postback and update panel problem Pin
Sandeep Mewara5-Dec-10 4:55
mveSandeep Mewara5-Dec-10 4:55 
QuestionConfusion regarding c# property Pin
Tridip Bhattacharjee3-Dec-10 23:00
professionalTridip Bhattacharjee3-Dec-10 23:00 
i got a sample code from a site. onething i just do not understand regarding how value is added in viewstate automatically.

private Dictionary<Guid, string> Names
        {
            get { return (Dictionary<Guid, string>)ViewState["Names"]; }
            set
            {
                ViewState["Names"] = value;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                /*
                 * to keep this sample really simple, we will populate some
                 * sample data in a Dictionary and store in the viewstate
                */
                var names = new Dictionary<Guid, string>
                            {
                                {Guid.NewGuid(), "John"},
                                {Guid.NewGuid(), "Smith"},
                                {Guid.NewGuid(), "Arther"},
                                {Guid.NewGuid(), "Hari"}
                            };
                //store the list in the viewstate.
                ViewState.Add("Names", names);
            }
        }

      
        protected void btnAddSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                Names.Add(Guid.NewGuid(), txtNewName.Text);
                
            }
        }


in page load event i understand that few values has been added in Dictionary collection and after that the whole collection is added in viewstate named "Names".in btnAddSave_Click event the code Names.Add(Guid.NewGuid(), txtNewName.Text); adds name again in collection. but one things i just do not understand that how new value is added in viewstate. if someone look private Dictionary Names property there is no any setter so how automatically new value is added in viewstate. i hope my question is clear. in simple word i just want to know there no any setter but then how new values has been added in viewstate when the code goes like "Names.Add(Guid.NewGuid(), txtNewName.Text);". automatically how new values has been added in viewstate. because new values is added in dictionary collection but there is no code available where all dictionaly values added in viewstate after adding any value to the dictionary collection.i run the code and it works fine.so this code become very ambiguous for me. so please help me to understand how new values is added in viewstate when any new values is added in dictionary collection. thanks
tbhattacharjee

AnswerRe: Confusion regarding c# property Pin
Keith Barrow3-Dec-10 23:55
professionalKeith Barrow3-Dec-10 23:55 
GeneralRe: Confusion regarding c# property Pin
Tridip Bhattacharjee4-Dec-10 4:34
professionalTridip Bhattacharjee4-Dec-10 4:34 
GeneralRe: Confusion regarding c# property Pin
Keith Barrow4-Dec-10 5:26
professionalKeith Barrow4-Dec-10 5:26 
QuestionJQuery unable to find controls on a page [modified] Pin
AndyASPVB3-Dec-10 22:13
AndyASPVB3-Dec-10 22:13 
AnswerRe: JQuery unable to find controls on a page Pin
Not Active4-Dec-10 2:06
mentorNot Active4-Dec-10 2:06 
GeneralRe: JQuery unable to find controls on a page Pin
AndyASPVB4-Dec-10 3:13
AndyASPVB4-Dec-10 3:13 
GeneralRe: JQuery unable to find controls on a page Pin
Not Active4-Dec-10 3:35
mentorNot Active4-Dec-10 3:35 
GeneralRe: JQuery unable to find controls on a page Pin
AndyASPVB4-Dec-10 3:43
AndyASPVB4-Dec-10 3:43 
GeneralRe: JQuery unable to find controls on a page Pin
Not Active4-Dec-10 5:46
mentorNot Active4-Dec-10 5:46 
GeneralRe: JQuery unable to find controls on a page Pin
AndyASPVB6-Dec-10 10:49
AndyASPVB6-Dec-10 10:49 
GeneralRe: JQuery unable to find controls on a page Pin
Not Active6-Dec-10 13:27
mentorNot Active6-Dec-10 13:27 
QuestionASP.Net Newby Question On ListView Pin
Kevin Marois3-Dec-10 7:32
professionalKevin Marois3-Dec-10 7:32 
AnswerRe: ASP.Net Newby Question On ListView Pin
Not Active3-Dec-10 12:36
mentorNot Active3-Dec-10 12:36 
Questionregarding VS2008 IDE Pin
Tridip Bhattacharjee3-Dec-10 6:31
professionalTridip Bhattacharjee3-Dec-10 6:31 
AnswerRe: regarding VS2008 IDE Pin
Brij3-Dec-10 7:42
mentorBrij3-Dec-10 7:42 
GeneralRe: regarding VS2008 IDE Pin
Tridip Bhattacharjee3-Dec-10 23:05
professionalTridip Bhattacharjee3-Dec-10 23:05 
GeneralRe: regarding VS2008 IDE Pin
Brij4-Dec-10 5:14
mentorBrij4-Dec-10 5:14 

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.