[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1113
  • Last Modified:

Stop navigation to PostbackUrl

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
Cyart
Asked:
Cyart
  • 2
  • 2
1 Solution
 
jtdebeerCommented:
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
 
HeoQueCommented:
use an input type submit with runat=server, getting post values on the destination page is as easy as :

Request["contolClientId"]
0
 
CyartAuthor Commented:
Hello,

I do not have control over the destination page, I also tried the dynamic postback but it didn't seem to work
0
 
HeoQueCommented:
ok, then you need to post with naming ? right ?
0
 
CyartAuthor Commented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now