| | |
This ASP.NET page is not working...!!! SOS
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2006
Posts: 2
Reputation:
Solved Threads: 0
Hi..All,
Can somebody please tell me what is wrong with this ASP.NET page??
The browser is returning me the error
--> SubmitBtn_click is undefined <--
here is the code
......
...
[HTML]<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@Import Namespace="System"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="C#" runat="server">
void SubmitBtn_Click(Object Source,EventArgs e)
{
spanMessage.InnerHtml = GetFormattedDate(sugg.Value);
}
</script>
<script language="C#" runat="server">
public static String GetFormattedDate(string cChoice)
{
string sReturn;
switch(cChoice.ToString())
{
case "0": sReturn=DateTime.Now.ToShortDateString();
break;
case "1": sReturn=DateTime.Now.ToShortTimeString();
break;
case "2": sReturn=DateTime.Now.DayOfWeek.ToString();
break;
case "3": sReturn=DateTime.Now.ToString();
break;
default: sReturn ="None";
break;
}
return sReturn;
}
</script>
</head>
<body>
</body>
</html>
<form id="formConvert" runat="server">
<select ID="sugg" runat="server">
<option value="0">Short Date</option>
<option value="1">Short Time</option>
<option value="2">Day of the Week</option>
<option value="3">Date and Time</option>
</select>
<input type="Submit" value="Submit" onClick="SubmitBtn_Click" runat="server"/>
<SPAN ID="spanMessage" runat="server"/>
</form>
[/HTML]
Thankyou.
Can somebody please tell me what is wrong with this ASP.NET page??
The browser is returning me the error
--> SubmitBtn_click is undefined <--
here is the code
......
...
[HTML]<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@Import Namespace="System"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="C#" runat="server">
void SubmitBtn_Click(Object Source,EventArgs e)
{
spanMessage.InnerHtml = GetFormattedDate(sugg.Value);
}
</script>
<script language="C#" runat="server">
public static String GetFormattedDate(string cChoice)
{
string sReturn;
switch(cChoice.ToString())
{
case "0": sReturn=DateTime.Now.ToShortDateString();
break;
case "1": sReturn=DateTime.Now.ToShortTimeString();
break;
case "2": sReturn=DateTime.Now.DayOfWeek.ToString();
break;
case "3": sReturn=DateTime.Now.ToString();
break;
default: sReturn ="None";
break;
}
return sReturn;
}
</script>
</head>
<body>
</body>
</html>
<form id="formConvert" runat="server">
<select ID="sugg" runat="server">
<option value="0">Short Date</option>
<option value="1">Short Time</option>
<option value="2">Day of the Week</option>
<option value="3">Date and Time</option>
</select>
<input type="Submit" value="Submit" onClick="SubmitBtn_Click" runat="server"/>
<SPAN ID="spanMessage" runat="server"/>
</form>
[/HTML]
Thankyou.
![]() |
Similar Threads
- Linking to asp.net page from html page (ASP.NET)
- How To Hyperlink Normal HTML page with ASP.NET Page? (ASP.NET)
- transfer data from an asp .net page into a javasscript script (ASP.NET)
- ASP.NET Page Life Cycle (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: CrystalReports.Engine: Load report failed
- Next Thread: Working with hyperlink....??????
| Thread Tools | Search this Thread |
.net 2.0 3.5 ajax alltypeofvideos appliances asp asp.net beginner box browser businesslogiclayer button c# cac checkbox class commonfunctions compatible content contenttype countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol fileuploader fill findcontrol flash flv formatdecimal formview gridview gudi iis javascript list listbox menu microsoft mouse mssql nameisnotdeclared news novell numerical opera order panelmasterpagebuttoncontrols problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security serializesmo.table sessionvariables silverlight smoobjects software sql sql-server sqlserver2005 ssl tracking treeview unauthorized validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers





