Tuesday, October 29, 2013

Useful links on LINQ TO XML, MVC 3, XML

Reading XML + LINQ
Reading XML and LINQ 1
Reading XML and LINQ 2

 Linq to XML
LINQ to XML 1
LINQ to XML 2
LINQ to XML 3
LINQ to XML 4
LINQ to XML 5
LINQ to XML 6
LINQ to XML 7
LINQ to XML 8
LINQ to XML 9
LINQ to XML 10
LINQ to XML 11

Linq to XML + Excel
LINQ to XML and Excel 1

ASP.NET MVC + XML
ASP.NET MVC and XML 1
ASP.NET MVC and XML 2

CRUD + XML + ASP.NET MVC3
CRUD, XML and ASP.NET MVC 3

Samsung Service Center in Manila and Makati, Philippines

http://www.samsung.com/ph/support/location/supportServiceLocation.do

1    PHONEVILLE MOBILE INC.     Unit 003 Ground Floor Cyberzone Area SM City Manila   
2    WSI PHONECARE, INC.    Samsung Customer Service Unit CZ-018, Lower G/F, SM City Manila   

1    SERVCARE SOLUTIONS PHILIPPINES INC.    Jaka Center, #2111 Don Chino Roces (Pasong Tamo), Makati City   
2    WELLCOM TELECOM SUPERMARKET INC.    Laptop Zone, Parksquare, Ayala (front of Glorietta 1)   
3    WSI PHONECARE, INC.    7F SEDCCO Bldg., Rada corner Legaspi Sts., Legaspi Village, Makati City   

HP Service Centers in the Philippines

http://www8.hp.com/ph/en/contact-hp/office-locations.html#2
Main office:
37th Floor Robinsons Summit Center
6783 Ayala Avenue
Makati City, Philippines

Trunk Line: (632) 888-5900
Fax Line: 830-7300

8:30am to 5:30pm / Monday to Friday
Two and Three World Square
22 Upper McKinley Road, McKinley Hill Town Center, Fort Bonifacio,
Taguig City 1634
Reception: (632) 902-6000

Intellectual Property Center
28 Upper Mckinley Road, Mckinley Hill Town Center, Fort Bonifacio
Taguig City 1634
Reception: (632) 718-7073

HP Service Centers:
GF Accelerando Building,
395 Sen. Gil Puyat Avenue, Makati City

Tel. No. (632) 888-6100
Unit C-D-E Ground Floor
Capitol Centrum Bldg.
Clavano cor. Escario St. Cebu City

Tel. No. (032) 254-4548 or (032) 412-5300

Thursday, October 24, 2013

Useful links for .NET Programmer

ReportViewer 2012 AND IIS 7
ReportViewer 2012 AND IIS 7 Reference #1
ReportViewer 2012 AND IIS 7 Reference #2

Logging Error in ASP.NET
Logging Error in ASP.NET Reference 1
Logging Error in ASP.NET Reference 2
Logging Error in ASP.NET Reference 3
Logging Error in ASP.NET Reference 4
Logging Error in ASP.NET Reference 5

Hover Menu Extender sample
Hover Menu Extender sample

Remove annoying arrow at menu
Remove annoying arrow at menu

SKyDrive Sample Codes
SKyDrive Sample Codes Reference 1
SKyDrive Sample Codes Reference 2

HoverMenuExtender
HoverMenuExtender Reference 1
HoverMenuExtender Reference 2
HoverMenuExtender Reference 3
HoverMenuExtender Reference 4

Showing Images on MouseOver
Showing Images on MouseOver

Cache, Session and Viewstate
 Cache, Session and Viewstate

Loading Related Entities
Loading Related Entities

 ASP.NET Session Timeout
ASP.NET Session Timeout

 ASP.NET Viewstate
 ASP.NET Viewstate Reference 1
  ASP.NET Viewstate Reference 2

Cell padding
Cell padding

vertical align css 3
vertical align css 3

Ajax-Based JavaScript File Uploader with Progress Bar
 Ajax-Based JavaScript File Uploader with Progress Bar

 jQuery File Upload Plugin
jQuery File Upload Plugin

ASP.NET File Upload with Progress Bar
ASP.NET File Upload with Progress Bar

FileUpload
FileUpload Reference 1
FileUpload Reference 2
FileUpload Reference 3

 flex container
 flex container

Chosen Plugin Dropdownlist?
Chosen Plugin Dropdownlist?

Textbox Autocomplete
Textbox Autocomplete

 ASp.NEt Autocomplete Dropdownlist
 ASp.NEt Autocomplete Dropdownlist

