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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linkbutton doesn't work properly

Status
Not open for further replies.

netangel

Programmer
Feb 7, 2002
124
PT
I'm developing an ASP.NET that uses linkbuttons to move arround pages. I'm using the Response.Redirect method.
I can't use hiperlinks, because before the Redirect method I set several Session variables and some other pieces of code not allowed in client script.

In the computer I'm programing,just like in some co-workers that also have VS.NET, everythink works fine. But in the test sever, everything works fine execept all the linkbuttons. They load a black empty page (with Done status) instead of the pages I'm calling.
If I put the same code in a normal button, also it works fine.
The tests server (Win 2000 Server) has .NET Framework installed.

This problem can't be on the client pc, as if I access the web page on the server from my pc, it also works incorrectly.

Is there any problem with buttonlinks? I'm I doing any mistake in configuration?
NetAngel
 
Paul (Link9) and myself had a discussion on this a while back (he was having wanky things happening with link buttons as well). What we found is that a link button really is just a hyperlink: when you click it, it doesn't actually trigger the form's submit.

Why it works that way, we never really figured that out (just discussed the theory behind it, but I don't recall we came to a conclusion). Anyway, if you want to play it safe, you could jsut use the regular buttons, but set its style so that it looks like a hyperlink.

Jack
 
Thanks Jack. I've already done that, just in case this problem had no solution.

But, I'd just like to understand what is happening. Why just in some computers? I could understand that some client computers have problems with running the client script that does the post back, but the problem is actually on the server.

If you look at the html source of a page with a linkbutton, it doesn't work like a normal hlink. It calls a javascript function called ____post.
So it actcually posts back. The main problem is that the server code doesn't run in some computers.

Still investigating... just for the fun of it...
NetAngel
 
Is it actually redirecting to a blank page, or is the current page reloading itself in a blank state, or is the button posting back at all?

Does the page you're redirecting to rely on those session variables being set? If so, then the computers in question may have session cookies turned off.
penny1.gif
penny1.gif
 
It can not be a cookie problem, since the computer I'm working on works well with the app in other computers, and won't work with the app on the server. The problem can´t be on the client computer. It has to be something in the server side - configuration, permissions, you name it!!!!

For as much as I can see, it doesn't even does the post. It never goes to the server. It never reloads. It just cleans the current page. Strange. ?????

And it becomes even stranger: As I can't install VS.NET on the server, I installed the Web Matrix (small free MS application to build ASP.NET and mobile pages). I used the same test, with the very same code. IT WORKED!!!!
The only diference is the way the page is saved. Web Matrix saves the server code in the .aspx page, inside a <script runat=server> tag instead of two separate files (code and html). Could it be the reason? NetAngel
 
anything's possible, but I'm afraid that w/o seeing at least the pertinent portion of your code, no one here will be able to guess any further.
penny1.gif
penny1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top