Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Problem in LinkButton

Reply
Thread Tools

Problem in LinkButton

 
 
Abhijit
Guest
Posts: n/a
 
      07-15-2003
On a aspx page I am having one button that causes
validation(Save button) , other button that dont causes
validation (Cancel button) and a link button that
causesvalidation. The click of cancel button shows
different behaviours if the page is not valid.

Case 1. (no problem case)
If I click save button and if the page is not
valid and then click cancel button the user is redirected
to other page as cancel button dont cause validation.

case 2: (problematic case)
If the user clicks link button and page is not
valid.Then after click of Cancel button nothing
happens.The user is not redirected.But if the Cancel
button is clicked second time he is redirected.

This happens only if we have link button on the page
and that causes validation.

Is anyone having the solution ?

 
Reply With Quote
 
 
 
 
Ravikanth[MVP]
Guest
Posts: n/a
 
      07-16-2003
Hi


By default, page validation is performed when a
LinkButton control is clicked. Page validation determines
whether the input controls associated with a validation
control on the page all pass the validation rules
specified by the validation control.

You can specify or determine whether validation is
performed on both the client and the server when a
LinkButton control is clicked by using the
CausesValidation property. To prevent validation from
being performed, set the CausesValidation property to
false.

This property is commonly set to false for a reset or
clear button to prevent validation from being performed
when the button is clicked.




HTH
Ravikanth


>-----Original Message-----
>On a aspx page I am having one button that causes
>validation(Save button) , other button that dont causes
>validation (Cancel button) and a link button that
>causesvalidation. The click of cancel button shows
>different behaviours if the page is not valid.
>
>Case 1. (no problem case)
> If I click save button and if the page is not
>valid and then click cancel button the user is

redirected
>to other page as cancel button dont cause validation.
>
>case 2: (problematic case)
> If the user clicks link button and page is not
>valid.Then after click of Cancel button nothing
>happens.The user is not redirected.But if the Cancel
>button is clicked second time he is redirected.
>
> This happens only if we have link button on the

page
>and that causes validation.
>
> Is anyone having the solution ?
>
>.
>

 
Reply With Quote
 
 
 
 
Abhijit Raje
Guest
Posts: n/a
 
      07-16-2003
Hi Ravikanth !!

I want the link button to cause validation.But once the link button
causes validation and the page is invalid and then you click
cancel(which dont cuases validation) button then nothing happens for the
first time but if I click it second time user is redirected. So why it
is not happening at the first time ?

Thanks and regards,

Abhijit




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linkbutton does not look like a linkbutton Sathyaish ASP .Net 3 09-08-2005 09:41 AM
Linkbutton does not look like a linkbutton Sathyaish ASP .Net Datagrid Control 1 09-08-2005 08:44 AM
Problem with custom LinkButton and AddAttributesToRender Henri ASP .Net 2 10-05-2004 09:10 AM
LinkButton / doPostBack problem Rob Meade ASP .Net 3 08-25-2004 04:00 PM
LinkButton Problem Mike ASP .Net 4 02-27-2004 12:08 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57