473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Help needed for ServerClick function don't start

Hi, I have a problem in VS2003 and .Net 1.1 as below:

I put a HTML submit button control and label it as "run @ server"

My purpose is that when click this button, system will check the input
fields' value

so I write on form's onsubmit method is "return checkfield()"

BUT, after I compose some code in button's server click method in C# code
behind the aspx file, when I click the "submit" button , the server_click
code never run.

How can I solve this problem, thanks!!
Oct 18 '06 #1
4 1503
Some Addtional information:
I have read some example in MSDN
seems the code I wrote is as the same as the example and a little diffence
is:
Example in MSDN place the Server_click in aspx file
The code I wrote is in cs file beind the aspx

What's the reason?

"David Jia" <ca*****@21cn.comдÈëÏûÏ¢ÐÂÎÅ:%2****************@T K2MSFTNGP03.phx.gbl...
Hi, I have a problem in VS2003 and .Net 1.1 as below:

I put a HTML submit button control and label it as "run @ server"

My purpose is that when click this button, system will check the input
fields' value

so I write on form's onsubmit method is "return checkfield()"

BUT, after I compose some code in button's server click method in C# code
behind the aspx file, when I click the "submit" button , the server_click
code never run.

How can I solve this problem, thanks!!

Oct 18 '06 #2
Does the button refer to your event properly for the click event? Something
you could do instead is override the init event of the page, then set the
button's click event to your event handler there such as:

Button1.Click+=new EventHandler(Button1_Click);

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"David Jia" <ca*****@21cn.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hi, I have a problem in VS2003 and .Net 1.1 as below:

I put a HTML submit button control and label it as "run @ server"

My purpose is that when click this button, system will check the input
fields' value

so I write on form's onsubmit method is "return checkfield()"

BUT, after I compose some code in button's server click method in C# code
behind the aspx file, when I click the "submit" button , the server_click
code never run.

How can I solve this problem, thanks!!

Oct 18 '06 #3
I have found this two sentences in my Initpage, does it work ?

private void InitializeComponent()
{
this.btnEdit.ServerClick += new
System.EventHandler(this.btnEdit_ServerClick);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

public void btnEdit_ServerClick(object sender, System.EventArgs e)
{
// nothing to do now
Response.Write("<scriptalert('yes'); </script>");
VideoFile.PostedFile.SaveAs("c:\\test.pp");

}
"Mark Fitzpatrick" <ma******@fitzme.comдÈëÏûÏ¢ÐÂÎÅ:e6**************@ TK2MSFTNGP04.phx.gbl...
Does the button refer to your event properly for the click event?
Something you could do instead is override the init event of the page,
then set the button's click event to your event handler there such as:

Button1.Click+=new EventHandler(Button1_Click);

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"David Jia" <ca*****@21cn.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>Hi, I have a problem in VS2003 and .Net 1.1 as below:

I put a HTML submit button control and label it as "run @ server"

My purpose is that when click this button, system will check the input
fields' value

so I write on form's onsubmit method is "return checkfield()"

BUT, after I compose some code in button's server click method in C# code
behind the aspx file, when I click the "submit" button , the server_click
code never run.

How can I solve this problem, thanks!!


Oct 19 '06 #4
It is not working, please help me !! help!!
"David Jia" <ca*****@21cn.comдÈëÏûÏ¢ÐÂÎÅ:uX*************@TK2M SFTNGP05.phx.gbl...
>I have found this two sentences in my Initpage, does it work ?

private void InitializeComponent()
{
this.btnEdit.ServerClick += new
System.EventHandler(this.btnEdit_ServerClick);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

public void btnEdit_ServerClick(object sender, System.EventArgs e)
{
// nothing to do now
Response.Write("<scriptalert('yes'); </script>");
VideoFile.PostedFile.SaveAs("c:\\test.pp");

}
"Mark Fitzpatrick" <ma******@fitzme.comдÈëÏûÏ¢ÐÂÎÅ:e6**************@ TK2MSFTNGP04.phx.gbl...
>Does the button refer to your event properly for the click event?
Something you could do instead is override the init event of the page,
then set the button's click event to your event handler there such as:

Button1.Click+=new EventHandler(Button1_Click);

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"David Jia" <ca*****@21cn.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>Hi, I have a problem in VS2003 and .Net 1.1 as below:

I put a HTML submit button control and label it as "run @ server"

My purpose is that when click this button, system will check the input
fields' value

so I write on form's onsubmit method is "return checkfield()"

BUT, after I compose some code in button's server click method in C#
code behind the aspx file, when I click the "submit" button , the
server_click code never run.

How can I solve this problem, thanks!!



Oct 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Gerry | last post by:
Help needed with this: I have had a guestbook-page in Europe and will now have to move it to a US based-server. This makes the time-function showing time 6 hours wrong. The time should be GMT...
8
by: Mike Gifford | last post by:
Hello, I've got a number of html fragments (in a template file) which are bundled together in a cms. I'm sure that there's a way through javascript to convert a piece of code like this: ...
4
by: cpptutor2000 | last post by:
I am trying to create a simple linked list. The source code is provided below. I receive the following error message: (Please see after source code). I have marked the lines where the error occurs...
2
by: Francois | last post by:
I have the following ASP.NET page : <!-- event.aspx --> <%@ Page Language="C#" %> <html> <script runat=server> protected int counter; protected void OnClickMyButton(object src, EventArgs e)...
5
by: JP | last post by:
ow do I get a HtmlInputImage to raise the ServerClick event I have two inputs one is a submit button the other is a image. The submit button works the input image does not. Does anyone know why...
0
by: Jon Cosby | last post by:
I'm trying to find a simple script for hiding my email until the user chooses to send a message. I thought I might be able to do this with the ServerClick event on the HTML anchor, setting the...
0
by: Oz | last post by:
Hi Using VS.NET 2003, Windows XP SP1, We have a page which has been developed using ASP.NET. On it, is a button which when clicked is supposed to add some data to a table. When the button is...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
3
by: TC | last post by:
Hey All, I have some classes that I recently built for a website which uses the HttpWebRequest & HttpWebResponse objects from the System.Net namespace. Basically, the classes rap submitted data...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.