List vs List

I need to create a heterogeneous List of objects (custom classes). My first thought was to create a List<ISomeMarkerInterface> but I quickly learned that this is not what I want. My next thought was List<dynamic> and this didn’t seem to be a bad idea. However, I was doing some research and came across this article about boxing and unboxing and in the example, they’re doing basically what I want using List<Object>.

How to maintain the value of label after postback in Asp.net?

In asp.net page I need to know how to maintain the value of a particular label assign by the html button click. After postback done. Detailed code: <table> <tr> <td><asp:Label ID="lbl1" runat="server" ClientIDMode="Static">Before Changing</asp:Label></td> <td><asp:Label id="lbl2" runat="server" ClientIDMode="Static"></asp:Label></td> <td><asp:TextBox ID="txtbox" runat="server"></asp:TextBox></td> </tr> <tr> <td><asp:Button ID="btnasp" runat="server" Text="ASP Button" Height="50px" Width="150px" OnClick="btnasp_Click"/></td> <td><input type="button" id="btnhtml" value="HTML … Read more

Disabling backbutton of browser in C#

<script type="text/javascript"> { function DisableBackButton() { window.history.forward() } DisableBackButton(); window.onload = DisableBackButton; window.onpageshow = function (evt) { if (evt.persisted) DisableBackButton() } window.onunload = function () { void (0) } } </script> I am using the following code in the master page to diable the back button. Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1)); Response.Cache.SetNoStore(); Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d); Response.Expires = -1500; … Read more