Click here to Skip to main content
16,005,080 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questioncrystal report Pin
ravilikesaboli6-Sep-07 0:27
ravilikesaboli6-Sep-07 0:27 
AnswerRe: crystal report Pin
John-ph6-Sep-07 0:39
John-ph6-Sep-07 0:39 
GeneralRe: crystal report Pin
Sandeep Akhare6-Sep-07 0:43
Sandeep Akhare6-Sep-07 0:43 
QuestionAsp.net web service problem [modified] Pin
vira trivedi6-Sep-07 0:17
vira trivedi6-Sep-07 0:17 
AnswerRe: Asp.net web service problem Pin
John-ph6-Sep-07 1:06
John-ph6-Sep-07 1:06 
GeneralRe: Asp.net web service problem Pin
vira trivedi6-Sep-07 3:04
vira trivedi6-Sep-07 3:04 
AnswerRe: Asp.net web service problem Pin
Shujaat Ullah Khan6-Sep-07 20:51
Shujaat Ullah Khan6-Sep-07 20:51 
QuestionValidation Problem Pin
Shaurya_Rastogi6-Sep-07 0:06
Shaurya_Rastogi6-Sep-07 0:06 
I have a page which has certain required fields.In order to validate them i am using Required Field Validators.

Now on my save button i have added the attribute
btnSave.Attributes.Add("OnClick", "return OnSaveClick();");

function OnSaveClick()
{
if(document.getElementById('ctl00$ContentPlaceHolder1$txtOneTouchUserName').value.length >0 && document.getElementById('ctl00$ContentPlaceHolder1$txtOneTouchPassword').value.length >0)
{
if(window.confirm("Are you sure you want to save configuration settings and log off ?"))
return true;
}
}

This java script function basically displays a Confirmation box ...

Now , the problem is that when i click save post back occurs and then the .net validation occurs, in case i dont add the HTML onclick event to the save button then the validation occurs without post back.

How do i prevent post back without removing the onclick java script.

AnswerRe: Validation Problem Pin
Parwej Ahamad6-Sep-07 0:12
professionalParwej Ahamad6-Sep-07 0:12 
GeneralRe: Validation Problem Pin
Shaurya_Rastogi6-Sep-07 0:31
Shaurya_Rastogi6-Sep-07 0:31 
GeneralRe: Validation Problem Pin
Sandeep Akhare6-Sep-07 0:47
Sandeep Akhare6-Sep-07 0:47 
GeneralRe: Validation Problem Pin
Shaurya_Rastogi6-Sep-07 1:00
Shaurya_Rastogi6-Sep-07 1:00 
GeneralRe: Validation Problem Pin
Sandeep Akhare6-Sep-07 1:17
Sandeep Akhare6-Sep-07 1:17 
GeneralRe: Validation Problem Pin
Shaurya_Rastogi6-Sep-07 1:23
Shaurya_Rastogi6-Sep-07 1:23 
GeneralRe: Validation Problem Pin
Sandeep Akhare6-Sep-07 1:40
Sandeep Akhare6-Sep-07 1:40 
GeneralRe: Validation Problem Pin
Shaurya_Rastogi6-Sep-07 1:58
Shaurya_Rastogi6-Sep-07 1:58 
GeneralRe: Validation Problem Pin
Imran Khan Pathan6-Sep-07 2:04
Imran Khan Pathan6-Sep-07 2:04 
GeneralRe: Validation Problem Pin
Sandeep Akhare6-Sep-07 2:05
Sandeep Akhare6-Sep-07 2:05 
GeneralRe: Validation Problem Pin
Shaurya_Rastogi6-Sep-07 2:07
Shaurya_Rastogi6-Sep-07 2:07 
GeneralRe: Validation Problem Pin
Sandeep Akhare6-Sep-07 2:09
Sandeep Akhare6-Sep-07 2:09 
QuestionValidation-------urgent Pin
Priya_20075-Sep-07 23:47
Priya_20075-Sep-07 23:47 
AnswerRe: Validation-------urgent Pin
Sandeep Akhare5-Sep-07 23:50
Sandeep Akhare5-Sep-07 23:50 
AnswerRe: Validation-------urgent Pin
Shujaat Ullah Khan6-Sep-07 0:09
Shujaat Ullah Khan6-Sep-07 0:09 
GeneralRe: Validation-------urgent Pin
Priya_20076-Sep-07 1:41
Priya_20076-Sep-07 1:41 
GeneralRe: Validation-------urgent Pin
Shujaat Ullah Khan6-Sep-07 1:51
Shujaat Ullah Khan6-Sep-07 1:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.