.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

General Question About Remembering Property Values Between Postbacks

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :ASP.Net
Here are examples of two different ways I've found to story Property values between postbacks:    private bool Initialized    {      get      {        return Convert.ToBoolean(this.Attributes["Initialized"]);      }      set      {        this.Attributes["Initialized"] = value.ToString();      }    }    private int DataTableRowIndex    {      get      {        return (int)ViewState["DataTableRowIndex"];      }      set      {        ViewState["DataTableRowIndex"] = value;      }    }I'd appreciate any comments about differences between these two approaches [Attributes vs. ViewState].  Is one better or worse?Robert

View Complete Post

More Related Resource Links

General .NET question

Hello, Is there any way to make sure a .NET application does not crash no matter what errors are thrown? TIA.

General Controller to View logic question

Hello, I am currently learning the MVC2 Framework and I have a brief question in terms of my logic and if their are any flaws in it. I created a basic example in a couple of minutes that demonstrates the way I think about it. public ViewResult Index() { return View(); } public ViewResult Cookies() { return View(new Cookie()); } public ViewResult CookiesInput(Cookie cookie) { return View(cookie); }<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>I really like cookies</h2> Would you like a cookie? <% using (Html.BeginForm("Cookies", "Example")) { %> <p><input type="submit" value="Yes" /></p> <% } %> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Cookies</h2> <% using (Html.BeginForm("CookiesInput", "Example")) { %> <%= Html.EditorForModel() %> <p><input type="submit" value="Gimme" /></p> <% } %> </asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="MainConten

General question steps to configure mysites in SharePoint 2010

I am trying to configure the mysite web application, so I have created a DNS record "mysite" and created a web application for the mysite and created a mysite host site collection on it. Now I have read somewhere that u have to create managed paths for the profile and the mysite, which actually corresponds with the name of the DNS record/mysite webapp. For some reason when i am opening the mysite, i get a url something like http://my/my. What am i doing wrong? Can somebody just give me a step by step approach on how to configure Mysites in MOSS 2010?I am a SharePoint Infrastructure Engineer, focussed on Administration and Installation of SharePoint Server environments.

General Question for SQL

Hi,  i am working at DB platform since last 2 years ... now i heard about .Net 2010. this platform have lots of new features like (create database, tables and storedprocedure also inbuilded ).. so its affect DBA, DBD prefession for features?..   Thanks in Advance

merge repligation general question?

Hello friends Please tell me that what is .sdf file in merge replicaton?

General Setup Question regarding Ssytem.XML assembly

Hello,I have a solution running perfectly well on one machine (or actually quite a few machines).  All the code is in source safe and I am trying to set up a new machine with the solution but keep getting the following build errors:'XName' is ambiguous in the namespace 'System.Xml.Linq'. InternalXmlHelper.vb 'XNamespace' is ambiguous in the namespace 'System.Xml.Linq'. InternalXmlHelper.vb 'XElement'is ambiguous in the namespace 'System.Xml.Linq'. InternalXmlHelper.vb 'XAttribute' is ambiguous in the namespace 'System.Xml.Linq'. InternalXmlHelper.vb and so on...The main difference that I noticed was that on the machines where the application builds, in the property page of the project whgere the build erros are occurring I check the reference list and I see a reference to the System.XML assembly (GAC,  However in the machine with the build errors, even when I try to add a reference to the System.XML assembly I get no error messages, but afterr adding the assembly does NOT appear in the reference list.In addition I have verified that I am able to create a new web application without any build or runtime errors on the machine experiencing these issues.Any feedback would be greatly appreicated.Thanks.

General question: Using the VS Designer vs. the Source Code

I just finished Sams Teach Yourself ASP.Net in 24 Hours. I am now going through the Data tutorials here. I am a beginner at ASP.Net. One thing that I am having a little bit of trouble with is the idea that I am using the Designer in Visual Studio for just about everything except for a few code tweaks. I used to do a lot of HTML, JavaScript and CSS. I even did some programming (PowerBuilder). So, I am used to writing/typing code instead of using a Designer. (I always liked writing web pages in a text editor.) When I look at the code generated by the Designer in Visual Studio, I can understand what is going on there. But, to sit down and write that code instead of using the Designer to me seems impossible. There is just so much there. From what I understand, ASP.Net and Visual Studio were created to help streamline the code writing process. I suppose if I was used to writing VB code to create applications I might look at this from a different angle. But, I am learning ASP.Net using the VS Designer. Any comments or suggestions from experienced coders? I really don't want to have a battle between people who use the Designer and the Source Code editor. I am just hoping for some comments that will help newbies. Thanks.

Sharepoint general functionality question?


I have a client who has an SBS2008 server. The shaprepoint component is not being used. This client is a flavor company and is currently maintaining formulas on excel spreadh sheets. Can I use sharepoint to create a database that can be easily searched based on any information in the formulas?




Mapping custom values and columns to destination table **Newb question**



I am copying data from one source to destination SQL CE table using the data flow task. I have two extra requirements which I am not sure how to achieve.

1.)  One source column needs to be mapped to two destination columns. In the column mapping dropdown the column name disappears after mapping it to one destination column.