Validator for Checkboxlist references:
Validator for Checkboxlist References 1
Validator for Checkboxlist References 2
Validator for Checkboxlist References 3
Validator for Checkboxlist References 4

Guid password generator
Guid Password Generator

Monday, August 19, 2013

Migrating old source code of Visual Studio 2010 to Visual Studio 2012

Step 1: Enable nuget restore. Find and click on Project then find and click enable nuget restore.

Step 2: Manage nuget packages and install entityframework and ajaxcontroltoolkit.

Step 3. Download and install ajaxcontroltoolkit 4.5.

Step 4: Click on Toolbox then choose item, browse and find AjaxControlToolkit.dll version 4.5.

Step 5: Add reference to all dll that you need in your project and can be found here, C:\Program Files (x86)\Microsoft Visual Studio 11.0\. For example,
Microsoft.ReportViewer.Common
Microsoft.ReportViewer.WebForms
System.Data.Entity

Step 6: Select a page to set as start page.

Step 7: Replace the following align or valign with vertical and text-align respectively.
Refer to this link,
 My other blog

Step 8: There are items to change in css 3 from css 1, like cursor:hand to cursor:pointer.
Browser Support
To align right,
click here

Step 9: To deploy or publish the web application. Please refer to the link below,
Reference 1
Reference 2
Reference 3
Reference 4
Reference 5

Step 10: Check for any missing dll. If you cannot find some of them, refer to this link below,
Reference 1

Step 11: To position two column table in the center at the top menu, add this css to menu.css file. .wrapper { position: absolute; left: 50%; margin-left: -70px; } the idea came from this link,
Align Contents

Step 12: When you wish to insert a image as a background, insert into a css file, this css below, background: url(../Images/ERRPAGE.png) center no-repeat;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background-size: auto auto;
Reference used:
background size
vertical centering

Step 13: If you receive an error message "Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack", apply this code before your redirect to error page like this code below,
if (ex.Message.StartsWith("Thread") == false)
{
Session["ErrorMessage"] = ex.Message;
Response.Redirect("~/Forms/Error.aspx", false);
}
Reference used for step 13,
Reference used

Step 14: to change the color of the scrollbar of a panel, use the link below,
Bar color
CSS Tutorial
There is no direct way of changing color of scrollbar in a treeview control unless you create new custom treeview control.

Step 15: In case you have this javascript error message "0x800a139e - JavaScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.", you can insert this meta tag in the master page,
 <meta http-equiv="X-UA-Compatible" content="IE=9" />
Step 16: To enable clicking on word displayed to expand the tree. Set the property SelectAction to Expand. To display the treeview in unexpanded format. Set the property Expanded to False.
<asp:TreeNode Text="Transaction" Value="Process" ImageUrl="~/Images/folder.png" Expanded="false" SelectAction="Expand" >
Step 17: To remove the default arrows that appear in the ASP.NET Menu Control. Set the StaticEnableDefaultPopOutImage property to False. This property is responsible for the default arrows that appear in the ASP.NET Menu control. To remove the default arrows that appear in the ASP.NET menu items. Set the DynamicEnableDefaultPopOutImage property to False. This property gets or sets a value indicating whether the built-in image that indicates that a dynamic menu item has a submenu is displayed.

Reference used for step 17:
Reference for DynamicEnableDefaultPopOutImage
Reference for StaticEnableDefaultPopOutImage
Another Reference for StaticEnableDefaultPopOutImage

Step 18: Fixing the displaying of rdlc inside a report viewer 2012 using IIS 7. Please refer to this link to add handler mappings at iis.

Step 19: To display Elmah.axd, allow remote access by setting allowRemoteAccess from false to true at web config file. And add a file extension to allow . Find and click Request Filtering. Find and click Allow file name extension link. Type in .axd at File name extension and then click OK.

Step 20: To insert space between menu and submenu, put some value at DynamicMenuItemStyle-HorizontalPadding  property.
Reference used for step 20

Migrating from Visual Studio 2010 to Visual Studio 2012
Reference 1
Reference 2
Reference 3
Reference 4
Reference 5
Reference 6

Monday, July 8, 2013

Migrating to HTML 5 using ASP.NET 4.5

Let us say, you have previous aspx page that you copy and paste. You use HTML 5 in visual studio 2012. When you try to compile, it will give you a compile error.
Please change align="left" to style="text-align:left". Please change align="right" to style="text-align:right". Please change align="center" to style="text-align:center".

Migrating from EF 4 to EF 4.5

