|
Yes, but I was hoping such JScript code could be invoked in an ASP page
as javascript is.
|
|
|
|
|
It can, but only if you use it as server code and call it from the server. You can't use it as client code, and you can't call server code directly from the client.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
I can't find OpenFileDialog control in the toolbox of the Web app, however i can find it in the Windows app, How can I do to use OpenFileDialog control in the Web app of ASP.NET ???
|
|
|
|
|
There is no direct equivalent but you probably want the FileUpload control (seems pretty logical to me, maybe you could of checked first).
|
|
|
|
|
|
I am developing a web site with ASP.NET and C# and I need to know what tax rates should be added to the price of a product so I could implement the application accordingly.
Could someone tell me if the tax rate added to the price of a product sold in a online e-commerce web site is the one existing in 1) the country of the person who bought the product, 2) the country where the web owner site resides, 3) the country where the server hosting the web site resides or 4) the country where the owner registered his company ( supposing he did so ) ?
And what would be the situation if the e-commerce web site owner works just as self-employed and did not register the web site as company ?
|
|
|
|
|
That depends from what country you're selling from.
In the uk, its a combination of where the company's registered (i.e. where the invoice is coming from)and where the shipment is going (and where the invoice is going).
If from UK -> UK then we add VAT (tax)
If from UK -> Eu (europe) non tax registered customer then we add UK VAT
If from UK -> Eu to tax registered customer then we don't add VAT *
If from UK -> Rest of world then we don't add VAT (although the recipient is responsible for any import duty)
*this is subject to a threshold for each EU country. once we reach that threshold, we need to register for VAT in that country and charge VAT at that country's rate for all sales to that country.
I see you are in the US, so most of the above won't apply, but it's most likely to be 4 on your list, and I think that you also need to take into account state sales tax if you are in a state that adds extra sales tax. Generally, exports aren't charged sales tax, as the recipient will usually have to pay duty on the import.
It won't be from the country the server is physically located in - eg, you could have it hosted on the space shuttle, sealand, or mars if you can get the bandwidth.
Hope that points you in some kind of direction.
|
|
|
|
|
Hi All,
I have tree view control which is filled through DB.Its working fine but my requirment is different now.
Firstly client wanted tree view
Parent
|
|----> Child
But now I want
Parent
|
|----> Child
|
|----> Grand Child.
Please tell me how do I go about it.
Thanks in advance.
|
|
|
|
|
|
Hi,
Please can some one help me wit a Div tag issue? i hav a div tag
which is editable. I type in some data or text. And in between the text i focus to a point. Then create a hyperlink dynamically on a asp button click. I'm able to get the hyperlink in the Div tag but i want it placed in the focus point of the div tag from where i left last.
Thank You,
Sparkling Star
Sparkling Star
|
|
|
|
|
This link[^] may point you in the right direction.
|
|
|
|
|
Thank u for ur response but that is not wat i want. I want to place my hyperlink inside the div tag from the cursor position i left b4 clicking the button.
Regards
Sparkling Star
|
|
|
|
|
Focus applies for only editable items.
|
|
|
|
|
Hi
Can someone tell me what are the pros and cons of calling a web-service through JavaScript instead of calling a web-service through c# or vb.net???
Regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
<%@ WebService Language="VB" Class="Samples.AspNet.SimpleWebService" %>
Imports System.Web
Imports System.Web.Services
Imports System.Xml
Imports System.Web.Services.Protocols
Imports System.Web.Script.Services
Namespace Samples.AspNet
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ScriptService()> _
Public Class SimpleWebService
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function EchoInput(ByVal input As String) As String
Dim inputString As String = Server.HtmlEncode(input)
If Not String.IsNullOrEmpty(inputString) Then
Return String.Format("You entered {0}. The " + _
"current time is {1}.", inputString, DateTime.Now)
Else
Return "The input string was null or empty."
End If
End Function 'EchoInput
End Class 'SimpleWebService
End Namespace
This is asmx File and this is aspx file
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<style type="text/css">
body { font: 11pt Trebuchet MS;
font-color: #000000;
padding-top: 72px;
text-align: center }
.text { font: 8pt Trebuchet MS }
</style>
<title>Simple Web Service</title>
<script type="text/javascript">
// This function calls the Web Service method.
function EchoUserInput()
{
var echoElem = document.getElementById("EnteredValue");
Samples.AspNet.SimpleWebService.EchoInput(echoElem.value,
OnSucceeded);
}
|
|
|
|
|
Thanks to provide the code. But my question was to tell me the advantages as well as disadvantages of calling a web-service through JavaScript. If you know then please write them here.
Regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
Hmm, no postback?
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
You cant achieve this using javascript, you have to use AJAX for this purpose
Best Regards,
Haissam Abdul Malak
My Blog
|
|
|
|
|
AJAX stands for Asynchronous Javascript And XML, duh.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
Really?? how smart!!
u have said it ASYNCHRONOUS JAVASCRIPT, and the libraries used in ajax are not by default for javascript, please learn more and then post your comment.
DUHH
Best Regards,
Haissam Abdul Malak
My Blog
|
|
|
|
|
|
hi
I would like to know ,what is the code for the textbox(txtWeekNo) to display the week number automatically ,after the user selected the date from the calender,when the date is displayed in the txtdate.
olgam
|
|
|
|
|
Hi All,
I have a form in a page. There are two of customer of my website i-e End User and Business User. When User Login to my website he can change his information. When he click on Change User Info a form is visible to him where he can change his information. But that form opens on a certain condition. Like when he click on Change User Info, a query string is send to that form page. If He is End user 1 is send in query string to that form page if he is Business User 2 is send in query string. Now if he is end user there is a button "Upgrade to Business User". When he click On that button a popups open where he can upgrade him self. He will click on Save Button. When Save button is Clicked the parent page is refreshed. Now the Business user Form should be visible, but there is still the end user form, although page is refreshed. The reason is that there was 1 in query string. Now can any one tell me How can I do that, the query string of parent page change to 2. I refresh parent page with the help of this coding.
Dim sScript As New System.Text.StringBuilder
sScript.Append("<SCRIPT language=""javascript"">" & vbCrLf)
sScript.Append("parent.window.opener.location =parent.window.opener.location; window.self.close();" & vbCrLf)
sScript.Append("</SCRIPT>" & vbCrLf)
RegisterClientScriptBlock("ForceDefaultToScript", sScript.ToString)
Any Help regarding to this.
Thanks in Advance.
|
|
|
|
|
erhm...
I think the best way is to open the pop window with the existing querystring of your parent page
window.open('popup.aspx?querystring=1','window','windowproperties');
in popup.aspx you modify the querystring to a new querystring you want to refresh the parentpage with. Lets assume you want to change the value 1 into two...
Your stringbuilder looks like this than
<br />
Dim sScript As New System.Text.StringBuilder<br />
sScript.Append("<SCRIPT language=""javascript"">")<br />
sScript.Append(Environment.NewLine)<br />
sScript.Append("parent.window.opener.location = 'page.aspx?querystring=")<br />
sScript.Append("2") ' or any value you want<br />
sScript.Append("';")<br />
sScript.Append(Environment.NewLine)<br />
sScript.Append("window.self.close();")<br />
sScript.Append(Environment.NewLine)<br />
sScript.Append("</SCRIPT>")<br />
RegisterClientScriptBlock("ForceDefaultToScript", sScript.ToString)<br />
Note I also changed your newline characters into en environment.newline, this is just more neat... You also add the newline characters by appending the character using an ampersant ( "a"&"a" ) if you do so, your stringbuilder doesn't make sense... I changed the way the javascript is built in just a neater way... the result will be fearly the same except for the querystring part
|
|
|
|