hyperlink posts back

M

Mark

Ok this is very odd. I have a hyperlink server control (not a linkbutton)
on my .aspx page. When the navigateurl property is set to a file
(blah.aspx) in the same directory as the current page, the page posts back
BEFORE redirecting to the next page. If I change the navigateurl property
to go to a page in a subfolder (foo\bar.aspx) it does not do a postback.

I swear I'm not messing with it - I did the experiment 3 times in a row ...
once to the same folder, one to a subfolder, one to the same folder, once to
a subfolder, etc., and it did this each time. I confirmed this by putting a
break point on a trivial Response.Write("blah") line in my Page_Load event.
For example, the first line below does NOT postback. The second does. ???

<asp:hyperlink id="HyperLink4" runat="server"
NavigateUrl="somefolder/whatever.aspx">HyperLink Text</asp:hyperlink>
<asp:hyperlink id="HyperLink5" runat="server"
NavigateUrl="blah.aspx">HyperLink Text</asp:hyperlink>

I do NOT want it to postback which is the expected behavior of a hyperlink
server control. Any suggestions?

Thanks in advance!
Mark
 
N

nfedin

Set the AutoPostBack property to "False" See if that helps. Can you
create the hyperlink dynamically? Try doing it with simple HTMLAnchor
object.

Neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top