2) some custom values for columns need to be added, which are not present in source. For e.g. a default value for some destination columns which is not present.

Any pointers would be extremely appreciated. Thanks,

Ganesh Ranganathan
[Please mark the post as answer if it answers your question]

MOSS 2007 Profile Property Question


I am trying to delete a default property in my MOSS 2007 farm.    We have created a custom property called Core Skills and I want to remove my default skills field.  But the delete button is greyed out.  I am noticing this on a few of the default properties.    Is there a reason why we can't delete them?   

We are running MOSS SP2.



How can i access claaes Property values in xml file ?



actually i am creating sitemap.sitemap is actually an xml file.And i have stored each page's url  of my project as Public shared property of a class.Now while creating sitemap xml file i want to get access to those property on my class, so that url should not be hardcoded.How can i do that ?

Please help .

How to access property values in the model that you are binding to? - Help!


From within a custom modelBinder (derived from DefaultModelBinder), how do I access the existing values of properties in the model into which the new values are being injected?

Thanks in advance for your help!

Determine node type selected in TreeView and reading property values


I am hoping that someone can help me get past some problems I am having when using the WPF TreeView control.  I have a TreeView that at most can have 3 levels.  The levels are defined as Project, Discipline, Person which would look like the following:

+ Project

    + Discipline

        - Person

My TreeView is bound to a database using two HierarchicalDataTemplate's and then one DataTemplate (the binding is done in the XAML).

What I would like to get is the following information when selecting an item:

  1. Read the selected value (text of the selected node)
  2. Inserting Property values of class into ParamArray parameters as object()


    Hi All,

    Using the properties as defined in a class, how about can I put them into the ParamArray parameters argument of my function.

    The code as follows:

    Public Class MyObject

       Public Property Prop1 as string

       Public Property Prop2 as integer

       Public Property Prop3 as Boolean

       Public Sub  AddNewMyObject

            MsSQL_ExecuteNonQuery("StoredProc_AddNewMyObject", ________________?)

       End Sub

    End Class

    Protected Function MsSQL_ExecuteNonQuery(ByVal storedProc as string, ByVal ParamArray parameters as object())

    'Some Code here.

    End Function

    Please kindly help and advice.

    Thank you in advance.

    Warmest Regards,


SSIS Lookup - Mismatched sqlcommand & sqlcommandparam Property Values


I had an issue recently and I'd like to solicit feedback as to whether this is an SSIS flaw:

In the lookup component, when you select the Partial or No Cache option, a property in addition to the sqlcommand property becomes available called sqlcommandparam. Originally this package was developed using Lookups pointing to a dimension on "schema_A" and we wanted to change the reference to "schema_B". Now, obviously the sqlcommandparam property became available because you can elect to use the Advanced SQL option in the component. However, I never chose to do that. So, long story short, I go into this package to change the schema reference in the Lookup's query. It changes the sqlcommand property value to be "select value from schema_B.table" but it didn't change the corresponding value in the sqlcommandparam property. That property remained "select value from schema_A.table". SSIS never threw an error to say the schema's didn't match. And the Lookup worked as designed, picking up values from the table on schema_B. Not until we finally decommisioned schema_A did I get an error at runtime that said "Table or view does not exist".

So, can anyone (hopefully Microsoft) confirm that this is in fact a flaw? I am on MSFT VS 2008 V 9.0.30729.1 SP.


General Question



I'm wondering why I never see an object like this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestConsole
    class TestClass2
        public TestClass2()
            A = "test";
            B = "test2";
            C = "test3";
            D = C;

        public string A

        public string B

        public string C

        public string D


Instead of something like this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestConsole
    class TestClass
        public string a;
        private string b;
        private string c;
        private string d ;

        public TestClass()
            a = "test";
            b = "chest";
            c = "chief";
            d = "test2";


Difference between UserProfile & User Information List Property Values?


If I checks the FirstName & LastName Property values in UserProfile it has someValue however the same properties does not have anyValue in User Information List, what would the reason behind this?

Even I could see comma (",") separated value for some Field in UIL however the same value is in UserProfile without comma (",") ....

ProfileSync and/or QuickSync will update the UIL with same Information avail in UserProfile, isn't it? In that case both should have the same value, right?

Karthikeyan | MCTS | India
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend