473,385 Members | 1,673 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,385 software developers and data experts.

how to work Submit Button on Content Page in ASPmet 2.0

I am doing one project with asp net 2.0 and c# ,i have master page and content page ,
in content page i have 10 text box and one submit button , when submit
will click those text box need to validate .
i have written java script function in content page ,But when i click submit button it will execute server side code when java script function returns false .

i dont know how to do in ASPnet 2.0 please help any body .
============================================

i don't know some how i solved this problem
in page load of content page i have written

string aa = " if(document.getElementById('Text1').value==\"\") { alert('please'); return false; }";
Page.ClientScript.RegisterOnSubmitStatement(GetTyp e(), "done", aa);

it is working but i dont want to write every thing in code i want to write in .js file or in html function ....

please help me ,, i will be thankful to you .......

thank s
Dipesh
Jun 29 '07 #1
2 1043
radcaesar
759 Expert 512MB
Why did u want to write your own JS when there is some inbuilt validations available ?

HTML Functions? Whats that mean you try to point out ?

:)

I am doing one project with asp net 2.0 and c# ,i have master page and content page ,
in content page i have 10 text box and one submit button , when submit
will click those text box need to validate .
i have written java script function in content page ,But when i click submit button it will execute server side code when java script function returns false .

i dont know how to do in ASPnet 2.0 please help any body .
============================================

i don't know some how i solved this problem
in page load of content page i have written

string aa = " if(document.getElementById('Text1').value==\"\") { alert('please'); return false; }";
Page.ClientScript.RegisterOnSubmitStatement(GetTyp e(), "done", aa);

it is working but i dont want to write every thing in code i want to write in .js file or in html function ....

please help me ,, i will be thankful to you .......

thank s
Dipesh
Jun 29 '07 #2
Frinavale
9,735 Expert Mod 8TB
Hi Dipesh!

I've moved your thread to the .NET Forum. Please don't post in the .NET Articles section because it is reserved for "how-tos" and other helpful programming information/tips and is not meant for questions. In the future please post your questions in the .NET Forum (Blue menu: Forums->.NET). You'll receive much more help posting in the right place.

As for your question:
This behaviour is supposed to happen. To avoid your server side script from executing code when you have clicked "cancel" in your alert box, I suggest using a hidden field.

So when the user clicks cancel, you should set the hidden field to false. Then in your server side code, grab the value of that hidden field and check to see if the code for that button click should be executed.

Cheers!

-Frinny
Jun 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Pete Mahoney | last post by:
Ok I use a textarea to store data input by the user, and then upon them clicking the submit button I store this data to a database. The problem is once the user inputs too much data (about 3...
10
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
9
by: Eric George | last post by:
Hi, Has anyone had any success using jscript submit method in their VS.NET projects? For example I have some client processing in a script function then call <form name>.submit(); This won't...
2
by: Robert Wagner | last post by:
I've created a page using VS.NET and page validator controls. The client side validation works fine on IE, but does not even activate under "alternate" browsers like Mozilla, Opera, etc. Why is...
4
by: nicholas | last post by:
Weird thing: Got an aspx page with a button and an associated code in VB.net. On my testing server the page works fine. On the old hosters server the page worked fine too. But now, at the new...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
2
by: dipesh10 | last post by:
I am doing one project with asp net 2.0 and c# ,i have master page and content page , in content page i have 10 text box and one submit button , when submit will click those text box need to...
0
by: thersitz | last post by:
Hi, Using aspnet3.5,VStudio 2008, VB 1.) I have a set of pages, with a search text box button within a userControl that searches across our websites and is registered in a masterpage. 2)...
5
by: maheswaran | last post by:
Hi all, My home page have login button to login the users. Am trying to use lightbox method in login screen. Using this when user click the loing button, login form will appear with lightbox effect...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.