944,183 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 2158
  • ASP.NET RSS
Jul 14th, 2006
0

This ASP.NET page is not working...!!! SOS

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
gajee is offline Offline
2 posts
since Jul 2006
Jul 14th, 2006
0

Re: This ASP.NET page is not working...!!! SOS

Not sure if it will work but try changing onClick in the input button's tag to onServerClick. If that doesn't work, give the button an ID and then add a handles ButtonID.ServerClick to the function declaration.
Last edited by ChimpusDupus; Jul 14th, 2006 at 3:35 pm.
Reputation Points: 10
Solved Threads: 0
Light Poster
ChimpusDupus is offline Offline
47 posts
since Jul 2006
Jul 22nd, 2006
0

Re: This ASP.NET page is not working...!!! SOS

thanx for your response, I will try that and get back to you, thanx again..
Reputation Points: 19
Solved Threads: 34
Posting Whiz in Training
katharnakh is offline Offline
237 posts
since Jan 2006
Jul 22nd, 2006
0

Re: This ASP.NET page is not working...!!! SOS

thank you guys, I will try that and hope it works.........thankyou all.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
gajee is offline Offline
2 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: serial port via ASP.NET 2005
Next Thread in ASP.NET Forum Timeline: Working with hyperlink....??????





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC