Category Archives: ASP.Net

.NET ASP.Net Microsoft

List of Request.ServerVariables

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)
ASP.Net Microsoft

Colors in ASP.NET

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
.NET ASP.Net Microsoft

Custom paging nav on GridView control

<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>
.NET ASP.Net Microsoft

ASP.NET Charting Control

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 more »

AJAX ASP.Net ATLAS

Using CSS Friendly Control Adapters

Thanks to Tim for this solution. In order to add the CSS Friendly adapter to your project, you will need to:

  1. Download CSSFriendly.dll and CSSFriendlyAdapters.browser from here.
  2. Inside your project, add a reference to CSSFriendly.dll.
  3. Add the special folder App_Browsers to your project, and copy the file CSSFriendlyAdapters.browser.

The CSS Friendly Control Adapters will render all the listed controls (Menu, TreeView, DetailsView, …) using CSS and HTML standards.

http://www.codeplex.com/cssfriendly

Code Snippets ASP.Net

ASP.Net Get File Size

Dim MyFile As String = “~/photos/myImage.gif”

Dim finfo As New FileInfo(Server.MapPath(MyFile))

Dim FileInBytes As Long = finfo.Length

Dim FileInKB As Long = finfo.Length / 1024

Response.Write((“File Size: ” & FileInBytes.ToString() & ” bytes (“) + FileInKB.ToString() & ” KB)”)

ASP.Net

ASP.Net erro: Proxy name could not be resolved

Colocar em web.config:

<system.net>

<!– ASP.NET Proxy Usage for HttpWebRequests
“usesystemdefault”
false – stops the server using the default proxy configuration or proxy
auto-detection.
“bypassonlocal”
true – this tells all requests to a local address to ignore configured proxies.
–>
<defaultProxy>
<proxy usesystemdefault=”false” bypassonlocal=”true”/>
</defaultProxy>

</system.net>

ASP.Net

ASP.NET MVC 1.0

newdotnetlogo_2_thumb_3

ASP.NET MVC 1.0 oferece um novo Model-View-Controller (MVC) framework sobre o existente ASP.NET 3.5 runtime. Isto significa que os programadores podem tirar partido dos Padrões Digitais do MVC para criar as suas aplicações web, que incluem a habilidade de atingir e manter uma clara separação de conceitos (o UI ou vista de formulário e a lógica da aplicação), assim como facilitar o test driven development (TDD).

O ASP.NET MVC framework define um padrão expecifico de estrutura de ficheiros de aplicações web.

Donwload link

Homepage: http://www.asp.net/mvc/

ASP.Net SQL Server

Como utilizar o Response.Redirect para uma nova janela

Para fazer um redireccionamento para uma nova janela podemos adicionar ao controlo <asp:button> o atributo

ButtonPrint.Attributes.Add(“OnClick”, “javascript:window.open(‘novapagina.aspx’)”)

este atributo pode ser adicionado no Page.load()

Apache ASP.Net

How to make Apache run ASP.NET / ASP.NET 2.0

Artigo interessante de Ohad’s Blog

Link: http://weblogs.asp.net/israelio/archive/2005/09/11/424852.aspx

read more »