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

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2006
Posts: 2
Reputation: gajee is an unknown quantity at this point 
Solved Threads: 0
gajee gajee is offline Offline
Newbie Poster

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

 
0
  #1
Jul 14th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 47
Reputation: ChimpusDupus is an unknown quantity at this point 
Solved Threads: 0
ChimpusDupus ChimpusDupus is offline Offline
Light Poster

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

 
0
  #2
Jul 14th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 237
Reputation: katharnakh is an unknown quantity at this point 
Solved Threads: 33
katharnakh's Avatar
katharnakh katharnakh is offline Offline
Posting Whiz in Training

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

 
0
  #3
Jul 22nd, 2006
thanx for your response, I will try that and get back to you, thanx again..
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 2
Reputation: gajee is an unknown quantity at this point 
Solved Threads: 0
gajee gajee is offline Offline
Newbie Poster

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

 
0
  #4
Jul 22nd, 2006
thank you guys, I will try that and hope it works.........thankyou all.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC