Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 13th, 2006, 12:40 AM
Registered User
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help~~!How to set the path £¿

I write asp.net code like this:
...
<tr>
 <td>
   <a href="<%=Request.ApplicationPath%>/Web/GetPass.aspx" class="text2">
   Forget Password
 </a>
 </td>
 <td align="center" colSpan="2">
 <P align="left"><asp:imagebutton id="SigninBtn" runat="server" ImageUrl = "~/images/szkm_31.gif"></asp:imagebutton>
 </P>
 </td>
</tr>

But when i use:
"ImageUrl = "<%=Request.ApplicationPath%>/images/szkm_31.gif" "instead of "ImageUrl = "~/images/szkm_31.gif" ",it show error.

i don't know why?

And The HTML code of picture like this
""UserControl/UserLogin/<%=Request.ApplicationPath%>/images/szkm_31.gif"" after i changed my code.

thanks.


 
Old December 13th, 2006, 10:34 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi

Use Page.ResolveUrl("~/images/szkm_31.gif") instead, this will work for you.

Regards
Mike

Fortune favours the brave, so don't regret on missed oppurtunities.
 
Old December 14th, 2006, 12:19 AM
Registered User
 
Join Date: Sep 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i know it .but i want to know why i cann't use "ImageUrl = "<%=Request.ApplicationPath%>/images/szkm_31.gif" "?

thanks!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help with path for loading Pics (app.path) Tabbasum Beginning VB 6 2 November 15th, 2007 04:57 AM
Implementing the all-path shortest path problem bitwords XSLT 1 December 6th, 2006 11:37 AM
using app.path in database path and filename kd8con VB Databases Basics 2 October 25th, 2006 11:45 AM
Convert logical path to absolute path zoostar J2EE 1 April 15th, 2005 10:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.