Solved

Stop navigation to PostbackUrl

Posted on 2008-10-15
5
1,096 Views
Last Modified: 2010-05-18
Hello experts,
I have a hardcoded the value for the PostbackUrl on a asp button and have some validation and sql calls serverside that conditions have to be met in order to proceed. However, if any of the server side validations fail I do not want to navigate using the PostBackurl. How is this possible?

I want to use Postbackurl as I need to post values to the resulting page.

0
Comment
Question by:Cyart
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

by:jtdebeer
ID: 22725767
I suggest you remove the property set for the button and rather set the postbackUrl at runtime

With other words do your validation and then use a statement like below in your buttons on_click event

If Validation = true then
button1.postbackurl = "http://someurl.aspx"
else
button1.postbackurl = "http://someotherurl.aspx"
end if


HTH
Joe
0
 
LVL 9

Expert Comment

by:HeoQue
ID: 22725778
use an input type submit with runat=server, getting post values on the destination page is as easy as :

Request["contolClientId"]
0
 

Author Comment

by:Cyart
ID: 22725839
Hello,

I do not have control over the destination page, I also tried the dynamic postback but it didn't seem to work
0
 
LVL 9

Accepted Solution

by:
HeoQue earned 250 total points
ID: 22725868
ok, then you need to post with naming ? right ?
0
 

Author Comment

by:Cyart
ID: 22725939
Yes I need to just thought could use response.redirect and querystring params but did not want to do it that way
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
YouTube API get the Video Tags - vb.net 7 51
asp.net mvc5 6 33
Web Site Administration Tool - Security Questions 2 37
dropdownlist in asp.net vb. 3 21
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question