I created a masterpage for using VirtualKeyboard
. It works fine, but when I am using this in content page it doesn't work.
This is code in masterpage:
<head runat="server">
<title></title>
<link href="css/keyboard.css" rel="stylesheet" />
<link rel="stylesheet" href="css/demo.css" />
<script src="script/prototype.js"></script>
<script src="script/keyboard.js"></script>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<cc1:VirtualKeyboard ID="VirtualKeyboard1" runat="server" ClientIDMode="AutoID" CssClass="KeyBoard" ForControl="TextBox1" />
</div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</form>
</body>
This is code in content page:
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@ Register Assembly="SPCS.AspDotNet" Namespace="SPCS.AspDotNet" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<cc1:VirtualKeyboard ID="VirtualKeyboard1" runat="server" ForControl="TextBox1" />
</asp:Content>
Please set ClientIDMode="Static" in TextBox because by default it is Inherit so it may generate AutoID and try it
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:TextBox ID="TextBox1" runat="server" ClientIDMode="Static"></asp:TextBox>
<cc1:VirtualKeyboard ID="VirtualKeyboard1" runat="server" ForControl="TextBox1" />
</asp:Content>