|
This (") is not a semicolon ( ; ), it is a quote.
Quotes are probably used around the value when it's sent as a string value. In that case you have to escape the quotes in the value. How that is done depends on how you are sending the data.
---
b { font-weight: normal; }
|
|
|
|
|
How can i solve this problem? I have a send Mail function was sends data through this code from form to Outlook:
isBody += "Employee Name: " + isForm.personal.value +"%0D%0A";
document.forms.Send.action = "mailto:"+recipient+"?subject="+isSubject+"&body="+isBody+" ";
isForm = Form name
personal.value = textbox field name
|
|
|
|
|
Use the escape() function on the values. That will url encode the characters that needs encoding.
---
b { font-weight: normal; }
|
|
|
|
|
Can u quote me an example???
|
|
|
|
|
isBody += "Employee Name: " + isForm.personal.value +"%0D%0A";<br />
document.forms.Send.action = "mailto:"+escape(recipient)+"?subject="+escape(isSubject)+"&body="+escape(isBody)+" ";
---
b { font-weight: normal; }
|
|
|
|
|
Hi there!
I am trying to save different .swf files on my local machine.
Actually this is already working with the below code.
Unfortunately (how I already figured while writing the code) The file is saved, but somehow corrupted.
Is there maybe a way more simple way to get the Response of an URI into a string (or, let's say a buffer) and save it on my disk?
Below is the code I came up with (within a C# web application):
// init
bool debug = false;
// this is where I get my test-swf, you can have a look at it at:
// http://www.styte.com/3.swf
// it may look strange, what I am trying to do is to read some php-created
// swf's into my .net application....
string url = "http://www.styte.com/trans.php?&bild=3.swf";
// work
Uri fileUrl = new Uri(url);
// Create 'FileWebrequest' object with specified Uri.
WebRequest myFileWebRequest = (WebRequest)WebRequest.Create(fileUrl);
// Send 'FileWebRequest' object & wait for response.
WebResponse myFileWebResponse = (WebResponse)myFileWebRequest.GetResponse();
// Get stream object associated with response object.
Stream receiveStream = myFileWebResponse.GetResponseStream();
Encoding encode = System.Text.Encoding.GetEncoding("windows-1252"); //("utf-8");
// Pipe stream to higher level stream reader with req. encoding format.
StreamReader readStream = new StreamReader (receiveStream, encode);
if (debug==true) Response.Write("\r\nResponse stream received<br>");
int numChars = 1;
Char[] read = new Char[numChars];
// Read "numChars" characters at a time.
int count = readStream.Read ( read, 0, numChars );
if (debug==true) Response.Write("(count): "+count.ToString()+" File Data...\r\n");
//Response.ContentType = "application/x-shockwave-flash";
//Response.AddHeader("Content-Type", "application/x-shockwave-flash");
FileStream fs = File.Create(@"C:\Inetpub\wwwroot\leilac\uploads\test.swf");
BinaryWriter bw = new BinaryWriter(fs);
while (count > 0) {
String str = new String(read, 0, count);
bw.Write(str);
Response.Write(str);
count = readStream.Read(read, 0, numChars);
}
bw.Close(); fs.Close();
if (debug==true) Response.Write("<br>");
// Release resources of stream & response object.
readStream.Close();
myFileWebResponse.Close();
Response.End();
Appreciate any comments/help.
Sascha Stanscheit, styte, http://www.styte.com/
|
|
|
|
|
Please don't double post.
---
b { font-weight: normal; }
|
|
|
|
|
Trying to replace certain value.
my Sql statment..
spGetPOListPageing'-1', '-1', '-1', '-1', '-1', '12', '-1', '01/01/1900', '01/01/1900', '01/01/1900', '01/01/1900', 'rprmen',4,117,30
What I need to do is replace 117 with a new page number (may be 1 or 234 or 45). Right now I have it like this
NewSql = Left( Sql, Len(str)-4 ) & currentPage & Right(Sql, 3)
But if I have 2234 pages then I will have problem. How can i replace the value from the second last comma to the last comma (in between)? for example I like to replace 1173 with 22. Like this
spGetPOListPageing'-1', '-1', '-1', '-1', '-1', '12', '-1', '01/01/1900', '01/01/1900', '01/01/1900', '01/01/1900', 'sabu.stephen',4,22,30
Please help
Thanks
BJ
|
|
|
|
|
Why not put the correct value in the string when you create it?
---
b { font-weight: normal; }
|
|
|
|
|
Could use Split(",") and work on the string in the second to last index, or use the indexOf(",117,") and then use substring....or you could write your own method to find the second to last comma, (even sounds like a good chance to use recursion....)
Brian Van Beek
Here's my boring blog! [^]
|
|
|
|
|
Hello,
I need javascript function which take two parameters(dates) and return total years and months difference.
Regards
Tariq mahmood
|
|
|
|
|
You have to specify more clearly what you want.
Do you want the difference in years and months separately, or the difference in month expressed as years and months?
Also, should the difference in months be calculated as the difference in whole months between the dates, or only based on the month of the dates.
---
b { font-weight: normal; }
|
|
|
|
|
I have developed a website using ASP , I'm new to this program , could you all advice me how can I disable the back button on the ie on my home page because when user click back buton they directed to the previous page which they veiwed earlier . but I don't want it happen .They should redirect to atleast " Warning: Page has Expired " or to disable the back button .
thanks in earlier .
Rgds
theepa
|
|
|
|
|
try using either of these javascript code examples (note: location.replace will not let you go back to the original page.)
<a href="somwhere.asp" onclick="location.replace(this.href);return false;">TEST</a>
or put this on the page you don't want your user going back to:
onLoad="if(history.length>0)history.go(+1)"
Brian Van Beek
Here's my boring blog! [^]
-- modified at 17:25 Wednesday 28th September, 2005
|
|
|
|
|
Hi there,
You basically cannot disable the Back button in the browser. To work around this issue, you either use javascript and play around with the history object like Brian suggested or place a snippet of code in the asp page to prevent caching[^] at the client side.
|
|
|
|
|
hi
help me..........
i have a php project and want convert it to asp.net
please help me for convert this project.
|
|
|
|
|
you can use this url for convert php, asp and jsp to aps.net
http://www.asp.net/MigrationAssistants/Default.aspx?tabindex=0&tabid=1
|
|
|
|
|
I want to be able to change the culture for a page by pressing an image button with a countries flag, but I'm having problems in that it appears to be ignoring my settings. It works using a dropdown list. Here code sample:-
<%@ Page Language="C#" uiculture="auto" %>
<%@ Import Namespace="System.Threading" %>
<%@ Import Namespace="System.Globalization" %>
protected override void InitializeCulture()
{
if (Request.Form["ListBox1"] != null)
{
String selectedLanguage = Request.Form["ListBox1"];
UICulture = selectedLanguage;
Culture = selectedLanguage ;
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(selectedLanguage);
Thread.CurrentThread.CurrentUICulture = new
CultureInfo(selectedLanguage);
}
base.InitializeCulture();
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
ListBox1.Text = "en-GB";
InitializeCulture();
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
ListBox1.Text = "es-MX";
InitializeCulture();
}
<asp:listbox id="ListBox1" runat="server" meta:resourcekey="ListBox1Resource1">
<asp:listitem value="en-GB"
="" selected="True" meta:resourcekey="ListItemResource1">English
<asp:listitem value="es-MX" meta:resourcekey="ListItemResource2">Español
<asp:listitem value="de-DE" meta:resourcekey="ListItemResource3">Deutsch
<asp:button id="Button1" runat="server"
="" text="Set Language" meta:resourcekey="Button1">
<asp:imagebutton id="ImageButton1" runat="server" imageurl="~/unionjack.gif" height="50px" onclick="ImageButton1_Click" width="100px">
<asp:imagebutton id="ImageButton2" runat="server" height="50px" imageurl="~/spanish_flag.jpg" width="100px" onclick="ImageButton2_Click">
<asp:label id="Label1" runat="server"
="" meta:resourcekey="Label1">
Clueless
|
|
|
|
|
Hi there,
Are you sure that the execution gets in the body of the if statement? Setting a value to the ListBox.Text property does not make any effect on the Request.Form that basically contains the input values sent from the client side. IMO, you should wrap the sample code in the body of the if statement in a separate private method which takes in the selectedLanguage as the method parameter. Then you can invoke this method both in the overriden InitializeCulture method and in the event handler of the Click event of the ImageButton.
|
|
|
|
|
I can't say I really understand what you mean, but I tried this and this didn't work either
<%@ Page Language="C#" uiculture="auto" %>
<%@ Import Namespace="System.Threading" %>
<%@ Import Namespace="System.Globalization" %>
protected override void InitializeCulture()
{
if (Request.Form["ListBox1"] != null)
InitCult(Request.Form["ListBox1"]);
base.InitializeCulture();
}
private void InitCult(string culture)
{
string selectedLanguage;
selectedLanguage = culture;
UICulture = selectedLanguage;
Culture = selectedLanguage;
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(selectedLanguage);
Thread.CurrentThread.CurrentUICulture = new
CultureInfo(selectedLanguage);
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
//ListBox1.Text = "en-GB";
//InitializeCulture();
InitCult("en-GB");
base.InitializeCulture();
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
//ListBox1.Text = "es-MX";
//InitializeCulture();
InitCult("es-MX");
base.InitializeCulture();
}
<asp:listbox id="ListBox1" runat="server" meta:resourcekey="ListBox1Resource1">
<asp:listitem value="en-GB"
="" selected="True" meta:resourcekey="ListItemResource1">English
<asp:listitem value="es-MX" meta:resourcekey="ListItemResource2">Español
<asp:listitem value="de-DE" meta:resourcekey="ListItemResource3">Deutsch
<asp:button id="Button1" runat="server"
="" text="Set Language" meta:resourcekey="Button1">
<asp:imagebutton id="ImageButton1" runat="server" imageurl="~/unionjack.gif" height="50px" onclick="ImageButton1_Click" width="100px">
<asp:imagebutton id="ImageButton2" runat="server" height="50px" imageurl="~/spanish_flag.jpg" width="100px" onclick="ImageButton2_Click">
<asp:label id="Label1" runat="server"
="" meta:resourcekey="Label1">
|
|
|
|
|
I didn't notice that you are using the implicit localization with the meta:resourcekey. If you run your application in debug mode you will see that the Text property is already set by the ASP.NET parser by the time the event handler of the Click event of the Image Button executes. The ASP.NET parser gets the values from the resource files based on the culture set in the overriden InitializeCulture. So in this case, you might consider using the Explicit Localization, and get the values from the resource manager to explicitly assign to the property of the control.
|
|
|
|
|
Hi,
My problem seem not to be "Web Development" .
I wrote an application by VBA (inside M$ Access). And I want to connect to another Access file in another computer outside my local network.
So, how could I point out the path of that Access file?
For example: "Provider=Microsoft.Jet.4.0; Data Source = ???"
Should it "Data Source = \\207.46.198.60\Temp\abc.mdb"?
I really don't know
Please help me.
Thanks.
-- modified at 5:29 Wednesday 28th September, 2005
|
|
|
|
|
wat probs u r facing if using the DataSource above?
<< >>
|
|
|
|
|
Couldn't connect to that path.
Though we just use "\\203.162.3.148\Temp" as a local address. But I want to connect to a file outside my network.
|
|
|
|
|
hi there,
kokain wrote:
"\\203.162.3.148\Temp" as a local address
Do u mean that this path is on local server? if so, try to share the folder
and let me know the result
That's just a suggestion.
<< >>
|
|
|
|