ASP.NET 2.0 - Enter Key - Default Submit Button

.NET, ASP.Net 2.0 September 7th, 2010

One of the most annoying things in developing web pages is handling the “Enter key” for form submission. Enter key has been the favourite way users like to submit forms. Though we provide Buttons to click on, the easiest and intuitive way is that, I can enter some text, make some changes and then hit “Enter” to accomplish my submission.
“Enter” Key is handled in a little tricky way by uplevel browsers like Internet Explorer, when it comes to ASP.NET.

* If there is a single Textbox and single button, then it becomes straight forward, the button is submitted. However, the event code doesnt get executed, though the page postsback.

* If there are two or more, buttons, then it takes up the first button as the default button. However, it still doesnt execute the event handler but just refreshes the page.

You can supress the Enter key event using Javascript. But this would result in other undesirable effects like, any Enter key in the form i.e. within Text Area or basically where large text is entered, would be disabled.

The earlier work around was to associate a javascript function to each Button to verify the that the relevant button is submitted upon Enter key.

ASP.NET 2.0 introduces a wonderful work around for this. By simply specifying the “defaultbutton” property to the ID of the <asp:Button>, whose event you want to fire, your job is done.

The defaultbutton property can be specified at the Form level in the form tag as well as at panel level in the <asp:panel> definition tag. The form level setting is overridden when specified at the panel level, for those controls that are inside the panel.
Read the rest of this entry »

Google Buzz
advertisement

 

List of Request.ServerVariables

.NET, ASP.Net, Microsoft July 12th, 2010

