Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save NPS-ARCN-CAKN/296619b6437a480159b037984b8ecc4d to your computer and use it in GitHub Desktop.
Save NPS-ARCN-CAKN/296619b6437a480159b037984b8ecc4d to your computer and use it in GitHub Desktop.
ASP .Net VB DetailsForm - Set DefaultMode on Page_Load using QueryString parameter
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Request.Params("CampaignID") = Nothing Then
'There is no record to edit, set the form to Insert mode
Me.DetailsView1.DefaultMode = DetailsViewMode.Insert
Else
'User requested a Campaign record to view
Me.DetailsView1.DefaultMode = DetailsViewMode.ReadOnly
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment