Hi,
I am coming up with a calendar.I am using ASP.net with C#.I am having using a .ascx file format. i am getting an error on the
10th line. it shows CS1001:identifier expected. i am not sure of what to do. Please guide me of my mistake. im using Visual web developer 2008 express
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MonthSelectControl.ascx.cs" Inherits="MonthSelectControl" %>
<%@ import namespace="system.web" %>
<%@ import namespace="system.web.security" %>
<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="System.Configuration" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script runat="server">
function nextYear(forward) {
var yearField = document.getElementById("<%= txtYear.ClientID %>");
var testEr = new RegExp( 'd','g');
if(testEr.test(yearField.value)) {
var yearValue = parseInt(yearField.value);
if(forward)
yearValue = yearValue+1;
else
yearValue = yearValue-1;
yearField.value = yearValue;
} else {
var newDate = new Date();
yearField.value = newDate.getFullYear();
}
}
</script>
<div style="border: 1px solid black; width: 100px; text-align: center;">
<div style="background-color: rgb(255,238,187); padding-top: 2px;">
<img src="<%= Page.ResolveUrl("~/images/prev1.gif") %>" border="0" onclick="nextYear(false);"/>
<asp:TextBox ID="txtYear" Runat="server" CssClass="form" Width="50" style="width: 50px; border: 1px solid; text-align: center;" MaxLength="4"
></asp:TextBox>
<img src="<%= Page.ResolveUrl("~/images/next1.gif") %>" border="0" onclick="nextYear(true);">
<hr style="border: black 1px solid;" size="1"></hr>
</div>
<table align="center" style="width: 163%">
<tr>
<td><asp:LinkButton ID="lnkJan" Runat=server OnClick="lnkMonthClick">Jan</asp:LinkButton>
</td>
<td><asp:LinkButton ID="lnkFeb" Runat=server OnClick="lnkMonthClick">Feb</asp:LinkButton>
</td>
<td><asp:LinkButton ID="lnkMar" Runat=server OnClick="lnkMonthClick">Mar</asp:LinkButton>
</td>
</tr>
<tr>
<td><asp:LinkButton ID="lnkApr" Runat=server OnClick="lnkMonthClick">Apr</asp:LinkButton>
</td>
<td><asp:LinkButton ID="lnkMay" Runat=server OnClick="lnkMonthClick">May</asp:LinkButton>
</td>
<td><asp:LinkButton ID="lnkJun" Runat=server OnClick="lnkMonthClick">Jun</asp:LinkButton>
</td>
</tr>
<tr>
<td><asp:LinkButton ID="lnkJul" Runat=server OnClick="lnkMonthClick">Jul</asp:LinkButton>
</td>
<td><asp:LinkButton ID="lnkAug" Runat=server OnClick="lnkMonthClick">Aug</asp:LinkButton>
</td>
<td><asp:LinkButton ID="lnkSep" Runat=server OnClick="lnkMonthClick">Sep</asp:LinkButton>
</td>
</tr>
<tr>
<td><asp:LinkButton ID="lnkOct" Runat=server OnClick="lnkMonthClick">Oct</asp:LinkButton>
</td>
<td><asp:LinkButton ID="lnkNov" Runat=server OnClick="lnkMonthClick">Nov</asp:LinkButton>
</td>
<td><asp:LinkButton ID="lnkDec" Runat=server OnClick="lnkMonthClick">Dec</asp:LinkButton>
</td>
</tr>
</table>
</div>