ALL_HTTP HTTP_CONNECTION:Keep-Alive HTTP_ACCEPT:*/* HTTP_ACCEPT_ENCODING:gzip, deflate HTTP_ACCEPT_LANGUAGE:sv HTTP_HOST:localhost:1229 HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1)
ALL_RAW Connection: Keep-Alive Accept: */* Accept-Encoding: gzip, deflate Accept-Language: sv Host: localhost:1229 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1)
APPL_MD_PATH
APPL_PHYSICAL_PATH D:\code\web\demos\membership\
AUTH_TYPE NTLM
AUTH_USER SYSTEMEN-D9AE02\Stefan Holmberg
AUTH_PASSWORD
LOGON_USER SYSTEMEN-D9AE02\Stefan Holmberg
REMOTE_USER SYSTEMEN-D9AE02\Stefan Holmberg
CERT_COOKIE
CERT_FLAGS
CERT_ISSUER
CERT_KEYSIZE
CERT_SECRETKEYSIZE
CERT_SERIALNUMBER
CERT_SERVER_ISSUER
CERT_SERVER_SUBJECT
CERT_SUBJECT
CONTENT_LENGTH 0
CONTENT_TYPE
GATEWAY_INTERFACE
HTTPS
HTTPS_KEYSIZE
HTTPS_SECRETKEYSIZE
HTTPS_SERVER_ISSUER
HTTPS_SERVER_SUBJECT
INSTANCE_ID
INSTANCE_META_PATH
LOCAL_ADDR 127.0.0.1
PATH_INFO /membership/servervariables.aspx
PATH_TRANSLATED D:\code\web\demos\membership\servervariables.aspx
QUERY_STRING
REMOTE_ADDR 127.0.0.1
REMOTE_HOST 127.0.0.1
REMOTE_PORT
REQUEST_METHOD GET
SCRIPT_NAME /membership/servervariables.aspx
SERVER_NAME localhost
SERVER_PORT 1229
SERVER_PORT_SECURE 0
SERVER_PROTOCOL HTTP/1.1
SERVER_SOFTWARE
URL /membership/servervariables.aspx
HTTP_CONNECTION Keep-Alive
HTTP_ACCEPT */*
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_ACCEPT_LANGUAGE sv
HTTP_HOST localhost:1229
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1)
Google Buzz
advertisement

 

Colors in ASP.NET

ASP.Net, Microsoft July 9th, 2010

System.Drawing.Color

AliceBlue Hex Code: #F0F8FF
AntiqueWhite Hex Code: #FAEBD7
Aqua Hex Code: #00FFFF
Aquamarine Hex Code: #7FFFD4
Azure Hex Code: #F0FFFF
Beige Hex Code: #F5F5DC
Bisque Hex Code: #FFE4C4
Black Hex Code: #000000
BlanchedAlmond Hex Code: #FFEBCD
Blue Hex Code: #0000FF
BlueViolet Hex Code: #8A2BE2
Brown Hex Code: #A52A2A
BurlyWood Hex Code: #DEB887
CadetBlue Hex Code: #5F9EA0
Chartreuse Hex Code: #7FFF00
Chocolate Hex Code: #D2691E
Coral Hex Code: #FF7F50
CornflowerBlue Hex Code: #6495ED
Cornsilk Hex Code: #FFF8DC
Crimson Hex Code: #DC143C
Cyan Hex Code: #00FFFF
DarkBlue Hex Code: #00008B
DarkCyan Hex Code: #008B8B
DarkGoldenrod Hex Code: #B8860B
DarkGray Hex Code: #A9A9A9
DarkGreen Hex Code: #006400
DarkKhaki Hex Code: #BDB76B
DarkMagenta Hex Code: #8B008B
DarkOliveGreen Hex Code: #556B2F
DarkOrange Hex Code: #FF8C00
DarkOrchid Hex Code: #9932CC
DarkRed Hex Code: #8B0000
DarkSalmon Hex Code: #E9967A
DarkSeaGreen Hex Code: #8FBC8B
DarkSlateBlue Hex Code: #483D8B
DarkSlateGray Hex Code: #2F4F4F
DarkTurquoise Hex Code: #00CED1
DarkViolet Hex Code: #9400D3
DeepPink Hex Code: #FF1493
DeepSkyBlue Hex Code: #00BFFF
DimGray Hex Code: #696969
DodgerBlue Hex Code: #1E90FF
Firebrick Hex Code: #B22222
FloralWhite Hex Code: #FFFAF0
ForestGreen Hex Code: #228B22
Fuchsia Hex Code: #FF00FF
Gainsboro Hex Code: #DCDCDC
GhostWhite Hex Code: #F8F8FF
Gold Hex Code: #FFD700
Goldenrod Hex Code: #DAA520
Gray Hex Code: #808080
Green Hex Code: #008000
GreenYellow Hex Code: #ADFF2F
Honeydew Hex Code: #F0FFF0
HotPink Hex Code: #FF69B4
IndianRed Hex Code: #CD5C5C
Indigo Hex Code: #4B0082
Ivory Hex Code: #FFFFF0
Khaki Hex Code: #F0E68C
Lavender Hex Code: #E6E6FA
LavenderBlush Hex Code: #FFF0F5
LawnGreen Hex Code: #7CFC00
LemonChiffon Hex Code: #FFFACD
LightBlue Hex Code: #ADD8E6
LightCoral Hex Code: #F08080
LightCyan Hex Code: #E0FFFF
LightGoldenrodYellow Hex Code: #FAFAD2
LightGray Hex Code: #D3D3D3
LightGreen Hex Code: #90EE90
LightPink Hex Code: #FFB6C1
LightSalmon Hex Code: #FFA07A
LightSeaGreen Hex Code: #20B2AA
LightSkyBlue Hex Code: #87CEFA
LightSlateGray Hex Code: #778899
LightSteelBlue Hex Code: #B0C4DE
LightYellow Hex Code: #FFFFE0
Lime Hex Code: #00FF00
LimeGreen Hex Code: #32CD32
Linen Hex Code: #FAF0E6
Magenta Hex Code: #FF00FF
Maroon Hex Code: #800000
MediumAquamarine Hex Code: #66CDAA
MediumBlue Hex Code: #0000CD
MediumOrchid Hex Code: #BA55D3
MediumPurple Hex Code: #9370DB
MediumSeaGreen Hex Code: #3CB371
MediumSlateBlue Hex Code: #7B68EE
MediumSpringGreen Hex Code: #00FA9A
MediumTurquoise Hex Code: #48D1CC
MediumVioletRed Hex Code: #C71585
MidnightBlue Hex Code: #191970
MintCream Hex Code: #F5FFFA
MistyRose Hex Code: #FFE4E1
Moccasin Hex Code: #FFE4B5
NavajoWhite Hex Code: #FFDEAD
Navy Hex Code: #000080
OldLace Hex Code: #FDF5E6
Olive Hex Code: #808000
OliveDrab Hex Code: #6B8E23
Orange Hex Code: #FFA500
OrangeRed Hex Code: #FF4500
Orchid Hex Code: #DA70D6
PaleGoldenrod Hex Code: #EEE8AA
PaleGreen Hex Code: #98FB98
PaleTurquoise Hex Code: #AFEEEE
PaleVioletRed Hex Code: #DB7093
PapayaWhip Hex Code: #FFEFD5
PeachPuff Hex Code: #FFDAB9
Peru Hex Code: #CD853F
Pink Hex Code: #FFC0CB
Plum Hex Code: #DDA0DD
PowderBlue Hex Code: #B0E0E6
Purple Hex Code: #800080
Red Hex Code: #FF0000
RosyBrown Hex Code: #BC8F8F
RoyalBlue Hex Code: #4169E1
SaddleBrown Hex Code: #8B4513
Salmon Hex Code: #FA8072
SandyBrown Hex Code: #F4A460
SeaGreen Hex Code: #2E8B57
SeaShell Hex Code: #FFF5EE
Sienna Hex Code: #A0522D
Silver Hex Code: #C0C0C0
SkyBlue Hex Code: #87CEEB
SlateBlue Hex Code: #6A5ACD
SlateGray Hex Code: #708090
Snow Hex Code: #FFFAFA
SpringGreen Hex Code: #00FF7F
SteelBlue Hex Code: #4682B4
Tan Hex Code: #D2B48C
Teal Hex Code: #008080
Thistle Hex Code: #D8BFD8
Tomato Hex Code: #FF6347
Transparent Hex Code: #FFFFFF
Turquoise Hex Code: #40E0D0
Violet Hex Code: #EE82EE
Wheat Hex Code: #F5DEB3
White Hex Code: #FFFFFF
WhiteSmoke Hex Code: #F5F5F5
Yellow Hex Code: #FFFF00
YellowGreen Hex Code: #9ACD32
Google Buzz
advertisement

 

Custom paging nav on GridView control

.NET, ASP.Net, Microsoft June 25th, 2010

<PagerTemplate>
      <asp:LinkButton CommandName="Page" CommandArgument="First"
        ID="LinkButton1" runat="server" Style="color: white">
        &lt;&lt;First</asp:LinkButton>
      <asp:LinkButton CommandName="Page" CommandArgument="Prev"
        ID="LinkButton2" runat="server" Style="color: white">
        &lt; Prev</asp:LinkButton>
      [Records <%= GridView1.PageIndex * GridView1.PageSize %>
        - <%= GridView1.PageIndex * GridView1.PageSize +
           GridView1.PageSize - 1 %>]
      <asp:LinkButton CommandName="Page" CommandArgument="Next"
        ID="LinkButton3" runat="server" Style="color: white">
        Next &gt;</asp:LinkButton>
      <asp:LinkButton CommandName="Page" CommandArgument="Last"
       ID="LinkButton4" runat="server" Style="color: white">
        Last &gt;&gt;</asp:LinkButton>
</PagerTemplate>
Google Buzz
advertisement

 

Erro ao abrir Outlook 2003/2007

Microsoft, Outlook May 28th, 2010

“Não é possível iniciar o microsoft office outlook. Não é possível abrir a janela do Outlook.”

Erro ao abrir o Outlook 2007 (Não é possivel abrir a janela do outlook)
Hoje depois de um reboot ao PC não estava a conseguir abri o Outlook.

Após alguma pesquisa e debug, lá encontrei a solução: “Limpar e gerar novamente o painel de navegação do perfil actual.â€

Para isso basta ir ao “Menu Iniciarâ€, escolher a opção “Executar†e escrever o comando outlook  /resetnavpane

Outros comandos que podem ser úteis para o Outlook:
http://office.microsoft.com/pt-pt/outlook/HP010031102070.aspx
http://www.mundibrasil.org/news/atualizacao-pode-causar-pane-no-outlook-saiba-como-resolver.html

Google Buzz
advertisement

 

Error “The report server database is an invalid version”

Microsoft May 27th, 2010

Source: Report Server Windows
Event ID: 117
Description: The report server database is an invalid version.

Reporting Services Configuration Manager

  1. Open up the “Reporting Services Configuration Manager” by going to Start -> Programs ->Microsoft SQL Server 2005 -> Configuration Tools -> Reporting Services Configuration.
  2. On the left hand side, click on “Database Setup”. (there should be a red “x” to the left of Database Setup.
  3. Choose the appropriate Server Name.
  4. For the Database Name, click “New” and do not use the default name “ReportServer” since it’s possible a .MDF file was already created with this name. I used “ReportServer2″.
  5. Make sure to choose the “Credentials Type” and enter the account information for a user who has create database permissions.
  6. Click “Upgrade”. Make sure you get all green check marks (even a warning message means the process probably didn’t complete properly).
  7. Click “Apply” at the bottom.
Google Buzz
advertisement

 

A WMI error has occurred and no additional error information is available

Microsoft, SQL Server May 26th, 2010

This can happen when you have different versions installed. For example, if you install SQL Server 2005 SP3 and later, and only then install the Reporting Services.

In this situation it should be rerun after the SP3 installation of Reporting Services

Google Buzz
advertisement

 

Installing GPMC on Windows Server 2008 and Windows Vista Service Pack 1

Microsoft, Networking May 26th, 2010

The Group Policy Management Console is included in Windows Server 2008; however, you must install it before you can use it. The domain controller promotion process installs GPMC on the server, in addition to adding the domain controller to the domain. Additionally, you can install GPMC on a member server as long as it’s a member of the domain. Let’s look at two ways to install GPMC on Windows Server 2008 (other than through DCPROMO).

Installing GPMC using Server Manager (Windows Server 2008)

The Group Policy Management Console is a Feature in Windows Server 2008. You install Features using Server Manager. Once installed, you can access the feature using Server Manager or you can the specific management console (like gpmc.msc).

Read the rest of this entry »

Google Buzz
advertisement

 

SQL collations

SQL Server, Transact-SQL April 30th, 2010

Query:

select * from fn_helpcollations()
where name like ‘%SQL_Latin1_General_CP1_CI_AS%’
or name = ‘Latin1_General_CI_AS’
or name like ‘%cp1%’

Query result:

Read the rest of this entry »

Google Buzz
advertisement

 

How to clear Outlook Contact history (auto display after TO:)

Outlook, Truques & Dicas April 21st, 2010

Short answer: Delete your NK2 file.

Slightly longer answer: In the C:\Documents and Settings\<user

name>\Application Data\Microsoft\Outlook directory there should be a file

with an NK2 extension. Deleting it should clear the auto-suggestion cache.

Google Buzz
advertisement

 

ASP.NET Charting Control

.NET, ASP.Net, Microsoft March 29th, 2010

Scott Gu blogged about the the free Microsoft Chart Controls for Microsoft .NET 3.5.

Microsoft recently released a cool new ASP.NET server control - <asp:chart /> - that can be used for free with ASP.NET 3.5 to enable rich browser-based charting scenarios:

Once installed the <asp:chart/> control shows up under the “Data” tab on the Toolbox, and can be easily declared on any ASP.NET page as a standard server control:

Read the rest of this entry »

Google Buzz
advertisement

 

IIS returns HTTP 404 for Office 2007 file downloads

IIS, Microsoft March 29th, 2010

This is kind of an old issue, but since I mostly work on corporate projects, we’re a bit slow on adopting new versions of anything.
I ran into this issue with Microsoft Word 2007 documents, but the same error will occur with any other file type that isn’t properly configured on the web server.

Symptoms
Microsoft Word 2007 documents return a HTTP 404 error when users attempt to download the documents. The web server uses Microsoft IIS 6.0.

Cause
IIS does not have a wildcard mapping for unknown MIME types and the file type is not known to the web server. This prevents IIS 6.0 to serve the file.

Resolution

To resolve the errors, add the missing MIME types to IIS.
Instructions

1. Open IIS Management Console (via Computer Manager->Services and Applications->Internet Information Service)
2. Right click on “Web Sitesâ€.
3. Choose Properties
4. Activate “HTTP Headers†tab
5. Click “File Types†button in the MIME Map groupbox
6. Click “New Typeâ€
7. Enter the MIME type data from the below table

Associated
Extension
Content type (MIME)
(remove any spaces below)
docx application/vnd.openxmlformats- officedocument.wordprocessingml.document
pptx application/vnd.openxmlformats- officedocument.presentationml.presentation
xlsx application/vnd.openxmlformats- officedocument.spreadsheetml.sheet
Google Buzz
advertisement

 

Hyper-V Licensing Explained!

Hyper-V, Microsoft March 29th, 2010

I’ve spoken to a lot of people who have expressed a lot of confusion about the OS licensing model when virtualizing systems using Hyper-V products.

There are some simple guidelines to observe when planning your Hyper-V infrastructure to take advantage of the licensing models for each edition of Windows Server 2008.

First, a term definition: Microsoft uses the term “OSE” to refer to an operating system environment, either physical or virtual. Also, Microsoft refers to a “processor” in the context of a single processor socket on the motherboard. This calculation is not affected when considering multiple core processors or hyper-threading capabilities on certain processor types.

posted in: http://msmvps.com/blogs/virtualreality

Read the rest of this entry »

Google Buzz
advertisement

 

Antivírus gratuito da Microsoft disponível em português

Microsoft, Security March 19th, 2010

A Microsoft  Portugal lançou hoje a versão portuguesa do Microsoft Security Essentials, uma solução gratuita de segurança para os computadores pessoais dos utilizadores do sistema operativo Windows.

Este antivírus está disponível a partir de hoje para download gratuito na página do produto e oferece aos utilizadores de tecnologia Microsoft uma protecção contra vírus, spyware e outros tipos de software malicioso, sendo compatível com os sistemas operativos Windows XP, Windows Vista e Windows 7.

security-essentials

homepage: www.microsoft.com/security_essentials

Read the rest of this entry »

Google Buzz
advertisement

 

Windows Server 2008 Workstation Converter

Windows server February 19th, 2010

Convert Windows Server 2008 to Workstation Manual

If you don’t want to configure all options to convert Windows Server 2008 to a Workstation manually, sawo now made it possible to use a tool for this. He has done a great job by creating this converter to automate all steps of the manual!

Get the Windows Server 2008 Workstation Converter

  • Download Serv08Convert12.zip (13.2MB)
  • View previous versions.

http://converter.win2008workstation.com/

Read the rest of this entry »

Google Buzz
advertisement

 

 
banner for http://www.eurobilltracker.com
 
Ligar ao Facebook