Wednesday, October 3, 2012

URL properties of Request to ASP.NET


URL properties of Request to ASP.NET

The following attributes are some of the usefull properties of the URL object. I use the following url to send my request to localhost:


http://localhost/Test/Asghar.aspx?test=fine


And I get the following results:

AbsolutePath = /Test/Asghar.aspx
AbsoluteUri = http://localhost/Test/Asghar.aspx?test=fine
Authority = localhost
DnsSafeHost = localhost
Fragment =
Host = localhost
HostNameType= Dns
IsAbsoluteUri = True
IsFile = False
LocalPath = /Test/Asghar.aspx
OriginalString = http://localhost:80/Test/Asghar.aspx?test=fine
PathAndQuery = /Test/Asghar.aspx?test=fine
Port = 80
Query = ?test=fine
Scheme = http
UserEscaped = False
UserInfo =

And the code to do it is as followes:

    AbsolutePath = <%= System.Web.HttpContext.Current.Request.Url.AbsolutePath %>

     AbsoluteUri = <%= System.Web.HttpContext.Current.Request.Url.AbsoluteUri %>

     Authority = <%= System.Web.HttpContext.Current.Request.Url.Authority %>

     DnsSafeHost = <%= System.Web.HttpContext.Current.Request.Url.DnsSafeHost %>

     Fragment = <%= System.Web.HttpContext.Current.Request.Url.Fragment %>

     Host = <%= System.Web.HttpContext.Current.Request.Url.Host %>

     HostNameType= <%= System.Web.HttpContext.Current.Request.Url.HostNameType.ToString() %>

     IsAbsoluteUri = <%= System.Web.HttpContext.Current.Request.Url.IsAbsoluteUri %>

     IsFile = <%= System.Web.HttpContext.Current.Request.Url.IsFile %>

     LocalPath = <%= System.Web.HttpContext.Current.Request.Url.LocalPath %>

     OriginalString  = <%= System.Web.HttpContext.Current.Request.Url.OriginalString  %>

     PathAndQuery = <%= System.Web.HttpContext.Current.Request.Url.PathAndQuery %>

     Port = <%= System.Web.HttpContext.Current.Request.Url.Port %>

     Query = <%= System.Web.HttpContext.Current.Request.Url.Query %>

     Scheme = <%= System.Web.HttpContext.Current.Request.Url.Scheme %>

     UserEscaped = <%= System.Web.HttpContext.Current.Request.Url.UserEscaped %>

     UserInfo = <%= System.Web.HttpContext.Current.Request.Url.UserInfo %>

 

Wednesday, September 26, 2012

SQL Server Management Studio keyboard shortcuts


CTRL+N New Project
CTRL+SHIFT+N Open an existing file
CTRL+O Open an existing project
CTRL+SHIFT+O Add New Item to the current project
CTRL+SHIFT+A Add Existing Item to the current project
ALT+SHIFT+A Display the Query Designer
CTRL+SHIFT+Q Move to the SQL Server Management Studio menu bar
ALT Close a menu or dialog box, canceling the action
ESC Activate the menu for a tool component
ALT+HYPHEN Display the context menu
SHIFT+F1 Clear all bookmarks
CTRL-SHIFT-F2 Insert or remove a bookmark (toggle)
CTRL+F2 Move to next bookmark
F2 Move to previous bookmark
SHIFT+F2 Copy
CTRL+C OR CTRL+INSERT Cut
CTRL+X OR SHIFT+DEL Paste
CTRL+V OR SHIFT+INSERT Make selection lowercase
CTRL+SHIFT+L Make selection uppercase
CTRL+SHIFT+U Select all
CTRL+A Decrease indent
SHIFT+TAB Clear the active Editor pane
CTRL+SHIFT+DEL Delete to end of a line in Editor pane
CTRL+DEL Print
CTRL+P Help for Query Analyzer
F1 Help for the selected Transact-SQL
SHIFT+F1 Switch panes
SHIFT+F6 Window Selector
CTRL+W Object Browser (show/hide)
F8 Object Search
F4 Display results in grid format
CTRL+D Display results in text format
CTRL+T Move the splitter
CTRL+B Show Results pane (toggle)
CTRL+R Insert a template
CTRL+SHIFT+INSERT Replace template parameters
CTRL+SHIFT+M Display estimated execution plan
CTRL+L Display execution plan (toggle ON/OFF)
CTRL+K Index Tuning Wizard
CTRL+I Show client statistics
CTRL+SHIFT+S Show server trace
CTRL+SHIFT+T Disconnect



CTRL+F4 Disconnect and close child window
ALT+F4 Database object information
ALT+F1 Use database
CTRL+U Change Database



CTRL+N Parse the query and check syntax
CTRL+F5 Execute a query
F5 OR CTRL + E Save results to file
CTRL+SHIFT+F Cancel a query
ALT+BREAK Save
CTRL+S Increase indent
TAB Comment - Remove Comment
CTRL+K > U Switch between query and result panes
F6 Comment - Comment Out Code



Visual Studio Keyboard Shortcuts


1. F5: Start your project in debug mode

2. F7 & Shift-F7: Show the code windows & Show the designer window

3. Alt-Enter: Show the properties panel for a selected object (this is general Windows shortcut that can be used on files and directories)

4. F6 / Shift-F6 / Ctrl-Shift-B: Build solution / Build project / Build solution

5. Shift-Alt-C: Add a new class to your project

6. Ctrl-K + Ctrl-C: Comment a selected block of code

7. Ctrl-K + Ctrl-U: Un-comment a selected block of code

8. Ctrl-M + Ctrl-O / Ctrl-M + Ctrl-P: Collapse all code to definitions / Expand all code (stop collapsing)

9. Ctrl-M + Ctrl+M: Expend or collapse a selected code fragment. The code collapsed depends on where the cursor is located

10. Ctrl-B + Ctrl-T: Toggle code bookmark

11. Ctrl-Alt-P: Attach the debugger to a process. This is insanely useful for debugging ASP.NET web sites without having to start the project in debug mode

12. Ctrl-Alt-L: Show the solution explorer

13. Ctrl-Shift-A / Alt-Shift-A: Add a new item to your project / add an existing item to your project

Ctrl-N: Add a new file

Ctrl-S: Save file

Ctrl-Z / Ctrl-Y: Undo typing / Redo typing

Ctrl-F: Bring up the "Find" dialog

Ctrl-H: Bring up the "Replace" dialog

Ctrl-Tab: Scroll forward through open windows

Ctrl-Shift-Tab: Scroll backwards through open windows

Tuesday, September 25, 2012

List of Sql Server Tables, Function,Stored Procedure and views.


Information about table
SELECT * FROM sys.sysobjects WHERE xtype = 'U' order by crdate asc

Information about Stored Procedure
SELECT * FROM sys.sysobjects WHERE xtype = 'P' and name like 'B2B_GetSD%' order by crdate desc

Information about Functions
SELECT * FROM sys.sysobjects WHERE xtype = 'FN' order by crdate desc

Information about Views
SELECT * FROM sys.sysobjects WHERE xtype = 'V' order by crdate desc