Solved

Stop navigation to PostbackUrl

Posted on 2008-10-15
5
1,085 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
ok, then you need to post with naming ? right ?
0
 

Author Comment

by:Cyart
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

16 Experts available now in Live!

Get 1:1 Help Now