If you do have a previous class that uses entity framework in visual studio 2010. Then you need to create the same class using visual studio 2012. When you try to copy and paste into the new class. Then compile it, it will give you an error. In visual studio 2010 Addto<tablename> method and DeleteObject method no longer exist. Please use <tablename>.Add method and <tablename>.Remove method respectively. For insert, user add method and for delete, use remove method.

Tuesday, May 28, 2013

How to validate an Ajax control combo box has item selected or not?



First, you need to insert beside the combo box a custom validator like this,

<asp:CustomValidator ID="cv" runat="server" ControlToValidate="cmb" Text="*" ForeColor="Red" ValidateEmptyText="true" ClientValidationFunction="CustomValidator" Display="Dynamic" ErrorMessage="combo box is required!" CssClass="validator" ValidationGroup="valGrp"></asp:CustomValidator>

If your combo box default selected value is an empty string then you need to add a function inside a <script type="text/javascript"> like this,

    function CustomValidator(s, e) {
        if ($find(s.controltovalidate)._textBoxControl.value == "") {
            e.IsValid = false;
        }
    }

If your combo box default value of “Please select” then you need to add a function inside a <script type="text/javascript”> like this,

    function CustomValidator(s, e) {
        if ($find(s.controltovalidate)._textBoxControl.value == "Please select") {
            e.IsValid = false;
        }
    }

References used:

Monday, May 13, 2013

How fix the column width in a gridview at insert tooltip in each cell in Asp.net 4?




If you need to set the width of each column in a gridview control,  If the column is just to display and no editing needed. You can like this,

<asp:TemplateField HeaderText="column Name" SortExpression="fieldname">
<HeaderTemplate>
       <div style="text-align:center;background-color:#41627E;color:White;font-size:x-small;font-weight:bold;overflow: hidden;white-space: nowrap;width: 50px;" >column Name</div>
</HeaderTemplate>
<ItemTemplate>
<div style="font-size:xx-small;white-space:nowrap;overflow: hidden;text-align:left;font-weight:600;font-family:Tahoma;width: 50px;" >
 <asp:Label ID="lblGridColumnName" runat="server" Text='<%# Bind("fieldname") %>' ></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>


But if there is a editing to be done, you need to do like this,

<asp:TemplateField HeaderText="column Name" SortExpression="fieldname">
<HeaderTemplate>
<div style="text-align:center;background-color:#41627E;color:White;font-size:x-small;font-weight:bold;overflow: hidden;white-space: nowrap;width: 40px;" >column name</div>
</HeaderTemplate>
<ItemTemplate>
<div style="font-size:xx-small;white-space:nowrap;overflow: hidden;text-align:left;font-weight:600;font-family:Tahoma;width: 40px;" >
<asp:Label ID="lblGridColumnName" runat="server" Text='<%# Bind("fieldname", "{0:n0}") %>'></asp:Label>
</div>
</ItemTemplate>
<EditItemTemplate>
              <asp:TextBox ID="txtGridColumnName" runat="server" Text='<%# Eval("fieldname", "{0:n0}") %>' Width="50px" CssClass="cssclass" />
       </EditItemTemplate>
</asp:TemplateField>


If you need insert a tooltip for each cell inside a gridview, you need to set each column tooltip. You can do like this,

protected void gv_DataBound(object sender, EventArgs e)
{
Label lbl = new Label();
foreach (GridViewRow rv in gv.Rows)
{
lbl = (Label)rv.FindControl("lblGridColumnName ");
rv.Cells[1].ToolTip = lbl == null ? string.Empty : lbl.Text;
}
}

Wednesday, October 10, 2012

How to manipulate back button in ASP.NET 4?

After searching a lot of references. I have came to a conclusion that you can only prevent user from accessing the previous page is thru javascript window history. You can not manipulate the forward button but only the back button. There are many ways to do it, if you really want to manipulate both button is to clear cache like this,
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
Response.Expires = 0;
Response.CacheControl = “no-cache”;

To manipulate the previous page (back button) is thru this way,

<script type="text/javascript" language="javascript">
function DeleteHistory() {
window.history.go('Default.aspx');
}
setTimeout("DeleteHistory()", 1000);
window.onunload = function () { DeleteHistory(); };
</script>

Here are references that I have used:
Reference 1
Reference 2
Reference 3
Reference 4
Reference 5
Reference 6
Reference 7
Reference 8
Reference 9
Reference 10
Reference 11

Javascript back button asp.net
Reference 12
Reference 13
Reference 14
Reference 15
Reference 16
Reference 17
Reference 18
Reference 19