Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

2008-07-11

VB: Regular Expressions, etc...

Regex.IsMatch("subject", "regex") ' Checks if the regular expression 
' matches the subject string.

VB: using Controls collection

' Clears textbox controls' content on the form using 
' Controls collection.
Dim intX As Integer
Do While intX < text = "" intx =" intX">

ViewState("UrlReferrer")

Sub Page_Load()
    If Page.IsPostBack = False Then
        ' Store URL Referrer to return to home page.
        ViewState("UrlReferrer") = Me.Request.UrlReferrer.ToString()
    End If
End Sub

Sub CancelBtn_Click()
    ' Redirect back to the home page.
    Me.Response.Redirect(CType(ViewState("UrlReferrer"), String))
End Sub

ASP confirm

 gt-a-s-p:button id="ConfirmOnClick" runat="server" onclientclick="return
confirm('You\'re sure you want to do this?');" text="Launch Airstrike"> lt/ a-s-p:button> 

ASP .NET set focus to a control (javascript)

body onload="javascript:document.forms[0].txtFirst.focus();"

2008-07-03

Model View Controller

  • Primary goal is to separate the things that change from the things that do not.
  • Model is the data representation.
  • View is the presentation of the model.
  • Controller responds to events and modifies the model.
  • Model notifies the views to update the presentation.

2007-06-19

Getting .dll into Registry

  1. Download the file (MSRDO20.zip) to your desktop
  2. Unzip the content of the file (a file called MSRDO20.DLL) to your desktop
  3. Right now you should have a new file called MSRDO20.DLL that resides on your desktop
  4. Copy this file to your Windows System Folder; this folder is usually found inside your 'C:\Windows' folder. It is called 'C:\Windows\System' or 'System32'...
  5. Go to 'Start Menu' and choose 'Run'
  6. A new window titled 'Run' will open; type the line 'regsvr32.exe msrdo20.dll' and hit 'Enter'.
  7. A message will show up stating that the registration was successful.

2007-06-08

Visual Studio Short-cuts

Most of the time, you will Step Into or Step Over commands in your stored procedures. The commands below apply to a single T-SQL line:

  • Step Into (F11): Use to single step through your code. (Move the yellow arrow down one statement.)
  • Step Over (F10): Useful if you have lines of code that perhaps modify data or call other procedures that you don't care about while debugging. For example, you may want to skip code that performs auditing.
  • Step Out (SHIFT+F11): Execute the rest of the stored procedure without pause.
  • Run to Cursor (CTRL+F10): Position the cursor to a point in your code and then hit CTRL-F10 to execute all code up to that point.
  • Continue or Start Debug or Run (F5): Start Debug. Or resumes execution until completion or until the next breakpoint.
  • Toggle Bookmark (CTRL+K)
  • Help (F1)

When you provide a summary of the class using XML comments, your class displays documentation about itself in appropriate places within Visual Studio, such as in the List Members box. Open the List Members box by selecting Edit | Intellisense | List Members from the main menu bar or by clicking the Display an Object Member List icon on the Text Editor toolbar.

Command Window debugging: Getting Values

To see the value of your variable whilst in Debug mode, use the "Command Window" (View >Other Windows >Command Window). Enter this: ? myVariableName
http://www.ondotnet.com/pub/a/dotnet/excerpt/vshacks_chap1/index.html

2006-11-25

Install Google Search API Into Visual Studio

  • Get the Google API and unzip. Import GoogleSearch.wsdl to the Project root.
  • Right-click on the Project root.
    • Add Web Reference
      • Then type in the URL: http://localhost:1574/projectname/GoogleSearch.wsdl or http://foo.com/GoogleSearch.wsdl

Then you should see an App_WebReferences folder in your Project. And then a folder in that called localhost. And then files GoogleSearch.discomap and GoogleSearch.wsdl in that.

2006-11-18

Load a Control into Visual Studio

  • Right-click on toolbar and "Choose Items"
  • Then browse and go to your /Controls/ folder
  • Then click on it and open
  • Then click "OK"

Then it will be on your toolbar and there will be a Reference to it in your /Bin/