2014-07-01 79 views
0

我正在使用ASP.NET的SVG。我在SVG中定義了一些圖像元素定義。基於一些操作,我想改變從asp.net代碼後面的svg圖像的路徑。我是新來的svg可以告訴我如何訪問代碼背後的svg圖像,並執行所需的操作。任何其他指導有關svg和asp .NET將高度讚賞SVG圖像元素和Asp.NET

這在Web表單我的SVG標記

<svg width="600" height="500"> 
      <rect x="10" y="10" height="250" width="500" style="fill:rgb(255, 255, 255);stroke-width:3;stroke:rgb(0,0,0)" /> 

      <image x="20" y="50" width="300" height="80" 
       xlink:href="http://dely.com/Svg/images/Layout/top-bar-logo.png" /> 
      <image x="15" y="125" width="300" height="80" 
       xlink:href="http://dely.com/Svg/images/Layers/left-bar.png" /> 

     </svg> 

回答

0

我不只需添加RUNAT =「服務器」並通過代碼修改URL後面看不出什麼問題使用屬性財產:

<svg width="600" height="500"> 
     <rect x="10" y="10" height="250" width="500" style="fill:rgb(255, 255, 255);stroke-width:3;stroke:rgb(0,0,0)" /> 

     <image runat="server" id="imgTest" x="20" y="50" width="300" height="80" 
      xlink:href="http://dely.com/Svg/images/Layout/top-bar-logo.png" /> 
     <image x="15" y="125" width="300" height="80" 
      xlink:href="http://dely.com/Svg/images/Layers/left-bar.png" /> 

    </svg> 

代碼隱藏(我放置了新的測試網址):

imgTest.Attributes.Add("xlink:href", "http://icons.iconarchive.com/icons/aha-soft/free-3d-glossy-interface/64/accept-icon.png");