以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 SVG/GML/VRML/X3D/XAML 』  (http://bbs.xml.org.cn/list.asp?boardid=21)
----  [求助] svg & asp.net  (http://bbs.xml.org.cn/dispbbs.asp?boardid=21&rootid=&id=34689)


--  作者:achio
--  发布时间:6/21/2006 2:25:00 PM

--  [求助] svg & asp.net
Hi.....
i'm facing problem with printNode() and postURL in svg.
this is what i have done in my application.

function saveImage()
{
       var imageString=printNode(myImage); //myImage is the shape i draw dynamically
       //alert(imageString);
       postURL("webForm1.aspx",imageString,null);
}

what should i do in "webForm1.aspx" to get the value i sent?
how can i get the value of imageString in asp.net?

hope anyone that know the solution give me some coding example.....

thanks......


--  作者:tamefox
--  发布时间:6/22/2006 8:36:00 AM

--  
postURL() is an function that send data to a given location. It is useful for saving the results of dynamic SVGs that have been updated based on user input/interaction or timed data feeds.

Examples include an SVG image that has been modified by a user, who wants to save the end product.

from Adobe, is as follows:

postURL( url, text, callback, type, enc )
url :URL to post data; for security reasons, must be on the same server as SVG document  
text:ata to post  
callback: function which processes reply status and the returned contents of the file from url  
type:optional media type of the posted data (such as "text/plain"). Not all browsers support that.  
enc :optional encoding for data null, 'gzip' and 'deflate' are possible values. If browser does not support binary post this parameter is ignored.  

postURL() is a non-standard extension available only with the AdobeSVGViewer.


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

From the Adobe SVG Forums:

Method postURL
Synopsis:

void postURL(string url, string data, viewer::AsyncStatusCallback cb, string mimeType, string contentEncoding)
Post data to the given URL (that should come from the same domain). Notify the callback when done. One can also specify MIME type to be reported to server and encoding to be used (valid values are null, "gzip" and "deflate", some browsers cannot post binary data and will ignore encoding). Callback will get passed an object of type viewer::AsyncURLStatus when post operation completes. Reply is assumed to be either ASCII or Unicode text (in UTF-8 or UTF-16 encodings), possibly compressed with gzip or deflate. Callback will get decoded, uncompressed text as a string.

For security reasons, it is possible to post only to the server that SVG document came from.


the above maybe useful to you ~

Beware that ASV considers the http://localhost and http://127.0.0.1 in a loopback as different server and will throw security violation error


--  作者:achio
--  发布时间:6/22/2006 10:00:00 AM

--  
thanks for your reply....
But, my problem is on the server side, that is on asp.net web form...

I know how to post the data to server(asp.net), but in asp.net, how can i get the data i sent? Do you have any idea? Can you give me some codes example? I'm using C# in the server side.

Thanks again for your kindly reply.......


--  作者:achio
--  发布时间:6/23/2006 2:10:00 PM

--  
I have found the solution I searched for.
Here is the sample code in C# that need to be placed on server side to process the input stream.

XmlDocument xml = new XmlDocument();
xml.Load(Request.InputStream);
xml.Save("C:\\file1.xml");


--  作者:vagerent
--  发布时间:7/25/2006 8:15:00 AM

--  
yeah,it is a good way,but i think U also can use this way:
"webform.aspx?param=printtoStr"
--  作者:achio
--  发布时间:7/26/2006 4:24:00 PM

--  
thanks for your suggestion, vagerent...
But is that the code u provide is in the server side (C#.net) ? Or is it the coding in the svg file (client side)?

u wrote----->"webform.aspx?param=printtoStr"

"param=printtoStr" means what? Actually, i'm a newbie in svg and asp.net, so could you please explain further about your coding?

Thanks again.
Regards,
achio.


--  作者:welfred
--  发布时间:7/26/2006 4:50:00 PM

--  
He means the content of the node(myImage) will be attached with the URL. The data you want to post is just a para of "webform.aspx".  You can use this.request("param") to get the data.
function saveImage()
{
       var imageString=printNode(myImage);
       postURL("webForm1.aspx?param="+imageString,null,null,null,null);
}


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
4,547.852ms