Solved

Stop navigation to PostbackUrl

Posted on 2008-10-15
5
1,095 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
  • 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

820 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