Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jumping down a page and validation when button is pressed

Status
Not open for further replies.

KevoMee

Technical User
Apr 30, 2002
72
IE
Hi again,

1. How do I decided where a user's browser will situate when he presses a button. i.e. when the user presses a button and a textbox appears down at the bottom of the screen i want the user's view to be automatically centered on this textbox and not up the top. any ideas?

2. I have a textbox and 2 buttons. Onw button is submit the other is cancel. To submit you must enter something, to cancel you don't have to enter anything. The thing is though validation seems to work on page buttons. I have tried to put if(page.isvalid) at the top of my submit_onclick function only but that does not make any difference. Any ideas?

Cheers,
Kev.
 
Well for your first question you can use anchor tags to get a page to scroll down.

So at each point you want it to possibly go to you put
<a name=&quot;uniquenamehere&quot;> content here</a>

Then when you refresh the page you append a #uniquenamehere value to the end of the page url. This will cause the page to go to the specified location on the page.

As to your second question I have found that I do most of my validation on my own without validation controls because I want to have more explicit control of validation than I feel I get with the built in controls. This may just be because I am not familiar enough with the controls, but custom validation is one potential answer.

Good Luck! Crystal
crystalized_s@yahoo.com

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
Hi cyrsytal,

&quot;Then when you refresh the page you append a #uniquenamehere value to the end of the page url.&quot;

How would I so this when a button is pressed in my C# code? just not too sure how to append the info on.

cheer,
kev.
 
You could try a Response.Redirect(urlWithAppendedValues) after you complete processing. You could also experiment with the other ones like Server.Transfer.

I have found the two I mention above work a little differently from each other. I have found cases where Response.redirect works while server.transfer does not.

I am not sure if this helps, and I am not sure if using the redirect is a good way to go about this. I just know that when solving the same problem in ColdFusion I used the anchoring method effectively, but I have not had to replicate that functionality in .Net yet. Crystal
crystalized_s@yahoo.com

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top