if you compiled in Debug mode, then your assembly would be larger than if you had compiled in Release mode.
oh~~~~~~~~ Right! Thanks for your help answer!
if you compiled in Debug mode, then your assembly would be larger than if you had compiled in Release mode.
without server side scripting, can we upload a file using client side scripting if destination folder and config file settings are known? is it possible?
avdp211:
without server side scripting, can we upload a file using client side scripting if destination folder and config file settings are known? is it possible?
I don't think it is possible.
You use the the HTML input file control and when you post the request, on the web server you need to read the data and save it to a file, so there has to be some interaction with the server to handle the post request.
http://geekswithblogs.net/rashid/archive/2007/08/01/Create-An-Ajax-Style-File-Upload.aspx
thanks
ok then shall it be possible with http put method?
It's fairly certain that we'll never see a client side method for automating file uploads. The security concerns are just too great.
If you use a custom ActiveX control you can do it (think Windows Update), but it's impossible in JavaScript.
The ajax assemblies need to be installed in the GAC on the hosting server.
You would need to confirm that this has been done with your host.
I have been learning about using an XML file and an XLST file to create a user editable form however I have yet to find a successful working version of this including a toolkit procedure
Can it be done? If so has anyone actually done it and showed how? If not why not?
A not correctly formatted example of what I want to do:
<XML File>
<Input Name="NumbersOnly" FilteredTextBox="Yes" Type="NumbersWithNeg"/>
</XML>
gets me the output of this:
<
asp:TextBoxID="TextBox3"runat="server"></asp:TextBox><
ajaxToolkit:FilteredTextBoxExtenderID="ftbe"runat="server"TargetControlID="TextBox3"FilterType="Custom, Numbers"ValidChars="-"/>It can be done. Heres how
<Code on main page>
private
void CreateSurvey() {// Load the data sourceXPathDocument surveyDoc =newXPathDocument(Server.MapPath("ExSurvey.xml"));// Load the xslt to do the transformationsXslTransform transform =newXslTransform();transform.Load(Server.MapPath(
"MakeControls.xslt"));// Get the transformed resultStringWriter sw =newStringWriter();transform.Transform(surveyDoc,
null, sw);string result = sw.ToString();// remove the namespace attributeresult = result.Replace(
"xmlns:asp=\"remove\"","");result = result.Replace(
"xmlns:cc1=\"remove\"","");result =
"<%@. Register Assembly=\"AjaxControlToolkit\" Namespace=\"AjaxControlToolkit\" TagPrefix=\"cc1\" %>" + result;int i;// parse the control(s) and add it to the pageControl ctrl = Page.ParseControl(result);survey.Controls.Add(ctrl);
}
<XLST File>
<
xsl:stylesheetversion="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns:asp="remove"xmlns:cc1="remove"><
xsl:outputmethod="xml"indent="yes"encoding="utf-8"omit-xml-declaration="yes"/><
xsl:templatematch="/">
<
table><
xsl:for-eachselect="//question"><
tr><
tdvalign="top"><xsl:value-ofselect="@.name" /><
xsl:iftest="@.required = 'yes'"><
asp:RequiredFieldValidatorErrorMessage=" Required Field"runat="server"ControlToValidate="{@.name}" /></
xsl:if>
</
td><
td><
xsl:iftest="@.type='text'"><
asp:TextBoxid="{@.name}"runat="server" /><
cc1:FilteredTextBoxExtenderID="FilteredTextBoxExtender{@.name}"runat="server"TargetControlID="{@.name}"FilterType="Numbers"></
cc1:FilteredTextBoxExtender></
xsl:if><
xsl:iftest="@.type='radio'"><
asp:RadioButtonListid="{@.name}"runat="server"><
xsl:for-eachselect="choice"><
asp:ListItemValue="{@.value}"><xsl:value-ofselect="@.value" /></asp:ListItem></
xsl:for-each></
asp:RadioButtonList></
xsl:if></
td></tr></
xsl:for-each></
table><
asp:buttonid="submit"runat="server"Text="Submit" /></
xsl:template></
xsl:stylesheet>Hi,
I have double byte characters in the content that I am returning using Web Services. However, the encoding in the xml file returned by Web Services is utf-8 and I am unable to read the content, not even by changing browser encoding setting to the appropriate one.
I implemented SoapExtension to modify the xml encoding before it returns to the client, which works when a WinForm calls it, but it doesn't work when a webpage calls it, and here is why:
http://www.dotnet247.com/247reference/msgs/45/228371.aspx
"If you're testing this by hitting the "Invoke" button on the .asmx page, it will never work. That execution path does not send any SOAP message to the ASP.NET runtime, and no SOAP Extension will ever get executed. You need to generate a client and use it to send some traffic at the service if you want to test your extension."
Then I created an aspx page to call my web service using Atlas, stepping through in debug mode, the code did not touch the SoapExntension at all. So Atlas doesn't get SoapMessage, therefore using SoapExtension to modify xml doesn't work?
How do I modify the xml that the Web Services send to me in this case? HttpHandler?
Thanks,
Janh
I forgot to mention that the data is stored in sql server as windows-1252 (or iso-8859-1), not nvarchar. If user inserts big5, it'll store big5 in windows-1252 format.
When I return the string to the client, I see ¤é?g?ü???Q|?|ü. The problem is, that no matter what browser encoding setting I change to, I always see this string. I don't know why but it should change to 日經指數昨收至 when I change browser encoding to big5.
I found something that kind of works. Since I know it is big5, I am able to do:
System.Text.Encoding iso = System.Text.Encoding.GetEncoding(1252);
System.Text.Encoding iso2 = System.Text.Encoding.GetEncoding(950); //code page for big5
byte[] isoBytes = iso.GetBytes(content); //content is the string from the database
newcontent = iso2.GetString(isoBytes);
send it via web service and Atlas to the client. It displays the string automatically and correctly in big5 encoding. But when I change the browser encoding setting to anything else, it is still stuck as the same big5 string. It is somehow fixed, unchangeable.
This behavior is the same if, instead of using Atlas and web service, I just createnew XMLHttpRequest()andxmlhttp.open("GET", "test.aspx",true) which the aspx page returns the same string as above. The string still has a fixed encoding regardless of browser encoding setting.
Is the problem in how XMLHttp is handling the string? That makes the string encoding unchangeable on the client side?
This is bad for me because I have no way of knowing what encoding to use. With this example, I converted the encoding to big5 because I know it's big5 in the database. I have many other languages in my database.
I would still like to use Atlas... but is there a way to NOT add any manual encoding at all, return the raw string to the client, and let client change the browser setting to view the correct encoding?
Sorry guys, I found my own answer.
Guess responseText is ALWAYS utf-8, so I am supposed to use responseXML in order to preserve the encoding.
So my new question is, how do I use responseXML in Atlas...? Or is there another way to preserve encoding?
There is a way to tell Atlas to treat the response as XML instead of text, for webservices that you want to return XML instead of JSON, you do this thru the WebOperationAttribute on the asmx webmethod...
[WebOperation(true /*getVerbEnabled*/, ResponseFormatMode.Xml, false /*safeForCrossDomain*/)]
Hope that helps,
-Hao
xml script spec