Solved

Stop navigation to PostbackUrl

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
asp.net bundle 8 47
Not showing page correctly 3 31
Ajax Panel Not Updating When Triggered By Timer 4 44
rebind a grid after user clicks on node in treeview 1 16
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
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.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now