Solved

Stop navigation to PostbackUrl

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

631 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