Oct 10, 2009

Use registry to clean right context menus

Some applications will install his quick launch items in the mouse right click menu, but many of the quicklinks are useless.
So let's begin to clean them and make our computer world clean as white snow.

Type 1: clean right menu item
1, use registry(run regedit.exe)
2, expand [HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers], find the item which you want to remove, like NamipanExt etc., delete it.

Type 2: clean right click new item
1, use registry(run regedit.exe)
2, expand [HKEY_CLASSES_ROOT], ctrl+F, find ShellNew, if you don't need it, rename it to ShellNewOld.

Update on March 17, 2011-
Type 3: clean right click IE item
1, use registry(run regedit.exe)
2, expand [HKEY_CURRENT_USER]\Software\Microsoft\Internet Explorer\MenuExt
Delete something like Thunder... Udown...
Udown? You done.

Update on November 14, 2012
Now a great tool can support this: CCleaner
CCleaner is a tool that can help you clean clean your system, like temporary files  cache etc., fix registry problems, and uninstall/install software etc.

To clean context menu, we can
1. click tools icon
2. Click StartUp area
3, In "Context Menu" we can enable/disable or delete the items.



Jul 21, 2009

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ContactManager.Models.Contact>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<title>Index</title>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">


<table class="data-table" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th class="actions edit">
Edit
</th>
<th class="actions delete">
Delete
</th>
<th>
Name
</th>
<th>
Phone
</th>
<th>
Email
</th>
</tr>
</thead>
<tbody>
<% foreach (var item in Model)
{ %>
<tr>
<td class="actions edit">
<a href='<%= Url.Action("Edit", new {id=item.Id}) %>'><img src="../../Content/Edit.png" alt="Edit" /></a>
</td>
<td class="actions delete">
<a href='<%= Url.Action("Delete", new {id=item.Id}) %>'><img src="../../Content/Delete.png" alt="Delete" /></a>
</td>
<th>
<%= Html.Encode(item.FirstName) %>
<%= Html.Encode(item.LastName) %>
</th>
<td>
<%= Html.Encode(item.Phone) %>
</td>
<td>
<%= Html.Encode(item.Email) %>
</td>
</tr>
<% } %>
</tbody>
</table>
<div class="divContactList-bottom">&nbsp;</div>
</asp:Content>


Jan 7, 2008

thrown: 'Dropdownlist1' has a SelectedValue which is invalid because it does not exist in the list of items.

Using GridView, I found .NET 2.0 is more efficient than .NET1.1
Expecially on GridView instead of DataGrid.

Recently, I found an error when I using a GridView which contains child control DropDownList. The DropDownList definition is:


Dec 26, 2007

Insert Table Using Trigger

insert 表
select * from
OPENROWSET('MICROSOFT.JET.OLEDB.4.0'
,'Excel 8.0;IMEX=1;HDR=YES;DATABASE=c:\test.xls' --c:\test.xls是excel文件名
,sheet1$) --sheet1$是工作表名+$

alter Trigger CheckandExist on temp_employee_info

for insert,delete,update

as

if not exists (select * from deleted)

if not exists (select * from employee_info where employee_info.CDSID=(select CDSID from inserted))

insert employee_info(CDSID,Name,Email) select CDSID,Name,Email from inserted
else

update employee_info
set
employee_info.Name=(select Name from inserted),
employee_info.Email=(select Email from inserted)


where
employee_info.CDSID=(select CDSID from inserted)

Oct 10, 2007

如何找到控件的父控件

Code Enough...

TabContainer myTabContainer=(TabContainer)this.Parent.Parent.FindControl("TabContainer1");
myTabContainer.ActiveTabIndex=4;
User Control Level
System.Web.UI.UserControl myASCX = new System.Web.UI.UserControl();
myASCX = (System.Web.UI.UserControl)this.Parent.FindControl("A1");
TextBox myTextBox;
myTextBox = (TextBox)myASCX.FindControl("TextBox1");