ASP.NET 4 Web Forms

Web page by Kevin Harris of Homer IL

Please contact Kevin Harris of Homer IL concerning this web site

ASP.NET 4 Web Forms

.jQuery UI and Dynamic Data


jQuery UI and Dynamic Data

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
<%@ Control Language="C#" CodeBehind="DateTime_Edit.ascx.cs" Inherits="DnamicDataExample.DateTime_EditField" %>
<link href="../../Styles/jquery-ui.min.css" rel="stylesheet" />
<script src="../../Scripts/jquery-1.7.1.js"></script>
<script src="../../Scripts/jquery-ui-1.8.20.js"></script>

<asp:TextBox ID="TextBox1" runat="server" Text='<%# (FieldValueEditString != "") ? String.Format("{0:MM/dd/yyyy}", Convert.ToDateTime(FieldValueEditString)) : "" %>' Columns="20"></asp:TextBox>

<script type="text/javascript">
    $(document).ready(function() {
    $('#<%=TextBox1.ClientID%>').datepicker();
    });

</script>

<asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" CssClass="DDControl DDValidator" ControlToValidate="TextBox1" Display="Static" Enabled="false" />
<asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator1" CssClass="DDControl DDValidator" ControlToValidate="TextBox1" Display="Static" Enabled="false" />
<asp:DynamicValidator runat="server" ID="DynamicValidator1" CssClass="DDControl DDValidator" ControlToValidate="TextBox1" Display="Static" />
<asp:CustomValidator runat="server" ID="DateValidator" CssClass="DDControl DDValidator" ControlToValidate="TextBox1" Display="Static" EnableClientScript="false" Enabled="false" OnServerValidate="DateValidator_ServerValidate" />

jQuery UI

https://jqueryui.com/

Dynamic Data for automatically creating Admin screens. Use VS 2013 "ASP.NET Dynamic Data Entities Web Application Template". Create entity model and then register it in Global.asax.cs. Note: Syntax change going from EF5 to EF 6
https://blogs.msdn.microsoft.com/webdev/2014/01/30/announcing-preview-of...
.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
     public static void RegisterRoutes(RouteCollection routes)
        {
            //                    IMPORTANT: DATA MODEL REGISTRATION 
            // Uncomment this line to register an ADO.NET Entity Framework model for ASP.NET Dynamic Data.
            // Set ScaffoldAllTables = true only if you are sure that you want all tables in the
            // data model to support a scaffold (i.e. templates) view. To control scaffolding for
            // individual tables, create a partial class for the table and apply the
            // [ScaffoldTable(true)] attribute to the partial class.
            // Note: Make sure that you change "YourDataContextType" to the name of the data context
            // class in your application.
            // See http://go.microsoft.com/fwlink/?LinkId=257395 for more information on how to register Entity Data Model with Dynamic Data            
            //DefaultModel.RegisterContext(() =>
            //{
            //    return ((IObjectContextAdapter)new Database1Entities()).ObjectContext;
            //}, new ContextConfiguration() { ScaffoldAllTables = true });

            DefaultModel.RegisterContext(
                new Microsoft.AspNet.DynamicData.ModelProviders.EFDataModelProvider(
                    () =>new Database1Entities()),
                new ContextConfiguration { ScaffoldAllTables = true });


Dynamic Data RegisterRoutes in Global.asax.cs

. IIS - localhost (Windows 10)


IIS - localhost (Windows 10)

Directories:

Home: C:\inetpub
Program: C:\Windows\System32\inetsrv\InetMgr.exe

.NET Framework Executables


NET Framework Executables

When changing directories, use the tab key to step thru the available subdirectories. Can also enter letter(s) and the tab to reduce list of choices.

  • aspnet_compiler.exe - Precompile and ASP.NET application.
  • aspnet_regbrowsers.exe - Compile/Register ASP.NET browser files.
  • aspnet_regiis.exe - Admin util to install and uninstall ASP.NET on local machine.
  • aspnet_regsql.exe - SQL Server setup wizard for membership, profiles, roles, and personalization.
Error | ASP.NET Developer

Error

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /srv/disk9/1218369/www/kcshadow.net/aspnet/includes/common.inc:2748) in drupal_send_headers() (line 1232 of /srv/disk9/1218369/www/kcshadow.net/aspnet/includes/bootstrap.inc).
  • PDOException: SQLSTATE[42000]: Syntax error or access violation: 1142 INSERT command denied to user '1218369_b2cf'@'185.176.40.58' for table 'watchdog': INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 0 [:db_insert_placeholder_1] => cron [:db_insert_placeholder_2] => Attempting to re-run cron while it is already running. [:db_insert_placeholder_3] => a:0:{} [:db_insert_placeholder_4] => 4 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://www.kcshadow.net/aspnet/?q=webforms4 [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => 54.80.87.62 [:db_insert_placeholder_9] => 1534851983 ) in dblog_watchdog() (line 160 of /srv/disk9/1218369/www/kcshadow.net/aspnet/modules/dblog/dblog.module).
The website encountered an unexpected error. Please try again later.