Posts

ASP.net - Safe method to check session is null

Robust application has to utilize Proper method to check the session veribles.Following  method is one of the best approch. Assume  Session["selmachine_id"] hold string value  string sessionMac = Session["selmachine_id"] as string;                 if (!string.IsNullOrEmpty(sessonTestId))                 {                     //Valid Action                  }

ASP.net best way to Return Multiple Values from a Function

From .NET Framework 4 Tuple class has been introduce to create combination of heterogeneous objects .Its can used to group different types of items (objects ) and indicate this group as single object. Tuple is a class and once you create the Tuple, you cannot change the types of the items or the values assigned in the creation. This makes the Tuple more like a struct. However this enable much safe way to return distinct number of    multiple elements to be returned for a function . Example function(return Boolean and string ) public class Class1     {  public static Tuple<Boolean, String> ExampleFunction(string parameterVal)         {   Boolean retunValue1= false;  string retunValue2 = ""; .......  return Tuple.Create(retunValue1, retunValue2 ); } } Calling Function and Retrieve return Values   var retTuple = Class1.ExampleFunction(parameterVal);    ...

Display hidden div in ASP.net page as a modal Dialog

In this approach you can load a content form the database (dynamic content) at the initial . page load to the div which going to display as a dialog  box when reqired .When it is not nessory to show you can hide it using CSS ( display :none). When the popup modal dialog is open ,the  content can be make visible by CSS In the below example I have generated a HTML table from code behind at the page load to the pop up div and display as a modal dialog.I have added dynamic feature (column filter) using jQuery. Using this approach you can avoid the performance delay of using separate .aspx page with i frame to load a dynamic content. aspx page ,,,div            <div  id="projectCreateDiv" style="width:500px ; display :none "  >                            <asp:Tabl...

ASP.net find control within dynamic table

 Following way can be used to find a control within dynamic content by casting . TextBox tb1 = (TextBox)tableDynamicFeilds.FindControl(pair.Key.ToString());

ASP.net with tinymce editor - ReferenceError: tinyMCE is not defined

In the context of ASP.net C#   tinyMCE can be bind to server side  text areas .However you have to use suitable request validation method considering the security level expected      <asp:TextBox ID="textArea" ClientIDMode="Static" name="elm1" class="elm1" runat="server"                      TextMode = "MultiLine" TabIndex="4" ></asp:TextBox> In that context you can use class name of the text are and bind editor for all the text areas within same page using following parameters.Mode define the specific text areas to be selected and editor selctor select them from the class name. < script type = "text/javascript" >      tinyMCE.init({          mode: "specific_textareas",          editor_selector: " elm1",  However...

සිහිනෙන් සිහිනෙන් (Sihinen Sihinen) Namal Udugama

Image
සිහිනෙන් සිහිනෙන්,,,මා  හඬවනවා,,මා  හඬවනවා,, සැබෑ ලොවේ දී ඔබ මා,,,නෑ මුණ ගැසිලා,,නෑ හමු වීලා,,, අදුරු අතීතේ,, කදුලු සළාලා,, තනි වු කාළේ,,ඔබ ළත වීලා,,, සෙනෙහේ පුදා හමු  වුනු දා,,ඔබ හිනහුණු දා,,මට සිහි වෙනවා,, සොදුරු සෙනෙහේ,,පැතුම් බිදීලා,, අපගේ වටා මේ,,පවුරු බැදිලා,, දෙතන රැදී අප දෙදෙනා,,අද තනි වෙනවා,,සිත් සසලෙනවා,,,,

Kaspersky Internet Security CBE 11 - Key Not Support

Image
The latest key (2 months before) I taken from the computerbuild is not support for Kaspersky Internet Security CBE 11 . ComputerBuild has change there login page to ajax page which is currently a popup window.Use following link to go to site and click the location in the image for login if you have a account. Step1 (1)http://www.computerbild.de/ or (2)http://www.computerbild.de/user/login_366835.html?redirect=http%3A%2F%2Fwww.computerbild.de%2FKaspersky-Security-Suite-CBE-4280623.html&lmid=2367037 if you fallow the second link you need to fallow Step3 and Step8 only. Login location  Login Popup will appeared as below . Step2 Login Window  Click below link and redirect to home Page Step3 Redirect page Step4  Click Below icon in order to get a new Key from ComputerBuild. Redirect to Free Key Section Step5  Click in the below image to go for Kaspersky Security Site Section. Kaspersky Security Site Section ...